ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilExAssignmentReminder Class Reference

TODO: import/export reminder data with the exercise/assignment. More...

+ Collaboration diagram for ilExAssignmentReminder:

Public Member Functions

 __construct (int $a_exc_id=0, int $a_ass_id=0, string $a_type="")
 
 getReminderType ()
 
 setReminderStatus (?bool $a_status)
 Set reminder for users without submission. More...
 
 getReminderStatus ()
 
 setReminderStart (int $a_num_days)
 
 getReminderStart ()
 
 setReminderEnd (int $a_date)
 
 getReminderEnd ()
 
 setReminderFrequency (int $a_num_days)
 
 getReminderFrequency ()
 
 setReminderLastSend (int $a_timestamp)
 
 getReminderLastSend ()
 
 setReminderMailTemplate (int $a_tpl_id)
 
 getReminderMailTemplate ()
 
 save ()
 
 update ()
 
 read ()
 
 getReminders (string $a_type="")
 Get reminders available by date/frequence. More...
 
 parseGradeReminders (array $a_reminders)
 
 parsePeerReminders (array $a_reminders)
 
 checkReminders ()
 
 deleteReminders (int $a_ass_id)
 

Data Fields

const SUBMIT_REMINDER = "submit"
 
const GRADE_REMINDER = "grade"
 
const FEEDBACK_REMINDER = "peer"
 

Protected Member Functions

 initFromDB (array $a_set)
 
 sendReminders (array $reminders)
 
 sentReminderPlaceholders (string $a_message, array $a_reminder_data, string $a_reminder_type)
 
 updateRemindersLastDate (array $a_reminders)
 

Protected Attributes

ilDBInterface $db
 
ilTree $tree
 
bool $rmd_status = null
 
int $rmd_start = 0
 
int $rmd_end = 0
 
int $rmd_frequency = 0
 
int $rmd_last_send = 0
 
int $rmd_tpl_id = 0
 
int $ass_id = 0
 
int $exc_id = 0
 
string $rmd_type = ""
 
ilLogger $log
 
ilAccessHandler $access
 

Private Attributes

ilMailTemplatePlaceholderResolver $placeholder_resolver
 

Detailed Description

TODO: import/export reminder data with the exercise/assignment.

TODO: Delete reminders from exc_ass_reminders when the assignment is deleted.

Exercise Assignment Reminders

Author
Jesús López lopez.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 31 of file class.ilExAssignmentReminder.php.

Constructor & Destructor Documentation

◆ __construct()

ilExAssignmentReminder::__construct ( int  $a_exc_id = 0,
int  $a_ass_id = 0,
string  $a_type = "" 
)

Definition at line 56 of file class.ilExAssignmentReminder.php.

60 {
61 global $DIC;
62 $this->db = $DIC->database();
63 $this->tree = $DIC->repositoryTree();
64 $this->access = $DIC->access();
65 $this->log = ilLoggerFactory::getLogger("exc");
66 $this->placeholder_resolver = $DIC->mail()->placeholderResolver();
67
68 if ($a_ass_id) {
69 $this->ass_id = $a_ass_id;
70 }
71 if ($a_exc_id) {
72 $this->exc_id = $a_exc_id;
73 }
74 if ($a_type) {
75 $this->rmd_type = $a_type;
76 }
77 if ($a_exc_id and $a_ass_id and $a_type) {
78 $this->read();
79 }
80 }
static getLogger(string $a_component_id)
Get component logger.
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\Repository\access(), ilLoggerFactory\getLogger(), and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkReminders()

ilExAssignmentReminder::checkReminders ( )
Returns
int number of reminders sent
Exceptions
ilExcUnknownAssignmentTypeException
Exception

Definition at line 461 of file class.ilExAssignmentReminder.php.

