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
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
chosen by the facilitator.</p> chosen by the facilitator.</p>


<p>The essay question will not be assigned a grade until it has been reviewed by a teacher <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 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 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> 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
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ function save_question_options($question) {


function print_question_formulation_and_controls(&$question, &$state, $cmoptions, $options) { function print_question_formulation_and_controls(&$question, &$state, $cmoptions, $options) {
global $CFG; global $CFG;
static $htmleditorused = false;


$answers = &$question->options->answers; $answers = &$question->options->answers;
$readonly = empty($options->readonly) ? '' : 'disabled="disabled"'; $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 = new stdClass;
$formatoptions->noclean = true; $formatoptions->noclean = true;
Expand Down Expand Up @@ -87,6 +90,7 @@ function print_question_formulation_and_controls(&$question, &$state, $cmoptions


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


Expand Down

0 comments on commit 594c911

Please sign in to comment.