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 153292d commit 95755113bf9a597adad7394f6120c7019db7758a @damyon damyon committed Jan 24, 2013
Showing with 6 additions and 2 deletions.
  1. +6 −2 mod/assign/lib.php
View
@@ -310,6 +310,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');
$strcutoffdate = get_string('nosubmissionsacceptedafter', 'assign');
$strnolatesubmissions = get_string('nolatesubmissions', 'assign');
@@ -329,6 +332,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,
@@ -343,8 +347,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 9575511

Please sign in to comment.