Class ilCronFinishUnfinishedTestPasses.
More...
◆ finishPassForUser()
ilCronFinishUnfinishedTestPasses::finishPassForUser |
( |
|
$active_id, |
|
|
|
$obj_id |
|
) |
| |
|
protected |
Definition at line 228 of file class.ilCronFinishUnfinishedTestPasses.php.
Referenced by processPasses().
230 $this->processLockerFactory->setActiveId($active_id);
231 $processLocker = $this->processLockerFactory->getLocker();
234 $pass_finisher->performFinishTasks($processLocker);
236 $this->log->info(
'Test session with active id (' . $active_id .
') and obj_id (' . $obj_id .
') is now finished.');
Class ilTestPassFinishTasks.
◆ gatherUsersWithUnfinishedPasses()
ilCronFinishUnfinishedTestPasses::gatherUsersWithUnfinishedPasses |
( |
| ) |
|
|
protected |
Definition at line 150 of file class.ilCronFinishUnfinishedTestPasses.php.
References $query, $result, and $row.
Referenced by run().
152 $query =
"SELECT tst_active.active_id, 154 tst_active.user_fi usr_id, 155 tst_active.test_fi test_fi, 159 tst_active.submitted test_finished, 160 usr_data.matriculation, 162 tst_active.lastindex, 163 tst_active.last_started_pass last_started 166 ON tst_active.user_fi = usr_data.usr_id 167 WHERE IFNULL(tst_active.last_finished_pass, -1) <> tst_active.last_started_pass 171 $this->unfinished_passes[] =
$row;
172 $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 176 of file class.ilCronFinishUnfinishedTestPasses.php.
References $query, $result, and $row.
Referenced by run().
178 $query =
'SELECT test_id, obj_fi, ending_time, ending_time_enabled, processing_time, enable_processing_time FROM tst_tests WHERE ' .
179 $this->db->in(
'test_id', $this->test_ids,
false,
'integer');
182 $this->test_ending_times[
$row[
'test_id']] =
$row;
184 $this->log->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 |
Definition at line 187 of file class.ilCronFinishUnfinishedTestPasses.php.
References $data, $key, $now, finishPassForUser(), and time.
Referenced by run().
190 foreach ($this->unfinished_passes as
$key =>
$data) {
191 $test_id =
$data[
'test_fi'];
192 $can_not_be_finished =
true;
193 if (array_key_exists($test_id, $this->test_ending_times)) {
194 if ($this->test_ending_times[$test_id][
'ending_time_enabled'] == 1) {
195 $this->log->info(
'Test (' . $test_id .
') has ending time (' . $this->test_ending_times[$test_id][
'ending_time'] .
')');
196 $ending_time = $this->test_ending_times[$test_id][
'ending_time'];
197 if ($ending_time <
$now) {
199 $can_not_be_finished =
false;
201 $this->log->info(
'Test (' . $test_id .
') ending time (' . $this->test_ending_times[$test_id][
'ending_time'] .
') > now (' .
$now .
') is not reached.');
204 $this->log->info(
'Test (' . $test_id .
') has no ending time.');
206 if ($this->test_ending_times[$test_id][
'enable_processing_time'] == 1) {
207 $this->log->info(
'Test (' . $test_id .
') has processing time (' . $this->test_ending_times[$test_id][
'processing_time'] .
')');
208 $obj_id = $this->test_ending_times[$test_id][
'obj_fi'];
209 $test_obj =
new ilObjTest($obj_id,
false);
210 $startingTime = $test_obj->getStartingTimeOfUser(
$data[
'active_id'],
$data[
'last_started_pass']);
211 $max_processing_time = $test_obj->isMaxProcessingTimeReached($startingTime,
$data[
'active_id']);
212 if ($max_processing_time) {
213 $this->log->info(
'Max Processing time reached for user id (' .
$data[
'usr_id'] .
') so test with active id (' .
$data[
'active_id'] .
') will be finished.');
214 $this->
finishPassForUser($data[
'active_id'], $this->test_ending_times[$test_id][
'obj_fi']);
215 $can_not_be_finished =
false;
218 $this->log->info(
'Test (' . $test_id .
') has no processing time.');
221 if ($can_not_be_finished) {
222 $this->log->info(
'Test session with active id (' .
$data[
'active_id'] .
') can not be finished by this cron job.');
finishPassForUser($active_id, $obj_id)
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
◆ run()
ilCronFinishUnfinishedTestPasses::run |
( |
| ) |
|
◆ $db
ilCronFinishUnfinishedTestPasses::$db |
|
protected |
◆ $lng
ilCronFinishUnfinishedTestPasses::$lng |
|
protected |
◆ $log
ilCronFinishUnfinishedTestPasses::$log |
|
protected |
◆ $now
ilCronFinishUnfinishedTestPasses::$now |
|
protected |
◆ $obj_data_cache
ilCronFinishUnfinishedTestPasses::$obj_data_cache |
|
protected |
◆ $processLockerFactory
ilCronFinishUnfinishedTestPasses::$processLockerFactory |
|
protected |
◆ $test_ending_times
ilCronFinishUnfinishedTestPasses::$test_ending_times |
|
protected |
◆ $test_ids
ilCronFinishUnfinishedTestPasses::$test_ids |
|
protected |
◆ $unfinished_passes
ilCronFinishUnfinishedTestPasses::$unfinished_passes |
|
protected |
The documentation for this class was generated from the following file: