ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilExAssignmentReminder Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. 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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning 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 29 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 54 of file class.ilExAssignmentReminder.php.

58 {
59 global $DIC;
60 $this->db = $DIC->database();
61 $this->tree = $DIC->repositoryTree();
62 $this->access = $DIC->access();
63 $this->log = ilLoggerFactory::getLogger("exc");
64 $this->placeholder_resolver = $DIC->mail()->placeholderResolver();
65
66 if ($a_ass_id) {
67 $this->ass_id = $a_ass_id;
68 }
69 if ($a_exc_id) {
70 $this->exc_id = $a_exc_id;
71 }
72 if ($a_type) {
73 $this->rmd_type = $a_type;
74 }
75 if ($a_exc_id and $a_ass_id and $a_type) {
76 $this->read();
77 }
78 }
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 459 of file class.ilExAssignmentReminder.php.

459 : int
460 {
461 $submit_reminders = $this->getReminders(self::SUBMIT_REMINDER);
462 $parsed_submit_reminders = $this->parseSubmissionReminders($submit_reminders);
463
464 $grade_reminders = $this->getReminders(self::GRADE_REMINDER);
465 $parsed_grade_reminders = $this->parseGradeReminders($grade_reminders);
466
467 $peer_reminders = $this->getReminders(self::FEEDBACK_REMINDER);
468 $parsed_peer_reminders = $this->parsePeerReminders($peer_reminders);
469
470 /* //DEBUG
471 $this->log->debug("ALL SUBMIT REMINDERS");
472 $this->log->dump($submit_reminders);
473 $this->log->debug("PARSED SUBMIT REMINDERS");
474 $this->log->dump($parsed_submit_reminders);
475 $this->log->debug("GRADE REMINDERS ARRAY");
476 $this->log->dump($grade_reminders);
477 $this->log->debug("PARSED GRADE REMINDERS");
478 $this->log->dump($parsed_grade_reminders);
479 $this->log->debug("PEER REMINDERS ARRAY");
480 $this->log->dump($peer_reminders);
481 $this->log->debug("PARSED PEER REMINDERS");
482 $this->log->dump($parsed_peer_reminders);
483 */
484
485 $reminders = array_merge($parsed_submit_reminders, $parsed_grade_reminders, $parsed_peer_reminders);
486
487 return $this->sendReminders($reminders);
488 }
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 621 of file class.ilExAssignmentReminder.php.

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

◆ getReminderEnd()

ilExAssignmentReminder::getReminderEnd ( )

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

115 : int
116 {
117 return $this->rmd_end;
118 }

References $rmd_end.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getReminderFrequency()

ilExAssignmentReminder::getReminderFrequency ( )

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

126 : int
127 {
129 }

References $rmd_frequency.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getReminderLastSend()

ilExAssignmentReminder::getReminderLastSend ( )

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

136 : int
137 {
139 }

References $rmd_last_send.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getReminderMailTemplate()

ilExAssignmentReminder::getReminderMailTemplate ( )

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

146 : int
147 {
148 return $this->rmd_tpl_id;
149 }

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 220 of file class.ilExAssignmentReminder.php.

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

Referenced by checkReminders().

+ Here is the caller graph for this function:

◆ getReminderStart()

ilExAssignmentReminder::getReminderStart ( )

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

105 : int
106 {
107 return $this->rmd_start;
108 }

References $rmd_start.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getReminderStatus()

ilExAssignmentReminder::getReminderStatus ( )

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

94 : ?bool
95 {
96 return $this->rmd_status;
97 }

References $rmd_status.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getReminderType()

ilExAssignmentReminder::getReminderType ( )

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

80 : string
81 {
82 return $this->rmd_type;
83 }

References $rmd_type.

◆ initFromDB()

ilExAssignmentReminder::initFromDB ( array  $a_set)
protected

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

203 : void
204 {
205 $this->setReminderStatus((bool) $a_set["status"]);
206 $this->setReminderStart((int) $a_set["start"]);
207 $this->setReminderEnd((int) $a_set["end"]);
208 $this->setReminderFrequency((int) $a_set["freq"]);
209 $this->setReminderLastSend((int) $a_set["last_send"]);
210 $this->setReminderMailTemplate((int) $a_set["template_id"]);
211 }
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 363 of file class.ilExAssignmentReminder.php.

