ILIAS  release_7 Revision v7.30-3-g800a261c036
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 ($a_is_personal_workspace=false)
 
 setType ($a_type)
 Set notification type. More...
 
 getType ()
 Get notification type. More...
 
 setSender ($a_usr_id)
 Set sender of mail. More...
 
 getSender ()
 get sender of mail More...
 
 setRecipients (array $a_rcp)
 
 getRecipients ()
 get array of recipients More...
 
 setAttachments ($a_att)
 Set attachments. More...
 
 getAttachments ()
 Get attachments. More...
 
 setLangModules (array $a_modules)
 Set lang modules. More...
 
 getUserLanguage ($a_usr_id)
 Get user language. More...
 
 setRefId ($a_id)
 
 getRefId ()
 
 getObjId ()
 
 setObjId ($a_obj_id)
 
 getObjType ()
 Get object type. More...
 
 setAdditionalInformation (array $a_info)
 Additional information for creating notification mails. More...
 
 getAdditionalInformation ()
 
 sendMail (array $a_rcp, $a_parse_recipients=true)
 
 getBlockBorder ()
 Get (ascii) block border. More...
 

Private Member Functions

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

Private Attributes

 $userId = null
 
 $questionGuiList = null
 
 $notificationData = null
 

Additional Inherited Members

- Data Fields inherited from ilMailNotification
const SUBJECT_TITLE_LENGTH = 60
 
- Protected Member Functions inherited from ilMailNotification
 setSubject ($a_subject)
 
 getSubject ()
 
 setBody ($a_body)
 
 appendBody ($a_body)
 Append body text. More...
 
 getBody ()
 
 initLanguage ($a_usr_id)
 Init language. More...
 
 initLanguageByIso2Code ($a_code='')
 Init language by ISO2 code. More...
 
 setLanguage ($a_language)
 
 getLanguage ()
 
 getLanguageText ($a_keyword)
 
 getObjectTitle ($a_shorten=false)
 
 initMail ()
 
 getMail ()
 
 createPermanentLink ($a_params=array(), $a_append='')
 
 userToString ($a_usr_id)
 
 isRefIdAccessible ($a_user_id, $a_ref_id, $a_permission="read")
 Check if ref id is accessible for user. More...
 
- Protected Attributes inherited from ilMailNotification
 $type = null
 
 $sender = null
 
 $mail = null
 
 $subject = ''
 
 $body = ''
 
 $attachments = array()
 
 $language = null
 
 $lang_modules = array()
 
 $recipients = array()
 
 $ref_id = null
 
 $obj_id = null
 
 $obj_type = null
 
 $additional_info = array()
 
 $is_in_wsp
 
 $wsp_tree
 
 $wsp_access_handler
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTestManScoringParticipantNotification::__construct (   $userId,
  $testRefId 
)

Member Function Documentation

◆ buildBody()

ilTestManScoringParticipantNotification::buildBody ( )
private

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

45 {
46 // Salutation
47
48 $this->setBody(
50 );
51 $this->appendBody("\n\n");
52
53 // Message (What has happened?)
54
55 $this->appendBody($this->getLanguageText('tst_notify_manscoring_done_body_msg_topic'));
56 $this->appendBody("\n\n");
57
58 $info = $this->getAdditionalInformation();
59
60 $this->appendBody($this->getLanguageText('obj_tst') . ': ' . $info['test_title']);
61 $this->appendBody("\n");
62 $this->appendBody($this->getLanguageText('pass') . ': ' . $info['test_pass']);
63 $this->appendBody("\n\n");
64
65 foreach ($info['questions_gui_list'] as $questionId => $questionGui) {
66 $points = $info['questions_scoring_data'][$questionId]['points'];
67 $feedback = $info['questions_scoring_data'][$questionId]['feedback'];
68
69 $feedback = $this->convertFeedbackForMail($feedback);
70
71 $this->appendBody($this->getLanguageText('tst_question') . ': ' . $questionGui->object->getTitle());
72 $this->appendBody("\n");
73 $this->appendBody($this->getLanguageText('tst_reached_points') . ': ' . $points);
74 $this->appendBody("\n");
75 $this->appendBody($this->getLanguageText('set_manual_feedback') . ":\n" . $feedback);
76 $this->appendBody("\n\n");
77 }
78
79 // Task (What do I have to do?
80
81 /* NOTHING REQUIRED FOR PARTICIPANT */
82
83 // Explanation (Why do I receive the following message?)
84
85 $this->appendBody("\n");
86 $this->appendBody($this->getLanguageText('tst_notify_manscoring_done_body_msg_reason'));
87
88 // Signature
89
90 $this->getMail()->appendInstallationSignature(true);
91 }
appendBody($a_body)
Append body text.
static getSalutation($a_usr_id, ilLanguage $a_language=null)

References 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 37 of file class.ilTestManScoringParticipantNotification.php.

38 {
39 $info = $this->getAdditionalInformation();
40
41 $this->setSubject(sprintf($this->getLanguageText('tst_notify_manscoring_done_body_msg_subject'), $info['test_title']));
42 }

References 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 103 of file class.ilTestManScoringParticipantNotification.php.

104 {
105 if (strip_tags($feedback) != $feedback) {
106 $feedback = preg_replace('/<br(.*\/)>/m', "\n", $feedback);
107 $feedback = strip_tags($feedback);
108 }
109
110 return $feedback;
111 }

Referenced by buildBody().

+ Here is the caller graph for this function:

◆ getRecipient()

ilTestManScoringParticipantNotification::getRecipient ( )
private

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

99 {
100 return current($this->getRecipients());
101 }
getRecipients()
get array of recipients

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 ( )

◆ setRecipient()

ilTestManScoringParticipantNotification::setRecipient (   $userId)
private

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

94 {
95 $this->setRecipients(array($userId));
96 }

References $userId, and ilMailNotification\setRecipients().

Referenced by __construct().

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

Field Documentation

◆ $notificationData

ilTestManScoringParticipantNotification::$notificationData = null
private

◆ $questionGuiList

ilTestManScoringParticipantNotification::$questionGuiList = null
private

◆ $userId

ilTestManScoringParticipantNotification::$userId = null
private

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

Referenced by __construct(), and setRecipient().


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