Add questions to quiz from a course restore - getting a duplicate entry database error

Re: Add questions to quiz from a course restore - getting a duplicate entry database error

by Susan Mangan -
Number of replies: 0

Re: So, the suggested work-around is to add an ORDER BY clause to the query,

Has anyone attempted this workaround?  Adding ORDER BY in the query eliminated the original error but didn't quite do the trick, still getting a dmlwriteexception occassionally.  Doesn't seem to be consistent.


Error code: dmlwriteexception
* line 482 of /lib/dml/moodle_database.php: dml_write_exception thrown
* line 1069 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
* line 2071 of /mod/quiz/locallib.php: call to mysqli_native_moodle_database->execute()
* line 129 of /mod/quiz/edit.php: call to quiz_add_quiz_question()

Of course it's entirely possible I've not done it correctly...