I installed and created numerous quizzes... When I am logged as Admin and I take a quiz, I can see the final screen and the Passed/Not passed Custom field summery (I have created pdf certificates for those who have passed)....

However, if I am logged as an user, all I get in that field is N/A?

I tried to install the newer version, but although it says it is installed, it fails to create three database tables, and the module does not work.

Any help is much appreciated!

Comments

westwesterson’s picture

Status: Active » Postponed (maintainer needs more info)

did you try the beta version, or dev 1.x?
And did you run the update.php after updating?

cardsup’s picture

Thanks! I tried again installing the new version. I run update.php...

When I go see a quiz , I get this error:

user warning: Duplicate entry '4' for key 1 query: INSERT INTO quiz_node_results (result_id, nid, vid, uid, time_start) VALUES (4, 201, 285, 141, 1202417331) in /home/www/public_html/site/includes/database.mysql.inc on line 172.

and the Quiz can not be started....

westwesterson’s picture

I cannot reproduce this error. Can you give me a dump of your quiz_node_results table? and what version of mysql are you using?

cardsup’s picture

Thanks! I managed to make the new module work when I emptied the quiz_node_results table.

However, there are two new problems which puzzle me...

1. When I take a quiz, everything seems to be working except that in the end it displays questions from other quizzes, marked as correctly answered. Why is that?

2. When I make a new multichoice question, it is created, but I get those errors:

* warning: Invalid argument supplied for foreach() in /home/site/public_html/kids/modules/node/node.module on line 521.
* warning: implode() [function.implode]: Invalid arguments passed in /home/site/public_html/kids/modules/node/node.module on line 525.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE in /home/site/public_html/kids/includes/database.mysql.inc on line 172.
* warning: Invalid argument supplied for foreach() in /home/site/public_html/kids/modules/node/node.module on line 521.
* warning: implode() [function.implode]: Invalid arguments passed in /home/site/public_html/kids/modules/node/node.module on line 525.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE in /home/site/public_html/kids/includes/database.mysql.inc on line 172.

westwesterson’s picture

Version: 5.x-1.x-dev » 5.x-2.0-beta2

Again, these errors do not show up for me, it sounds like somehow your database was corrupted, on a clean install I cannot reproduce any of these problems.
Perhaps the update function is messed up somehow. The fact that you had installed the 1.x dev version may be a part of this.

Anyhow just in case it is not a corrupted database, can you tell me the steps you take to create a multichoice question. (there are 2 ways to do so, one through create content, and one through the quiz itself. This should have an impact on the node_load() function which is being called. I believe that somehow the correct nid is not being passed to node load.

If it is a corrupted database this should only effect the quiz tables, so the rest of your drupal site should be alright, untill i figure out exactly what is going on with your database, I can't provide a patch which allows quiz to fix itself. But i believe if you were to go into the database and make sure that all the nids were correctly aligned, that all these problems would go away. Depending on the number of quiz questions, it may be possible to just do a clean install of the quiz module using the latest beta. and just re-add them manually. I would like to find the problem so I could fix it more programatically, but i would need a readout of the tables corresponding to the quiz module, and the node table too.

dudskie’s picture

Got the same problem here. Please advised.

mach5_kel’s picture

Version: 5.x-2.0-beta2 » 5.x-2.0-beta4

I have something similar. I can donate some money for time to get this solved. Important for me.

Appears on multiple choice "personality" quizes.

After each question I get:

warning: array_values() [function.array-values]: The argument should be an array in /home/content/m/a/c/mach5kel/html/modules/quiz/multichoice.module on line 655.

On the final results page. No "personality" is given or results summary of any kind. Just a thank you message and the following error:

* warning: array_values() [function.array-values]: The argument should be an array in /home/content/m/a/c/mach5kel/html/modules/quiz/multichoice.module on line 655.
* user warning: Invalid use of group function query: SELECT (SELECT count(*) FROM quiz_node_results_answers WHERE result_id = 12) as question_count,(SELECT option_summary FROM quiz_multichoice_user_answers LEFT JOIN quiz_multichoice_answers USING (answer_id) LEFT JOIN quiz_node_result_options ON (result_option = option_id) WHERE result_id = 12 GROUP BY result_option ORDER BY COUNT(result_option) desc LIMIT 1) as result_option in /home/content/m/a/c/mach5kel/html/includes/database.mysql.inc on line 172.

You can see an example here:

http://www.easy-shoponline.net/erics-personality-quiz

Thank you,

Eric

mbutcher’s picture

While porting to D6, I found a case where this issue might appear, and I have fixed it in HEAD. The fix will make its way into the next developer release.

mbutcher’s picture

Assigned: Unassigned » mbutcher
Priority: Critical » Normal

Cannot reproduce in 6.x-2.0.

mbutcher’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Quiz for D5 is no longer supported.