3 declare(strict_types=1);
23 private const ID =
'prg_user_risky_to_fail';
33 $this->
log = $DIC[
'ilLog'];
34 $this->
lng = $DIC[
'lng'];
35 $this->
lng->loadLanguageModule(
'prg');
38 $this->assignment_repo =
$dic[
'repo.assignment'];
39 $this->adapter =
$dic[
'cron.riskyToFail'];
44 return $this->
lng->txt(
'prg_user_risky_to_fail_title');
49 return $this->
lng->txt(
'prg_user_risky_to_fail_desc');
69 return self::SCHEDULE_TYPE_IN_DAYS;
82 $programmes_to_send = $this->adapter->getRelevantProgrammeIds();
83 if (count($programmes_to_send) == 0) {
88 $programmes_and_due = [];
89 foreach ($programmes_to_send as $programme_obj_id => $days_offset_mail) {
90 $interval =
new DateInterval(
'P' . $days_offset_mail .
'D');
91 $due = $today->add($interval);
92 $programmes_and_due[$programme_obj_id] = $due;
97 $assignments = $this->assignment_repo->getRiskyToFail($programmes_and_due,
true);
99 if (count($assignments) == 0) {
103 foreach ($assignments as $ass) {
104 $pgs = $ass->getProgressTree();
107 'PRG, RiskyToFail: user %s at progress %s (prg obj_id %s)',
114 $this->adapter->actOnSingleAssignment($ass);
115 $this->assignment_repo->storeRiskyToFailSentFor($ass);
126 protected function log(
string $msg): void
128 $this->
log->write($msg);
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()
ilPrgCronJobAdapter $adapter
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...