Name: Phased Contest

This module allows creation of a voting contest with voting and submission phases. It creates two content types.

  • phased_contest - Actual contest node, allows for anonymous submissions and limiting number of submissions per user.
  • phased_contest_entries - Stores contest entries

Phased contest content type allows creation of entry form via Form Builder Field. Type also has fields for controlling if anonymous users can submit and entry and controlling the number of submissions per user.

Sandbox: http://drupal.org/sandbox/PieIsGood/1937046
Drupal Version: 7.x

Comments

mayank-kamothi’s picture

hi

Autometed Review:

Check this url http://ventral.org/pareview/httpgitdrupalorgsandboxpieisgood1937046git

Manual Review:

  • In your module file line no.34 Hook is hook_form_FORM_ID_alter but your comment is hook_form_alter.
  • Insted of use img tag it would be nice if you used theme_image hook.
  • t() is missing for description of form field in your phased_contest.proprties.inc file.

Thanks,
Mayank Kamothi

mnico’s picture

Hi
Manual Review

  1. It should eliminate persistent variables on hook_uninstall
  2. Add the README.txt
  3. It would be great if you could create a file *.api.php to document module's hooks
pieisgood’s picture

Thanks for the review!

Fixed all the warnings and errors located here http://ventral.org/pareview/httpgitdrupalorgsandboxpieisgood1937046git

Changed the hook_form_alter to hook_form_FORM_ID_alter
Switched to using theme_image
Added missing t()s

Thanks,

Jeffrey

pieisgood’s picture

Thanks for the review!

1. Added hook_uninstall to remove variables.
2. Added README.txt
3. Creating phased_contest.api.php with documentation and examples.

Thanks,

Jeffrey

klausi’s picture

We are currently quite busy with all the project applications and I can only review projects with a review bonus. Please help me reviewing and put yourself on the PAReview: review bonus high priority list. Then I'll take a look at your project right away :-)

arnoldbird’s picture

Status: Needs review » Needs work

Hi PieIsGood,

The module seems like it could be useful but has some UI problems (possibly form_builder bugs) that make it difficult to test.

The module has a lot of dependencies (more than 10) so you might consider listing them on your project page as this may affect some people's decision about whether to use the module.

In the module file, consider using module_load_include() to include 'phased_contest.features.inc'.

Incomplete comment at line 62 of the module file.

At line 312 of the module file, you add CSS, but if I'm not mistaken I think you could also add it in phased_contest_form_phased_contest_entries_node_form_alter() by setting $form['#attached'] like in this example...

$form['#attached']['css'] = array(
  drupal_get_path('module', 'ajax_example') . '/ajax_example.css',<br/>
);

At line 388 and 391 I don't think you need that equals sign. That's the default.

At line 328 please write a clearer comment especially when you are highlighting something that you think might not work.

In the function doc blocks consider indicating when you are implementing _preprocess_. I don't know the standard way of doing that but it seems like a good idea.

You have untranslated strings at lines 223 and 232.

Line 422 is another place where your comment indicates you think something is inadequate, but you don't explain why.

Untranslated string at line 433.

I'm getting this error...

Warning: Invalid argument supplied for foreach() in element_children() (line 6370 of /var/www/drupal_fresh/includes/common.inc).
    Warning: Invalid argument supplied for foreach() in element_children() (line 6370 of /var/www/drupal_fresh/includes/common.inc).
    Warning: Invalid argument supplied for foreach() in element_children() (line 6370 of /var/www/drupal_fresh/includes/common.inc).
    Notice: Undefined index: #prefix in form_builder_field_field_widget_form() (line 153 of /var/www/drupal_fresh/sites/all/modules/form_builder_field/form_builder_field.module).

...at node/add/phased-contest.

I don't know if it's a bug in your module or form_builder, but I get "Field Name field is required." when I click a red X to delete a checkbox option. So it's not possible to delete a checkbox option.

This looks to be a form_builder bug I got when I clicked the fieldset button:

  Warning: Invalid argument supplied for foreach() in element_children() (line 6370 of /var/www/drupal_fresh/includes/common.inc).
    Warning: Invalid argument supplied for foreach() in element_children() (line 6370 of /var/www/drupal_fresh/includes/common.inc).
    Warning: Invalid argument supplied for foreach() in element_children() (line 6370 of /var/www/drupal_fresh/includes/common.inc).
    Warning: Invalid argument supplied for foreach() in element_children() (line 6370 of /var/www/drupal_fresh/includes/common.inc).
    Notice: Undefined index: #prefix in form_builder_field_field_widget_form() (line 153 of /var/www/drupal_fresh/sites/all/modules/form_builder_field/form_builder_field.module).

In any case, there are some problems in the UI that are blockers at least as long as the module depends on form_builder. At one point clicking the fieldset button seemed to clear all the inputs from the pane where you drag the inputs.

There is a broken "Edit Form" link showing at the bottom of the Create Phased Contest form.

pieisgood’s picture

Thanks for the review. Here are the following items that I have addressed:

  • Added dependencies to module page
  • Did not change to module_load_include(). This is a features export that is being loaded.
  • Add more info to comment on line 62.
  • Did not change the drupal_add_css on line 312. This is the theme that is switched to on view if the form is past the submission phase and can be called else where.
  • Did not remove the "=". I understand it is default, but this makes reading the code a little easier for those not completely versed in fieldCondition.
  • Added clearer comment to line 328.
  • Not sure what you mean by adding a function doc block to a theme preprocess.
  • Added string translations to 223 and 232.
  • Added more to comment on line 422.
  • Fixed Warning: Invalid argument supplied for foreach() in element_children() in Form Builder Field. Please download latest release.
  • Error with removing checkbox was probably fixed in last release of Form Builder Field. A js file was missing from the previous release of Form Builder Field. This missing file was causing a lot of bugs on my module.
  • Added new release to Form Builder Crud to fix remaining Warning: Invalid argument supplied for foreach() in element_children().
  • New release of Form Builder Field fixed form showing up on top. The "Edit Form" link should be the only place to edit the form.

Once again, thank you for the review.

pieisgood’s picture

Status: Needs work » Needs review

Please see comment #7

kscheirer’s picture

Status: Needs review » Reviewed & tested by the community

Nice feature module, well documented and the code looks solid.

----
Top Shelf Modules - Enterprise modules from the community for the community.

kscheirer’s picture

Title: Phased Contest » [D7] Phased Contest
Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

Would it be easier to use Webform and a scheduler module to handle this use case? Webform allows you to build a form easily, and stores the submissions, and can track # of entries / user. If you could describe the differences that would help let a user know why they would use your module instead.

----
Top Shelf Modules - Crafted, Curated, Contributed.

pieisgood’s picture

Hey kscheirer,

Unless I'm mistaken you can't vote on webform entries, nor display them easily. Also you cannot have revisions on webforms. By using form_builder_field you can attach form_builder to a node field and use the built in revision mechanism. The purpose of this was for a client that wanted forms to have revisions and voting on the entries.

kscheirer’s picture

Status: Postponed (maintainer needs more info) » Fixed

Thanks for the additional info, that does seem reasonable.

Thanks for your contribution, PieIsGood!

I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!

Thanks, 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.

Thanks to the dedicated reviewer(s) as well.

----
Top Shelf Modules - Crafted, Curated, Contributed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.