]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12824 "Essay type of quiz questions needs to color mark which students have been...
authorjamiesensei <jamiesensei>
Mon, 26 May 2008 13:18:46 +0000 (13:18 +0000)
committerjamiesensei <jamiesensei>
Mon, 26 May 2008 13:18:46 +0000 (13:18 +0000)
Fixing notices introduced by the changes for this bug in grading report when no question is selected.

mod/quiz/report/grading/report.php

index b7cfeb81ddb469d5b60bec9b8bf9549b508aafe9..641d80cde89c37045473509986fec005c3f5c62e 100644 (file)
@@ -181,16 +181,18 @@ class quiz_report extends quiz_default_report {
             $menu = popup_form(($qurl->out()).'&amp;questionid=',$qmenu, 'questionid', $questionid, 'choose', '', '', true);
             echo '<div class="mdl-align" style="clear:left;">'.$menu.'</div>';
         }
-        if ($questionid){
-            $a= new object();
-            $a->number = $question->number;
-            $a->name = $question->name;
-            $a->gradedattempts =$qattempts[$question->id]->gradedattempts;
-            $a->totalattempts =$qattempts[$question->id]->totalattempts;
-            $a->openspan ='<span class="highlightgraded">';
-            $a->closespan ='</span>';
-            print_heading(get_string('questiontitle', 'quiz_grading', $a));
+        if (!$questionid){
+            return true;
         }
+        $a= new object();
+        $a->number = $question->number;
+        $a->name = $question->name;
+        $a->gradedattempts =$qattempts[$question->id]->gradedattempts;
+        $a->totalattempts =$qattempts[$question->id]->totalattempts;
+        $a->openspan ='<span class="highlightgraded">';
+        $a->closespan ='</span>';
+        print_heading(get_string('questiontitle', 'quiz_grading', $a));
+
         // our 3 different views
         // the first one displays all of the manually graded questions in the quiz
         // with the number of ungraded attempts for each question
@@ -204,7 +206,7 @@ class quiz_report extends quiz_default_report {
         $ungraded = $qattempts[$questionid]->totalattempts- $qattempts[$questionid]->gradedattempts;
         if ($gradeungraded || $gradeall || $userid || $attemptid){
             $this->print_questions_and_form($quiz, $question, $userid, $attemptid, $gradeungraded, $ungraded);
-        } else if ($questionid){
+        } else {
             $this->view_question($quiz, $question, $qattempts[$questionid]->totalattempts, $ungraded);
         }
         return true;