From dcbfe15f37d073e2e1b4fa656da040a54ead91f1 Mon Sep 17 00:00:00 2001 From: Shamim Rezaie Date: Mon, 26 Apr 2021 14:27:45 +1000 Subject: [PATCH] MDL-71163 mod_assign: Show the selected group's dates --- mod/assign/classes/dates.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mod/assign/classes/dates.php b/mod/assign/classes/dates.php index 9de15e8a86c..fa284deccc1 100644 --- a/mod/assign/classes/dates.php +++ b/mod/assign/classes/dates.php @@ -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 = [];