]> git.mjollnir.org Git - moodle.git/commitdiff
merged fix for MDL-8358, wrong count for not graded assignments
authortoyomoyo <toyomoyo>
Mon, 12 Feb 2007 06:50:32 +0000 (06:50 +0000)
committertoyomoyo <toyomoyo>
Mon, 12 Feb 2007 06:50:32 +0000 (06:50 +0000)
mod/assignment/lib.php

index 294e1364d25db0fa2f2aafe56d8ea97a7d7c1ad8..4847405e2011c96ad4990878742d19065ed585e4 100644 (file)
@@ -2387,6 +2387,7 @@ function assignment_upgrade_submodules() {
 }
 
 function assignment_print_overview($courses, &$htmlarray) {
+
     global $USER, $CFG;
 
     if (empty($courses) || !is_array($courses) || count($courses) == 0) {
@@ -2439,7 +2440,11 @@ function assignment_print_overview($courses, &$htmlarray) {
             $submissions = 0; // init
             if ($students = get_users_by_capability($context, 'mod/assignment:submit')) {
                 foreach ($students as $student) {
-                    if (get_record('assignment_submissions', 'assignment', $assignment->id, 'userid', $student->id)) {
+                    if (get_records_sql("SELECT id,id FROM {$CFG->prefix}assignment_submissions
+                                         WHERE assignment = $assignment->id AND
+                                               userid = $student->id AND
+                                               teacher = 0 AND
+                                               timemarked = 0")) {
                         $submissions++;  
                     }
                 }