MDL-20636 Fix backup and restore issues found during testing.

This commit is contained in:
Tim Hunt
2011-03-02 17:42:54 +00:00
parent 42663bb78e
commit beca0d8daf
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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) {
@@ -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
@@ -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)