I'm upgrading from 1.9.19 to 2.2.5. (using a duplicate of the database/data).
Get the error below on mod_quiz ...
I can find and remove the duplicate but then it just finds another, and another. I gave up after four, I could be here for weeks.
What's causing this (I'm guessing this doesn't happen very often, I can only find one other thread about this and that didn't help except to tell me how to clear it for the one error)?
Is there a way I can clean up the whole thing in one go?
Many thanks for any help.
Debug info: SQLState: 23000<br>
Error Code: 2601<br>
Message: [Microsoft][SQL Server Native Client 10.0][SQL Server]Cannot insert duplicate key row in object 'dbo.mdl_question_attempt_steps' with unique index 'mdl_quesattestep_queseq_uix'.<br>
SQLState: 01000<br>
Error Code: 3621<br>
Message: [Microsoft][SQL Server Native Client 10.0][SQL Server]The statement has been terminated.<br>
INSERT INTO mdl_question_attempt_steps (fraction,timecreated,userid,state,sequencenumber,questionattemptid) VALUES(NULL,'1315316991','1047',N'todo','0','21166')
[array (
0 => NULL,
1 => '1315316991',
2 => '1047',
3 => 'todo',
4 => 0,
5 => 21166,
)]
- line 397 of \lib\dml\moodle_database.php: dml_write_exception thrown
- line 256 of \lib\dml\sqlsrv_native_moodle_database.php: call to moodle_database->query_end()
- line 372 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->query_end()
- line 885 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->do_query()
- line 963 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->insert_record_raw()
- line 300 of \question\engine\upgrade\upgradelib.php: call to sqlsrv_native_moodle_database->insert_record()
- line 259 of \question\engine\upgrade\upgradelib.php: call to question_engine_attempt_upgrader->insert_record()
- line 222 of \question\engine\upgrade\upgradelib.php: call to question_engine_attempt_upgrader->save_usage()
- line 177 of \question\engine\upgrade\upgradelib.php: call to question_engine_attempt_upgrader->convert_quiz_attempt()
- line 132 of \question\engine\upgrade\upgradelib.php: call to question_engine_attempt_upgrader->update_all_attempts_at_quiz()
- line 1112 of \mod\quiz\db\upgrade.php: call to question_engine_attempt_upgrader->convert_all_quiz_attempts()
- line 540 of \lib\upgradelib.php: call to xmldb_quiz_upgrade()
- line 271 of \lib\upgradelib.php: call to upgrade_plugins_modules()
- line 1437 of \lib\upgradelib.php: call to upgrade_plugins()
- line 269 of \admin\index.php: call to upgrade_noncore()