24 require_once(
"./Modules/ScormAicc/classes/AICC/class.ilObjAICCTracking.php");
25 require_once(
"./Modules/ScormAicc/classes/HACP/class.ilHACPResponse.php");
39 global $ilias, $HTTP_POST_VARS;
40 global
$ilDB, $ilUser;
44 $mainKeys=array(
"command",
"version",
"session_id",
"aicc_data");
45 $postVars=array_change_key_case($HTTP_POST_VARS, CASE_LOWER);
46 foreach($mainKeys as
$key) {
47 $$key=$postVars[
$key];
52 $allowedCommands=array(
"getparam",
"putparam",
"exitau");
53 if (!in_array(
$command, $allowedCommands)) {
72 $response->sendParam();
90 $this->update=array();
91 $this->insert=array();
92 if (is_object($ilUser)) {
93 $user_id = $ilUser->getId();
97 $set = $ilDB->queryF(
'
98 SELECT * FROM scorm_tracking WHERE user_id = %s
102 array(
'integer',
'integer',
'text',
'integer'),
103 array($user_id,$obj_id,
$key,$hacp_id));
105 if ($rec = $ilDB->fetchAssoc($set))
106 $this->update[] = array(
"left" =>
$key,
"right" => $value);
108 $this->insert[] = array(
"left" =>
$key,
"right" => $value);
113 $this->
store($hacp_id, $obj_id, 0);
126 $response->sendParam();
131 if (!empty($string)) {
132 $lines=explode(
"\n", $string);
133 for($i=0;$i<count($lines);$i++) {
134 $line=trim($lines[$i]);
135 if (empty($line) || substr($line,0,1)==
";" || substr($line,0,1)==
"#"){
138 if (substr($line,0,1)==
"[") {
139 $block=substr($line,1,-1);
145 if (substr_count($line,
"=")==0)
146 $data[strtolower(
"cmi.".$block)]=$line;
147 else if (substr_count($line,
"=")==1) {
148 $line=explode(
"=", $line);
149 $data[strtolower(
"cmi.".$block.
".".$line[0])]=$line[1];