From b5fff70bdd43d9d2c5467c390b422abfb3f7386e Mon Sep 17 00:00:00 2001 From: Shamim Rezaie Date: Thu, 30 Aug 2018 14:18:19 +1000 Subject: [PATCH] MDL-63186 quiz_statistics: Highlight the summary row if is dubious The summary row should be highlighted if any of the summarised rows are dubious. Part of MDL-62610 --- mod/quiz/report/statistics/statistics_table.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mod/quiz/report/statistics/statistics_table.php b/mod/quiz/report/statistics/statistics_table.php index 82f8aa5af50..8b492132548 100644 --- a/mod/quiz/report/statistics/statistics_table.php +++ b/mod/quiz/report/statistics/statistics_table.php @@ -496,11 +496,19 @@ class quiz_statistics_table extends flexible_table { * @return bool is this question possibly not pulling it's weight? */ protected function is_dubious_question($questionstat) { - if (!is_numeric($questionstat->discriminativeefficiency)) { + if ($this->is_random_question_summary($questionstat)) { + // We only care about the minimum value here. + // If the minimum value is less than the threshold, then we know that there is at least one value below the threshold. + list($discriminativeefficiency) = $questionstat->get_min_max_of('discriminativeefficiency'); + } else { + $discriminativeefficiency = $questionstat->discriminativeefficiency; + } + + if (!is_numeric($discriminativeefficiency)) { return false; } - return $questionstat->discriminativeefficiency < 15; + return $discriminativeefficiency < 15; } /** -- 2.11.4.GIT