461 : int
462 {
463 $submit_reminders = $this->getReminders(self::SUBMIT_REMINDER);
464 $parsed_submit_reminders = $this->parseSubmissionReminders($submit_reminders);
465
466 $grade_reminders = $this->getReminders(self::GRADE_REMINDER);
467 $parsed_grade_reminders = $this->parseGradeReminders($grade_reminders);
468
469 $peer_reminders = $this->getReminders(self::FEEDBACK_REMINDER);
470 $parsed_peer_reminders = $this->parsePeerReminders($peer_reminders);
471
472 /* //DEBUG
473 $this->log->debug("ALL SUBMIT REMINDERS");
474 $this->log->dump($submit_reminders);
475 $this->log->debug("PARSED SUBMIT REMINDERS");
476 $this->log->dump($parsed_submit_reminders);
477 $this->log->debug("GRADE REMINDERS ARRAY");
478 $this->log->dump($grade_reminders);
479 $this->log->debug("PARSED GRADE REMINDERS");
480 $this->log->dump($parsed_grade_reminders);
481 $this->log->debug("PEER REMINDERS ARRAY");
482 $this->log->dump($peer_reminders);
483 $this->log->debug("PARSED PEER REMINDERS");
484 $this->log->dump($parsed_peer_reminders);
485 */
486
487 $reminders = array_merge($parsed_submit_reminders, $parsed_grade_reminders, $parsed_peer_reminders);
488
489 return $this->sendReminders($reminders);
490 }
getReminders(string $a_type="")
Get reminders available by date/frequence.

References getReminders(), parseGradeReminders(), parsePeerReminders(), and sendReminders().

+ Here is the call graph for this function:

◆ deleteReminders()

ilExAssignmentReminder::deleteReminders ( int  $a_ass_id)

Definition at line 623 of file class.ilExAssignmentReminder.php.

623 : void
624 {
625 $sql = "DELETE FROM exc_ass_reminders" .
626 " WHERE ass_id = " . $a_ass_id;
627
628 $this->db->manipulate($sql);
629 }

◆ getReminderEnd()

ilExAssignmentReminder::getReminderEnd ( )

Definition at line 117 of file class.ilExAssignmentReminder.php.

117 : int
118 {
119 return $this->rmd_end;
120 }

References $rmd_end.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getReminderFrequency()

ilExAssignmentReminder::getReminderFrequency ( )

Definition at line 128 of file class.ilExAssignmentReminder.php.

128 : int
129 {
131 }

References $rmd_frequency.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getReminderLastSend()

ilExAssignmentReminder::getReminderLastSend ( )

Definition at line 138 of file class.ilExAssignmentReminder.php.

138 : int
139 {
141 }

References $rmd_last_send.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getReminderMailTemplate()

ilExAssignmentReminder::getReminderMailTemplate ( )

Definition at line 148 of file class.ilExAssignmentReminder.php.

148 : int
149 {
150 return $this->rmd_tpl_id;
151 }

References $rmd_tpl_id.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getReminders()

ilExAssignmentReminder::getReminders ( string  $a_type = "")

Get reminders available by date/frequence.

Exceptions
Exception

Definition at line 222 of file class.ilExAssignmentReminder.php.

222 : array
223 {
224 $now = time();
225 $today = date("Y-m-d");
226
227 $this->log->debug("Get reminders $a_type.");
228
229 //remove time from the timestamp (86400 = 24h)
230 //$now = floor($now/86400)*86400;
231 $and_type = "";
232 if ($a_type == self::SUBMIT_REMINDER || $a_type == self::GRADE_REMINDER || $a_type == self::FEEDBACK_REMINDER) {
233 $and_type = " AND type = '" . $a_type . "'";
234 }
235
236 $query = "SELECT last_send_day, ass_id, exc_id, status, start, freq, end, type, last_send, template_id" .
237 " FROM exc_ass_reminders" .
238 " WHERE status = 1" .
239 " AND start <= " . $now .
240 " AND end > " . ($now - 86400) .
241 $and_type;
242
243
244 $result = $this->db->query($query);
245
246 $array_data = array();
247 while ($rec = $this->db->fetchAssoc($result)) {
248 $rem = array(
249 "ass_id" => $rec["ass_id"],
250 "exc_id" => $rec["exc_id"],
251 "start" => $rec["start"],
252 "end" => $rec["end"],
253 "freq" => $rec["freq"],
254 "type" => $rec["type"],
255 "last_send" => $rec["last_send"],
256 "last_send_day" => $rec["last_send_day"],
257 "template_id" => $rec["template_id"]
258 );
259
260 $end_day = date("Y-m-d", $rec["end"]);
261
262 //frequency
263 $next_send = "";
264 if ($rec["last_send_day"] != "") {
265 $date = new DateTime($rec["last_send_day"]);
266 $date->add(new DateInterval('P' . $rec["freq"] . 'D'));
267 $next_send = $date->format('Y-m-d');
268 }
269 $this->log->debug("ass: " . $rec["ass_id"] . ", last send: " . $rec["last_send_day"] .
270 ", freq: " . $rec["freq"] . ", end_day: $end_day, today: " . $today . ", next send: $next_send");
271 if ($rec["last_send_day"] == "" || $next_send <= $today) {
272 if ($end_day >= $today) {
273 $this->log->debug("included");
274 $array_data[] = $rem;
275 }
276 }
277 }
278
279 return $array_data;
280 }

