ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
storeScorm2004.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
10include_once "Services/Context/classes/class.ilContext.php";
12
13require_once("Services/Init/classes/class.ilInitialisation.php");
15
16include_once 'Modules/Scorm2004/classes/class.ilSCORM2004StoreData.php';
17
18//conditions for storing data
19global $ilDB;
20$packageId=(int)$_GET['package_id'];
21$lm_set = $ilDB->queryF('SELECT default_lesson_mode, interactions, objectives, time_from_lms, comments FROM sahs_lm WHERE id = %s',
22 array('integer'),array($packageId));
23while($lm_rec = $ilDB->fetchAssoc($lm_set))
24{
25 $defaultLessonMode=($lm_rec["default_lesson_mode"]);
26 $interactions=(ilUtil::yn2tf($lm_rec["interactions"]));
27 $objectives=(ilUtil::yn2tf($lm_rec["objectives"]));
28 $time_from_lms=(ilUtil::yn2tf($lm_rec["time_from_lms"]));
29 $comments=(ilUtil::yn2tf($lm_rec["comments"]));
30}
31
32if ((string) $_GET['do'] == "unload") {
34} else {
35 global $ilUser;
36 $data = file_get_contents('php://input');
37 $ilUser->setId($data->p);
38
39 //until now only 2004
40 ilSCORM2004StoreData::persistCMIData(null, $packageId, $defaultLessonMode, $comments, $interactions, $objectives, $time_from_lms, $data);
41}
42
43
44?>
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
static init($a_type)
Init context by type.
const CONTEXT_SCORM
static initILIAS()
ilias initialisation
static persistCMIData($userId=null, $packageId, $defaultLessonMode, $comments, $interactions, $objectives, $time_from_lms, $data=null)
static scormPlayerUnload($userId=null, $packageId, $time_from_lms)
static yn2tf($a_yn)
convert "y"/"n" to true/false
$packageId
global $ilDB
$lm_set
$ilUser
Definition: imgupload.php:18