This module allows the creators of a quiz to add a grouping question type.

The grouping question invites participants to group together a series of terms by dragging and dropping similar terms on to up to 10 groups.

This module is dependant on the quiz module and jquery_ui module and requires the users to have javascript enabled to use it.

The sandbox project page for this can be found at the following URL:

http://drupal.org/sandbox/johnennew/1184752

Comments

tim.plunkett’s picture

Status: Needs review » Needs work
StatusFileSize
new12.83 KB

I haven't tested the module yet, just pure code review.

Attached is a patch for mostly coding standards fixes.

The only real problem is the tpl.php files, they are full of PHP logic that should be in a template_preprocess function.

Using grouping-question-help.tpl.php is an interesting approach, but it makes it all untranslatable. Much of the text should be in the README.txt, and the rest should be condensed and printed out directly by hook_help.

The patch removes all author credit. That is given on the project page itself.

Thanks!

johnennew’s picture

Thanks for the review, will commit your modifications when I can!

John

johnennew’s picture

Status: Needs work » Needs review

Hello,

I have refactored the grouping_question module following the advice here. Please could it be reviewed again? The release branch to check is 6.x-4.3

Many thanks,

John

patrickd’s picture

You are working wrong with branches in git. Please see the documentation about release naming conventions and creating a branch in git.

Review of the 6.x-1.x branch:

  • Remove "version" from the info file, it will be added by drupal.org packaging automatically.
  • ./grouping_question.classes.inc: The description on the line after the @param/@return documentation is either missing or not formatted correctly. See http://drupal.org/node/1354#functions
    61-   *  The group index
    75-   *  The group index
    
  • Bad line endings were found, always use unix style terminators. See http://drupal.org/coding-standards#indenting
    
    theme/grouping-question-answering-form.tpl.php
    

This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.

Source: http://ventral.org/pareview - PAReview.sh online service

patrickd’s picture

Status: Needs review » Needs work
johnennew’s picture

Thanks for the review.

I have run the pareview.sh script locally and corrected the warnings it generated. I've changed the git branch to 6.x-4.x as per the instructions and removed the other branches. I'd like to use 6.x-4.x to match the quiz release that this question type is for. I have also generated a 6.x-4.3-beta1 tag.

Kind regards,

John

johnennew’s picture

Status: Needs work » Needs review
patrickd’s picture

johnennew’s picture

Status: Needs work » Needs review

Thanks for looking at the 7.x-4.x branch but its only the 6.x-4.x branch I asked to be reviewed. Since the quiz module only has a stable 6.x release I thought it still worth getting the 6.x-4.x branch out of sandbox. 7.x-4.x is certainly not ready and won't be until quiz 7.x-4.x is released.

Kind regards

John

patrickd’s picture

Status: Needs review » Needs work

I'm sorry!
Unfortunatelly also the 6.x-4.x branch has some issues:
http://ventral.org/pareview/httpgitdrupalorgsandboxjohnennew1184556git-6...

I understand the sense of naming the branch 6.x-4.x but I don't know if this is allowed (?)

johnennew’s picture

Hi Patrickd, My project will track the quiz module so I think it makes sense to match revisions but I don't know if its allowed either. Should I tweet @dries?!

thanks for your help and patience, I'll get there in the end. My locally installed coder and pareview do not seem to pick up as much as the online version for some reason. Maybe I am on a mac?

I like the http://ventral.org automated tests, very impressive.

John

patrickd’s picture

nah :D this isn't the kind of question you should ask dries ;)
you can wait until somebody clarifies this here, look for other applications that had the same issue or ask in IRC

the modules pareview.sh depends on are changed frequently, you have to update it and I think you will get the same results as at ventral.org
thank you

johnennew’s picture

Status: Needs work » Needs review

OK, Passing ventral.org review now :)

http://ventral.org/pareview/httpgitdrupalorgsandboxjohnennew1184752git-6...

Move to a 6.x-1.x branch to match other quiz add ons and removed old 6.x-4.x branch.

Kind regards,

John

johnennew’s picture

Can anyone explain how I would fix the following error reported by ventral.org project review:

Files must end in a single new line character

I have tried no extra lines at the end of the file, 1 extra line and two extra lines. I am using Unix line endings as far as I can tell. I am editing in VIM.

Kind regards,

John

doitDave’s picture

Hi, correct style is to have *one* \n character at each file's end. If you have this, you can safely ignore each warning as any reviewer will do.

There is no convention that forces you to start your major version id by "1". The release naming conventions are only about proper formatting of your branches and tags.

While I personally would not cut myself off from any chance to do my own version naming and look for a different idea (e.g. 6.x-1.0-v4 (...-v5); not sure if this would work but should), you may of course start with 6.x-4.0-alpha1 or similar. You should, however, not tag too early; tagging before you have full project status does not make any sense.

hth, dave

jthorson’s picture

On the branch naming, there's nothing against matching your version numbering up with the quiz module, but it typically only makes sense when you are the maintainer of both projects and can ensure you are simultaneously releasing updates on both projects. Matching version strings will cause end users to assume they need to keep the module versions in synch, when this may not actually be the case. In most cases, the child module should generally work with any release with the same minor release prefix (i.e. work with any 6.x-4.x, instead of needing seperate releases for 6.x-4.1, 6.x-4.2, and 6.x-4.3).

What you will find is that it becomes more confusing for the end user (and more work for the maintainer) when you try to sync up version strings, as you start doing things like releasing new version with no code changes, just because the other module was forced to make a tweak due to a security vulnerability or other bug.

When you have different maintainers for the two projects, then the additional coordination needed to keep releases in synch becomes somewhat more troublesome than it's worth.

All that said, there are cases where projects are only supported with each other at the dot release level, and there isn't anything restricting you from doing this ... I'd just suggest you avoid it unless you have a specific reason that synchronizing releases is required.

jthorson’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed the 6.x version.

Only suggestion I'd have is to use the $form['#attached'] property to add your js when you complete the D7 version, instead of drupal_add_js ... otherwise, everything looks good!

klausi’s picture

Status: Reviewed & tested by the community » Fixed
StatusFileSize
new783 bytes

Review of the 7.x-1.x branch:

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Go and review some other project applications, so we can get back to yours sooner.

manual review:

  • info file: "php = 5" this is not necessary as D7 already requires PHP 5.2.
  • "cache_clear_all('autoload:', 'cache');": are you sure this is necessary in D7?
  • grouping_question_schema(): It would be nice to have actual untranslated descriptions for the tables and the columns in there, and please do not define empty '' descriptions.
  • class GroupingQuestion: "@param int $a": a class definition does not have any parameters?
  • grouping_question.js: @file doc block is empty. Indentation should always be 2 spaces, same as for PHP files.
  • grouping_question.theme.inc: @file block is empty. Please make sure that all @file blocks have descriptions in your module.
  • I find it hard to check if your module is XSS safe from reviewing the code. Please insert <script>alert('XSS!');</script> into all form elements that you expose to users and check if you get any nasty javascript popups (If you do, you have a security problem).

But that are just minor issues.

Thanks for your contribution, johnennew! Welcome to the community of project contributors on drupal.org.

I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.

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.

As you continue to work on your module, keep in mind: Commit messages - providing history and credit and Release naming conventions.

Status: Fixed » Closed (fixed)

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

avpaderno’s picture

Title: Grouping question » [D6] Grouping question
Issue summary: View changes