Class ilSCORMPresentationGUI.
More...
Class ilSCORMPresentationGUI.
GUI class for scorm learning module presentation
- Author
- Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
- Version
- $Id$
\
Definition at line 31 of file class.ilSCORMPresentationGUI.php.
◆ __construct()
ilSCORMPresentationGUI::__construct |
( |
| ) |
|
◆ apiInitData()
ilSCORMPresentationGUI::apiInitData |
( |
| ) |
|
◆ attrib2arr()
ilSCORMPresentationGUI::attrib2arr |
( |
?array |
$a_attributes | ) |
|
- Returns
- mixed[]
Definition at line 84 of file class.ilSCORMPresentationGUI.php.
88 if (!is_array($a_attributes)) {
91 foreach ($a_attributes as $attribute) {
92 $attr[$attribute->name()] = $attribute->value();
◆ contentSelect()
ilSCORMPresentationGUI::contentSelect |
( |
| ) |
|
Definition at line 438 of file class.ilSCORMPresentationGUI.php.
References $DIC, ilUtil\getStyleSheetLocation(), and ilLanguage\txt().
441 $lng = $DIC->language();
442 $this->tpl =
new ilGlobalTemplate(
"tpl.scorm_content_select.html",
true,
true,
"components/ILIAS/ScormAicc");
444 $this->tpl->setVariable(
'TXT_SPECIALPAGE',
$lng->
txt(
"seq_toc"));
445 $this->tpl->printToStdout(
"DEFAULT",
false);
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
special template class to simplify handling of ITX/PEAR
◆ downloadCertificate()
ilSCORMPresentationGUI::downloadCertificate |
( |
| ) |
|
Download the certificate for the active user.
- Exceptions
-
Definition at line 497 of file class.ilSCORMPresentationGUI.php.
References $DIC, ilObject\_lookupObjId(), ilCertificatePdfAction\downloadPdf(), exit, and ILIAS\Repository\lng().
501 $ilUser = $DIC->user();
502 $tree = $DIC[
'tree'];
503 $ilCtrl = $DIC->ctrl();
504 $refId = $DIC->http()->wrapper()->query()->retrieve(
'ref_id', $DIC->refinery()->kindlyTo()->int());
508 $allowed = $certValidator->isCertificateDownloadable($ilUser->getId(), $obj_id);
510 $certificateLogger = $DIC->logger()->root();
517 $this->
lng->txt(
'error_creating_certificate_pdf')
520 $pdfAction->
downloadPdf($ilUser->getId(), $obj_id);
524 $parent = $tree->getParentId(
$refId);
525 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $parent);
526 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
static _lookupObjId(int $ref_id)
Validates if an active certificate is stored in the database and can be downloaded by the user...
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
downloadPdf(int $userId, int $objectId)
◆ executeCommand()
ilSCORMPresentationGUI::executeCommand |
( |
| ) |
|
execute command
- Exceptions
-
Definition at line 58 of file class.ilSCORMPresentationGUI.php.
References $DIC, $ilErr, ILIAS\Repository\ctrl(), ilLoggerFactory\getLogger(), and ilLanguage\txt().
61 $ilAccess = $DIC->access();
63 $lng = $DIC->language();
66 $next_class = $this->
ctrl->getNextClass($this);
67 $cmd = $this->
ctrl->getCmd(
"frameset");
69 if (!$ilAccess->checkAccess(
"write",
"", $this->refId) &&
70 (!$ilAccess->checkAccess(
"read",
"", $this->refId) ||
71 $this->slm->getOfflineStatus())) {
static getLogger(string $a_component_id)
Get component logger.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
◆ explorer()
ilSCORMPresentationGUI::explorer |
( |
string |
$a_target = "sahs_content" | ) |
|
save the active module version to scorm_tracking
output table of content
- Exceptions
-
Definition at line 359 of file class.ilSCORMPresentationGUI.php.
References $DIC, $slm, ILIAS\Repository\ctrl(), ilLoggerFactory\getLogger(), ilUtil\getStyleSheetLocation(), ILIAS\Repository\lng(), ilTree\readRootId(), and ilExplorer\setTargetGet().
362 $ilBench = $DIC[
'ilBench'];
365 $ilBench->start(
"SCORMExplorer",
"initExplorer");
367 $this->tpl =
new ilGlobalTemplate(
"tpl.sahs_exp_main.html",
true,
true,
"components/ILIAS/ScormAicc");
371 $exp->setFrameTarget($a_target);
377 if ($DIC->http()->wrapper()->query()->has(
'scexpand')) {
378 $expanded = $DIC->http()->wrapper()->query()->retrieve(
'scexpand', $DIC->refinery()->kindlyTo()->string());
380 if ($expanded ==
"") {
384 $exp->setExpand($expanded);
386 $exp->forceExpandAll(
true,
false);
387 $ilBench->stop(
"SCORMExplorer",
"initExplorer");
390 $ilBench->start(
"SCORMExplorer",
"setOutput");
392 $ilBench->stop(
"SCORMExplorer",
"setOutput");
394 $ilBench->start(
"SCORMExplorer",
"getOutput");
395 $output = $exp->getOutput($jsApi);
396 $ilBench->stop(
"SCORMExplorer",
"getOutput");
399 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.sahs_explorer.html",
"components/ILIAS/ScormAicc");
401 $this->tpl->setVariable(
"EXP_REFRESH", $this->
lng->txt(
"refresh"));
402 $this->tpl->setVariable(
"EXPLORER", $output);
405 if ($DIC->http()->wrapper()->query()->has(
'cmd')) {
406 $cmd = $DIC->http()->wrapper()->query()->retrieve(
'cmd', $DIC->refinery()->kindlyTo()->string());
409 if ($DIC->http()->wrapper()->query()->has(
'frame')) {
410 $frame = $DIC->http()->wrapper()->query()->retrieve(
'frame', $DIC->refinery()->kindlyTo()->string());
412 $this->tpl->setVariable(
"ACTION",
"ilias.php?baseClass=ilSAHSPresentationGUI&cmd=" . $cmd .
"&frame=" . $frame .
413 "&ref_id=" . $this->slm->getRefId() .
"&scexpand=" . $expanded);
414 $this->tpl->parseCurrentBlock();
417 $this->tpl->printToStdout(
"DEFAULT",
false);
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
static getLogger(string $a_component_id)
Get component logger.
special template class to simplify handling of ITX/PEAR
ilObjSCORMLearningModule $slm
setTargetGet(string $a_target_get)
◆ frameset()
ilSCORMPresentationGUI::frameset |
( |
| ) |
|
Output main frameset.
If only one SCO/Asset is given, it is displayed without the table of contents explorer frame on the left.
- Exceptions
-
Definition at line 103 of file class.ilSCORMPresentationGUI.php.
References $DIC, ilSCORMObject\_lookupPresentableItems(), ILIAS\Repository\ctrl(), exit, increase_attemptAndsave_module_version(), and ilWACSignedPath\signFolderOfStartFile().
106 $lng = $DIC->language();
107 $javascriptAPI =
true;
122 $debug = $this->slm->getDebug();
123 if (count($items) > 1) {
124 $this->
ctrl->setParameter($this,
"expand",
"1");
125 $this->
ctrl->setParameter($this,
"jsApi",
"1");
126 $exp_link = $this->
ctrl->getLinkTarget($this,
"explorer");
130 $this->tpl =
new ilGlobalTemplate(
"tpl.sahs_pres_frameset_js_debug.html",
false,
false,
"components/ILIAS/ScormAicc");
132 $this->tpl =
new ilGlobalTemplate(
"tpl.sahs_pres_frameset_js.html",
false,
false,
"components/ILIAS/ScormAicc");
135 $this->tpl->setVariable(
"EXPLORER_LINK", $exp_link);
136 $pres_link = $this->
ctrl->getLinkTarget($this,
"contentSelect");
137 $this->tpl->setVariable(
"PRESENTATION_LINK", $pres_link);
140 $this->tpl =
new ilGlobalTemplate(
"tpl.sahs_pres_frameset_js_debug_one_page.html",
false,
false,
"components/ILIAS/ScormAicc");
142 $this->tpl =
new ilGlobalTemplate(
"tpl.sahs_pres_frameset_js_one_page.html",
false,
false,
"components/ILIAS/ScormAicc");
145 $this->
ctrl->setParameter($this,
"autolaunch", $items[0] ??
"");
147 $api_link = $this->
ctrl->getLinkTarget($this,
"apiInitData");
148 $this->tpl->setVariable(
"TITLE", $this->slm->getTitle());
149 $this->tpl->setVariable(
"API_LINK", $api_link);
150 $this->tpl->printToStdout(
"DEFAULT",
false,
true);
static _lookupPresentableItems(int $a_slm_id)
Count number of presentable SCOs/Assets of SCORM learning module.
special template class to simplify handling of ITX/PEAR
static signFolderOfStartFile(string $start_file_path)
increase_attemptAndsave_module_version()
Increases attempts by one for this package.
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ get_actual_attempts()
ilSCORMPresentationGUI::get_actual_attempts |
( |
| ) |
|
Get max.
number of attempts allowed for this package Get number of actual attempts for the user
Definition at line 167 of file class.ilSCORMPresentationGUI.php.
References $DIC, $ilDB, and null.
170 $ilDB = $DIC->database();
171 $ilUser = $DIC->user();
172 $val_set =
$ilDB->queryF(
173 'SELECT package_attempts FROM sahs_user WHERE obj_id = %s AND user_id = %s',
174 array(
'integer',
'integer'),
175 array($this->slm->getId(),$ilUser->getId())
177 $val_rec =
$ilDB->fetchAssoc($val_set);
178 $attempts = $val_rec[
"package_attempts"];
179 if ($attempts ==
null) {
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ increase_attemptAndsave_module_version()
ilSCORMPresentationGUI::increase_attemptAndsave_module_version |
( |
| ) |
|
Increases attempts by one for this package.
Increases attempts by one and saves module_version for this package
Definition at line 270 of file class.ilSCORMPresentationGUI.php.
References $DIC, $ilDB, $res, ilLPStatusWrapper\_updateStatus(), and null.
Referenced by frameset().
273 $ilDB = $DIC->database();
274 $ilUser = $DIC->user();
276 'SELECT package_attempts,count(*) cnt FROM sahs_user WHERE obj_id = %s AND user_id = %s GROUP BY package_attempts',
277 array(
'integer',
'integer'),
278 array($this->slm->getId(),$ilUser->getId())
281 if (!is_array($val_rec)) {
284 'INSERT INTO sahs_user (obj_id,user_id,package_attempts,module_version,last_access) VALUES(%s,%s,%s,%s,%s)',
285 array(
'integer',
'integer',
'integer',
'integer',
'timestamp'),
286 array($this->slm->getId(), $ilUser->getId(), $attempts, $this->slm->getModuleVersion(), date(
'Y-m-d H:i:s'))
289 $attempts = $val_rec[
"package_attempts"];
290 if ($attempts ==
null) {
295 'UPDATE sahs_user SET package_attempts = %s, module_version = %s, last_access=%s WHERE obj_id = %s AND user_id = %s ',
296 array(
'integer',
'integer',
'timestamp',
'integer',
'integer'),
297 array($attempts, $this->slm->getModuleVersion(), date(
'Y-m-d H:i:s'), $this->slm->getId(), $ilUser->getId())
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
◆ pingSession()
ilSCORMPresentationGUI::pingSession |
( |
| ) |
|
◆ view()
ilSCORMPresentationGUI::view |
( |
| ) |
|
◆ $ctrl
◆ $lng
◆ $refId
int ilSCORMPresentationGUI::$refId |
|
protected |
◆ $slm
◆ $tpl
The documentation for this class was generated from the following file: