Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-39317 assign: Fix for submitted filter on grading table.

Some old upgraded assignments have no timecreated column so use
a different one to check for a valid submission.
  • Loading branch information...
commit cf697e34064ca671cb4877ed09a588442b817592 1 parent a2d0601
@damyon damyon authored
Showing with 7 additions and 5 deletions.
  1. +7 −5 mod/assign/gradingtable.php
View
12 mod/assign/gradingtable.php
@@ -106,15 +106,17 @@ function __construct(assign $assignment, $perpage, $filter, $rowoffset, $quickgr
// The filters do not make sense when there are no submissions, so do not apply them.
if ($this->assignment->is_any_submission_plugin_enabled()) {
if ($filter == ASSIGN_FILTER_SUBMITTED) {
- $where .= ' AND s.timecreated > 0 ';
- }
- if ($filter == ASSIGN_FILTER_REQUIRE_GRADING) {
+ $where .= ' AND (s.timemodified IS NOT NULL AND
+ s.status = :submitted) ';
+ $params['submitted'] = ASSIGN_SUBMISSION_STATUS_SUBMITTED;
+
+ } else if ($filter == ASSIGN_FILTER_REQUIRE_GRADING) {
$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) {
+
+ } else if (strpos($filter, ASSIGN_FILTER_SINGLE_USER) === 0) {
$userfilter = (int) array_pop(explode('=', $filter));
$where .= ' AND (u.id = :userid)';
$params['userid'] = $userfilter;
Please sign in to comment.
Something went wrong with that request. Please try again.