ILIAS  eassessment Revision 61809
 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)
 storeJsApi ($obj_id=0)
 _syncReadEvent ($a_obj_id, $a_user_id, $a_type, $a_ref_id)
 Synch read event table.
 _insertTrackData ($a_sahs_id, $a_lval, $a_rval, $a_obj_id)
 _getTrackedUsers ($a_obj_id)
 Get all tracked users.
 _getFailed ($scorm_item_id, $a_obj_id)
 Redesign required.

Additional Inherited Members

- Static Public Member Functions inherited from ilObjSCORMTracking
static _getInProgress ($scorm_item_id, $a_obj_id)
 Redesign required.
static _getCompleted ($scorm_item_id, $a_obj_id)
 Redesign required.
static _getCollectionStatus ($a_scos, $a_obj_id, $a_user_id)
static _countCompleted ($a_scos, $a_obj_id, $a_user_id)
static _getCountCompletedPerUser ($a_scorm_item_ids, $a_obj_id)
 Get users who have status completed or passed.
static _getProgressInfo ($sco_item_ids, $a_obj_id)
 Get info about.

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 119 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, $ilDB, $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 129 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, $ilDB, $ilLog, $ref_id, ilObject\_lookupObjId(), 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)
{
$set = $ilDB->queryF('
SELECT * FROM scorm_tracking WHERE user_id = %s
AND sco_id = %s
AND lvalue = %s
AND obj_id = %s',
array('integer','integer','text','integer'),
array($user_id,$obj_id,$key,$hacp_id));
if ($rec = $ilDB->fetchAssoc($set))
$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 124 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: