ILIAS
trunk Revision v12.0_alpha-377-g3641b37b9db
◀ ilDoc Overview
storeScorm2004.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
require_once __DIR__ .
"/../vendor/composer/vendor/autoload.php"
;
22
23
ilContext::init
(
ilContext::CONTEXT_SCORM
);
24
ilInitialisation::initILIAS
();
25
26
//conditions for storing data
27
global
$DIC
;
28
$ilDB
=
$DIC
->database();
29
30
$packageId
=
$DIC
->http()->wrapper()->query()->retrieve(
'package_id'
,
$DIC
->refinery()->kindlyTo()->int());
31
$refId
=
$DIC
->http()->wrapper()->query()->retrieve(
'ref_id'
,
$DIC
->refinery()->kindlyTo()->int());
32
$doUnload
=
false
;
33
if
(
$DIC
->http()->wrapper()->query()->has(
'do'
)) {
34
if
(
$DIC
->http()->wrapper()->query()->retrieve(
'do'
,
$DIC
->refinery()->kindlyTo()->string()) ==
"unload"
) {
35
$doUnload
=
true
;
36
}
37
}
38
39
$defaultLessonMode
=
"normal"
;
40
$comments
=
true
;
41
$interactions
=
true
;
42
$objectives
=
true
;
43
$time_from_lms
=
false
;
44
45
$lm_set
=
$ilDB
->queryF(
46
'SELECT default_lesson_mode, interactions, objectives, time_from_lms, comments FROM sahs_lm WHERE id = %s'
,
47
array(
'integer'
),
48
array(
$packageId
)
49
);
50
while
($lm_rec =
$ilDB
->fetchAssoc(
$lm_set
)) {
51
$defaultLessonMode
= ($lm_rec[
"default_lesson_mode"
]);
52
$interactions
=
ilUtil::yn2tf
($lm_rec[
"interactions"
]);
53
$objectives
=
ilUtil::yn2tf
($lm_rec[
"objectives"
]);
54
$time_from_lms
=
ilUtil::yn2tf
($lm_rec[
"time_from_lms"
]);
55
$comments
=
ilUtil::yn2tf
($lm_rec[
"comments"
]);
56
}
57
58
if
(
$doUnload
) {
59
ilSCORM2004StoreData::scormPlayerUnload
(
$packageId
,
$refId
,
$time_from_lms
,
null
);
60
}
else
{
61
// $data = file_get_contents('php://input');
62
ilSCORM2004StoreData::persistCMIData
(
$packageId
,
$refId
,
$defaultLessonMode
,
$comments
,
$interactions
,
$objectives
,
$time_from_lms
,
null
,
null
);
63
}
ilContext\CONTEXT_SCORM
const CONTEXT_SCORM
Definition:
class.ilContext.php:42
ilContext\init
static init(string $a_type)
Init context by type.
Definition:
class.ilContext.php:52
ilInitialisation\initILIAS
static initILIAS()
ilias initialisation
Definition:
class.ilInitialisation.php:1144
ilSCORM2004StoreData\persistCMIData
static persistCMIData(int $packageId, int $refId, string $defaultLessonMode, bool $comments, bool $interactions, bool $objectives, bool $time_from_lms, ?string $data=null, ?int $userId=null)
Definition:
class.ilSCORM2004StoreData.php:125
ilSCORM2004StoreData\scormPlayerUnload
static scormPlayerUnload(int $packageId, int $refId, bool $time_from_lms, ?int $userId=null)
Definition:
class.ilSCORM2004StoreData.php:28
ilUtil\yn2tf
static yn2tf(string $a_yn)
Definition:
class.ilUtil.php:903
$interactions
$interactions
Definition:
storeScorm2004.php:41
$ilDB
$ilDB
Definition:
storeScorm2004.php:28
$time_from_lms
$time_from_lms
Definition:
storeScorm2004.php:43
$comments
$comments
Definition:
storeScorm2004.php:40
$packageId
$packageId
Definition:
storeScorm2004.php:30
$DIC
global $DIC
Definition:
storeScorm2004.php:27
$doUnload
$doUnload
Definition:
storeScorm2004.php:32
$lm_set
$lm_set
Definition:
storeScorm2004.php:45
$refId
$refId
Definition:
storeScorm2004.php:31
$objectives
$objectives
Definition:
storeScorm2004.php:42
$defaultLessonMode
if($DIC->http() ->wrapper() ->query() ->has('do')) $defaultLessonMode
Definition:
storeScorm2004.php:39
components
ILIAS
Scorm2004
resources
storeScorm2004.php
Generated on Sat Dec 13 2025 23:02:54 for ILIAS by
1.9.4 (using
Doxyfile
)