Skip to content

Commit

Permalink
MDL-74941 qtype_calculated: Copy dataset from previous question version
Browse files Browse the repository at this point in the history
  • Loading branch information
smbader authored and lucaboesch committed Sep 20, 2022
1 parent 27093b1 commit 0e18ad3
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions question/type/calculated/questiontype.php
Expand Up @@ -640,7 +640,7 @@ public function save_question($question, $form) {
if (isset($form->synchronize) && $form->synchronize == 2) {
$this->addnamecategory($question);
}
} else if (!empty($form->makecopy)) {
} else {
$questionfromid = $form->id;
$question = parent::save_question($question, $form);
// Prepare the datasets.
Expand All @@ -650,16 +650,6 @@ public function save_question($question, $form) {
if (isset($form->synchronize) && $form->synchronize == 2) {
$this->addnamecategory($question);
}
} else {
// Editing a question.
$question = parent::save_question($question, $form);
// Prepare the datasets.
$this->preparedatasets($form, $question->id);
$form->id = $question->id;
$this->save_dataset_definitions($form);
if (isset($form->synchronize) && $form->synchronize == 2) {
$this->addnamecategory($question);
}
}
break;
case 'datasetdefinitions':
Expand Down

0 comments on commit 0e18ad3

Please sign in to comment.