示例#1
0
 // Ouside the if because we may be showing feedback but not grades.
 $attemptgrade = quiz_rescale_grade($attempt->sumgrades, $quiz, false);
 if ($gradecolumn) {
     if ($attemptoptions->scores && $attempt->timefinish > 0) {
         $formattedgrade = quiz_format_grade($quiz, $attemptgrade);
         // highlight the highest grade if appropriate
         if ($overallstats && !$attempt->preview && $numattempts > 1 && !is_null($mygrade) && $attemptgrade == $mygrade && $quiz->grademethod == QUIZ_GRADEHIGHEST) {
             $table->rowclasses[$attempt->attempt] = 'bestrow';
         }
         $row[] = $formattedgrade;
     } else {
         $row[] = '';
     }
 }
 if ($canreviewmine) {
     $row[] = $accessmanager->make_review_link($attempt, $canpreview, $attemptoptions);
 }
 if ($feedbackcolumn && $attempt->timefinish > 0) {
     if ($attemptoptions->overallfeedback) {
         $row[] = quiz_feedback_for_grade($attemptgrade, $quiz->id);
     } else {
         $row[] = '';
     }
 }
 if (isset($quiz->showtimetaken)) {
     $row[] = $timetaken;
 }
 if ($attempt->preview) {
     $table->data['preview'] = $row;
 } else {
     $table->data[$attempt->attempt] = $row;