References ILIAS\UI\examples\Symbol\Glyph\Date\date().

Referenced by checkReminders().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getReminderStart()

ilExAssignmentReminder::getReminderStart ( )

Definition at line 107 of file class.ilExAssignmentReminder.php.

107 : int
108 {
109 return $this->rmd_start;
110 }

References $rmd_start.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getReminderStatus()

ilExAssignmentReminder::getReminderStatus ( )

Definition at line 96 of file class.ilExAssignmentReminder.php.

96 : ?bool
97 {
98 return $this->rmd_status;
99 }

References $rmd_status.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getReminderType()

ilExAssignmentReminder::getReminderType ( )

Definition at line 82 of file class.ilExAssignmentReminder.php.

82 : string
83 {
84 return $this->rmd_type;
85 }

References $rmd_type.

◆ initFromDB()

ilExAssignmentReminder::initFromDB ( array  $a_set)
protected

Definition at line 205 of file class.ilExAssignmentReminder.php.

205 : void
206 {
207 $this->setReminderStatus((bool) $a_set["status"]);
208 $this->setReminderStart((int) $a_set["start"]);
209 $this->setReminderEnd((int) $a_set["end"]);
210 $this->setReminderFrequency((int) $a_set["freq"]);
211 $this->setReminderLastSend((int) $a_set["last_send"]);
212 $this->setReminderMailTemplate((int) $a_set["template_id"]);
213 }
setReminderStatus(?bool $a_status)
Set reminder for users without submission.

References setReminderEnd(), setReminderFrequency(), setReminderLastSend(), setReminderMailTemplate(), setReminderStart(), and setReminderStatus().

Referenced by read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseGradeReminders()

ilExAssignmentReminder::parseGradeReminders ( array  $a_reminders)
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 365 of file class.ilExAssignmentReminder.php.

365 : array
366 {
367 $reminders = $a_reminders;
368 $users_to_remind = array();
369
370 $has_pending_to_grade = false;
371
372 foreach ($reminders as $rem) {
373 //$this->log->debug("---- parse grade reminder with values -> ",$rem);
374 $ass_obj = new ilExAssignment($rem["ass_id"]);
375 $members_data = $ass_obj->getMemberListData();
376
377 //$this->log->debug("--- get members list data => ",$members_data);
378 foreach ($members_data as $assignment_data) {
379 if ($assignment_data["status"] == ilExerciseManagementGUI::GRADE_NOT_GRADED) {
380 //at least there is one submission pending to grade.
381 $has_pending_to_grade = true;
382 }
383 }
384
385 if ($has_pending_to_grade) {
386 //get tutor of this exercise.
388
389 foreach ($users as $user_id) {
390 $exc_refs = ilObject::_getAllReferences($rem["exc_id"]);
391 $unike_usr_id = array();
392 foreach ($exc_refs as $exc_ref) {
393 if ($this->access->checkAccessOfUser($user_id, "write", "", $exc_ref)) {
394 if (!in_array($user_id, $unike_usr_id)) {
395 $member_data = array(
396 "exc_id" => $rem["exc_id"],
397 "exc_ref" => $exc_ref,
398 "ass_id" => $rem["ass_id"],
399 "member_id" => $user_id,
400 "reminder_type" => $rem["type"],
401 "template_id" => $rem["template_id"]
402 );
403 $users_to_remind[] = $member_data;
404 $unike_usr_id[] = $user_id;
405 }
406 }
407 }
408 }
409 }
410 }
411
412 return $users_to_remind;
413 }
Exercise assignment.
static getNotificationsForObject(int $type, int $id, ?int $page_id=null, bool $ignore_threshold=false)
Get all users/recipients for given object.
static _getAllReferences(int $id)
get all reference ids for object ID

