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