]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16632 "green highlighting should not be applied to grading method in quiz respons...
authorjamiesensei <jamiesensei>
Tue, 23 Sep 2008 10:39:12 +0000 (10:39 +0000)
committerjamiesensei <jamiesensei>
Tue, 23 Sep 2008 10:39:12 +0000 (10:39 +0000)
mod/quiz/report/reportlib.php
mod/quiz/report/responses/report.php
mod/quiz/report/responses/responsessettings_form.php

index ba77bd674dcaa573b977dac52cc0479bcc811432..081b1dd475116626376c18c9d8dcea367f3424d6 100644 (file)
@@ -287,7 +287,7 @@ function quiz_report_grade_bands($bandwidth, $bands, $quizid, $userids=array()){
     unset($data[$bands]);
     return $data;
 }
-function quiz_report_highlighting_grading_method($quiz, $qmsubselect, $qmfilter){
+function quiz_report_highlighting_grading_method($quiz, $qmsubselect, $qmfilter, $highlight=true){
     if ($quiz->attempts == 1) {//only one attempt allowed on this quiz
         return "<p>".get_string('onlyoneattemptallowed', "quiz_overview")."</p>";
     } else if (!$qmsubselect){
@@ -295,8 +295,11 @@ function quiz_report_highlighting_grading_method($quiz, $qmsubselect, $qmfilter)
     } else if ($qmfilter){
         return "<p>".get_string('showinggraded', "quiz_overview")."</p>";
     }else {
-        return "<p>".get_string('showinggradedandungraded', "quiz_overview",
-                ('<span class="highlight">'.quiz_get_grading_option_name($quiz->grademethod).'</span>'))."</p>";
+        $a = quiz_get_grading_option_name($quiz->grademethod);
+        if ($highlight){
+            $a = '<span class="highlight">'.$a.'</span>';
+        }
+        return "<p>".get_string('showinggradedandungraded', "quiz_overview", $a)."</p>";
     }
 }
 
index 58116ac3e0725edf722de27af2411efb954b80dc..37f5fcc4bb1f2cc5fa3e72d53a7eb0568b0147ff 100644 (file)
@@ -165,7 +165,7 @@ class quiz_responses_report extends quiz_default_report {
             // Print information on the grading method and whether we are displaying
             //
             if (!$table->is_downloading()) { //do not print notices when downloading
-                if ($strattempthighlight = quiz_report_highlighting_grading_method($quiz, $qmsubselect, $qmfilter)) {
+                if ($strattempthighlight = quiz_report_highlighting_grading_method($quiz, $qmsubselect, $qmfilter, false)) {
                     echo '<div class="quizattemptcounts">' . $strattempthighlight . '</div>';
                 }
             }
index c77e129378b752880cae4f467616ed39841e809e..f915f906a3267cc7e342ebdc74255635ca80123c 100644 (file)
@@ -28,7 +28,7 @@ class mod_quiz_report_responses_settings extends moodleform {
         }
         $mform->addElement('select', 'attemptsmode', get_string('show', 'quiz_overview'), $options);
         if ($this->_customdata['qmsubselect']){
-            $gm = '<span class="highlight">'.quiz_get_grading_option_name($this->_customdata['quiz']->grademethod).'</span>';
+            $gm = quiz_get_grading_option_name($this->_customdata['quiz']->grademethod);
             $mform->addElement('advcheckbox', 'qmfilter', get_string('show', 'quiz_overview'), get_string('optonlygradedattempts', 'quiz_overview', $gm), null, array(0,1));
         }
 //-------------------------------------------------------------------------------