Skip to content
Browse files

MDL-29529 Assignment: Fix regression caused by MDL-27638

  • Loading branch information...
1 parent 3d99c7e commit d83c73053db8a5b18166a191aa7f2a368b737025 Stephen Bourget committed with stronk7 Nov 10, 2011
Showing with 8 additions and 6 deletions.
  1. +8 −6 mod/assignment/lib.php
View
14 mod/assignment/lib.php
@@ -978,7 +978,10 @@ function display_submission($offset=-1,$userid =-1, $display=true) {
$userfields = user_picture::fields('u', array('lastaccess'));
$select = "SELECT $userfields,
s.id AS submissionid, s.grade, s.submissioncomment,
- s.timemodified, s.timemarked ";
+ s.timemodified, s.timemarked,
+ CASE WHEN s.timemarked > 0 AND s.timemarked >= s.timemodified THEN 1
+ ELSE 0 END AS status ";
+
$sql = 'FROM {user} u '.
'LEFT JOIN {assignment_submissions} s ON u.id = s.userid
AND s.assignment = '.$this->assignment->id.' '.
@@ -991,8 +994,6 @@ function display_submission($offset=-1,$userid =-1, $display=true) {
if (is_array($auser) && count($auser)>1) {
$nextuser = next($auser);
- /// Calculate user status
- $nextuser->status = ($nextuser->timemarked > 0) && ($nextuser->timemarked >= $nextuser->timemodified);
$nextid = $nextuser->id;
}
}
@@ -1311,7 +1312,10 @@ function display_submissions($message='') {
if (!empty($users)) {
$select = "SELECT $ufields,
s.id AS submissionid, s.grade, s.submissioncomment,
- s.timemodified, s.timemarked ";
+ s.timemodified, s.timemarked,
+ CASE WHEN s.timemarked > 0 AND s.timemarked >= s.timemodified THEN 1
+ ELSE 0 END AS status ";
+
$sql = 'FROM {user} u '.
'LEFT JOIN {assignment_submissions} s ON u.id = s.userid
AND s.assignment = '.$this->assignment->id.' '.
@@ -1341,8 +1345,6 @@ function display_submissions($message='') {
$locked_overridden = 'overridden';
}
- /// Calculate user status
- $auser->status = ($auser->timemarked > 0) && ($auser->timemarked >= $auser->timemodified);
$picture = $OUTPUT->user_picture($auser);
if (empty($auser->submissionid)) {

0 comments on commit d83c730

Please sign in to comment.
Something went wrong with that request. Please try again.