]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16502 "highlight questions that appear not to be working very well according...
authorjamiesensei <jamiesensei>
Mon, 15 Sep 2008 11:13:31 +0000 (11:13 +0000)
committerjamiesensei <jamiesensei>
Mon, 15 Sep 2008 11:13:31 +0000 (11:13 +0000)
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.

mod/quiz/report/statistics/statistics_table.php
theme/standard/styles_color.css

index d1d39552cd681bedba760fe51bcc7e541d81bf62..4ac711fe675ce9a50c97def8212b87a6230e5bdb 100644 (file)
@@ -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 .'&amp;qid='.$question->id;
-            return "<a title=\"$tooltip\" href=\"$url\">".$question->name."</a>";
+        if (!$this->is_downloading()){
+            if ($question->qtype!='random'){
+                $tooltip = get_string('detailedanalysis', 'quiz_statistics');
+                $url = $this->baseurl .'&amp;qid='.$question->id;
+                $html = "<a title=\"$tooltip\" href=\"$url\">".$question->name."</a>";
+            } else {
+                $html = $question->name;
+            }
+            if ($this->is_dubious_question($question)){
+                return "<div class=\"dubious\">$html</div>";
+            } 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);
index 1f7446093cffbb4b9d8e0c259515438fa521cbb6..1785555f19b5cc71d8070af088dea616df53eb2b 100644 (file)
@@ -1081,6 +1081,10 @@ table.quizreviewsummary td.cell {
   background-color: #fcc;
 }
 
+#mod-quiz-report .dubious{
+  background-color: #fcc;
+}
+
 /***
  *** Modules: Resource
  ***/