Browse Source

Fixing commit d29856f9c to still check that the user validated the gradebook - refs BT#12404

Nicolas Ducoulombier 7 years ago
parent
commit
cccb9fe443
1 changed files with 8 additions and 0 deletions
  1. 8 0
      plugin/grading_electronic/generate.php

+ 8 - 0
plugin/grading_electronic/generate.php

@@ -118,6 +118,14 @@ try {
 
     /** @var User $student */
     foreach ($students as $student) {
+        $userFinishedCourse = Category::userFinishedCourse(
+            $student->getId(),
+            $gradebook,
+            true
+        );
+        if (!$userFinishedCourse) {
+             continue;
+        }
         $exerciseResult = Event::get_best_exercise_results_by_user(
             $exerciseId,
             $course->getId(),