From: moodler Date: Sun, 24 Sep 2006 12:02:00 +0000 (+0000) Subject: Simplified a bit and removed a notice X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=bf7288a2c0b605485eeacc39c3ccd9f17bf89808;p=moodle.git Simplified a bit and removed a notice --- diff --git a/mod/quiz/index.php b/mod/quiz/index.php index 176a0ee070..0b04c265e1 100644 --- a/mod/quiz/index.php +++ b/mod/quiz/index.php @@ -108,28 +108,23 @@ $closequiz = $quiz->timeclose ? userdate($quiz->timeclose) : ''; + $gradecol = ''; + $feedbackcol = ''; + if (has_capability('mod/quiz:viewreports', $context)) { if ($a->attemptnum = count_records('quiz_attempts', 'quiz', $quiz->id, 'preview', 0)) { $a->studentnum = count_records_select('quiz_attempts', "quiz = '$quiz->id' AND preview = '0'", 'COUNT(DISTINCT userid)'); $a->studentstring = $course->students; $gradecol = "id\">".get_string('numattempts', 'quiz', $a).''; - } else { - $gradecol = ""; } } else { // If student has no grade for this quiz, // or the quiz has no grade, display nothing in grade col - if ($bestgrade === NULL || $quiz->grade == 0) { - $gradecol = ""; - $feedbackcol = ''; - } else { + if ($bestgrade !== NULL && $quiz->grade != 0) { //If all quiz's attempts have visible results, show bestgrade - if(all_attempt_results_visible($quiz, $USER)) { + if (all_attempt_results_visible($quiz, $USER)) { $gradecol = "$bestgrade / $quiz->grade"; $feedbackcol = quiz_get_feedback($quiz, $bestgrade); - } else { - $gradecol = ""; - $feedbackcol = ''; } } } @@ -141,7 +136,7 @@ } } - echo "
"; + echo '
'; print_table($table); @@ -149,4 +144,4 @@ print_footer($course); -?> \ No newline at end of file +?>