mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
MDL-37635 Assign: Prevent errors when viewing a feedback for an assignment with no gradeitem in gradebook
Also adds unit tests to verify that: Feedback is visible even if there is no grade The grade is not shown if the gradeitem is hidden unless you have mod/assign:grade capability
This commit is contained in:
parent
1918a2452e
commit
46692c3a81
3 changed files with 111 additions and 30 deletions
|
@ -321,18 +321,20 @@ class mod_assign_renderer extends plugin_renderer_base {
|
|||
$t = new html_table();
|
||||
|
||||
// Grade.
|
||||
$row = new html_table_row();
|
||||
$cell1 = new html_table_cell(get_string('grade'));
|
||||
$cell2 = new html_table_cell($status->gradefordisplay);
|
||||
$row->cells = array($cell1, $cell2);
|
||||
$t->data[] = $row;
|
||||
if (isset($status->gradefordisplay)) {
|
||||
$row = new html_table_row();
|
||||
$cell1 = new html_table_cell(get_string('grade'));
|
||||
$cell2 = new html_table_cell($status->gradefordisplay);
|
||||
$row->cells = array($cell1, $cell2);
|
||||
$t->data[] = $row;
|
||||
|
||||
// Grade date.
|
||||
$row = new html_table_row();
|
||||
$cell1 = new html_table_cell(get_string('gradedon', 'assign'));
|
||||
$cell2 = new html_table_cell(userdate($status->gradeddate));
|
||||
$row->cells = array($cell1, $cell2);
|
||||
$t->data[] = $row;
|
||||
// Grade date.
|
||||
$row = new html_table_row();
|
||||
$cell1 = new html_table_cell(get_string('gradedon', 'assign'));
|
||||
$cell2 = new html_table_cell(userdate($status->gradeddate));
|
||||
$row->cells = array($cell1, $cell2);
|
||||
$t->data[] = $row;
|
||||
}
|
||||
|
||||
if ($status->grader) {
|
||||
// Grader.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue