ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilTestManScoringParticipantNotification Class Reference
+ Inheritance diagram for ilTestManScoringParticipantNotification:
+ Collaboration diagram for ilTestManScoringParticipantNotification:

Public Member Functions

 __construct ($userId, $testRefId)
 
 send ()
 
- Public Member Functions inherited from ilMailNotification
 __construct (protected bool $is_in_wsp=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
final const int 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 = []
 
ilWorkspaceTree $wsp_tree
 
ilWorkspaceAccessHandler $wsp_access_handler
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTestManScoringParticipantNotification::__construct (   $userId,
  $testRefId 
)

Member Function Documentation

◆ buildBody()

ilTestManScoringParticipantNotification::buildBody ( )
private

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

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

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

Referenced by send().

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

◆ buildSubject()

ilTestManScoringParticipantNotification::buildSubject ( )
private

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

47 : void
48 {
50
51 $this->setSubject(sprintf($this->getLanguageText('tst_notify_manscoring_done_body_msg_subject'), $info['test_title']));
52 }
setSubject(string $a_subject)

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

Referenced by send().

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

◆ convertFeedbackForMail()

ilTestManScoringParticipantNotification::convertFeedbackForMail (   $feedback)
private

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

113 : ?string
114 {
115 if (strip_tags($feedback) != $feedback) {
116 $feedback = preg_replace('/<br(.*\/)>/m', "\n", $feedback);
117 $feedback = strip_tags($feedback);
118 }
119
120 return $feedback;
121 }

Referenced by buildBody().

+ Here is the caller graph for this function:

◆ getRecipient()

ilTestManScoringParticipantNotification::getRecipient ( )
private

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

109 {
110 return current($this->getRecipients());
111 }

References ilMailNotification\getRecipients().

Referenced by __construct(), and buildBody().

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

◆ send()

ilTestManScoringParticipantNotification::send ( )

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

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

+ Here is the call graph for this function:

◆ setRecipient()

ilTestManScoringParticipantNotification::setRecipient (   $userId)
private

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

103 : void
104 {
105 $this->setRecipients([$userId]);
106 }

References ilMailNotification\setRecipients().

Referenced by __construct().

+ 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: