ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
ilObjHACPTracking Class Reference
+ Inheritance diagram for ilObjHACPTracking:
+ Collaboration diagram for ilObjHACPTracking:

Public Member Functions

 ilObjHACPTracking ($ref_id, $obj_id)
 Constructor public. More...
 
 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. More...
 
- Public Member Functions inherited from ilObjSCORMTracking
 ilObjSCORMTracking ()
 Constructor public. More...
 
 extractData ()
 
 store ($obj_id=0, $sahs_id=0, $extractData=1)
 
 storeJsApi ($obj_id=0)
 
 storeJsApiCmi ($user_id, $obj_id, $data)
 
 syncGlobalStatus ($userId, $packageId, $data, $new_global_status)
 
 _syncReadEvent ($a_obj_id, $a_user_id, $a_type, $a_ref_id)
 Synch read event table. More...
 
 _insertTrackData ($a_sahs_id, $a_lval, $a_rval, $a_obj_id)
 
 _getTrackedUsers ($a_obj_id)
 Get all tracked users. More...
 
 _getFailed ($scorm_item_id, $a_obj_id)
 like necessary because of Oracle More...
 
 scorm12PlayerUnload ()
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjSCORMTracking
static _getInProgress ($scorm_item_id, $a_obj_id, $a_blocked_user_ids=null)
 
static _getCompleted ($scorm_item_id, $a_obj_id)
 like necessary because of Oracle More...
 
static _getCollectionStatus ($a_scos, $a_obj_id, $a_user_id)
 
static _hasMaxAttempts ($a_obj_id, $a_user_id)
 
static _countCompleted ($a_scos, $a_obj_id, $a_user_id)
 
static lookupLastAccessTimes ($a_obj_id)
 Lookup last acccess time for all users of a scorm module ilDB $ilDB. More...
 
static _getCountCompletedPerUser ($a_scorm_item_ids, $a_obj_id)
 Get users who have status completed or passed. More...
 
static _getProgressInfo ($sco_item_ids, $a_obj_id)
 Get info about. More...
 

Detailed Description

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

Member Function Documentation

◆ exitau()

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

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

References $ref_id.

118  {
119  $response=new ilHACPResponse($ref_id, $obj_id);
120  $response->sendOk();
121  }
$ref_id
Definition: sahs_server.php:39

◆ getparam()

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

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

References $ref_id.

64  {
65  //if (empty($aicc_data)) {
66  // $this->startau($ref_id, $obj_id, $version, $aicc_data);
67  // return;
68  //}
69 
70  $response=new ilHACPResponse($ref_id, $obj_id);
71  $response->sendParam();
72 
73 /*
74  $fp=fopen("././Modules/ScormAicc/log/hacp.log", "a+");
75  fputs($fp, "getparam ref_id=$ref_id, obj_id=$obj_id, aicc_data=$aicc_data\n");
76  fclose($fp);
77 */
78  }
$ref_id
Definition: sahs_server.php:39

◆ ilObjHACPTracking()

ilObjHACPTracking::ilObjHACPTracking (   $ref_id,
  $obj_id 
)

Constructor public.

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

References $_POST, $ilDB, $ilUser, $ref_id, and exit.

38  {
39  global $ilias, $ilDB, $ilUser;
40 
41 
42  //just to make sure to extract only this parameter
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];
47  }
48 
49  //only allowed commands
50  $command=strtolower($command);
51  $allowedCommands=array("getparam", "putparam", "exitau");
52  if (!in_array($command, $allowedCommands)) {
53  exit;
54  }
55 /*
56  $fp=fopen("././Modules/ScormAicc/log/hacp.log", "a+");
57  fputs($fp, "$command ref_id=$ref_id, obj_id=$obj_id\n");
58  fclose($fp);
59 */
60  $this->$command($ref_id, $obj_id, $version, $aicc_data);
61 
62  }
exit
Definition: login.php:54
$_POST['username']
Definition: cron.php:12
global $ilUser
Definition: imgupload.php:15
$ref_id
Definition: sahs_server.php:39
global $ilDB

◆ parseAICCData()

ilObjHACPTracking::parseAICCData (   $string)

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

References $data.

Referenced by putparam().

128  {
129  $data=array();
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)=="#"){
135  continue;
136  }
137  if (substr($line,0,1)=="[") {
138  $block=substr($line,1,-1);
139  continue;
140  }
141  if (empty($block))
142  continue;
143 
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];
149  }
150  }
151  }
152  return $data;
153  }
+ Here is the caller graph for this function:

◆ putparam()

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

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

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

80  {
81  //aiccdata is a non standard ini format
82  //$data=parse_ini_file($tmpFilename, TRUE);
83  $data=$this->parseAICCData($aicc_data);
84 
85  $hacp_id = ilObject::_lookupObjId($ref_id);
86 
87  //choose either insert or update to be able to inherit superclass
88  global $ilDB, $ilUser, $ilLog;
89  $this->update=array();
90  $this->insert=array();
91  if (is_object($ilUser)) {
92  $user_id = $ilUser->getId();
93  foreach ($data as $key=>$value)
94  {
95 
96  $set = $ilDB->queryF('
97  SELECT * FROM scorm_tracking WHERE user_id = %s
98  AND sco_id = %s
99  AND lvalue = %s
100  AND obj_id = %s',
101  array('integer','integer','text','integer'),
102  array($user_id,$obj_id,$key,$hacp_id));
103 
104  if ($rec = $ilDB->fetchAssoc($set))
105  $this->update[] = array("left" => $key, "right" => $value);
106  else
107  $this->insert[] = array("left" => $key, "right" => $value);
108  }
109  }
110 
111  //store
112  $this->store($hacp_id, $obj_id, 0);
113 
114  $response=new ilHACPResponse($ref_id, $obj_id);
115  $response->sendOk();
116  }
static _lookupObjId($a_id)
global $ilUser
Definition: imgupload.php:15
$ref_id
Definition: sahs_server.php:39
global $ilDB
store($obj_id=0, $sahs_id=0, $extractData=1)
+ Here is the call graph for this function:

◆ startau()

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

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

References $ref_id.

123  {
124  $response=new ilHACPResponse($ref_id, $obj_id);
125  $response->sendParam();
126  }
$ref_id
Definition: sahs_server.php:39

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