From 2c78623121650c7ee0fa08e3d8e6cbc2f75bfa24 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Wed, 2 Jul 2014 19:12:28 +0100 Subject: [PATCH] MDL-44492 quiz: fix hilighting of graded attempt In various places, when showing several attempts, we try to hilight the most significant one (the one that gave the final grade if the quiz is set to first/last/best attempt). That was not working because the table zebra stripes were a more specific rule. Also, the colour was inconsistent, not nice, and not very bootstrapy, so I changed it. --- mod/quiz/renderer.php | 1 + mod/quiz/styles.css | 16 +++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/mod/quiz/renderer.php b/mod/quiz/renderer.php index 6c36544ad1b..db84cfc6e36 100644 --- a/mod/quiz/renderer.php +++ b/mod/quiz/renderer.php @@ -973,6 +973,7 @@ class mod_quiz_renderer extends plugin_renderer_base { // Highlight the highest grade if appropriate. if ($viewobj->overallstats && !$attemptobj->is_preview() && $viewobj->numattempts > 1 && !is_null($viewobj->mygrade) + && $attemptobj->get_state() == quiz_attempt::FINISHED && $attemptgrade == $viewobj->mygrade && $quiz->grademethod == QUIZ_GRADEHIGHEST) { $table->rowclasses[$attemptobj->get_attempt_number()] = 'bestrow'; diff --git a/mod/quiz/styles.css b/mod/quiz/styles.css index 92647ccecf0..0cd9a6b7ad2 100644 --- a/mod/quiz/styles.css +++ b/mod/quiz/styles.css @@ -311,8 +311,9 @@ div.editq div.question div.content .singlequestion a .questiontext { #page-mod-quiz-view #page .quizattemptsummary td p { margin-top: 0; } -table.quizattemptsummary .bestrow td { - background-color: #e8e8e8; +#page-mod-quiz-view table.quizattemptsummary tr.bestrow td { + border-color: #bce8f1; + background-color: #d9edf7; } table.quizattemptsummary .noreviewmessage { color: gray; @@ -347,9 +348,10 @@ table.quizattemptsummary .noreviewmessage { display: inline; } -.mod-quiz .gradedattempt, -.mod-quiz tr.gradedattempt td { - background-color: #e8e8e8; +body.path-mod-quiz .gradedattempt, +body.path-mod-quiz table tbody tr.gradedattempt > td { + border-color: #bce8f1; + background-color: #d9edf7; } .quizattemptcounts { @@ -431,8 +433,8 @@ table.quizreviewsummary td.cell { background-color: #fcc; } #page-mod-quiz-report .highlight { - border : medium solid yellow; - background-color: lightYellow; + border: 1px solid #bce8f1; + background-color: #d9edf7; } #page-mod-quiz-report .negcovar { border : medium solid pink;