From: tjhunt Date: Tue, 3 Oct 2006 17:32:22 +0000 (+0000) Subject: MDL-6649 Only show the HTML editor for the first essay question on a page, since... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=54f306788a7da36868564c8b65162abe05d53fcb;p=moodle.git MDL-6649 Only show the HTML editor for the first essay question on a page, since it is unreliable when there are lots. Merged from MOODLE_16_STABLE. --- diff --git a/lang/en_utf8/help/quiz/essay.html b/lang/en_utf8/help/quiz/essay.html index 0dbd1d9e36..4152680579 100644 --- a/lang/en_utf8/help/quiz/essay.html +++ b/lang/en_utf8/help/quiz/essay.html @@ -6,6 +6,9 @@ chosen by the facilitator.

The essay question will not be assigned a grade until it has been reviewed by a teacher - or facilitator by using the Manual Grading feature. When manually grading an essay - question, the grader will be able to enter a custom comment in response to the respondent's - essay and be able to assign a score for the essay.

\ No newline at end of file + question, the grader will be able to enter a custom comment in response the respondent's + essay and be able to assign a score for the essay.

+ +

Normally, the student can type their answer using the rich-text editor. However, + if there is more than one essay question on a page, the rich-text editor is + only used for the first essay question.

\ No newline at end of file diff --git a/question/type/essay/questiontype.php b/question/type/essay/questiontype.php index 017db8885b..2dbefbf94c 100644 --- a/question/type/essay/questiontype.php +++ b/question/type/essay/questiontype.php @@ -47,10 +47,13 @@ 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"'; - $usehtmleditor = can_use_html_editor(); + + // 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; @@ -97,6 +100,7 @@ class question_essay_qtype extends default_questiontype { if ($usehtmleditor) { use_html_editor($inputname); + $htmleditorused = true; } }