References $user_id, ilObject\_getAllReferences(), ILIAS\Repository\access(), ilNotification\getNotificationsForObject(), ilExerciseManagementGUI\GRADE_NOT_GRADED, and ilNotification\TYPE_EXERCISE_SUBMISSION.

Referenced by checkReminders().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parsePeerReminders()

ilExAssignmentReminder::parsePeerReminders ( array  $a_reminders)
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 418 of file class.ilExAssignmentReminder.php.

418 : array
419 {
420 $reminders = $a_reminders;
421 $users_to_remind = array();
422
423 $this->log->debug("Peer Reminders: " . count($a_reminders));
424
425 foreach ($reminders as $reminder) {
426 $this->log->debug("Init peer review: " . $reminder["ass_id"]);
427 $pr = new ilExPeerReview(new ilExAssignment($reminder["ass_id"]));
428 $pr->initPeerReviews();
429 $giver_ids = array_unique(ilExPeerReview::lookupGiversWithPendingFeedback($reminder["ass_id"]));
430 foreach ($giver_ids as $giver_id) {
431 $state = ilExcAssMemberState::getInstanceByIds($reminder["ass_id"], $giver_id);
432 $days_diff = (($state->getPeerReviewDeadline() - time()) / (60 * 60 * 24));
433
434 if ($state->isPeerReviewAllowed() && $days_diff < $reminder["start"]) {
435 $exc_refs = ilObject::_getAllReferences($reminder["exc_id"]);
436 foreach ($exc_refs as $exc_ref) {
437 if ($this->access->checkAccessOfUser($giver_id, "read", "", $exc_ref)) {
438 $member_data = array(
439 "exc_id" => $reminder["exc_id"],
440 "exc_ref" => $exc_ref,
441 "ass_id" => $reminder["ass_id"],
442 "member_id" => $giver_id,
443 "reminder_type" => $reminder["type"],
444 "template_id" => $reminder["template_id"]
445 );
446 $users_to_remind[] = $member_data;
447 }
448 }
449 }
450 }
451 }
452
453 return $users_to_remind;
454 }
Exercise peer review.
static lookupGiversWithPendingFeedback(int $a_ass_id)
static getInstanceByIds(int $a_ass_id, int $a_user_id=0)

References ilObject\_getAllReferences(), ILIAS\Repository\access(), ilExcAssMemberState\getInstanceByIds(), and ilExPeerReview\lookupGiversWithPendingFeedback().

Referenced by checkReminders().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilExAssignmentReminder::read ( )

Definition at line 189 of file class.ilExAssignmentReminder.php.

189 : void
190 {
191 $set = $this->db->queryF(
192 "SELECT status, start, freq, end, last_send, template_id" .
193 " FROM exc_ass_reminders" .
194 " WHERE type = %s AND ass_id = %s AND exc_id = %s",
195 ["text", "integer", "integer"],
196 [$this->rmd_type, $this->ass_id, $this->exc_id]
197 );
198
199 $rec = $this->db->fetchAssoc($set);
200 if (is_array($rec)) {
201 $this->initFromDB($rec);
202 }
203 }

References initFromDB().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilExAssignmentReminder::save ( )

Definition at line 153 of file class.ilExAssignmentReminder.php.

153 : void
154 {
155 $this->db->insert("exc_ass_reminders", array(
156 "type" => array("text", $this->rmd_type),
157 "ass_id" => array("integer", $this->ass_id),
158 "exc_id" => array("integer", $this->exc_id),
159 "status" => array("integer", $this->getReminderStatus()),
160 "start" => array("integer", $this->getReminderStart()),
161 "end" => array("integer", $this->getReminderEnd()),
162 "freq" => array("integer", $this->getReminderFrequency()),
163 "last_send" => array("integer", $this->getReminderLastSend()),
164 "template_id" => array("integer", $this->getReminderMailTemplate())
165 ));
166 }

References getReminderEnd(), getReminderFrequency(), getReminderLastSend(), getReminderMailTemplate(), getReminderStart(), and getReminderStatus().

