Active
Project:
phpEdu
Version:
6.x-1.1-beta2
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Mar 2009 at 20:34 UTC
Updated:
15 Mar 2009 at 20:03 UTC
I can't seem to save answers for questions because when it tries to insert into the 'pe_quiz_question_answer' table, it's using NULL as the value for the 'aid' column.
An example from pe_multichoice.module:
db_query("INSERT INTO {pe_quiz_question_answer} (aid, question_nid, answer, feedback, points) VALUES(%d, %d, '%s', '%s', %d)",
NULL, $node->nid, $value['answer'], $value['feedback'], $value['correct']);
I'm using postgreSQL, so maybe it's a difference between mysql and pgsql in that a it would create the next incremented value. But otherwise I'm not sure what it's supposed to be doing.
Can someone clear this up?
Comments
Comment #1
dakalaSorry, I haven't done any testing on PostgreSQL but I suspect it has to do with your observation. You could try this:
db_query("INSERT INTO {pe_quiz_question_answer} (question_nid, answer, feedback, points) VALUES(%d, '%s', '%s', %d)",
$node->nid, $value['answer'], $value['feedback'], $value['correct']);