Permalink
Browse files

MDL-37533 Assign: Use the constant for the submitted status in the qu…

…ery (and parameterize the query)
  • Loading branch information...
1 parent 5ac3323 commit 45e9749984f28f0a3712799e4313ac677cb5515e @damyon damyon committed Jan 24, 2013
Showing with 6 additions and 2 deletions.
  1. +6 −2 mod/assign/lib.php
View
@@ -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');
@@ -311,6 +314,7 @@ function assign_print_overview($courses, &$htmlarray) {
// 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,
@@ -325,8 +329,8 @@ function assign_print_overview($courses, &$htmlarray) {
( g.timemodified is NULL OR
s.timemodified > g.timemodified ) AND
s.timemodified IS NOT NULL AND
- s.status = "submitted" AND
- s.assignment ' . $sqlassignmentids, $assignmentidparams);
+ s.status = ? AND
+ s.assignment ' . $sqlassignmentids, $dbparams);
$unmarkedsubmissions = array();
foreach ($rs as $rd) {

0 comments on commit 45e9749

Please sign in to comment.