MDL-71163 mod_assign: Show the selected group's dates

This commit is contained in:
Shamim Rezaie 2021-04-26 14:27:45 +10:00
parent 9e3b2d6f47
commit 940f57d519

View File

@ -52,6 +52,20 @@ class dates extends activity_dates {
$timeopen = $this->cm->customdata['allowsubmissionsfromdate'] ?? null;
$timedue = $this->cm->customdata['duedate'] ?? null;
$activitygroup = groups_get_activity_group($this->cm, true);
if ($activitygroup) {
if ($assign->can_view_grades()) {
$groupoverride = \cache::make('mod_assign', 'overrides')->get("{$this->cm->instance}_g_{$activitygroup}");
if (!empty($groupoverride->allowsubmissionsfromdate)) {
$timeopen = $groupoverride->allowsubmissionsfromdate;
}
if (!empty($groupoverride->duedate)) {
$timedue = $groupoverride->duedate;
}
}
}
$now = time();
$dates = [];