+ Here is the call graph for this function:

◆ sendReminders()

ilExAssignmentReminder::sendReminders ( array  $reminders)
protected

Definition at line 492 of file class.ilExAssignmentReminder.php.

492 : int
493 {
494 global $DIC;
495
496 $tpl = null;
497
498 foreach ($reminders as $reminder) {
499 $template_id = $reminder['template_id'];
500
501 $rmd_type = $reminder["reminder_type"];
502 $this->log->debug("Sending reminder type = " . $rmd_type);
503
504 //if the template exists (can be deleted via Administration/Mail)
505 if ($template_id) {
506 $templateService = $DIC->mail()->textTemplates();
507 $tpl = $templateService->loadTemplateForId((int) $template_id);
508 }
509 $subject = "";
510 if ($tpl) {
511 $this->log->debug("** send reminder WITH template.");
512 $subject = $tpl->getSubject();
513
514 $placeholder_params = array(
515 "exc_id" => $reminder["exc_id"],
516 "exc_ref" => $reminder["exc_ref"],
517 "ass_id" => $reminder["ass_id"],
518 "member_id" => $reminder["member_id"]
519 );
520 $message = $this->sentReminderPlaceholders($tpl->getMessage(), $placeholder_params, $rmd_type);
521 } else {
522 $this->log->debug("** send reminder WITHOUT template.");
523
524 $ass_title = ilExAssignment::lookupTitle($reminder["ass_id"]);
525 $exc_title = ilObjExercise::_lookupTitle($reminder["exc_id"]);
526
527 // use language of recipient to compose message
528 $ulng = ilLanguageFactory::_getLanguageOfUser($reminder["member_id"]);
529 $ulng->loadLanguageModule('exc');
530
531 $link = ilLink::_getLink($reminder["exc_ref"], "exc", array(), "_" . $reminder["ass_id"]);
532
533 $message = sprintf($ulng->txt('exc_reminder_salutation'), ilObjUser::_lookupFullname($reminder["member_id"])) . "\n\n";
534
535 $this->log->debug("send: MAIL TYPE = " . $rmd_type . ", user: " . $reminder["member_id"] . ", ass: " . $reminder["ass_id"]);
536
537 switch ($rmd_type) {
538 case "submit":
539 $subject = sprintf($ulng->txt('exc_reminder_submit_subject'), $ass_title);
540 $message .= $ulng->txt('exc_reminder_submit_body') . ":\n\n";
541 break;
542
543 case "grade":
544 $subject = sprintf($ulng->txt('exc_reminder_grade_subject'), $ass_title);
545 $message .= $ulng->txt('exc_reminder_grade_body') . ":\n\n";
546 break;
547
548 case "peer":
549 $subject = sprintf($ulng->txt('exc_reminder_peer_subject'), $ass_title);
550 $message .= $ulng->txt('exc_reminder_peer_body') . ":\n\n";
551 break;
552 }
553
554 $message .= $ulng->txt('obj_exc') . ": " . $exc_title . "\n";
555 $message .= $ulng->txt('obj_ass') . ": " . $ass_title . "\n";
556 $message .= "\n" . $ulng->txt('exc_reminder_link') . ": " . $link;
557 }
558 $mail_obj = new ilMail(ANONYMOUS_USER_ID);
559 $mail_obj->appendInstallationSignature(true);
560 $mail_obj->enqueue(
561 ilObjUser::_lookupLogin($reminder["member_id"]),
562 "",
563 "",
564 $subject,
565 $message,
566 MailAttachments::empty()
567 );
568 }
569
570 $this->updateRemindersLastDate($reminders);
571 return count($reminders);
572 }
sentReminderPlaceholders(string $a_message, array $a_reminder_data, string $a_reminder_type)
updateRemindersLastDate(array $a_reminders)
static lookupTitle(int $a_id)
static _getLanguageOfUser(int $a_usr_id)
Get language object of user.
static _lookupFullname(int $a_user_id)
static _lookupLogin(int $a_user_id)
static _lookupTitle(int $obj_id)
const ANONYMOUS_USER_ID
Definition: constants.php:27
readonly ilGlobalTemplateInterface $tpl

