@@ -77,17 +77,11 @@ public function get_content() {
77
77
}
78
78
return $ this ->content ;
79
79
}
80
- $ ismodeautomated = (bool )\block_evasys_sync \evasys_inviter::getmode ($ this ->page ->course ->category );
81
- // If the teacher can start the evaluation directly, we'll want to run some javascript initialization.
82
- if ($ ismodeautomated ) {
83
- $ this ->page ->requires ->js_call_amd ('block_evasys_sync/invite_manager ' , 'init ' );
84
- } else {
85
- $ categoryhasstandardtime = \block_evasys_sync \evasys_synchronizer::get_standard_timemode ($ this ->page ->course ->category );
80
+ $ categoryhasstandardtime = \block_evasys_sync \evasys_synchronizer::get_standard_timemode ($ this ->page ->course ->category );
86
81
87
- // Only use standardtime js if no record exists.
88
- if (!$ record ) {
89
- $ this ->page ->requires ->js_call_amd ('block_evasys_sync/standardtime ' , 'init ' );
90
- }
82
+ // Only use standardtime js if no record exists.
83
+ if (!$ record ) {
84
+ $ this ->page ->requires ->js_call_amd ('block_evasys_sync/standardtime ' , 'init ' );
91
85
}
92
86
$ evasyssynchronizer = new \block_evasys_sync \evasys_synchronizer ($ this ->page ->course ->id );
93
87
try {
@@ -98,12 +92,7 @@ public function get_content() {
98
92
return $ this ->content ;
99
93
}
100
94
101
- if ($ ismodeautomated ) {
102
- $ href = new moodle_url ('/course/view.php ' ,
103
- array ('id ' => $ this ->page ->course ->id , "evasyssynccheck " => true ));
104
- } else {
105
- $ href = new moodle_url ('/blocks/evasys_sync/sync.php ' );
106
- }
95
+ $ href = new moodle_url ('/blocks/evasys_sync/sync.php ' );
107
96
108
97
// Initialize data for mustache template.
109
98
$ startdisabled = false ;
@@ -130,33 +119,20 @@ public function get_content() {
130
119
// If the persistenceclass exists and the state is manual an email must have been sent.
131
120
$ emailsentnotice = true ;
132
121
}
133
- if ($ state == course_evaluation_allocation::STATE_AUTO_NOTOPENED ) {
134
- // If the persistenceclass exists and the state is automatic and not opened
135
- // the period must have been set.
136
- $ periodsetnotice = true ;
137
- }
138
- if ($ state >= course_evaluation_allocation::STATE_AUTO_OPENED || $ nostudents ) {
139
- // If the course was already opened, disable the start date. If there are no students disable all controls.
140
- $ startdisabled = true ;
141
- }
142
- if ($ state == course_evaluation_allocation::STATE_AUTO_CLOSED || $ nostudents ) {
143
- // If the course was already closed, disable the end date. If there are no students disable all controls.
144
- $ enddisabled = true ;
145
- }
146
122
// If there is a record the period has been set at least once.
147
123
// Set start and end to match the period that had been set.
148
124
$ start = $ record ->get ('startdate ' );
149
125
$ end = $ record ->get ('enddate ' );
150
126
$ recordhasstandardtime = $ record ->get ('usestandardtime ' );
151
127
} else {
152
- if (! $ ismodeautomated && $ categoryhasstandardtime ) {
128
+ if ($ categoryhasstandardtime ) {
153
129
$ start = $ categoryhasstandardtime ['start ' ];
154
130
$ end = $ categoryhasstandardtime ['end ' ];
155
131
$ recordhasstandardtime = true ;
156
132
}
157
133
}
158
134
// This javascript module sets the start and end fields to the correct values.
159
- $ jsmodestring = $ ismodeautomated ? ' automated ' : 'manual ' ;
135
+ $ jsmodestring = 'manual ' ;
160
136
$ jsmodestring .= $ enddisabled ? '_closed ' : '_open ' ;
161
137
$ this ->page ->requires ->js_call_amd ('block_evasys_sync/initialize ' , 'init ' , array ($ start , $ end , $ jsmodestring ));
162
138
@@ -212,7 +188,7 @@ public function get_content() {
212
188
$ courses [] = $ course ;
213
189
}
214
190
215
- $ standardttimemode = (! $ ismodeautomated && $ recordhasstandardtime && !$ record );
191
+ $ standardttimemode = ($ recordhasstandardtime && !$ record );
216
192
$ hisconnection = get_config ('block_evasys_sync ' , 'default_his_connection ' );
217
193
218
194
// Create the data object for the mustache table.
@@ -224,10 +200,10 @@ public function get_content() {
224
200
/* In case of the manual workflow, we can start synchronisation also, if no surveys are registered, yet.
225
201
* In case of the automated workflow, we require surveys
226
202
* in order to be able to automatically trigger the evaluation. */
227
- 'showcontrols ' => ($ hassurveys || ! $ ismodeautomated ) && count ($ evasyscourses ) > 0 && !$ invalidcourses ,
228
- 'usestandardtimelayout ' => (! $ ismodeautomated && $ recordhasstandardtime && !$ record ),
203
+ 'showcontrols ' => ($ hassurveys ) && count ($ evasyscourses ) > 0 && !$ invalidcourses ,
204
+ 'usestandardtimelayout ' => ($ recordhasstandardtime && !$ record ),
229
205
// Choose mode.
230
- 'direct ' => $ ismodeautomated ,
206
+ 'direct ' => false ,
231
207
'startdisabled ' => $ startdisabled || $ standardttimemode ,
232
208
'enddisabled ' => $ enddisabled || $ standardttimemode ,
233
209
'onlyend ' => $ startdisabled && !$ standardttimemode ,
0 commit comments