6 declare(strict_types=1);
11 const ID =
'prg_user_risky_to_fail';
41 $this->
log = $DIC[
'ilLog'];
42 $this->lng = $DIC[
'lng'];
43 $this->lng->loadLanguageModule(
'prg');
55 return $this->lng->txt(
'prg_user_risky_to_fail_title');
65 return $this->lng->txt(
'prg_user_risky_to_fail_desc');
105 return self::SCHEDULE_TYPE_IN_DAYS;
124 ->getProgrammeIdsWithRiskyToFailSettings();
126 if (count($programmes_to_send) == 0) {
131 $programmes_and_due = [];
132 foreach ($programmes_to_send as $programme_obj_id => $days_offset_mail) {
133 $interval =
new DateInterval(
'P' . $days_offset_mail .
'D');
134 $due = $today->add($interval);
135 $programmes_and_due[$programme_obj_id] = $due;
139 ->getRiskyToFail($programmes_and_due);
141 if (count($progresses) == 0) {
146 foreach ($progresses as $progress) {
149 'PRG, RiskyToFail: user %s at progress %s (prg obj_id %s)',
150 $progress->getUserId(),
152 $progress->getNodeId()
155 $events->userRiskyToFail($progress);
168 return $this->dic[
'model.Settings.ilStudyProgrammeSettingsRepository'];
173 return $this->dic[
'ilStudyProgrammeUserProgressDB'];
178 return $this->dic[
'ilStudyProgrammeEvents'];
181 protected function log(
string $msg) : void
183 $this->
log->write($msg);
hasFlexibleSchedule()
Can the schedule be configured?
Cron job application base class.
hasAutoActivation()
Is to be activated on "installation".
getDefaultScheduleType()
Get schedule type.
getDefaultScheduleValue()
Get schedule value.
Cron job result data container.
getDescription()
Get description.