Skip to content

Commit

Permalink
MDL-6649 Only show the HTML editor for the first essay question on a …
Browse files Browse the repository at this point in the history
…page, since it is unreliable when there are lots.
  • Loading branch information
tjhunt committed Oct 3, 2006
1 parent cfca034 commit 594c911
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 7 additions & 3 deletions lang/en_utf8/help/quiz/essay.html
Expand Up @@ -6,6 +6,10 @@
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 the respondent's
essay and be able to assign a score for the essay.</p>
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 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>
6 changes: 5 additions & 1 deletion question/type/essay/questiontype.php
Expand Up @@ -37,10 +37,13 @@ function save_question_options($question) {

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;
Expand Down Expand Up @@ -87,6 +90,7 @@ function print_question_formulation_and_controls(&$question, &$state, $cmoptions

if ($usehtmleditor) {
use_html_editor($inputname);
$htmleditorused = true;
}
}

Expand Down

0 comments on commit 594c911

Please sign in to comment.