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