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;
}
}
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;
}