References $DIC, $message, $rmd_type, ILIAS\News\Common\Table\$tpl, ilLanguageFactory\_getLanguageOfUser(), ilObjUser\_lookupFullname(), ilObjUser\_lookupLogin(), ilObject\_lookupTitle(), ANONYMOUS_USER_ID, ilExAssignment\lookupTitle(), sentReminderPlaceholders(), and updateRemindersLastDate().

Referenced by checkReminders().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sentReminderPlaceholders()

ilExAssignmentReminder::sentReminderPlaceholders ( string  $a_message,
array  $a_reminder_data,
string  $a_reminder_type 
)
protected

Definition at line 575 of file class.ilExAssignmentReminder.php.

579 : string {
580 // see ilMail::replacePlaceholders()
581 try {
582 switch ($a_reminder_type) {
585 break;
588 break;
591 break;
592 default:
593 exit();
594 }
595
596 $user = new ilObjUser($a_reminder_data["member_id"]);
597
598 $a_message = $this->placeholder_resolver->resolve($context, $a_message, $user, $a_reminder_data);
599 } catch (Exception $e) {
600 ilLoggerFactory::getLogger('mail')->error(__METHOD__ . ' has been called with invalid context.');
601 }
602
603 return $a_message;
604 }
User class.
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References exit, FEEDBACK_REMINDER, ilMailTemplateContextService\getTemplateContextById(), GRADE_REMINDER, ilExcMailTemplateGradeReminderContext\ID, ilExcMailTemplatePeerReminderContext\ID, ilExcMailTemplateSubmitReminderContext\ID, and SUBMIT_REMINDER.

Referenced by sendReminders().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setReminderEnd()

ilExAssignmentReminder::setReminderEnd ( int  $a_date)

Definition at line 112 of file class.ilExAssignmentReminder.php.

112 : void
113 {
114 $this->rmd_end = $a_date;
115 }

Referenced by initFromDB().

+ Here is the caller graph for this function:

◆ setReminderFrequency()

ilExAssignmentReminder::setReminderFrequency ( int  $a_num_days)

Definition at line 123 of file class.ilExAssignmentReminder.php.

123 : void
124 {
125 $this->rmd_frequency = $a_num_days;
126 }

Referenced by initFromDB().

+ Here is the caller graph for this function:

◆ setReminderLastSend()

ilExAssignmentReminder::setReminderLastSend ( int  $a_timestamp)

Definition at line 133 of file class.ilExAssignmentReminder.php.

133 : void
134 {
135 $this->rmd_last_send = $a_timestamp;
136 }

Referenced by initFromDB().

+ Here is the caller graph for this function:

◆ setReminderMailTemplate()

ilExAssignmentReminder::setReminderMailTemplate ( int  $a_tpl_id)

Definition at line 143 of file class.ilExAssignmentReminder.php.

143 : void
144 {
145 $this->rmd_tpl_id = $a_tpl_id;
146 }

Referenced by initFromDB().

+ Here is the caller graph for this function:

◆ setReminderStart()

ilExAssignmentReminder::setReminderStart ( int  $a_num_days)

Definition at line 102 of file class.ilExAssignmentReminder.php.

102 : void
103 {
104 $this->rmd_start = $a_num_days;
105 }

Referenced by initFromDB().

+ Here is the caller graph for this function:

◆ setReminderStatus()

ilExAssignmentReminder::setReminderStatus ( ?bool  $a_status)

Set reminder for users without submission.

Parameters
bool$a_statusactivated?

Definition at line 91 of file class.ilExAssignmentReminder.php.

91 : void
92 {
93 $this->rmd_status = $a_status;
94 }

Referenced by initFromDB().

+ Here is the caller graph for this function:

◆ update()

ilExAssignmentReminder::update ( )

Definition at line 168 of file class.ilExAssignmentReminder.php.

168 : void
169 {
170 $this->db->update(
171 "exc_ass_reminders",
172 array(
173 "status" => array("integer", $this->getReminderStatus()),
174 "start" => array("integer", $this->getReminderStart()),
175 "end" => array("integer", $this->getReminderEnd()),
176 "freq" => array("integer", $this->getReminderFrequency()),
177 "last_send" => array("integer", $this->getReminderLastSend()),
178 "template_id" => array("integer", $this->getReminderMailTemplate())
179 ),
180 array(
181 "type" => array("text", $this->rmd_type),
182 "exc_id" => array("integer", $this->exc_id),
183 "ass_id" => array("integer", $this->ass_id)
184 )
185 );
186 }

