MDL-40479 mod_assign: Fix the colour of grading success messages.
This commit is contained in:
committed by
Sam Hemelryk
parent
294629be5f
commit
4b2a23e36f
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user