Skip to content

Commit

Permalink
More notices fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Nov 4, 2005
1 parent 2eb607b commit 7d255d1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions mod/assignment/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ function display_grade($grade) {
*/
function display_submission() {

global $CFG;//need prefix
global $CFG;

$userid = required_param('userid');
$offset = required_param('offset');//offset for where to start looking for student.
Expand Down Expand Up @@ -669,10 +669,12 @@ function display_submission() {
$users = get_course_users($course->id);
}

$select = 'SELECT u.id, u.id, u.firstname, u.lastname, u.picture, s.id AS submissionid, s.grade, s.comment, s.timemodified, s.timemarked, ((s.timemarked > 0) AND (s.timemarked >= s.timemodified)) AS status ';
$select = 'SELECT u.id, u.id, u.firstname, u.lastname, u.picture,'.
's.id AS submissionid, s.grade, s.comment, s.timemodified, s.timemarked, ((s.timemarked > 0) AND (s.timemarked >= s.timemodified)) AS status ';
$sql = 'FROM '.$CFG->prefix.'user u '.
'LEFT JOIN '.$CFG->prefix.'assignment_submissions s ON u.id = s.userid AND s.assignment = '.$this->assignment->id.' '.
'WHERE u.id IN ('.implode(',', array_keys($users)).') ';
$nextid = 0;
if (($ausers = get_records_sql($select.$sql.$sort.$limit)) !== false) {
foreach ($ausers as $auser => $val){
$nextid = $val->id;
Expand Down Expand Up @@ -711,7 +713,7 @@ function display_submission() {
print_user_picture($teacher->id, $this->course->id, $teacher->picture);
echo '</td>';
echo '<td class="content">';
echo '<form name="submitform" action="submissions.php?id='.$this->cm->id.'&amp;userid='.$nextid.'&amp;mode=single&amp;offset='.++$offset.'&amp;tsort='.$sort.'" method="post">';
echo '<form name="submitform" action="submissions.php?id='.$this->cm->id.'&amp;mode=single&amp;offset='.++$offset.'&amp;tsort='.$sort.'" method="post">';
echo '<input type="hidden" name="userid" value="'.$userid.'">';
echo '<input type="hidden" name="id" value="'.$this->cm->id.'">';
echo '<input type="hidden" name="mode" value="grade">';
Expand Down Expand Up @@ -752,7 +754,7 @@ function display_submission() {
echo '<input type="submit" name="submit" value="'.get_string('savechanges').'" onClick = "document.submitform.menuindex.value = document.submitform.grade.selectedIndex" />';
echo '<input type="submit" name="cancel" value="'.get_string('cancel').'" />';
//if there are more to be graded.
if ($nextid){
if ($nextid) {
echo '<input type="submit" name="saveandnext" value="'.get_string('saveandnext').'" onClick="saveNext()" />';
echo '<input type="submit" name="next" value="'.get_string('next').'" onClick="setNext();" />';
}
Expand Down

0 comments on commit 7d255d1

Please sign in to comment.