Merge branch 'MDL40479_Grading_alert_colour' of https://github.com/Dave-B/moodle
authorSam Hemelryk <sam@moodle.com>
Sun, 20 Jul 2014 23:32:09 +0000 (11:32 +1200)
committerSam Hemelryk <sam@moodle.com>
Sun, 20 Jul 2014 23:32:09 +0000 (11:32 +1200)
1  2 
mod/assign/renderer.php

diff --combined mod/assign/renderer.php
@@@ -92,10 -92,11 +92,11 @@@ class mod_assign_renderer extends plugi
      public function render_assign_gradingmessage(assign_gradingmessage $result) {
          $urlparams = array('id' => $result->coursemoduleid, 'action'=>'grading');
          $url = new moodle_url('/mod/assign/view.php', $urlparams);
+         $classes = $result->gradingerror ? 'notifyproblem' : 'notifysuccess';
  
          $o = '';
          $o .= $this->output->heading($result->heading, 4);
-         $o .= $this->output->notification($result->message);
+         $o .= $this->output->notification($result->message, $classes);
          $o .= $this->output->continue_button($url);
          return $o;
      }
          $row->cells = array($cell1, $cell2);
          $t->data[] = $row;
  
 +        $submission = $status->teamsubmission ? $status->teamsubmission : $status->submission;
          $duedate = $status->duedate;
          if ($duedate > 0) {
              // Due date.
              $row = new html_table_row();
              $cell1 = new html_table_cell(get_string('timeremaining', 'assign'));
              if ($duedate - $time <= 0) {
 -                if (!$status->submission ||
 -                        $status->submission->status != ASSIGN_SUBMISSION_STATUS_SUBMITTED) {
 +                if (!$submission ||
 +                        $submission->status != ASSIGN_SUBMISSION_STATUS_SUBMITTED) {
                      if ($status->submissionsenabled) {
                          $overduestr = get_string('overdue', 'assign', format_time($time - $duedate));
                          $cell2 = new html_table_cell($overduestr);
                          $cell2 = new html_table_cell(get_string('duedatereached', 'assign'));
                      }
                  } else {
 -                    if ($status->submission->timemodified > $duedate) {
 +                    if ($submission->timemodified > $duedate) {
                          $latestr = get_string('submittedlate',
                                                'assign',
 -                                              format_time($status->submission->timemodified - $duedate));
 +                                              format_time($submission->timemodified - $duedate));
                          $cell2 = new html_table_cell($latestr);
                          $cell2->attributes = array('class'=>'latesubmission');
                      } else {
                          $earlystr = get_string('submittedearly',
                                                 'assign',
 -                                               format_time($status->submission->timemodified - $duedate));
 +                                               format_time($submission->timemodified - $duedate));
                          $cell2 = new html_table_cell($earlystr);
                          $cell2->attributes = array('class'=>'earlysubmission');
                      }
          }
  
          // Last modified.
 -        $submission = $status->teamsubmission ? $status->teamsubmission : $status->submission;
          if ($submission) {
              $row = new html_table_row();
              $cell1 = new html_table_cell(get_string('timemodified', 'assign'));