24 include_once
"./Services/Certificate/classes/class.ilCertificateAdapter.php";
54 return CLIENT_WEB_DIR .
"/certificates/scorm/" . $this->
object->getId() .
"/";
69 $vars[
"SCORM_POINTS"] = number_format(80.7, 1, $lng->txt(
"lang_sep_decimal"), $lng->txt(
"lang_sep_thousand")) .
" %";
70 $vars[
"SCORM_POINTS_MAX"] = number_format(90, 0, $lng->txt(
"lang_sep_decimal"), $lng->txt(
"lang_sep_thousand"));
72 $insert_tags = array();
73 foreach($vars as $id => $caption)
75 $insert_tags[
"[".$id.
"]"] = $caption;
78 include_once
'Services/Tracking/classes/class.ilLPCollections.php';
84 if($lp_collections->isAssigned($item_id)) {
85 $insert_tags[
'[SCO_T_'.$counter.
']'] = $sahs_item[
'title'];
86 $insert_tags[
'[SCO_P_'.$counter.
']'] = number_format(30.3, 1, $lng->txt(
"lang_sep_decimal"), $lng->txt(
"lang_sep_thousand"));
87 $insert_tags[
'[SCO_PM_'.$counter.
']'] = number_format(90.9, 1, $lng->txt(
"lang_sep_decimal"), $lng->txt(
"lang_sep_thousand"));
88 $insert_tags[
'[SCO_PP_'.$counter.
']'] = number_format(33.3333, 1, $lng->txt(
"lang_sep_decimal"), $lng->txt(
"lang_sep_thousand")) .
" %";
108 $lng->loadLanguageModule(
'certificate');
110 $points = $this->
object->getPointsInPercent();
112 if (is_null($points))
114 $txtPoints = $lng->txt(
"certificate_points_notavailable");
118 $txtPoints = number_format($points, 1, $lng->txt(
"lang_sep_decimal"), $lng->txt(
"lang_sep_thousand")) .
" %";
121 $max_points = $this->
object->getMaxPoints();
123 if (is_null($max_points))
125 $txtMaxPoints = $lng->txt(
"certificate_points_notavailable");
129 if($max_points != floor($max_points))
131 $txtMaxPoints = number_format($max_points, 1, $lng->txt(
"lang_sep_decimal"), $lng->txt(
"lang_sep_thousand"));
135 $txtMaxPoints = $max_points;
139 $user_data = $params[
"user_data"];
144 $vars[
"SCORM_POINTS"] = $txtPoints;
145 $vars[
"SCORM_POINTS_MAX"] = $txtMaxPoints;
147 foreach($vars as $id => $caption)
149 $insert_tags[
"[".$id.
"]"] = $caption;
152 include_once
'Services/Tracking/classes/class.ilLPCollections.php';
158 if($lp_collections->isAssigned($item_id)) {
159 $insert_tags[
'[SCO_T_'.$counter.
']'] = $sahs_item[
'title'];
161 if ($a_scores[
"raw"] == null) $insert_tags[
'[SCO_P_'.$counter.
']'] = $lng->txt(
"certificate_points_notavailable");
162 else $insert_tags[
'[SCO_P_'.$counter.
']'] = number_format($a_scores[
"raw"], 1, $lng->txt(
"lang_sep_decimal"), $lng->txt(
"lang_sep_thousand"));
163 if ($a_scores[
"max"] == null) $insert_tags[
'[SCO_PM_'.$counter.
']'] = $lng->txt(
"certificate_points_notavailable");
164 else $insert_tags[
'[SCO_PM_'.$counter.
']'] = number_format($a_scores[
"max"], 1, $lng->txt(
"lang_sep_decimal"), $lng->txt(
"lang_sep_thousand"));
165 if ($a_scores[
"scaled"] == null) $insert_tags[
'[SCO_PP_'.$counter.
']'] = $lng->txt(
"certificate_points_notavailable");
166 else $insert_tags[
'[SCO_PP_'.$counter.
']'] = number_format(($a_scores[
"scaled"]*100), 1, $lng->txt(
"lang_sep_decimal"), $lng->txt(
"lang_sep_thousand")) .
" %";
185 $vars[
"SCORM_TITLE"] = $lng->txt(
"certificate_ph_scormtitle");
186 $vars[
"SCORM_POINTS"] = $lng->txt(
"certificate_ph_scormpoints");
187 $vars[
"SCORM_POINTS_MAX"] = $lng->txt(
"certificate_ph_scormmaxpoints");
189 $template =
new ilTemplate(
"tpl.certificate_edit.html", TRUE, TRUE,
"Modules/ScormAicc");
190 $template->setCurrentBlock(
"items");
191 foreach($vars as $id => $caption)
193 $template->setVariable(
"ID", $id);
194 $template->setVariable(
"TXT", $caption);
195 $template->parseCurrentBlock();
198 $template->setVariable(
"PH_INTRODUCTION", $lng->txt(
"certificate_ph_introduction"));
200 include_once
'Services/Tracking/classes/class.ilLPCollections.php';
204 $template->setCurrentBlock(
'NO_SCO');
205 $template->setVariable(
'PH_NO_SCO',$lng->txt(
'certificate_ph_no_sco'));
206 $template->parseCurrentBlock();
209 $template->setCurrentBlock(
'SCOS');
210 $template->setVariable(
'PH_SCOS',$lng->txt(
'certificate_ph_scos'));
211 $template->parseCurrentBlock();
212 $template->setCurrentBlock(
'SCO_HEADER');
213 $template->setVariable(
'PH_TITLE_SCO',$lng->txt(
'certificate_ph_title_sco'));
215 $template->setVariable(
'PH_SCO_TITLE',$lng->txt(
'certificate_ph_sco_title'));
216 $template->setVariable(
'PH_SCO_POINTS_RAW',$lng->txt(
'certificate_ph_sco_points_raw'));
217 $template->setVariable(
'PH_SCO_POINTS_MAX',$lng->txt(
'certificate_ph_sco_points_max'));
218 $template->setVariable(
'PH_SCO_POINTS_SCALED',$lng->txt(
'certificate_ph_sco_points_scaled'));
219 $template->parseCurrentBlock();
225 if($lp_collections->isAssigned($item_id)) {
226 $template->setCurrentBlock(
"SCO");
227 $template->setVariable(
'SCO_TITLE',$sahs_item[
'title']);
228 $template->setVariable(
'PH_SCO_TITLE',
'[SCO_T_'.$counter.
']');
229 $template->setVariable(
'PH_SCO_POINTS_RAW',
'[SCO_P_'.$counter.
']');
230 $template->setVariable(
'PH_SCO_POINTS_MAX',
'[SCO_PM_'.$counter.
']');
231 $template->setVariable(
'PH_SCO_POINTS_SCALED',
'[SCO_PP_'.$counter.
']');
232 $template->parseCurrentBlock();
237 return $template->get();
252 $short_name =
new ilTextInputGUI($lng->txt(
"certificate_short_name"),
"short_name");
254 require_once
"./Services/Utilities/classes/class.ilStr.php";
255 $short_name->setValue(strlen($form_fields[
"short_name"]) ? $form_fields[
"short_name"] :
ilStr::subStr($this->object->getTitle(), 0, 30));
256 $short_name->setSize(30);
257 if (strlen($form_fields[
"short_name"])) {
258 $short_name->setInfo(str_replace(
"[SHORT_TITLE]", $form_fields[
"short_name"], $lng->txt(
"certificate_short_name_description")));
260 $short_name->setInfo($lng->txt(
"certificate_short_name_description"));
262 if (count(
$_POST)) $short_name->checkInput();
263 $form->addItem($short_name);
265 $visibility =
new ilCheckboxInputGUI($lng->txt(
"certificate_enabled_scorm"),
"certificate_enabled_scorm");
266 $visibility->
setInfo($lng->txt(
"certificate_enabled_scorm_introduction"));
267 $visibility->setValue(1);
268 if ($form_fields[
"certificate_enabled_scorm"])
270 $visibility->setChecked(TRUE);
272 if (count(
$_POST)) $visibility->checkInput();
273 $form->addItem($visibility);
286 $form_fields[
"certificate_enabled_scorm"] =
$_POST[
"certificate_enabled_scorm"];
287 $form_fields[
"short_name"] =
$_POST[
"short_name"];
302 $form_fields[
"certificate_enabled_scorm"] = $scormSetting->get(
"certificate_" . $this->object->getId());
303 $form_fields[
"short_name"] = $scormSetting->get(
"certificate_short_name_" . $this->object->getId());
317 $scormSetting->set(
"certificate_" . $this->object->getId(), $form_fields[
"certificate_enabled_scorm"]);
318 $scormSetting->set(
"certificate_short_name_" . $this->object->getId(), $form_fields[
"short_name"]);
340 return $this->
object->getId();
355 $user_data = $params[
"user_data"];
356 if (!is_array($user_data))
360 $short_title = $scormSetting->get(
"certificate_short_name_" . $this->object->getId());
361 return strftime(
"%y%m%d", time()) .
"_" . $lng->txt(
"certificate_var_user_lastname") .
"_" . $short_title .
"_" . $basename;
365 return strftime(
"%y%m%d", time()) .
"_" . $user_data[
"lastname"] .
"_" . $params[
"short_title"] .
"_.$basename";
378 $scormSetting->delete(
"certificate_" . $this->object->getId());
389 return $a_params[
"user_data"][
"usr_id"];