Hello quiz fans! I'm rather new at this and don't have CSV access (I'll request that today, though), but I'm working on a new question type (more details as I get it working), and so have been using the code in HEAD. I'd like to help all I can. Please excuse any social or process faux pax I might make as I learn how to be a contributer to Open Source. :) Many thanks!

First thing I noticed when I tried to create a quiz this morning was this error:

user warning: Column count doesn't match value count at row 1 query: INSERT INTO quiz_node_properties (vid, nid, number_of_random_questions, shuffle, backwards_navigation, quiz_open, quiz_close, takes, pass_rate, summary_pass, summary_default, quiz_always, feedback_time, tid) VALUES(5, 5, 0, 1, 0, 1197619200, 1200211200, 0, '75', 'Congrats, you\'ve passed the test.', 0, 1, 0) in /Users/katin/Sites/includes/database.mysql.inc on line 172.

In quiz.module,v 1.126 2007/12/13 20:09:53, t'was missing a %d for pass_rate. The code routine should look like this: (only the VALUES line changed)

function quiz_insert($node) {
  quiz_translate_form_date($node, 'quiz_open');
  quiz_translate_form_date($node, 'quiz_close');
  $sql = "INSERT INTO {quiz_node_properties} " .
         "(vid, nid, number_of_random_questions, shuffle, backwards_navigation, quiz_open, quiz_close, takes, pass_rate, summary_pass, summary_default, quiz_always, feedback_time, tid) " .
         "VALUES(%d, %d, %d, %d, %d, %d, %d, %d, %d, '%s', '%s', %d, %d, %d)";
  db_query($sql, $node->vid, $node->nid, $node->number_of_random_questions, $node->shuffle, $node->backwards_navigation,
          $node->quiz_open, $node->quiz_close, $node->takes, $node->pass_rate, $node->summary_pass, $node->summary_default, $node->quiz_always, $node->feedback_time, $node->tid);
  _quiz_insert_resultoptions($node);
}

With that change in place, I was able to successfully create a quiz w/o error msgs.

Not sure how to build a patch the right way yet, but I've got the CLI and will endeavor to learn. Thanks.

Comments

westwesterson’s picture

Status: Closed (duplicate) » Active

Actually on this one you don't need to, we do need a tester for the patch though you can check out the patch here. It needs a second set of eyes to make sure it doesn't mess anything up on accident. If you'd like to submit any additional functionality or additional quiz type modules, that would be great, but you don't need to request cvs access. If you submit a patch, we can test it, and make sure that it's fully working before the current maintainer submits it to core. (that's me)

If you'd like to learn more about the patch process, check out these handbook pages.
How to apply a patch.
http://drupal.org/patch/apply

How to create a patch.
http://drupal.org/patch/create

The easiest way to get started is probably to use some kind of IDE such as eclipse (thats what i use).
http://www.zend.com/en/community/pdt

And to access cvs (for download) you don't need an account. This page should tell you how to login as an anonymous user.
http://drupal.org/node/321

westwesterson’s picture

Status: Active » Closed (duplicate)

Status: Active » Closed (duplicate)