Skip to content

Commit 4add4b1

Browse files
committed
Component/Exercise: contribute cron jobs
1 parent 31e3d97 commit 4add4b1

4 files changed

Lines changed: 10 additions & 23 deletions

File tree

components/ILIAS/Exercise/Exercise.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,15 @@ public function init(
4242
new Component\Resource\ComponentJS($this, "ilExcPresentation.js");
4343
$contribute[Component\Resource\PublicAsset::class] = fn() =>
4444
new Component\Resource\ComponentJS($this, "ilExcPeerReview.js");
45+
$contribute[\ILIAS\Cron\CronJob::class] = static fn() =>
46+
new \ilExcCronFeedbackNotification(
47+
'components\\' . self::class,
48+
$use[\ILIAS\Language\Language::class]
49+
);
50+
$contribute[\ILIAS\Cron\CronJob::class] = static fn() =>
51+
new \ilExcCronReminders(
52+
'components\\' . self::class,
53+
$use[\ILIAS\Language\Language::class]
54+
);
4555
}
4656
}

components/ILIAS/Exercise/classes/class.ilExcCronFeedbackNotification.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@
2626
*/
2727
class ilExcCronFeedbackNotification extends ilCronJob
2828
{
29-
protected ilLanguage $lng;
30-
31-
32-
public function __construct()
33-
{
34-
global $DIC;
35-
36-
$this->lng = $DIC->language();
37-
}
38-
3929
public function getId(): string
4030
{
4131
return "exc_feedback_notification";

components/ILIAS/Exercise/classes/class.ilExcCronReminders.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,6 @@
2626
*/
2727
class ilExcCronReminders extends ilCronJob
2828
{
29-
protected ilLanguage $lng;
30-
31-
public function __construct()
32-
{
33-
global $DIC;
34-
35-
$this->lng = $DIC->language();
36-
}
37-
3829
public function getId(): string
3930
{
4031
return "exc_reminders";

components/ILIAS/Exercise/module.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525
<parent id="wfld">wfld</parent>
2626
</object>
2727
</objects>
28-
<crons>
29-
<cron id="exc_feedback_notification" class="ilExcCronFeedbackNotification" />
30-
<cron id="exc_reminders" class="ilExcCronReminders" />
31-
</crons>
3228
<mailtemplates>
3329
<context id="exc_context_submit_rmd" class="ilExcMailTemplateSubmitReminderContext" />
3430
<context id="exc_context_grade_rmd" class="ilExcMailTemplateGradeReminderContext" />

0 commit comments

Comments
 (0)