Skip to content

Commit 2439aeb

Browse files
author
rtschu
committed
fixed bug where a started course could show standardtimecontrols
1 parent 557729b commit 2439aeb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

block_evasys_sync.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public function get_content() {
102102
$enddisabled = false;
103103
$emailsentnotice = false;
104104
$periodsetnotice = false;
105+
$wasstarted = false;
105106

106107
// Set start to today and end to a week from now.
107108
$start = time();
@@ -128,6 +129,8 @@ public function get_content() {
128129
// If the persistenceclass exists and the state is automatic and not opened
129130
// the period must have been set.
130131
$periodsetnotice = true;
132+
} else {
133+
$wasstarted = true;
131134
}
132135
if ($state >= course_evaluation_allocation::STATE_AUTO_OPENED || $nostudents) {
133136
// If the course was already opened, disable the start date. If there are no students disable all controls.
@@ -230,7 +233,7 @@ public function get_content() {
230233
* In case of the automated workflow, we require surveys
231234
* in order to be able to automatically trigger the evaluation. */
232235
'showcontrols' => ($hassurveys || !$ismodeautomated) && count($evasyscourses) > 0 && !$invalidcourses,
233-
'usestandardtimelayout' => (!$ismodeautomated && $hasstandardtime),
236+
'usestandardtimelayout' => (!$ismodeautomated && $hasstandardtime && !$wasstarted),
234237
// Choose mode.
235238
'direct' => $ismodeautomated,
236239
'startdisabled' => $startdisabled || $standardttimemode,

0 commit comments

Comments
 (0)