3 declare(strict_types=1);
25 private const ID =
'prg_user_risky_to_fail';
35 $this->
log = $DIC[
'ilLog'];
36 $this->
lng = $DIC[
'lng'];
37 $this->
lng->loadLanguageModule(
'prg');
40 $this->assignment_repo =
$dic[
'repo.assignment'];
41 $this->adapter =
$dic[
'cron.riskyToFail'];
46 return $this->
lng->txt(
'prg_user_risky_to_fail_title');
51 return $this->
lng->txt(
'prg_user_risky_to_fail_desc');
71 return CronJobScheduleType::SCHEDULE_TYPE_IN_DAYS;
84 $programmes_to_send = $this->adapter->getRelevantProgrammeIds();
85 if (count($programmes_to_send) == 0) {
90 $programmes_and_due = [];
91 foreach ($programmes_to_send as $programme_obj_id => $days_offset_mail) {
92 $interval =
new DateInterval(
'P' . $days_offset_mail .
'D');
93 $due = $today->add($interval);
94 $programmes_and_due[$programme_obj_id] = $due;
99 $assignments = $this->assignment_repo->getRiskyToFail($programmes_and_due,
true);
101 if (count($assignments) == 0) {
105 foreach ($assignments as $ass) {
106 $pgs = $ass->getProgressTree();
109 'PRG, RiskyToFail: user %s at progress %s (prg obj_id %s)',
116 $this->adapter->actOnSingleAssignment($ass);
117 $this->assignment_repo->storeRiskyToFailSentFor($ass);
128 protected function log(
string $msg): void
130 $this->
log->write($msg);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilPRGAssignmentDBRepository $assignment_repo
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Component logger with individual log levels by component id.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getDefaultScheduleValue()
final const STATUS_NO_ACTION
ilPrgCronJobAdapter $adapter
Assignments are relations of users to a PRG; They hold progress-information for (sub-)nodes of the PR...