Class ilCronFinishUnfinishedTestPasses.
More...
◆ finishPassForUser()
ilCronFinishUnfinishedTestPasses::finishPassForUser |
( |
|
$active_id, |
|
|
|
$obj_id |
|
) |
| |
|
protected |
Definition at line 246 of file class.ilCronFinishUnfinishedTestPasses.php.
Referenced by processPasses().
248 $this->processLockerFactory->setActiveId($active_id);
249 $processLocker = $this->processLockerFactory->getLocker();
252 $pass_finisher->performFinishTasks($processLocker);
254 $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 152 of file class.ilCronFinishUnfinishedTestPasses.php.
References $query, $result, and $row.
Referenced by run().
154 $query =
"SELECT tst_active.active_id, 156 tst_active.user_fi usr_id, 157 tst_active.test_fi test_fi, 161 tst_active.submitted test_finished, 162 usr_data.matriculation, 164 tst_active.lastindex, 165 tst_active.last_started_pass last_started 168 ON tst_active.user_fi = usr_data.usr_id 169 WHERE IFNULL(tst_active.last_finished_pass, -1) <> tst_active.last_started_pass 174 $this->unfinished_passes[] =
$row;
175 $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 179 of file class.ilCronFinishUnfinishedTestPasses.php.
References $query, $result, and $row.
Referenced by run().
181 $query =
'SELECT test_id, obj_fi, ending_time, ending_time_enabled, processing_time, enable_processing_time FROM tst_tests WHERE '.
182 $this->db->in(
'test_id', $this->test_ids,
false,
'integer');
186 $this->test_ending_times[
$row[
'test_id']] =
$row;
188 $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 191 of file class.ilCronFinishUnfinishedTestPasses.php.
References $data, $now, finishPassForUser(), and time.
Referenced by run().
194 foreach($this->unfinished_passes as $key =>
$data)
196 $test_id =
$data[
'test_fi'];
197 $can_not_be_finished =
true;
198 if(array_key_exists($test_id, $this->test_ending_times))
200 if($this->test_ending_times[$test_id][
'ending_time_enabled'] == 1)
202 $this->log->info(
'Test (' . $test_id .
') has ending time ('.$this->test_ending_times[$test_id][
'ending_time'].
')' );
203 $ending_time = $this->test_ending_times[$test_id][
'ending_time'];
204 if($ending_time <
$now)
207 $can_not_be_finished =
false;
211 $this->log->info(
'Test (' . $test_id .
') ending time ('.$this->test_ending_times[$test_id][
'ending_time'].
') > now ('.
$now.
') is not reached.' );
217 $this->log->info(
'Test (' . $test_id .
') has no ending time.' );
219 if($this->test_ending_times[$test_id][
'enable_processing_time'] == 1)
221 $this->log->info(
'Test (' . $test_id .
') has processing time ('.$this->test_ending_times[$test_id][
'processing_time'].
')' );
222 $obj_id = $this->test_ending_times[$test_id][
'obj_fi'];
223 $test_obj =
new ilObjTest($obj_id,
false);
224 $startingTime = $test_obj->getStartingTimeOfUser(
$data[
'active_id'],
$data[
'last_started_pass']);
225 $max_processing_time = $test_obj->isMaxProcessingTimeReached($startingTime,
$data[
'active_id']);
226 if($max_processing_time)
228 $this->log->info(
'Max Processing time reached for user id ('.
$data[
'usr_id'].
') so test with active id ('.
$data[
'active_id'].
') will be finished.');
229 $this->
finishPassForUser($data[
'active_id'], $this->test_ending_times[$test_id][
'obj_fi']);
230 $can_not_be_finished =
false;
235 $this->log->info(
'Test (' . $test_id .
') has no processing time.');
238 if($can_not_be_finished)
240 $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: