CVS edit link for garbanzito
I have created and tested a module which enables use of SurveyGizmo surveys within a Drupal site. I would like to contribute this module, and I plan to maintain it and respond to the module's issue queue so that others can use it and the community can improve the module. The module was developed with the support of SurveyGizmo.com, and as part of my work with Growing Venture Solutions. I look forward to the review this module will get as part of my CVS application.
I have been working with Drupal for over three years, and have gradually become a site architect and developer over the last 18 months. As a developer coming from other environments, I have worked hard to understand and embrace the Drupal community's goals and standards. I have other contributions planned.
Comments
Comment #1
garbanzito commentedplease review my module and application
Comment #2
garbanzito commentedPre-emptively, here is a comparison with existing solutions. First of all, there is currently no Drupal module offering SurveyGizmo integration. Instead, a search of for "surveygizmo" on Drupal.org and Groups.drupal.org reveals that many users have included links to SurveyGizmo surveys in their posts, or mentioned SurveyGizmo as having features they'd like to have on a Drupal site. SurveyGizmo clearly appeals to some Drupal users as a way to conduct surveys.
A few modules offer ways to manage a narrower use-case of survey, for example:
http://drupal.org/project/priorities
http://drupal.org/project/quiz
Some modules address a more general use-case, but without the comprehensive tools SurveyGizmo provides:
The obsolete http://drupal.org/project/survey
http://drupal.org/project/webform
However I can find no modules that implement embedding or integration with any of the major online survey services.
[Edited by kiamlaluno to alter the links that were written using a Markdown syntax, which is not handled on d.o]
Comment #3
garbanzito commentedPre-emptively, here is a more detailed description of the module. The SurveyGizmo module provides the following basic features:
1. An admin interface to enter a SurveyGizmo API key.
2. An admin interface to list surveys associated with the API key, selectively activate surveys for use with the site, and specify a path at which an activated survey can be presented.
3. Presentation of surveys on stand-alone pages.
4. An input filter which, when part of an available input format, enables JavaScript embedding of SurveyGizmo surveys within content.
Comment #4
avpadernoHello, and thanks for applying for a CVS account. I am adding the review tags, and some volunteers will review your code, pointing out what needs to be changed.
As you reported links to projects that in someway allows to handle surveys, may you report the pro of using the proposed module versus using the existing projects?
Comment #5
garbanzito commentedSure -- the pro of using the proposed module is that it allows use of all of the features SurveyGizmo's hosted surveys provide on a survey presented to visitors as a part of a Drupal site. SuveyGizmo's features include very detailed survey construction, easy management of multiple surveys, complex survey logic, survey theming, and comprehensive reporting, all of which are designed to be accessible to people who are not Drupal developers nor architects. None of the the existing modules provides a compelling end-user package of this sort. Even combining several modules would not approximate the depth or ease of SurveyGizmo's tools. It seems unlikely that such a survey-builder package will soon evolve out of the existing Drupal modules.
There is also a use case where people may want to use a survey on multiple sites. With this module alone, the same survey may be embedded on several Drupal sites. With other tools available, the same survey could also be used on other non-Drupal sites. There is no Drupal module for deploying the same survey on many different sites, some of which are not Drupal sites.
As I mentioned above, many Drupal users, some of them very experienced, have linked to SurveyGizmo surveys or mentioned SurveyGizmo as having features they like. Some have even used SurveyGizmo for gathering information from the Drupal community, so SurveyGizmo's service seems to have a perceptible credibility within the Drupal community.
Comment #6
coltraneLooks great, and I love all the commenting!
Few things found under code inspection:
In the
_surveygizmo_request()method of the surveygizmo_api class you usefile_get_contents()and have a TODO to use a more graceful solution. How about using drupal_http_request()? This allows for easily checking the response code. You can also use http://api.drupal.org/api/function/drupal_query_string_encode/6 to build the query part.In
surveygizmo_present_survey()how about wrapping the $fail message int()so it can be translated? You can pass the $sgid and $survey variables as arguments.You don't need the
check_plain()insurveygizmo_manage_survey()on 'Manage survey', but you could uset()so it's translatable.I think you need a return; or exit; after using
drupal_not_found()in the functionssurveygizmo_form_manage_survey()andsurveygizmo_manage_survey()Arguments in the $embed_description on line 190 of
surveygizmo_form_manage_survey()appear to not actually be used in the string. I don't see the replacement @format used.I don't see any, but maybe I'm missing it, but is there anything stopping me from setting a survey to an existing system path, like 'admin' or 'node/add/page' ? I don't think this is a blocker though cause it's a bit difficult to check for all the system paths. You could see what Views does, if anything. This could be handled later once the module is on contrib.
There are a few text arguments to
l()insurveygizmo_dashboard()that should be run throught().Comment #7
gregglesPathauto handles that with the below code. I just tried to create a node with a pattern of "user/[title-raw]" and a node title of "register" and Pathauto silently refuses to create the alias. I'm not sure being silent is right, but at least we know that the check that Pathauto does works ;)
I guess something similar could work here as well.
Comment #8
garbanzito commentedThanks for the review, Ben. And thanks for the tip, Greg -- turns out that was one of the first places I had looked for an example of path checking.
In the attached I believe I've addressed all the above concerns, but with a different tactic than suggested on the menu path checking.
To answer Ben's question, there is indeed nothing stopping someone with the 'administer surveygizmo' permission from usurping an existing system path. I think there are valid reasons one might want to render a survey at an existing path, perhaps on a temporary basis. This is borne out by the fact that neither Views nor the core Path module disallows usurping an existing path.
But the question led me to address two other issues:
1) I learned that I wasn't doing enough to delete unreferenced paths from the menu cache, so the code now has logic to detect changed/deleted paths and deactivate the old path;
2) a user with 'adminster surveygizmo' permission could override a system path to which they did not have access, so I've prevented that with an access check when validating the a path submission.
Comment #9
garbanzito commentedComment #10
coltraneI've reviewed again, and installed and used the module and I believe garbanzito's app should be approved. As a coworker I don't want to RTBC but I do think it's RTBC status.
Comment #11
avpadernoI will review the code tomorrow morning (less than 24 hours from now).
Comment #12
avpadernoError messages, as other type of messages, are shown with
drupal_set_message().In this case, passing a single string to
t()would give more context to who translates the strings. There are languages where the word can be translated in different ways, depending on the context. Without such context, it would not be possible to translate the word correctly.Comment #13
garbanzito commentedThanks. Took care of those items.
Comment #14
avpadernoThe code doesn't work, as it's trying to load the file from the Drupal root directory, which is the current directory set by Drupal. If the file is always included, then it is better to merge it with the module file.
Thank you for your contribution! I am going to update your account.
These are some recommended readings to help with excellent maintainership:
You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
I thank all the dedicated reviewers as well.
Comment #17
avpaderno