ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestManScoringParticipantNotification Class Reference

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

+ Inheritance diagram for ilTestManScoringParticipantNotification:
+ Collaboration diagram for ilTestManScoringParticipantNotification:

Public Member Functions

 __construct ($userId, $testRefId)
 
 send ()
 
- Public Member Functions inherited from ilMailNotification
 __construct (bool $a_is_personal_workspace=false)
 
 setType (int $a_type)
 
 getType ()
 
 setSender (int $a_usr_id)
 
 getSender ()
 
 setRecipients (array $a_rcp)
 
 getRecipients ()
 
 setAttachments (array $a_att)
 
 getAttachments ()
 
 setLangModules (array $a_modules)
 
 getUserLanguage (int $a_usr_id)
 
 setRefId (int $a_id)
 
 getRefId ()
 
 getObjId ()
 
 setObjId (int $a_obj_id)
 
 getObjType ()
 
 setAdditionalInformation (array $a_info)
 
 getAdditionalInformation ()
 
 sendMail (array $a_rcp, bool $a_parse_recipients=true)
 
 getBlockBorder ()
 

Private Member Functions

 buildSubject ()
 
 buildBody ()
 
 setRecipient ($userId)
 
 getRecipient ()
 
 convertFeedbackForMail ($feedback)
 

Additional Inherited Members

- Data Fields inherited from ilMailNotification
const SUBJECT_TITLE_LENGTH = 60
 
- Protected Member Functions inherited from ilMailNotification
 setSubject (string $a_subject)
 
 getSubject ()
 
 setBody (string $a_body)
 
 appendBody (string $a_body)
 
 getBody ()
 
 initLanguage (int $a_usr_id)
 
 initLanguageByIso2Code (string $a_code='')
 
 setLanguage (ilLanguage $a_language)
 
 getLanguage ()
 
 getLanguageText (string $a_keyword)
 
 getObjectTitle (bool $a_shorten=false)
 
 initMail ()
 
 getMail ()
 
 createPermanentLink (array $a_params=[], string $a_append='')
 
 userToString (int $a_usr_id)
 
 isRefIdAccessible (int $a_user_id, int $a_ref_id, string $a_permission="read")
 
- Protected Attributes inherited from ilMailNotification
int $type
 
int $sender
 
ilMail $mail = null
 
string $subject = ''
 
string $body = ''
 
array $attachments = []
 
ilLanguage $language
 
array $lang_modules = []
 
array $recipients = []
 
int $ref_id
 
int $obj_id = 0
 
string $obj_type = ''
 
array $additional_info = []
 
bool $is_in_wsp
 
ilWorkspaceTree $wsp_tree
 
ilWorkspaceAccessHandler $wsp_access_handler
 

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

Definition at line 19 of file class.ilTestManScoringParticipantNotification.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestManScoringParticipantNotification::__construct (   $userId,
  $testRefId 
)

Member Function Documentation

◆ buildBody()

ilTestManScoringParticipantNotification::buildBody ( )
private

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

References ilMailNotification\appendBody(), convertFeedbackForMail(), ilMailNotification\getAdditionalInformation(), ilMailNotification\getLanguage(), ilMailNotification\getLanguageText(), ilMailNotification\getMail(), getRecipient(), ilMail\getSalutation(), and ilMailNotification\setBody().

Referenced by send().

52  : void
53  {
54  // Salutation
55 
56  $this->setBody(
58  );
59  $this->appendBody("\n\n");
60 
61  // Message (What has happened?)
62 
63  $this->appendBody($this->getLanguageText('tst_notify_manscoring_done_body_msg_topic'));
64  $this->appendBody("\n\n");
65 
66  $info = $this->getAdditionalInformation();
67 
68  $this->appendBody($this->getLanguageText('obj_tst') . ': ' . $info['test_title']);
69  $this->appendBody("\n");
70  $this->appendBody($this->getLanguageText('pass') . ': ' . $info['test_pass']);
71  $this->appendBody("\n\n");
72 
73  foreach ($info['questions_gui_list'] as $questionId => $questionGui) {
74  $points = $info['questions_scoring_data'][$questionId]['points'];
75  $feedback = $info['questions_scoring_data'][$questionId]['feedback'];
76 
77  $feedback = $this->convertFeedbackForMail($feedback);
78 
79  $this->appendBody($this->getLanguageText('tst_question') . ': ' . $questionGui->object->getTitleForHTMLOutput());
80  $this->appendBody("\n");
81  $this->appendBody($this->getLanguageText('tst_reached_points') . ': ' . $points);
82  $this->appendBody("\n");
83  $this->appendBody($this->getLanguageText('set_manual_feedback') . ":\n" . $feedback);
84  $this->appendBody("\n\n");
85  }
86 
87  // Task (What do I have to do?
88 
89  /* NOTHING REQUIRED FOR PARTICIPANT */
90 
91  // Explanation (Why do I receive the following message?)
92 
93  $this->appendBody("\n");
94  $this->appendBody($this->getLanguageText('tst_notify_manscoring_done_body_msg_reason'));
95 
96  // Signature
97 
98  $this->getMail()->appendInstallationSignature(true);
99  }
static getSalutation(int $a_usr_id, ?ilLanguage $a_language=null)
getLanguageText(string $a_keyword)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildSubject()

ilTestManScoringParticipantNotification::buildSubject ( )
private

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

References ilMailNotification\getAdditionalInformation(), ilMailNotification\getLanguageText(), and ilMailNotification\setSubject().

Referenced by send().

45  : void
46  {
47  $info = $this->getAdditionalInformation();
48 
49  $this->setSubject(sprintf($this->getLanguageText('tst_notify_manscoring_done_body_msg_subject'), $info['test_title']));
50  }
getLanguageText(string $a_keyword)
setSubject(string $a_subject)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ convertFeedbackForMail()

ilTestManScoringParticipantNotification::convertFeedbackForMail (   $feedback)
private

Definition at line 111 of file class.ilTestManScoringParticipantNotification.php.

Referenced by buildBody().

111  : ?string
112  {
113  if (strip_tags($feedback) != $feedback) {
114  $feedback = preg_replace('/<br(.*\/)>/m', "\n", $feedback);
115  $feedback = strip_tags($feedback);
116  }
117 
118  return $feedback;
119  }
+ Here is the caller graph for this function:

◆ getRecipient()

ilTestManScoringParticipantNotification::getRecipient ( )
private

Definition at line 106 of file class.ilTestManScoringParticipantNotification.php.

References ilMailNotification\getRecipients().

Referenced by __construct(), and buildBody().

107  {
108  return current($this->getRecipients());
109  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ send()

ilTestManScoringParticipantNotification::send ( )

Definition at line 34 of file class.ilTestManScoringParticipantNotification.php.

References buildBody(), buildSubject(), ilMailNotification\getRecipients(), and ilMailNotification\sendMail().

34  : void
35  {
36  $this->buildSubject();
37 
38  $this->buildBody();
39 
40  $this->sendMail(
41  $this->getRecipients()
42  );
43  }
sendMail(array $a_rcp, bool $a_parse_recipients=true)
+ Here is the call graph for this function:

◆ setRecipient()

ilTestManScoringParticipantNotification::setRecipient (   $userId)
private

Definition at line 101 of file class.ilTestManScoringParticipantNotification.php.

References ilMailNotification\setRecipients().

Referenced by __construct().

101  : void
102  {
103  $this->setRecipients(array($userId));
104  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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