mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-37533 Assign: Use the constant for the submitted status in the query (and parameterize the query)
This commit is contained in:
parent
b7f461419b
commit
d43b31094e
1 changed files with 6 additions and 2 deletions
|
@ -319,6 +319,9 @@ function assign_print_overview($courses, &$htmlarray) {
|
||||||
return true;
|
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');
|
$strduedate = get_string('duedate', 'assign');
|
||||||
$strcutoffdate = get_string('nosubmissionsacceptedafter', 'assign');
|
$strcutoffdate = get_string('nosubmissionsacceptedafter', 'assign');
|
||||||
$strnolatesubmissions = get_string('nolatesubmissions', 'assign');
|
$strnolatesubmissions = get_string('nolatesubmissions', 'assign');
|
||||||
|
@ -336,6 +339,7 @@ function assign_print_overview($courses, &$htmlarray) {
|
||||||
|
|
||||||
// Build up and array of unmarked submissions indexed by assignment id/ userid
|
// Build up and array of unmarked submissions indexed by assignment id/ userid
|
||||||
// for use where the user has grading rights on assignment.
|
// 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
|
$rs = $DB->get_recordset_sql('SELECT
|
||||||
s.assignment as assignment,
|
s.assignment as assignment,
|
||||||
s.userid as userid,
|
s.userid as userid,
|
||||||
|
@ -350,8 +354,8 @@ function assign_print_overview($courses, &$htmlarray) {
|
||||||
( g.timemodified is NULL OR
|
( g.timemodified is NULL OR
|
||||||
s.timemodified > g.timemodified ) AND
|
s.timemodified > g.timemodified ) AND
|
||||||
s.timemodified IS NOT NULL AND
|
s.timemodified IS NOT NULL AND
|
||||||
s.status = "submitted" AND
|
s.status = ? AND
|
||||||
s.assignment ' . $sqlassignmentids, $assignmentidparams);
|
s.assignment ' . $sqlassignmentids, $dbparams);
|
||||||
|
|
||||||
$unmarkedsubmissions = array();
|
$unmarkedsubmissions = array();
|
||||||
foreach ($rs as $rd) {
|
foreach ($rs as $rd) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue