4 include_once
'./Services/Mail/classes/class.ilMailTemplateContext.php';
14 const ID =
'sahs_context_lp';
31 $lng->loadLanguageModule(
'sahs');
33 return $lng->txt(
'sahs_mail_context_lp');
43 $lng->loadLanguageModule(
'sahs');
45 return $lng->txt(
'sahs_mail_context_lp_info');
59 $lng->loadLanguageModule(
'trac');
62 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
66 $placeholders =
array();
69 $placeholders[
'sahs_title'] =
array(
70 'placeholder' =>
'SCORM_TITLE',
71 'label' => $lng->txt(
'obj_sahs')
74 $placeholders[
'sahs_status'] =
array(
75 'placeholder' =>
'SCORM_STATUS',
76 'label' => $lng->txt(
'trac_status')
79 $placeholders[
'sahs_mark'] =
array(
80 'placeholder' =>
'SCORM_MARK',
81 'label' => $lng->txt(
'trac_mark')
85 $lng->loadLanguageModule(
'content');
86 $placeholders[
'sahs_score'] =
array(
87 'placeholder' =>
'SCORM_SCORE',
88 'label' => $lng->txt(
'cont_score')
93 $placeholders[
'sahs_time_spent'] =
array(
94 'placeholder' =>
'SCORM_TIME_SPENT',
95 'label' => $lng->txt(
'trac_spent_seconds')
101 $placeholders[
'sahs_first_access'] =
array(
102 'placeholder' =>
'SCORM_FIRST_ACCESS',
103 'label' => $lng->txt(
'trac_first_access')
106 $placeholders[
'sahs_last_access'] =
array(
107 'placeholder' =>
'SCORM_LAST_ACCESS',
108 'label' => $lng->txt(
'trac_last_access')
113 $placeholders[
'sahs_link'] =
array(
114 'placeholder' =>
'SCORM_LINK',
115 'label' => $lng->txt(
'perma_link')
118 return $placeholders;
129 global $ilObjDataCache;
131 if(!in_array($placeholder_id,
array(
'sahs_title',
'sahs_link')))
136 $obj_id = $ilObjDataCache->lookupObjId($context_parameters[
'ref_id']);
138 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
141 switch($placeholder_id)
144 return $ilObjDataCache->lookupTitle($obj_id);
147 require_once
'./Services/Link/classes/class.ilLink.php';
151 if($recipient === null)
156 include_once
'./Services/Tracking/classes/class.ilLPStatus.php';
157 include_once
'./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php';
166 if($recipient === null)
171 include_once
'./Services/Tracking/classes/class.ilLPMarks.php';
173 return strlen(trim($mark)) ? $mark :
'-';
176 if($recipient === null)
183 include_once
'Modules/ScormAicc/classes/class.ilScormLP.php';
185 if($coll->getItems())
187 include_once
'Services/Tracking/classes/class.ilTrQuery.php';
190 $SCOStatusForUser = (
new ilTrQuery)->getSCOsStatusForUser($recipient->getId(), $obj_id, $coll->getItems());
191 foreach($SCOStatusForUser as $item)
193 $scores[] = $item[
'title'].
': '.$item[
'score'];
196 return implode(
"\n", $scores);
198 case 'sahs_time_spent':
199 if($recipient === null)
206 include_once
'./Services/Tracking/classes/class.ilLearningProgress.php';
208 if(isset($progress[
'spent_seconds']))
215 case 'sahs_first_access':
216 if($recipient === null)
223 include_once
'./Services/Tracking/classes/class.ilLearningProgress.php';
225 if(isset($progress[
'access_time_min']))
232 case 'sahs_last_access':
233 if($recipient === null)
240 include_once
'./Services/Tracking/classes/class.ilLearningProgress.php';
242 if(isset($progress[
'access_time']))
const EXTENDED_DATA_LAST_ACCESS
static _getStatusText($a_status, $a_lng=null)
Get status alt text.
resolveSpecificPlaceholder($placeholder_id, array $context_parameters, ilObjUser $recipient=null, $html_markup=false)
getSpecificPlaceholders()
Return an array of placeholders.
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
static _lookupObjId($a_id)
static formatDate(ilDateTime $date)
Format a date public.
Class ilMailTemplateContext.
Create styles array
The data for the language used.
const EXTENDED_DATA_SPENT_SECONDS
const LP_STATUS_NOT_ATTEMPTED_NUM
static _lookupMark($a_usr_id, $a_obj_id)
static getInstance($a_obj_id)
static _getProgress($a_user_id, $a_obj_id)
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static _lookupStatus($a_obj_id, $a_user_id, $a_create=true)
Lookup status.