4 include_once
'./Services/Mail/classes/class.ilMailTemplateContext.php';
14 const ID =
'sahs_context_lp';
32 $lng->loadLanguageModule(
'sahs');
34 return $lng->txt(
'sahs_mail_context_lp');
45 $lng->loadLanguageModule(
'sahs');
47 return $lng->txt(
'sahs_mail_context_lp_info');
62 $lng->loadLanguageModule(
'trac');
65 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
69 $placeholders = array();
72 $placeholders[
'sahs_title'] = array(
73 'placeholder' =>
'SCORM_TITLE',
74 'label' =>
$lng->txt(
'obj_sahs')
77 $placeholders[
'sahs_status'] = array(
78 'placeholder' =>
'SCORM_STATUS',
79 'label' =>
$lng->txt(
'trac_status')
82 $placeholders[
'sahs_mark'] = array(
83 'placeholder' =>
'SCORM_MARK',
84 'label' =>
$lng->txt(
'trac_mark')
88 $lng->loadLanguageModule(
'content');
89 $placeholders[
'sahs_score'] = array(
90 'placeholder' =>
'SCORM_SCORE',
91 'label' =>
$lng->txt(
'cont_score')
95 $placeholders[
'sahs_time_spent'] = array(
96 'placeholder' =>
'SCORM_TIME_SPENT',
97 'label' =>
$lng->txt(
'trac_spent_seconds')
102 $placeholders[
'sahs_first_access'] = array(
103 'placeholder' =>
'SCORM_FIRST_ACCESS',
104 'label' =>
$lng->txt(
'trac_first_access')
107 $placeholders[
'sahs_last_access'] = array(
108 'placeholder' =>
'SCORM_LAST_ACCESS',
109 'label' =>
$lng->txt(
'trac_last_access')
114 $placeholders[
'sahs_link'] = array(
115 'placeholder' =>
'SCORM_LINK',
116 'label' =>
$lng->txt(
'perma_link')
119 return $placeholders;
131 $ilObjDataCache = $DIC[
'ilObjDataCache'];
133 if (!in_array($placeholder_id, array(
'sahs_title',
'sahs_link'))) {
137 $obj_id = $ilObjDataCache->lookupObjId($context_parameters[
'ref_id']);
139 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
142 switch ($placeholder_id) {
144 return $ilObjDataCache->lookupTitle($obj_id);
147 require_once
'./Services/Link/classes/class.ilLink.php';
151 if ($recipient === null) {
155 include_once
'./Services/Tracking/classes/class.ilLPStatus.php';
156 include_once
'./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php';
164 if ($recipient === null) {
168 include_once
'./Services/Tracking/classes/class.ilLPMarks.php';
170 return strlen(trim($mark)) ? $mark :
'-';
173 if ($recipient === null) {
179 include_once
'Modules/ScormAicc/classes/class.ilScormLP.php';
181 if ($coll->getItems()) {
182 include_once
'Services/Tracking/classes/class.ilTrQuery.php';
185 $SCOStatusForUser = (
new ilTrQuery)->getSCOsStatusForUser($recipient->getId(), $obj_id, $coll->getItems());
186 foreach ($SCOStatusForUser as $item) {
187 $scores[] = $item[
'title'] .
': ' . $item[
'score'];
190 return implode(
"\n", $scores);
192 case 'sahs_time_spent':
193 if ($recipient === null) {
198 include_once
'./Services/Tracking/classes/class.ilLearningProgress.php';
200 if (isset($progress[
'spent_seconds'])) {
206 case 'sahs_first_access':
207 if ($recipient === null) {
212 include_once
'./Services/Tracking/classes/class.ilLearningProgress.php';
214 if (isset($progress[
'access_time_min'])) {
220 case 'sahs_last_access':
221 if ($recipient === null) {
226 include_once
'./Services/Tracking/classes/class.ilLearningProgress.php';
228 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 formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
static _lookupObjId($a_id)
Class ilMailTemplateContext.
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.