by Lazaros Sotiriadis.
Dear Simon,
I have tested your backup in a fresh 3.8 moodle installation (after installing grid_format plugin as well) using my latest restore.php version and it checks out as is, either in NEW_COURSE or in EXISTING_DELETING target and mode general.
It is normally restored with signle error "Invalid sequence found in restored multianswer question 39" with grid format without any users (they were not included in the backup as I can see).
In my attempts one time when EXISTING_DELETING target was detected (because the course existed) it failed, but redoing the same exact operation succeeded. (" php admin/cli/restore.php --categoryid=3 --source=/tmp/foo/"). It seems to be a bug in the way the restore controller creates the questions. Runing same restore command over and over I can see that first fails, second succeeds, third fails, fourth succeeds etc. It only happens when overwriting existing course.
I have tested your backup in a fresh 3.8 moodle installation (after installing grid_format plugin as well) using my latest restore.php version and it checks out as is, either in NEW_COURSE or in EXISTING_DELETING target and mode general.
It is normally restored with signle error "Invalid sequence found in restored multianswer question 39" with grid format without any users (they were not included in the backup as I can see).
In my attempts one time when EXISTING_DELETING target was detected (because the course existed) it failed, but redoing the same exact operation succeeded. (" php admin/cli/restore.php --categoryid=3 --source=/tmp/foo/"). It seems to be a bug in the way the restore controller creates the questions. Runing same restore command over and over I can see that first fails, second succeeds, third fails, fourth succeeds etc. It only happens when overwriting existing course.
This happens because course contents are not entirerly emptied before restoring and create conflicts and that is why I changed restore code so that if it is overwriting a course it first removes all course content.
That worked. I uploaded the new version and is ready to test.
Regards,
Lazaros
"Default exception handler: error/error_qtype_match_subquestion_missing_in_db Debug:
Error code: error_qtype_match_subquestion_missing_in_db
$a contents: stdClass Object
(
[id] => 165543
[questiontext] => <p>Spotted and claimed the East Coast of Australia for the Crown and named it New South Wales</p>
[questiontextformat] => 1
[answertext] => Captain James Cook
)
* line 174 of /question/type/match/backup/moodle2/restore_qtype_match_plugin.class.php: restore_step_exception thrown
...
Error code: error_qtype_match_subquestion_missing_in_db
$a contents: stdClass Object
(
[id] => 165543
[questiontext] => <p>Spotted and claimed the East Coast of Australia for the Crown and named it New South Wales</p>
[questiontextformat] => 1
[answertext] => Captain James Cook
)
* line 174 of /question/type/match/backup/moodle2/restore_qtype_match_plugin.class.php: restore_step_exception thrown
...