]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-6649 Only show the HTML editor for the first essay question on a page, since...
authortjhunt <tjhunt>
Tue, 3 Oct 2006 17:32:22 +0000 (17:32 +0000)
committertjhunt <tjhunt>
Tue, 3 Oct 2006 17:32:22 +0000 (17:32 +0000)
lang/en_utf8/help/quiz/essay.html
question/type/essay/questiontype.php

index 0dbd1d9e362241c315ee994e507f034664575609..4152680579bf03dda9a0ef6f9acc381775acb8bf 100644 (file)
@@ -6,6 +6,9 @@
    chosen by the facilitator.</p>
 
 <p>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.</p>
\ 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.</p>
+
+<p>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.</p>
\ No newline at end of file
index 017db8885b8fa235f9be22c082a5c47dd54e6bf5..2dbefbf94c05190bb6a24b3695e3924249112051 100644 (file)
@@ -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;
         }
     }