MDL-86912 assign: Adjust display of Status column in Overview
This commit is contained in:
@@ -162,10 +162,7 @@ class overview extends \core_courseformat\activityoverviewbase {
|
||||
private function get_extra_submission_status_overview(): ?overviewitem {
|
||||
global $USER;
|
||||
|
||||
if (
|
||||
!has_capability('mod/assign:submit', $this->context)
|
||||
|| has_capability('moodle/site:config', $this->context)
|
||||
) {
|
||||
if (!has_capability('mod/assign:submit', $this->context, $USER, false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -258,6 +258,10 @@ final class overview_test extends \advanced_testcase {
|
||||
$method->setAccessible(true);
|
||||
$item = $method->invoke($overview);
|
||||
$this->assertNull($item);
|
||||
// Unless the admin is enrolled as a student.
|
||||
$this->getDataGenerator()->enrol_user(get_admin()->id, $course->id, 'student');
|
||||
$item = $method->invoke($overview);
|
||||
$this->assertEquals(get_string('submissionstatus', 'assign'), $item->get_name());
|
||||
|
||||
// Check student see the new status.
|
||||
$this->setUser($student);
|
||||
|
||||
Reference in New Issue
Block a user