Lately when I try to open any quizz on my moodle 3.3.5 installation I get the following debug info:
Debug info: Duplicate entry
'48954-0' for key 'mdl_quesattestep_queseq_uix'
INSERT INTO mdl_question_attempt_steps
(questionattemptid,sequencenumber,state,fraction,timecreated,userid) VALUES(?,?,?,?,?,?)
[array (
0 => 48954,
1 => 0,
2 => 'todo',
3 => NULL,
4 => 1533734132,
5 => '2',
)]
Error code: dmlwriteexception
×Stack trace:
· line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown
· line 1300 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
· line 1346 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
· line 227 of /question/engine/datalib.php: call to mysqli_native_moodle_database->insert_record()
· line 148 of /question/engine/datalib.php: call to question_engine_data_mapper->insert_question_attempt_step()
· line 100 of /question/engine/datalib.php: call to question_engine_data_mapper->insert_question_attempt()
· line 100 of /question/engine/lib.php: call to question_engine_data_mapper->insert_questions_usage_by_activity()
· line 349 of /mod/quiz/locallib.php: call to question_engine::save_questions_usage_by_activity()
· line 2366 of /mod/quiz/locallib.php: call to quiz_attempt_save_started()
· line 111 of /mod/quiz/startattempt.php: call to quiz_prepare_and_start_new_attempt()
Seems that Moodle cannot write into the Database table „mdl_question_attempt_steps“ anymore.
I have copied the database to a test-moodle 3.4.4 on another server with barracuda enabled.
I have run the cli script to change the database to barracuda which converted selcted tables, but did not include the table „mdl_question_attempt_steps“ – the problem is still the same.
In a radical step I deleted all the content in that table via phpmyadmin – now everything seems to work again.
Is there a better solution to my problem? Might emptying that table have any consequences in other places?
I have checked the grades for quizzes in different courses and everything seems to be fine.
Has anybody run into the same problem?