From d3e99e85d4ea9c9f191c36d665c3a2500905d9bf Mon Sep 17 00:00:00 2001 From: jamiesensei Date: Mon, 15 Sep 2008 11:13:31 +0000 Subject: [PATCH] MDL-16502 "highlight questions that appear not to be working very well according to statistics" There is a function is_dubious_question on the statistics table passed all the stats for that question and other question data and that returns a bool. --- .../report/statistics/statistics_table.php | 30 ++++++++++++++++--- theme/standard/styles_color.css | 4 +++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/mod/quiz/report/statistics/statistics_table.php b/mod/quiz/report/statistics/statistics_table.php index d1d39552cd..4ac711fe67 100644 --- a/mod/quiz/report/statistics/statistics_table.php +++ b/mod/quiz/report/statistics/statistics_table.php @@ -88,15 +88,37 @@ class quiz_report_statistics_table extends flexible_table { function col_name($question){ - if (!$this->is_downloading() && $question->qtype!='random'){ - $tooltip = get_string('detailedanalysis', 'quiz_statistics'); - $url = $this->baseurl .'&qid='.$question->id; - return "".$question->name.""; + if (!$this->is_downloading()){ + if ($question->qtype!='random'){ + $tooltip = get_string('detailedanalysis', 'quiz_statistics'); + $url = $this->baseurl .'&qid='.$question->id; + $html = "".$question->name.""; + } else { + $html = $question->name; + } + if ($this->is_dubious_question($question)){ + return "
$html
"; + } else { + return $html; + } } else { return $question->name; } } + + /** + * @param object question the question object with a property _stats which + * includes all the stats for the question. + * @return boolean is this question possibly not pulling it's weight? + */ + function is_dubious_question($question){ + if (!is_numeric($question->_stats->discriminativeefficiency)){ + return false; + } else { + return $question->_stats->discriminativeefficiency < 15; + } + } function col_icon($question){ return print_question_icon($question, true); diff --git a/theme/standard/styles_color.css b/theme/standard/styles_color.css index 1f7446093c..1785555f19 100644 --- a/theme/standard/styles_color.css +++ b/theme/standard/styles_color.css @@ -1081,6 +1081,10 @@ table.quizreviewsummary td.cell { background-color: #fcc; } +#mod-quiz-report .dubious{ + background-color: #fcc; +} + /*** *** Modules: Resource ***/ -- 2.39.5