CVS edit link for a_lawry

I have written a module named Node Questions for a project I am developing and I would like to share it with the community as other people might find it useful.

Node Questions allows an administrator with appropriate permissions to add questions to a node. The questions are multiple choice. It provides a block to display the questions to the user. If the user has appropriate permissions they can answer the questions. Each question may be answered correctly only once by a user and if they answer incorrectly they have to wait a specified number of days before trying again.

It integrates with User points so points can be awarded to the user if they answer correctly.

I didn't find any existing modules that implemented this functionality.

The code can be found here:

http://www.andrewlawry.com.au/node_questions/node_questions.tar.gz

Comments

a_lawry’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new6.03 KB

Uploaded node_questions code.

avpaderno’s picture

Status: Needs review » Needs work
Issue tags: +Module review

Hello, 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 per http://drupal.org/cvs-application/requirements, the motivation message should be expanded to contain more details about the features of the proposed module, and it should include also a comparison with the existing solutions. In particular, what is the difference between the proposed module and http://drupal.org/project/jeopardy? Why didn't you open a feature report for any features you think missing in the existing project?

a_lawry’s picture

Hi Kiamlalumo,

Is there a way to edit the original post and expand the motivation message?

I'll just expand here based on what you have asked.

The Node Questions module is used to provide a short test about the node it is on. In the project it was originally created for these were nodes containing videos. So the user can watch the video then have a few questions to answer to gain User Points. I don't believe any other module provides this functionality.

The module with the most similar functionality is http://drupal.org/project/jeopardy but this module has been marked abandoned by the maintainer and only had a development release for Drupal 5. The Jeopardy module creates a new content type to add question/answer nodes. My module adds questions and answers to existing nodes.

Andrew

avpaderno’s picture

Status: Needs work » Needs review

Thanks for the reply.
You cannot edit the original post; you can only expand the text in a comment like you did.

qasimzee’s picture

You are required to delete all the variables you have used

variable_get('node_questions_wait_period', 0) * 3600 * 24;

Include the CVS keyword $Id$ in each file. This should be in the format

// $Id$ or // $Id$ (Drupal Docs)

Please read coding standards for details.

Also, isn't it possible to modify this module to serve the same purpose?
http://drupal.org/project/block_quiz

qasimzee’s picture

Status: Needs review » Needs work
a_lawry’s picture

Status: Needs work » Needs review
StatusFileSize
new6.04 KB

I've updated the CVS tags. Missed the uppercase I.

The module now also removes the configuration variable.

http://drupal.org/project/block_quiz serves a different purpose. It is more like the jeopardy module. They both display a quiz the user based on their own storage. For a quick fun question and answer session. To provide the functionality of my module the following changes would have to be made to that module taking it in a completely different direction.

1. Store questions per node.
2. Allow multiple questions in the block.
3. Integrate with userpoints
4. Add a freeze out time for incorrectly answered questions
5. Stop users correctly answering multiple times.

Which is basically the entire new module.

a_lawry’s picture

Any updates on this? Did I need to do something else?

meba’s picture

Status: Needs review » Reviewed & tested by the community

There are few bits there and there like missing t() in some l()'s but otherwise it seems fine

avpaderno’s picture

Status: Reviewed & tested by the community » Needs work
  • The points reported in this review are not in order or importance / relevance.
  • Most of the times I report the code that present an issue. In such cases, the same error can be present in other parts of the code; the fact I don't report the same issue more than once doesn't mean the same issue is not present in different places.
  • Not all the reported points are application blockers; some of the points I report are simple suggestions to who applies for a CVS account. For a list of what is considered a blocker for the application approval, see CVS applications review, what to expect. Keep in mind the list is still under construction, and can be changed to adapt it to what has been found out during code review, or to make the list clearer to who applies for a CVS account.
  1. Menu descriptions and titles, schema descriptions are not passed to t().
  2. function node_questions_help($path, $arg) {
      if ($path == 'admin/help#node_questions') {
        $txt = 'The Node Questions module adds questions to nodes that can be answered by the user.';
        return '<p>' . $txt . '</p>';
      }
    }
    

    Strings used in the user interface should be translated.

  3. /**
    * Implementation of hook_perm()
    */
    function node_questions_perm() {
      return array('View questions', 'Answer questions');
    }
    
    

    The permissions should be view questions, and answer questions; there should probably be also administer questions, which should be used instead of the generic administer site.

  4.   $query = "SELECT ua.* FROM {nq_user_answers} as ua ";
      $query .= " WHERE ua.nid = %d AND ua.uid = %d ";
    
    

    Reserved SQL keywords should be written in upper case.

manuel garcia’s picture

Status: Needs work » Closed (won't fix)

I'm setting this to closed since there's been 7 weeks without further interest from the applicant.

a_lawry, feel free to re-open it if you are willing to fix the mentioned problems with the module.

avpaderno’s picture

Component: Miscellaneous » new project application
Issue summary: View changes

Please read the following links as this is very important information about CVS applications.