Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'MDL-37533-23' of git://github.com/damyon/moodle into MO…

…ODLE_23_STABLE
  • Loading branch information...
commit 6e607d44c01de460f506433fec5a7501c070ee1b 2 parents aebbfda + db2a65b
@stronk7 stronk7 authored
Showing with 26 additions and 7 deletions.
  1. +4 −1 mod/assign/gradingtable.php
  2. +22 −6 mod/assign/lib.php
View
5 mod/assign/gradingtable.php
@@ -105,7 +105,10 @@ function __construct(assign $assignment, $perpage, $filter, $rowoffset, $quickgr
$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));
View
28 mod/assign/lib.php
@@ -295,6 +295,9 @@ function assign_print_overview($courses, &$htmlarray) {
return true;
}
+ // Definitely something to print, now include the constants we need.
+ require_once($CFG->dirroot . '/mod/assign/locallib.php');
+
$strduedate = get_string('duedate', 'assign');
$strduedateno = get_string('duedateno', 'assign');
$strgraded = get_string('graded', 'assign');
@@ -309,12 +312,25 @@ function assign_print_overview($courses, &$htmlarray) {
//
list($sqlassignmentids, $assignmentidparams) = $DB->get_in_or_equal($assignmentids);
- // build up and array of unmarked submissions indexed by assignment id/ userid
- // for use where the user has grading rights on assignment
- $rs = $DB->get_recordset_sql("SELECT s.assignment as assignment, s.userid as userid, s.id as id, s.status as status, g.timemodified as timegraded
- FROM {assign_submission} s LEFT JOIN {assign_grades} g ON s.userid = g.userid and s.assignment = g.assignment
- WHERE g.timemodified = 0 OR s.timemodified > g.timemodified
- AND s.assignment $sqlassignmentids", $assignmentidparams);
+ // Build up and array of unmarked submissions indexed by assignment id/ userid
+ // for use where the user has grading rights on assignment.
+ $dbparams = array_merge(array(ASSIGN_SUBMISSION_STATUS_SUBMITTED), $assignmentidparams);
+ $rs = $DB->get_recordset_sql('SELECT
+ s.assignment as assignment,
+ s.userid as userid,
+ s.id as id,
+ s.status as status,
+ g.timemodified as timegraded
+ FROM {assign_submission} s
+ LEFT JOIN {assign_grades} g ON
+ s.userid = g.userid AND
+ s.assignment = g.assignment
+ WHERE
+ ( g.timemodified is NULL OR
+ s.timemodified > g.timemodified ) AND
+ s.timemodified IS NOT NULL AND
+ s.status = ? AND
+ s.assignment ' . $sqlassignmentids, $dbparams);
$unmarkedsubmissions = array();
foreach ($rs as $rd) {
Please sign in to comment.
Something went wrong with that request. Please try again.