ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjHACPTracking Class Reference
+ Inheritance diagram for ilObjHACPTracking:
+ Collaboration diagram for ilObjHACPTracking:

Public Member Functions

 ilObjHACPTracking ($ref_id, $obj_id)
 Constructor public.
 getparam ($ref_id, $obj_id, $version, $aicc_data)
 putparam ($ref_id, $obj_id, $version, $aicc_data)
 exitau ($ref_id, $obj_id, $version, $aicc_data)
 startau ($ref_id, $obj_id, $version, $aicc_data)
 parseAICCData ($string)
- Public Member Functions inherited from ilObjAICCTracking
 ilObjAICCTracking ()
 Constructor public.
- Public Member Functions inherited from ilObjSCORMTracking
 ilObjSCORMTracking ()
 Constructor public.
 extractData ()
 store ($obj_id=0, $sahs_id=0, $extractData=1)
 _insertTrackData ($a_sahs_id, $a_lval, $a_rval, $a_obj_id)
 _getInProgress ($scorm_item_id, $a_obj_id)
 _getCompleted ($scorm_item_id, $a_obj_id)
 _getFailed ($scorm_item_id, $a_obj_id)
 _getCountCompletedPerUser ($a_scorm_item_ids, $a_obj_id)
 _getProgressInfo ($sco_item_ids, $a_obj_id)

Detailed Description

Definition at line 31 of file class.ilObjHACPTracking.php.

Member Function Documentation

ilObjHACPTracking::exitau (   $ref_id,
  $obj_id,
  $version,
  $aicc_data 
)

Definition at line 113 of file class.ilObjHACPTracking.php.

References $ref_id.

{
$response=new ilHACPResponse($ref_id, $obj_id);
$response->sendOk();
}
ilObjHACPTracking::getparam (   $ref_id,
  $obj_id,
  $version,
  $aicc_data 
)

Definition at line 65 of file class.ilObjHACPTracking.php.

References $ref_id.

{
//if (empty($aicc_data)) {
// $this->startau($ref_id, $obj_id, $version, $aicc_data);
// return;
//}
$response=new ilHACPResponse($ref_id, $obj_id);
$response->sendParam();
/*
$fp=fopen("././Modules/ScormAicc/log/hacp.log", "a+");
fputs($fp, "getparam ref_id=$ref_id, obj_id=$obj_id, aicc_data=$aicc_data\n");
fclose($fp);
*/
}
ilObjHACPTracking::ilObjHACPTracking (   $ref_id,
  $obj_id 
)

Constructor public.

Definition at line 37 of file class.ilObjHACPTracking.php.

References $command, $ref_id, and exit.

{
global $ilias, $HTTP_POST_VARS;
global $ilDB, $ilUser;
//just to make sure to extract only this parameter
$mainKeys=array("command", "version", "session_id", "aicc_data");
$postVars=array_change_key_case($HTTP_POST_VARS, CASE_LOWER);
foreach($mainKeys as $key) {
$$key=$postVars[$key];
}
//only allowed commands
$command=strtolower($command);
$allowedCommands=array("getparam", "putparam", "exitau");
if (!in_array($command, $allowedCommands)) {
}
/*
$fp=fopen("././Modules/ScormAicc/log/hacp.log", "a+");
fputs($fp, "$command ref_id=$ref_id, obj_id=$obj_id\n");
fclose($fp);
*/
$this->$command($ref_id, $obj_id, $version, $aicc_data);
}
ilObjHACPTracking::parseAICCData (   $string)

Definition at line 123 of file class.ilObjHACPTracking.php.

References $data.

Referenced by putparam().

{
$data=array();
if (!empty($string)) {
$lines=explode("\n", $string);
for($i=0;$i<count($lines);$i++) {
$line=trim($lines[$i]);
if (empty($line) || substr($line,0,1)==";" || substr($line,0,1)=="#"){
continue;
}
if (substr($line,0,1)=="[") {
$block=substr($line,1,-1);
continue;
}
if (empty($block))
continue;
if (substr_count($line, "=")==0)
$data[strtolower("cmi.".$block)]=$line;
else if (substr_count($line, "=")==1) {
$line=explode("=", $line);
$data[strtolower("cmi.".$block.".".$line[0])]=$line[1];
}
}
}
return $data;
}

+ Here is the caller graph for this function:

ilObjHACPTracking::putparam (   $ref_id,
  $obj_id,
  $version,
  $aicc_data 
)

Definition at line 81 of file class.ilObjHACPTracking.php.

References $data, $ilLog, $ref_id, ilObject\_lookupObjId(), DB_FETCHMODE_ASSOC, parseAICCData(), and ilObjSCORMTracking\store().

{
//aiccdata is a non standard ini format
//$data=parse_ini_file($tmpFilename, TRUE);
$data=$this->parseAICCData($aicc_data);
//choose either insert or update to be able to inherit superclass
global $ilDB, $ilUser, $ilLog;
$this->update=array();
$this->insert=array();
if (is_object($ilUser)) {
$user_id = $ilUser->getId();
foreach ($data as $key=>$value) {
$stmt = "SELECT * FROM scorm_tracking WHERE user_id = ".$ilDB->quote($user_id).
" AND sco_id = ".$ilDB->quote($obj_id)." AND lvalue = ".$ilDB->quote($key).
" AND obj_id = ".$ilDB->quote($hacp_id);
$set = $ilDB->query($stmt);
if ($rec = $set->fetchRow(DB_FETCHMODE_ASSOC))
$this->update[] = array("left" => $key, "right" => $value);
else
$this->insert[] = array("left" => $key, "right" => $value);
}
}
//store
$this->store($hacp_id, $obj_id, 0);
$response=new ilHACPResponse($ref_id, $obj_id);
$response->sendOk();
}

+ Here is the call graph for this function:

ilObjHACPTracking::startau (   $ref_id,
  $obj_id,
  $version,
  $aicc_data 
)

Definition at line 118 of file class.ilObjHACPTracking.php.

References $ref_id.

{
$response=new ilHACPResponse($ref_id, $obj_id);
$response->sendParam();
}

The documentation for this class was generated from the following file: