MDL-32177 questions: allow default questiontext in the editing form.

This commit is contained in:
Tim Hunt
2012-03-23 15:36:17 +00:00
parent c856a1f60b
commit 1a2de1c7ce
+4 -2
View 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,