ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
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
24
25require_once __DIR__ . '/../artifacts/bootstrap_default.php';
26entry_point('ILIAS Legacy Initialisation Adapter');
27
28//conditions for storing data
29global $DIC;
30$ilDB = $DIC->database();
31
32$packageId = $DIC->http()->wrapper()->query()->retrieve('package_id', $DIC->refinery()->kindlyTo()->int());
33$refId = $DIC->http()->wrapper()->query()->retrieve('ref_id', $DIC->refinery()->kindlyTo()->int());
34$doUnload = false;
35if ($DIC->http()->wrapper()->query()->has('do')) {
36 if ($DIC->http()->wrapper()->query()->retrieve('do', $DIC->refinery()->kindlyTo()->string()) == "unload") {
37 $doUnload = true;
38 }
39}
40
42$comments = true;
46
47$lm_set = $ilDB->queryF(
48 'SELECT default_lesson_mode, interactions, objectives, time_from_lms, comments FROM sahs_lm WHERE id = %s',
49 array('integer'),
50 array($packageId)
51);
52while ($lm_rec = $ilDB->fetchAssoc($lm_set)) {
53 $defaultLessonMode = ($lm_rec["default_lesson_mode"]);
54 $interactions = ilUtil::yn2tf($lm_rec["interactions"]);
55 $objectives = ilUtil::yn2tf($lm_rec["objectives"]);
56 $time_from_lms = ilUtil::yn2tf($lm_rec["time_from_lms"]);
57 $comments = ilUtil::yn2tf($lm_rec["comments"]);
58}
59
60if ($doUnload) {
62} else {
63// $data = file_get_contents('php://input');
65}
const CONTEXT_SCORM
Definition: ilContext.php:42
static init(string $a_type)
Init context by type.
Definition: ilContext.php:52
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)
entry_point(string $name)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: result1.php:21
$interactions
$time_from_lms
$comments
$packageId
global $DIC
$doUnload
$lm_set
$refId
$objectives
if($DIC->http() ->wrapper() ->query() ->has('do')) $defaultLessonMode