"Fossies" - the Fresh Open Source Software Archive

Member "ILIAS-5.4.9/storeScorm2004.php" (24 Jan 2020, 1483 Bytes) of package /linux/www/ILIAS-5.4.9.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "storeScorm2004.php" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 5.4.8_vs_5.4.9.

    1 <?php
    2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
    3 /**
    4  * for storing Data also without session
    5  * @author Uwe Kohnle <kohnle@internetlehrer-gmbh.de>
    6  * @version $Id$
    7  */
    8 
    9 
   10 include_once "Services/Context/classes/class.ilContext.php";
   11 ilContext::init(ilContext::CONTEXT_SCORM);
   12 
   13 require_once("Services/Init/classes/class.ilInitialisation.php");
   14 ilInitialisation::initILIAS();
   15 
   16 include_once 'Modules/Scorm2004/classes/class.ilSCORM2004StoreData.php';
   17 
   18 //conditions for storing data
   19 global $ilDB;
   20 $packageId=(int) $_GET['package_id'];
   21 $lm_set = $ilDB->queryF(
   22     'SELECT default_lesson_mode, interactions, objectives, time_from_lms, comments FROM sahs_lm WHERE id = %s',
   23     array('integer'),
   24     array($packageId)
   25 );
   26 while ($lm_rec = $ilDB->fetchAssoc($lm_set)) {
   27     $defaultLessonMode=($lm_rec["default_lesson_mode"]);
   28     $interactions=(ilUtil::yn2tf($lm_rec["interactions"]));
   29     $objectives=(ilUtil::yn2tf($lm_rec["objectives"]));
   30     $time_from_lms=(ilUtil::yn2tf($lm_rec["time_from_lms"]));
   31     $comments=(ilUtil::yn2tf($lm_rec["comments"]));
   32 }
   33 
   34 if ((string) $_GET['do'] == "unload") {
   35     ilSCORM2004StoreData::scormPlayerUnload(null, $packageId, $time_from_lms);
   36 } else {
   37     global $ilUser;
   38     $data = file_get_contents('php://input');
   39     $ilUser->setId($data->p);
   40 
   41     //until now only 2004
   42     ilSCORM2004StoreData::persistCMIData(null, $packageId, $defaultLessonMode, $comments, $interactions, $objectives, $time_from_lms, $data);
   43 }