References getReminderEnd(), getReminderFrequency(), getReminderLastSend(), getReminderMailTemplate(), getReminderStart(), and getReminderStatus().

+ Here is the call graph for this function:

◆ updateRemindersLastDate()

ilExAssignmentReminder::updateRemindersLastDate ( array  $a_reminders)
protected

Definition at line 607 of file class.ilExAssignmentReminder.php.

607 : void
608 {
609 $today = date("Y-m-d");
610 foreach ($a_reminders as $reminder) {
611 $sql = "UPDATE exc_ass_reminders" .
612 " SET last_send = " . $this->db->quote(time(), 'integer') .
613 " , last_send_day = " . $this->db->quote($today, 'date') .
614 " WHERE type = " . $this->db->quote($reminder["reminder_type"], 'text') .
615 " AND ass_id = " . $this->db->quote($reminder["ass_id"], 'integer') .
616 " AND exc_id = " . $this->db->quote($reminder["exc_id"], 'integer');
617
618 $this->db->manipulate($sql);
619 }
620 }

References ILIAS\UI\examples\Symbol\Glyph\Date\date().

Referenced by sendReminders().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilExAssignmentReminder::$access
protected

Definition at line 52 of file class.ilExAssignmentReminder.php.

◆ $ass_id

int ilExAssignmentReminder::$ass_id = 0
protected

Definition at line 47 of file class.ilExAssignmentReminder.php.

◆ $db

ilDBInterface ilExAssignmentReminder::$db
protected

Definition at line 37 of file class.ilExAssignmentReminder.php.

◆ $exc_id

int ilExAssignmentReminder::$exc_id = 0
protected

Definition at line 48 of file class.ilExAssignmentReminder.php.

◆ $log

ilLogger ilExAssignmentReminder::$log
protected

Definition at line 51 of file class.ilExAssignmentReminder.php.

◆ $placeholder_resolver

ilMailTemplatePlaceholderResolver ilExAssignmentReminder::$placeholder_resolver
private

Definition at line 53 of file class.ilExAssignmentReminder.php.

◆ $rmd_end

int ilExAssignmentReminder::$rmd_end = 0
protected

Definition at line 42 of file class.ilExAssignmentReminder.php.

Referenced by getReminderEnd().

◆ $rmd_frequency

int ilExAssignmentReminder::$rmd_frequency = 0
protected

Definition at line 43 of file class.ilExAssignmentReminder.php.

Referenced by getReminderFrequency().

◆ $rmd_last_send

int ilExAssignmentReminder::$rmd_last_send = 0
protected

Definition at line 44 of file class.ilExAssignmentReminder.php.

Referenced by getReminderLastSend().

◆ $rmd_start

int ilExAssignmentReminder::$rmd_start = 0
protected

Definition at line 41 of file class.ilExAssignmentReminder.php.

Referenced by getReminderStart().

◆ $rmd_status

bool ilExAssignmentReminder::$rmd_status = null
protected

Definition at line 40 of file class.ilExAssignmentReminder.php.

Referenced by getReminderStatus().

◆ $rmd_tpl_id

int ilExAssignmentReminder::$rmd_tpl_id = 0
protected

Definition at line 45 of file class.ilExAssignmentReminder.php.

Referenced by getReminderMailTemplate().

◆ $rmd_type

string ilExAssignmentReminder::$rmd_type = ""
protected

Definition at line 49 of file class.ilExAssignmentReminder.php.

Referenced by getReminderType(), and sendReminders().

◆ $tree

ilTree ilExAssignmentReminder::$tree
protected

Definition at line 38 of file class.ilExAssignmentReminder.php.

◆ FEEDBACK_REMINDER

◆ GRADE_REMINDER

const ilExAssignmentReminder::GRADE_REMINDER = "grade"

◆ SUBMIT_REMINDER

const ilExAssignmentReminder::SUBMIT_REMINDER = "submit"

The documentation for this class was generated from the following file: