From 5083db4e9ef7ada570079c9a9ef7e1994118eae4 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Fri, 7 May 2010 01:29:06 +0000 Subject: [PATCH] essay qtype: MDL-9419 use the HTML editor for all questions on a page. This undoes the horrible hack that we have had for a long time. --- question/type/essay/questiontype.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/question/type/essay/questiontype.php b/question/type/essay/questiontype.php index da7197b2902..12acc8d629e 100644 --- a/question/type/essay/questiontype.php +++ b/question/type/essay/questiontype.php @@ -42,13 +42,11 @@ class question_essay_qtype extends default_questiontype { function print_question_formulation_and_controls(&$question, &$state, $cmoptions, $options) { global $CFG; - static $htmleditorused = false; $answers = &$question->options->answers; $readonly = empty($options->readonly) ? '' : 'disabled="disabled"'; // Only use the rich text editor for the first essay question on a page. - $usehtmleditor = can_use_html_editor() && !$htmleditorused; $formatoptions = new stdClass; $formatoptions->noclean = true; @@ -82,7 +80,8 @@ class question_essay_qtype extends default_questiontype { // answer if (empty($options->readonly)) { // the student needs to type in their answer so print out a text editor - $answer = print_textarea($usehtmleditor, 18, 80, 630, 400, $inputname, $value, $cmoptions->course, true); + $answer = print_textarea(can_use_html_editor(), 18, 80, 630, 400, + $inputname, $value, $cmoptions->course, true); } else { // it is read only, so just format the students answer and output it $safeformatoptions = new stdClass; @@ -93,10 +92,6 @@ class question_essay_qtype extends default_questiontype { } include("$CFG->dirroot/question/type/essay/display.html"); - - if ($usehtmleditor && empty($options->readonly)) { - $htmleditorused = true; - } } function grade_responses(&$question, &$state, $cmoptions) {