diff --git a/mod/quiz/report/grading/report.php b/mod/quiz/report/grading/report.php
index 336722c68ff..ca0a093ceae 100644
--- a/mod/quiz/report/grading/report.php
+++ b/mod/quiz/report/grading/report.php
@@ -181,16 +181,18 @@ class quiz_report extends quiz_default_report {
$menu = popup_form(($qurl->out()).'&questionid=',$qmenu, 'questionid', $questionid, 'choose', '', '', true);
echo '
'.$menu.'
';
}
- 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 ='';
- $a->closespan ='';
- 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 ='';
+ $a->closespan ='';
+ 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;