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.

This commit is contained in:
tjhunt 2006-10-03 17:32:22 +00:00
parent 2ddec1f4ac
commit 54f306788a
2 changed files with 11 additions and 4 deletions

View 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>
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>

View 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;
}
}