Esempio n. 1
0
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $ilAccess, $ilLog, $ilUser, $lng, $ilias;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
         $ilias->raiseError($lng->txt("permission_denied"), $ilias->error_obj->WARNING);
     }
     //$ilLog->write("SCORM2004 Player cmd: ".$cmd);
     switch ($cmd) {
         case 'getRTEjs':
             $this->getRTEjs();
             break;
         case 'cp':
             $this->getCPData();
             break;
         case 'adlact':
             $this->getADLActData();
             break;
         case 'suspend':
             $this->suspendADLActData();
             break;
         case 'getSuspend':
             $this->getSuspendData();
             break;
         case 'gobjective':
             //				$this->writeGObjective();
             break;
         case 'getGobjective':
             $this->readGObjective();
             break;
         case 'getSharedData':
             $this->readSharedData($_GET['node_id']);
             break;
         case 'setSharedData':
             $this->writeSharedData($_GET['node_id']);
             break;
         case 'cmi':
             if ($_SERVER['REQUEST_METHOD'] == 'POST') {
                 include_once './Modules/Scorm2004/classes/class.ilSCORM2004StoreData.php';
                 ilSCORM2004StoreData::persistCMIData($this->userId, $this->packageId, $this->slm->getDefaultLessonMode(), $this->slm->getComments(), $this->slm->getInteractions(), $this->slm->getObjectives());
                 //error_log("Saved CMI Data");
             } else {
                 $this->fetchCMIData();
             }
             break;
         case 'specialPage':
             $this->specialPage();
             break;
         case 'debugGUI':
             $this->debugGUI();
             break;
         case 'postLogEntry':
             $this->postLogEntry();
             break;
         case 'liveLogContent':
             $this->liveLogContent();
             break;
         case 'downloadLog':
             $this->downloadLog();
             break;
         case 'openLog':
             $this->openLog();
             break;
         case 'pingSession':
             $this->pingSession();
             break;
         case 'scormPlayerUnload':
             include_once './Modules/Scorm2004/classes/class.ilSCORM2004StoreData.php';
             ilSCORM2004StoreData::scormPlayerUnload($this->userId, $this->packageId);
             break;
             // case 'getConfigForPlayer':
             // $this->getConfigForPlayer();
             // break;
         // case 'getConfigForPlayer':
         // $this->getConfigForPlayer();
         // break;
         default:
             $this->getPlayer();
             break;
     }
 }
Esempio n. 2
0
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
/**
 * for storing Data also without session
 * @author Uwe Kohnle <*****@*****.**>
 * @version $Id$
 */
include_once "Services/Context/classes/class.ilContext.php";
ilContext::init(ilContext::CONTEXT_SCORM);
require_once "Services/Init/classes/class.ilInitialisation.php";
ilInitialisation::initILIAS();
include_once 'Modules/Scorm2004/classes/class.ilSCORM2004StoreData.php';
if ((string) $_GET['do'] == "unload") {
    include_once 'Modules/Scorm2004/classes/class.ilSCORM2004StoreData.php';
    ilSCORM2004StoreData::scormPlayerUnload(null, (int) $_GET['package_id']);
} else {
    global $ilLog, $ilDB, $ilUser;
    $packageId = (int) $_GET['package_id'];
    $lm_set = $ilDB->queryF('SELECT default_lesson_mode, interactions, objectives, comments FROM sahs_lm WHERE id = %s', array('integer'), array($packageId));
    while ($lm_rec = $ilDB->fetchAssoc($lm_set)) {
        $defaultLessonMode = $lm_rec["default_lesson_mode"];
        $interactions = ilUtil::yn2tf($lm_rec["interactions"]);
        $objectives = ilUtil::yn2tf($lm_rec["objectives"]);
        $comments = ilUtil::yn2tf($lm_rec["comments"]);
    }
    $data = file_get_contents('php://input');
    $ilUser->setId($data->p);
    //until now only 2004
    include_once 'Modules/Scorm2004/classes/class.ilSCORM2004StoreData.php';
    ilSCORM2004StoreData::persistCMIData(null, $packageId, $defaultLessonMode, $comments, $interactions, $objectives, $data);
}
 public function persistCMIData()
 {
     global $ilLog, $ilDB, $ilUser;
     $packageId = (int) $_GET['package_id'];
     $lm_set = $ilDB->queryF('SELECT default_lesson_mode, interactions, objectives, comments FROM sahs_lm WHERE id = %s', array('integer'), array($packageId));
     while ($lm_rec = $ilDB->fetchAssoc($lm_set)) {
         $defaultLessonMode = $lm_rec["default_lesson_mode"];
         $interactions = ilUtil::yn2tf($lm_rec["interactions"]);
         $objectives = ilUtil::yn2tf($lm_rec["objectives"]);
         $comments = ilUtil::yn2tf($lm_rec["comments"]);
     }
     $data = file_get_contents('php://input');
     $ilUser->setId($data->p);
     include_once './Modules/Scorm2004/classes/class.ilSCORM2004StoreData.php';
     ilSCORM2004StoreData::persistCMIData(null, $packageId, $defaultLessonMode, $comments, $interactions, $objectives, $data);
 }