diff --git a/mod/quiz/lib.php b/mod/quiz/lib.php
index 5064001b031..99f197f72e3 100644
--- a/mod/quiz/lib.php
+++ b/mod/quiz/lib.php
@@ -784,25 +784,29 @@ function quiz_print_question($number, $question, $grade, $courseid,
$actualresponse = $responseitems[1];
if (1.0 == $responsefractiongrade) {
- $style = '"background-color:lime"';
+ $style = 'style="background-color:lime"';
} else if (0.0 < $responsefractiongrade) {
- $style = '"background-color:yellow"';
- } else { // The response must have been totally wrong:
- $style = '"background-color:red"';
+ $style = 'style="background-color:yellow"';
+ } else if ('' != $actualresponse) {
+ // The response must have been totally wrong:
+ $style = 'style="background-color:red"';
+ } else {
+ // There was no response given
+ $style = '';
}
} else {
$responsefractiongrade = 0.0;
$actualresponse = '';
- $style = '"background-color:white"';
+ $style = '';
}
switch ($multianswer->answertype) {
case SHORTANSWER:
case NUMERICAL:
- echo " ";
+ echo " ";
break;
case MULTICHOICE:
- echo ("