MDL-20636 Fix backup and restore issues found during testing.
This commit is contained in:
@@ -2297,10 +2297,10 @@ class restore_create_categories_and_questions extends restore_structure_step {
|
||||
$data->category = $this->get_mappingid('question_category', $questionmapping->parentitemid);
|
||||
|
||||
// In the past, there were some very sloppy values of penalty. Fix them.
|
||||
if ($data->penalty >= 0.33 && $question->penalty <= 0.34) {
|
||||
if ($data->penalty >= 0.33 && $data->penalty <= 0.34) {
|
||||
$data->penalty = 0.3333333;
|
||||
}
|
||||
if ($data->penalty >= 0.66 && $question->penalty <= 0.67) {
|
||||
if ($data->penalty >= 0.66 && $data->penalty <= 0.67) {
|
||||
$data->penalty = 0.6666667;
|
||||
}
|
||||
if ($data->penalty >= 1) {
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ class backup_qtype_oumultiresponse_plugin extends backup_qtype_plugin {
|
||||
$pluginwrapper->add_child($oumultiresponse);
|
||||
|
||||
// set source to populate the data
|
||||
$oumultiresponse->set_source_table('question_oumultiresponse', array('question' => backup::VAR_PARENTID));
|
||||
$oumultiresponse->set_source_table('question_oumultiresponse', array('questionid' => backup::VAR_PARENTID));
|
||||
|
||||
// don't need to annotate ids nor files
|
||||
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ class restore_qtype_oumultiresponse_plugin extends restore_qtype_plugin {
|
||||
// If the question has been created by restore, we need to create its question_oumultiresponse too
|
||||
if ($questioncreated) {
|
||||
// Adjust some columns
|
||||
$data->question = $newquestionid;
|
||||
$data->questionid = $newquestionid;
|
||||
// Insert record
|
||||
$newitemid = $DB->insert_record('question_oumultiresponse', $data);
|
||||
// Create mapping (needed for decoding links)
|
||||
|
||||
Reference in New Issue
Block a user