MDL-34660: Fix SQL error in assignments module with Oracle Database I by replacing 'offline' with 'nosubmissions'

This commit is contained in:
Raymond Wijaya 2012-08-24 14:32:04 +08:00
parent d71c486507
commit 93c18e73c2

View File

@ -260,7 +260,7 @@ function assign_print_overview($courses, &$htmlarray) {
// get all user submissions, indexed by assignment id
$mysubmissions = $DB->get_records_sql("SELECT a.id AS assignment, a.nosubmissions AS offline, g.timemodified AS timemarked, g.grader AS grader, g.grade AS grade, s.status AS status
$mysubmissions = $DB->get_records_sql("SELECT a.id AS assignment, a.nosubmissions AS nosubmissions, g.timemodified AS timemarked, g.grader AS grader, g.grade AS grade, s.status AS status
FROM {assign} a LEFT JOIN {assign_grades} g ON g.assignment = a.id AND g.userid = ? LEFT JOIN {assign_submission} s ON s.assignment = a.id AND s.userid = ?
AND a.id $sqlassignmentids", array_merge(array($USER->id, $USER->id), $assignmentidparams));
@ -300,7 +300,7 @@ function assign_print_overview($courses, &$htmlarray) {
$str .= '<div class="details">';
$str .= get_string('mysubmission', 'assign');
$submission = $mysubmissions[$assignment->id];
if ($submission->offline) {
if ($submission->nosubmissions) {
$str .= get_string('offline', 'assign');
} else if(!$submission->status || $submission->status == 'draft'){
$str .= $strnotsubmittedyet;