MDL-32177 questions: allow default questiontext in the editing form.
authorTim Hunt <T.J.Hunt@open.ac.uk>
Mon, 5 Mar 2012 18:22:02 +0000 (18:22 +0000)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Fri, 23 Mar 2012 15:36:17 +0000 (15:36 +0000)
question/type/edit_question_form.php

index a0c80c4..f01e2d5 100644 (file)
@@ -431,7 +431,8 @@ abstract class question_edit_form extends question_wizard_form {
         if (!empty($question->questiontext)) {
             $questiontext = $question->questiontext;
         } else {
-            $questiontext = '';
+            $questiontext = $this->_form->getElement('questiontext')->getValue();
+            $questiontext = $questiontext['text'];
         }
         $questiontext = file_prepare_draft_area($draftid, $this->context->id,
                 'question', 'questiontext', empty($question->id) ? null : (int) $question->id,
@@ -447,7 +448,8 @@ abstract class question_edit_form extends question_wizard_form {
         $draftid = file_get_submitted_draft_itemid('generalfeedback');
 
         if (empty($question->generalfeedback)) {
-            $question->generalfeedback = '';
+            $generalfeedback = $this->_form->getElement('generalfeedback')->getValue();
+            $question->generalfeedback = $generalfeedback['text'];
         }
 
         $feedback = file_prepare_draft_area($draftid, $this->context->id,