Merge branch 'MDL40479_Grading_alert_colour' of https://github.com/Dave-B/moodle

This commit is contained in:
Sam Hemelryk 2014-07-21 11:32:09 +12:00
commit 424033b780
3 changed files with 11 additions and 6 deletions

View File

@ -2303,9 +2303,9 @@ class assign {
}
/**
* Display a continue page.
* Display a continue page after grading.
*
* @param string $message - The message to display
* @param string $message - The message to display.
* @return string
*/
protected function view_savegrading_result($message) {
@ -2323,9 +2323,9 @@ class assign {
return $o;
}
/**
* Display a grading error.
* Display a continue page after quickgrading.
*
* @param string $message - The description of the result
* @param string $message - The message to display.
* @return string
*/
protected function view_quickgrading_result($message) {

View File

@ -65,17 +65,21 @@ class assign_gradingmessage implements renderable {
public $message = '';
/** @var int $coursemoduleid */
public $coursemoduleid = 0;
/** @var int $gradingerror should be set true if there was a problem grading */
public $gradingerror = null;
/**
* Constructor
* @param string $heading This is the heading to display
* @param string $message This is the message to display
* @param bool $gradingerror Set to true to display the message as an error.
* @param int $coursemoduleid
*/
public function __construct($heading, $message, $coursemoduleid) {
public function __construct($heading, $message, $coursemoduleid, $gradingerror = false) {
$this->heading = $heading;
$this->message = $message;
$this->coursemoduleid = $coursemoduleid;
$this->gradingerror = $gradingerror;
}
}

View File

@ -92,10 +92,11 @@ class mod_assign_renderer extends plugin_renderer_base {
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;
}