Class ilCronFinishUnfinishedTestPasses.
More...
|
| getId () |
|
| getTitle () |
|
| getDescription () |
|
| getDefaultScheduleType () |
|
| getDefaultScheduleValue () |
|
| hasAutoActivation () |
|
| hasFlexibleSchedule () |
|
| hasCustomSettings () |
|
| run () |
|
| setDateTimeProvider (?\Closure $date_time_provider) |
|
| isDue (?\DateTimeImmutable $last_run, ?JobScheduleType $schedule_type, ?int $schedule_value, bool $is_manually_executed=false) |
|
| getScheduleType () |
| Get current schedule type (if flexible) More...
|
|
| getScheduleValue () |
| Get current schedule value (if flexible) More...
|
|
| setSchedule (?JobScheduleType $a_type, ?int $a_value) |
| Update current schedule (if flexible) More...
|
|
| getAllScheduleTypes () |
| Get all available schedule types. More...
|
|
| getScheduleTypesWithValues () |
|
| getValidScheduleTypes () |
| Returns a collection of all valid schedule types for a specific job. More...
|
|
| isManuallyExecutable () |
|
| hasCustomSettings () |
|
| usesLegacyForms () |
|
| getCustomConfigurationInput (\ILIAS\UI\Factory $ui_factory, \ILIAS\Refinery\Factory $factory, \ilLanguage $lng) |
|
| addCustomSettingsToForm (\ilPropertyFormGUI $a_form) |
|
| saveCustomConfiguration (mixed $form_data) |
|
| saveCustomSettings (\ilPropertyFormGUI $a_form) |
|
| addToExternalSettingsForm (int $a_form_id, array &$a_fields, bool $a_is_active) |
|
| activationWasToggled (\ilDBInterface $db, \ilSetting $setting, bool $a_currently_active) |
| Important: This method is (also) called from the setup process, where the constructor of an ilCronJob ist NOT executed. More...
|
|
| getId () |
|
| getTitle () |
|
| getDescription () |
|
| hasAutoActivation () |
| Is to be activated on "installation", does only work for ILIAS core cron jobs. More...
|
|
| hasFlexibleSchedule () |
|
| getDefaultScheduleType () |
|
| getDefaultScheduleValue () |
|
| run () |
|
◆ finishPassForUser()
ilCronFinishUnfinishedTestPasses::finishPassForUser |
( |
|
$active_id, |
|
|
|
$obj_id |
|
) |
| |
|
protected |
Definition at line 252 of file class.ilCronFinishUnfinishedTestPasses.php.
References ilObject\_exists(), ILIAS\Repository\logger(), null, and ILIAS\Repository\user().
Referenced by finishPassOnEndingTime(), and finishPassOnProcessingTime().
254 $processLocker = $this->processLockerFactory->withContextId((
int) $active_id)->getLocker();
257 $test_session->loadFromDb($active_id);
260 $this->test_result_repository->updateTestAttemptResult(
262 $test_session->getPass(),
270 $this->test_result_repository
271 ))->performFinishTasks($processLocker, StatusOfAttempt::FINISHED_BY_CRONJOB);
272 $this->
logger->info(
'Test session with active id (' . $active_id .
') and obj_id (' . $obj_id .
') is now finished.');
274 $this->
logger->info(
'Test object with id (' . $obj_id .
') does not exist.');
Class ilTestPassFinishTasks.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
◆ finishPassOnEndingTime()
ilCronFinishUnfinishedTestPasses::finishPassOnEndingTime |
( |
int |
$test_id, |
|
|
int |
$active_id |
|
) |
| |
|
private |
Definition at line 193 of file class.ilCronFinishUnfinishedTestPasses.php.
References finishPassForUser(), and ILIAS\Repository\logger().
Referenced by processPasses().
196 if ($this->test_ending_times[$test_id][
'ending_time_enabled'] !== 1) {
197 $this->
logger->info(
'Test (' . $test_id .
') has no ending time.');
201 $this->
logger->info(
'Test (' . $test_id .
') has ending time (' 202 . $this->test_ending_times[$test_id][
'ending_time'] .
')');
203 $ending_time = $this->test_ending_times[$test_id][
'ending_time'];
204 if ($ending_time >=
$now) {
205 $this->
logger->info(
'Test (' . $test_id .
') ending time (' 206 . $this->test_ending_times[$test_id][
'ending_time']
207 .
') > now (' .
$now .
') is not reached.');
211 $this->
finishPassForUser($active_id, $this->test_ending_times[$test_id][
'obj_fi']);
finishPassForUser($active_id, $obj_id)
◆ finishPassOnProcessingTime()
ilCronFinishUnfinishedTestPasses::finishPassOnProcessingTime |
( |
int |
$test_id, |
|
|
int |
$usr_id, |
|
|
int |
$active_id |
|
) |
| |
|
private |
Definition at line 215 of file class.ilCronFinishUnfinishedTestPasses.php.
References ilObject\_exists(), finishPassForUser(), and ILIAS\Repository\logger().
Referenced by processPasses().
220 if ($this->test_ending_times[$test_id][
'enable_processing_time'] !== 1) {
221 $this->
logger->info(
'Test (' . $test_id .
') has no processing time.');
225 $this->
logger->info(
'Test (' . $test_id .
') has processing time (' . $this->test_ending_times[$test_id][
'processing_time'] .
')');
226 $obj_id = $this->test_ending_times[$test_id][
'obj_fi'];
229 $this->
logger->info(
'Test object with id (' . $obj_id .
') does not exist.');
233 $test_obj =
new ilObjTest($obj_id,
false);
234 $startingTime = $test_obj->getStartingTimeOfUser($active_id);
235 $max_processing_time = $test_obj->isMaxProcessingTimeReached($startingTime, $active_id);
236 if (!$max_processing_time) {
237 $this->
logger->info(
'Max Processing time not reached for user id (' 238 . $usr_id .
') in test with active id (' 239 . $active_id .
'). Starting time: ' . $startingTime
240 .
' Processing time: ' . $test_obj->getProcessingTime() .
' / ' 241 . $test_obj->getProcessingTimeInSeconds() .
's');
245 $this->
logger->info(
'Max Processing time reached for user id (' 246 . $usr_id .
') so test with active id (' 247 . $active_id .
') will be finished.');
248 $this->
finishPassForUser($active_id, $this->test_ending_times[$test_id][
'obj_fi']);
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
finishPassForUser($active_id, $obj_id)
◆ gatherUsersWithUnfinishedPasses()
ilCronFinishUnfinishedTestPasses::gatherUsersWithUnfinishedPasses |
( |
| ) |
|
|
protected |
Definition at line 134 of file class.ilCronFinishUnfinishedTestPasses.php.
Referenced by run().
137 SELECT tst_active.active_id, 139 tst_active.user_fi usr_id, 140 tst_active.test_fi test_fi, 144 tst_active.submitted test_finished, 145 usr_data.matriculation, 147 tst_active.lastindex, 148 tst_active.last_started_pass last_started 151 ON tst_active.user_fi = usr_data.usr_id 152 WHERE IFNULL(tst_active.last_finished_pass, -1) <> tst_active.last_started_pass 154 $result = $this->db->query($query);
155 while ($row = $this->db->fetchAssoc($result)) {
156 $this->unfinished_passes[] = $row;
157 $this->test_ids[] = $row[
'test_fi'];
◆ getDefaultScheduleType()
ilCronFinishUnfinishedTestPasses::getDefaultScheduleType |
( |
| ) |
|
◆ getDefaultScheduleValue()
ilCronFinishUnfinishedTestPasses::getDefaultScheduleValue |
( |
| ) |
|
◆ getDescription()
ilCronFinishUnfinishedTestPasses::getDescription |
( |
| ) |
|
◆ getId()
ilCronFinishUnfinishedTestPasses::getId |
( |
| ) |
|
◆ getTestsFinishAndProcessingTime()
ilCronFinishUnfinishedTestPasses::getTestsFinishAndProcessingTime |
( |
| ) |
|
|
protected |
Definition at line 161 of file class.ilCronFinishUnfinishedTestPasses.php.
References ILIAS\Repository\logger().
Referenced by run().
163 $query =
'SELECT test_id, obj_fi, ending_time, ending_time_enabled, processing_time, enable_processing_time FROM tst_tests WHERE ' .
164 $this->db->in(
'test_id', $this->test_ids,
false,
'integer');
165 $result = $this->db->query($query);
166 while ($row = $this->db->fetchAssoc($result)) {
167 $this->test_ending_times[$row[
'test_id']] = $row;
169 $this->
logger->info(
'Gathered data for ' . count($this->test_ids) .
' test id(s) => (' . implode(
',', $this->test_ids) .
')');
◆ getTitle()
ilCronFinishUnfinishedTestPasses::getTitle |
( |
| ) |
|
◆ hasAutoActivation()
ilCronFinishUnfinishedTestPasses::hasAutoActivation |
( |
| ) |
|
◆ hasCustomSettings()
ilCronFinishUnfinishedTestPasses::hasCustomSettings |
( |
| ) |
|
◆ hasFlexibleSchedule()
ilCronFinishUnfinishedTestPasses::hasFlexibleSchedule |
( |
| ) |
|
◆ processPasses()
ilCronFinishUnfinishedTestPasses::processPasses |
( |
| ) |
|
|
protected |
◆ run()
ilCronFinishUnfinishedTestPasses::run |
( |
| ) |
|
◆ $db
◆ $lng
readonly ilLanguage ilCronFinishUnfinishedTestPasses::$lng |
|
protected |
◆ $logger
readonly TestLogger ilCronFinishUnfinishedTestPasses::$logger |
|
protected |
◆ $now
int ilCronFinishUnfinishedTestPasses::$now |
|
protected |
◆ $obj_data_cache
◆ $processLockerFactory
◆ $test_ending_times
array ilCronFinishUnfinishedTestPasses::$test_ending_times |
|
protected |
◆ $test_ids
array ilCronFinishUnfinishedTestPasses::$test_ids |
|
protected |
◆ $test_result_repository
TestResultRepository ilCronFinishUnfinishedTestPasses::$test_result_repository |
|
protected |
◆ $unfinished_passes
array ilCronFinishUnfinishedTestPasses::$unfinished_passes |
|
protected |
◆ $user
readonly ilObjUser ilCronFinishUnfinishedTestPasses::$user |
|
protected |
The documentation for this class was generated from the following file: