ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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_type, $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 45 of file class.ilTestManScoringParticipantNotification.php.

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

Referenced by send().

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

◆ buildSubject()

ilTestManScoringParticipantNotification::buildSubject ( )
private

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

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

Referenced by send().

39  {
41 
42  $this->setSubject(sprintf($this->getLanguageText('tst_notify_manscoring_done_body_msg_subject'), $info['test_title']));
43  }
$info
Definition: index.php:5
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ convertFeedbackForMail()

ilTestManScoringParticipantNotification::convertFeedbackForMail (   $feedback)
private

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

Referenced by buildBody().

105  {
106  if (strip_tags($feedback) != $feedback) {
107  $feedback = preg_replace('/<br(.*\/)>/m', "\n", $feedback);
108  $feedback = strip_tags($feedback);
109  }
110 
111  return $feedback;
112  }
+ Here is the caller graph for this function:

◆ getRecipient()

ilTestManScoringParticipantNotification::getRecipient ( )
private

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

References ilMailNotification\getRecipients().

Referenced by __construct(), and buildBody().

100  {
101  return current($this->getRecipients());
102  }
getRecipients()
get array of recipients
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ send()

ilTestManScoringParticipantNotification::send ( )

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

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

27  {
28  $this->buildSubject();
29 
30  $this->buildBody();
31 
32  $this->sendMail(
33  $this->getRecipients(),
34  array('system')
35  );
36  }
Create styles array
The data for the language used.
sendMail(array $a_rcp, $a_type, $a_parse_recipients=true)
getRecipients()
get array of recipients
+ Here is the call graph for this function:

◆ setRecipient()

ilTestManScoringParticipantNotification::setRecipient (   $userId)
private

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

References $userId, array, and ilMailNotification\setRecipients().

Referenced by __construct().

95  {
96  $this->setRecipients(array($userId));
97  }
Create styles array
The data for the language used.
+ 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: