MDL-37533 Assign: Fix grading filters to show only assignments needing grading
authorStephen Bourget <sbourget@goffstown.k12.nh.us>
Mon, 21 Jan 2013 17:02:25 +0000 (12:02 -0500)
committerDamyon Wiese <damyon@moodle.com>
Thu, 24 Jan 2013 03:16:29 +0000 (11:16 +0800)
Conflicts:

mod/assign/gradingtable.php

mod/assign/gradingtable.php

index 5e17895..c724eed 100644 (file)
@@ -105,7 +105,10 @@ class assign_grading_table extends table_sql implements renderable {
             $where .= ' AND s.timecreated > 0 ';
         }
         if ($filter == ASSIGN_FILTER_REQUIRE_GRADING) {
-            $where .= ' AND (s.timemodified > g.timemodified OR (s.timemodified IS NOT NULL AND g.timemodified IS NULL))';
+            $where .= ' AND (s.timemodified IS NOT NULL AND
+                             s.status = :submitted AND
+                             (s.timemodified > g.timemodified OR g.timemodified IS NULL))';
+            $params['submitted'] = ASSIGN_SUBMISSION_STATUS_SUBMITTED;
         }
         if (strpos($filter, ASSIGN_FILTER_SINGLE_USER) === 0) {
             $userfilter = (int) array_pop(explode('=', $filter));