Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-31919 Fix assignment overview output to respect gradebook grading.

Currenly, if assigment has been graded in gradebook only, in the assigment
overview it is listed as not graded.
  • Loading branch information...
commit 8ef93c7029202e6b952687c3b1f7a09a4029c855 1 parent 5bbf3cb
Ruslan Kabalin authored

Showing 1 changed file with 6 additions and 2 deletions. Show diff stats Hide diff stats

  1. +6 2 mod/assignment/lib.php
8 mod/assignment/lib.php
@@ -3612,6 +3612,7 @@ function assignment_types() {
3612 3612
3613 3613 function assignment_print_overview($courses, &$htmlarray) {
3614 3614 global $USER, $CFG, $DB;
  3615 + require_once($CFG->libdir.'/gradelib.php');
3615 3616
3616 3617 if (empty($courses) || !is_array($courses) || count($courses) == 0) {
3617 3618 return array();
@@ -3680,6 +3681,9 @@ function assignment_print_overview($courses, &$htmlarray) {
3680 3681 assignment $sqlassignmentids", array_merge(array($USER->id), $assignmentidparams));
3681 3682
3682 3683 foreach ($assignments as $assignment) {
  3684 + $grading_info = grade_get_grades($assignment->course, 'mod', 'assignment', $assignment->id, $USER->id);
  3685 + $final_grade = $grading_info->items[0]->grades[$USER->id];
  3686 +
3683 3687 $str = '<div class="assignment overview"><div class="name">'.$strassignment. ': '.
3684 3688 '<a '.($assignment->visible ? '':' class="dimmed"').
3685 3689 'title="'.$strassignment.'" href="'.$CFG->wwwroot.
@@ -3713,9 +3717,9 @@ function assignment_print_overview($courses, &$htmlarray) {
3713 3717
3714 3718 $submission = $mysubmissions[$assignment->id];
3715 3719
3716   - if ($submission->teacher == 0 && $submission->timemarked == 0) {
  3720 + if ($submission->teacher == 0 && $submission->timemarked == 0 && !$final_grade->grade) {
3717 3721 $str .= $strsubmitted . ', ' . $strnotgradedyet;
3718   - } else if ($submission->grade <= 0) {
  3722 + } else if ($submission->grade <= 0 && !$final_grade->grade) {
3719 3723 $str .= $strsubmitted . ', ' . $strreviewed;
3720 3724 } else {
3721 3725 $str .= $strsubmitted . ', ' . $strgraded;

0 comments on commit 8ef93c7

Please sign in to comment.
Something went wrong with that request. Please try again.