From 042e68477d3484e7ec986430157239e370d5ba0b Mon Sep 17 00:00:00 2001 From: tjhunt Date: Fri, 2 Jun 2006 15:39:41 +0000 Subject: [PATCH] Bug #5559: Move CLOZE qtype hightight colours into CSS insted of hardcoding, so themes can override. Merged from 1.6stable. --- mod/quiz/styles.php | 9 +++++++++ question/type/multianswer/questiontype.php | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/mod/quiz/styles.php b/mod/quiz/styles.php index abe58e098d..798b2df7e1 100644 --- a/mod/quiz/styles.php +++ b/mod/quiz/styles.php @@ -100,3 +100,12 @@ body#mod-quiz-grading table#grading td #question-preview .essay .answer textarea { width: 400px; } +.incorrecthighlight { + background-color: #faa; +} +.partialcorrecthighlight { + background-color: #ff9; +} +.correcthighlight { + background-color: #afa; +} diff --git a/question/type/multianswer/questiontype.php b/question/type/multianswer/questiontype.php index 2ce32cbb97..1b02974ad4 100644 --- a/question/type/multianswer/questiontype.php +++ b/question/type/multianswer/questiontype.php @@ -286,15 +286,15 @@ class embedded_cloze_qtype extends default_questiontype { if (!isset($chosenanswer->fraction) || $chosenanswer->fraction <= 0.0) { // The response must have been totally wrong: - $style = 'style="background-color:red"'; + $style = 'class="incorrecthighlight"'; } else if ($chosenanswer->fraction >= 1.0) { // The response was correct!! - $style = 'style="background-color:lime"'; + $style = 'class="correcthighlight"'; } else { // This response did at least give some credit: - $style = 'style="background-color:yellow"'; + $style = 'class="partialcorrecthighlight"'; } } else { $style = ''; -- 2.39.5