ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
storeScorm2004.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21require_once __DIR__ . "/../vendor/composer/vendor/autoload.php";
22
25
26//conditions for storing data
27global $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;
33if ($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
40$comments = true;
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);
50while ($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
58if ($doUnload) {
60} else {
61// $data = file_get_contents('php://input');
63}
const CONTEXT_SCORM
static init(string $a_type)
Init context by type.
static initILIAS()
ilias initialisation
static persistCMIData(int $packageId, int $refId, string $defaultLessonMode, bool $comments, bool $interactions, bool $objectives, bool $time_from_lms, ?string $data=null, ?int $userId=null)
static scormPlayerUnload(int $packageId, int $refId, bool $time_from_lms, ?int $userId=null)
static yn2tf(string $a_yn)
$interactions
$time_from_lms
$comments
$packageId
global $DIC
$doUnload
$lm_set
$refId
$objectives
if($DIC->http() ->wrapper() ->query() ->has('do')) $defaultLessonMode