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();
89 global $ilDB, $ilUser,
$ilLog;
90 $this->update=array();
91 $this->insert=array();
92 if (is_object($ilUser)) {
93 $user_id = $ilUser->getId();
94 foreach (
$data as $key=>$value) {
95 $stmt =
"SELECT * FROM scorm_tracking WHERE user_id = ".$ilDB->quote($user_id).
96 " AND sco_id = ".$ilDB->quote($obj_id).
" AND lvalue = ".$ilDB->quote($key).
97 " AND obj_id = ".$ilDB->quote($hacp_id);
98 $set = $ilDB->query($stmt);
100 $this->update[] = array(
"left" => $key,
"right" => $value);
102 $this->insert[] = array(
"left" => $key,
"right" => $value);
107 $this->
store($hacp_id, $obj_id, 0);
120 $response->sendParam();
125 if (!empty($string)) {
126 $lines=explode(
"\n", $string);
127 for($i=0;$i<count($lines);$i++) {
128 $line=trim($lines[$i]);
129 if (empty($line) || substr($line,0,1)==
";" || substr($line,0,1)==
"#"){
132 if (substr($line,0,1)==
"[") {
133 $block=substr($line,1,-1);
139 if (substr_count($line,
"=")==0)
140 $data[strtolower(
"cmi.".$block)]=$line;
141 else if (substr_count($line,
"=")==1) {
142 $line=explode(
"=", $line);
143 $data[strtolower(
"cmi.".$block.
".".$line[0])]=$line[1];