We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4564790 commit 743b2fbCopy full SHA for 743b2fb
questionnaire.class.php
@@ -1764,9 +1764,12 @@ public function survey_copy($owner) {
1764
$qidarray[$oldid] = $newqid;
1765
foreach ($question->choices as $key => $choice) {
1766
$oldcid = $key;
1767
- unset($choice->id);
1768
- $choice->question_id = $newqid;
1769
- if (!$newcid = $DB->insert_record('questionnaire_quest_choice', $choice)) {
+ $newchoice = (object) [
+ 'question_id' => $newqid,
+ 'content' => $choice->content,
1770
+ 'value' => $choice->value,
1771
+ ];
1772
+ if (!$newcid = $DB->insert_record('questionnaire_quest_choice', $newchoice)) {
1773
return(false);
1774
}
1775
$cidarray[$oldcid] = $newcid;
0 commit comments