363 : array
364 {
365 $reminders = $a_reminders;
366 $users_to_remind = array();
367
368 $has_pending_to_grade = false;
369
370 foreach ($reminders as $rem) {
371 //$this->log->debug("---- parse grade reminder with values -> ",$rem);
372 $ass_obj = new ilExAssignment($rem["ass_id"]);
373 $members_data = $ass_obj->getMemberListData();
374
375 //$this->log->debug("--- get members list data => ",$members_data);
376 foreach ($members_data as $assignment_data) {
377 if ($assignment_data["status"] == ilExerciseManagementGUI::GRADE_NOT_GRADED) {
378 //at least there is one submission pending to grade.
379 $has_pending_to_grade = true;
380 }
381 }
382
383 if ($has_pending_to_grade) {
384 //get tutor of this exercise.
386
387 foreach ($users as $user_id) {
388 $exc_refs = ilObject::_getAllReferences($rem["exc_id"]);
389 $unike_usr_id = array();
390 foreach ($exc_refs as $exc_ref) {
391 if ($this->access->checkAccessOfUser($user_id, "write", "", $exc_ref)) {
392 if (!in_array($user_id, $unike_usr_id)) {
393 $member_data = array(
394 "exc_id" => $rem["exc_id"],
395 "exc_ref" => $exc_ref,
396 "ass_id" => $rem["ass_id"],
397 "member_id" => $user_id,
398 "reminder_type" => $rem["type"],
399 "template_id" => $rem["template_id"]
400 );
401 $users_to_remind[] = $member_data;
402 $unike_usr_id[] = $user_id;
403 }
404 }
405 }
406 }
407 }
408 }
409
410 return $users_to_remind;
411 }
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 416 of file class.ilExAssignmentReminder.php.

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

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

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 151 of file class.ilExAssignmentReminder.php.

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

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 490 of file class.ilExAssignmentReminder.php.

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

References $DIC, $message, $rmd_type, 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 573 of file class.ilExAssignmentReminder.php.

577 : string {
578 // see ilMail::replacePlaceholders()
579 try {
580 switch ($a_reminder_type) {
583 break;
586 break;
589 break;
590 default:
591 exit();
592 }
593
594 $user = new ilObjUser($a_reminder_data["member_id"]);
595
596 $a_message = $this->placeholder_resolver->resolve($context, $a_message, $user, $a_reminder_data);
597 } catch (Exception $e) {
598 ilLoggerFactory::getLogger('mail')->error(__METHOD__ . ' has been called with invalid context.');
599 }
600
601 return $a_message;
602 }
User class.
exit
$context
Definition: webdav.php:31

References $context, 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 110 of file class.ilExAssignmentReminder.php.

110 : void
111 {
112 $this->rmd_end = $a_date;
113 }

Referenced by initFromDB().

+ Here is the caller graph for this function:

◆ setReminderFrequency()

ilExAssignmentReminder::setReminderFrequency ( int  $a_num_days)

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

121 : void
122 {
123 $this->rmd_frequency = $a_num_days;
124 }

Referenced by initFromDB().

+ Here is the caller graph for this function:

◆ setReminderLastSend()

ilExAssignmentReminder::setReminderLastSend ( int  $a_timestamp)

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

131 : void
132 {
133 $this->rmd_last_send = $a_timestamp;
134 }

Referenced by initFromDB().

+ Here is the caller graph for this function:

◆ setReminderMailTemplate()

ilExAssignmentReminder::setReminderMailTemplate ( int  $a_tpl_id)

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

141 : void
142 {
143 $this->rmd_tpl_id = $a_tpl_id;
144 }

Referenced by initFromDB().

+ Here is the caller graph for this function:

◆ setReminderStart()

ilExAssignmentReminder::setReminderStart ( int  $a_num_days)

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

100 : void
101 {
102 $this->rmd_start = $a_num_days;
103 }

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 89 of file class.ilExAssignmentReminder.php.

89 : void
90 {
91 $this->rmd_status = $a_status;
92 }

Referenced by initFromDB().

+ Here is the caller graph for this function:

◆ update()

ilExAssignmentReminder::update ( )

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

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

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 605 of file class.ilExAssignmentReminder.php.

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

Referenced by sendReminders().

+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilExAssignmentReminder::$access
protected

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

◆ $ass_id

int ilExAssignmentReminder::$ass_id = 0
protected

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

◆ $db

ilDBInterface ilExAssignmentReminder::$db
protected

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

◆ $exc_id

int ilExAssignmentReminder::$exc_id = 0
protected

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

◆ $log

ilLogger ilExAssignmentReminder::$log
protected

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

◆ $placeholder_resolver

ilMailTemplatePlaceholderResolver ilExAssignmentReminder::$placeholder_resolver
private

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

◆ $rmd_end

int ilExAssignmentReminder::$rmd_end = 0
protected

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

Referenced by getReminderEnd().

◆ $rmd_frequency

int ilExAssignmentReminder::$rmd_frequency = 0
protected

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

Referenced by getReminderFrequency().

◆ $rmd_last_send

int ilExAssignmentReminder::$rmd_last_send = 0
protected

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

Referenced by getReminderLastSend().

◆ $rmd_start

int ilExAssignmentReminder::$rmd_start = 0
protected

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

Referenced by getReminderStart().

◆ $rmd_status

bool ilExAssignmentReminder::$rmd_status = null
protected

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

Referenced by getReminderStatus().

◆ $rmd_tpl_id

int ilExAssignmentReminder::$rmd_tpl_id = 0
protected

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

Referenced by getReminderMailTemplate().

◆ $rmd_type

string ilExAssignmentReminder::$rmd_type = ""
protected

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

Referenced by getReminderType(), and sendReminders().

◆ $tree

ilTree ilExAssignmentReminder::$tree
protected

Definition at line 36 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: