Bug #5559: Move CLOZE qtype hightight colours into CSS insted of hardcoding, so themes can override. Merged from 1.6stable.

This commit is contained in:
tjhunt 2006-06-02 15:39:41 +00:00
parent b65f13b510
commit 042e68477d
2 changed files with 12 additions and 3 deletions

View file

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

View file

@ -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 = '';