ILIAS  release_4-4 Revision
ilHACPResponse Class Reference
+ Collaboration diagram for ilHACPResponse:

Public Member Functions

 ilHACPResponse ($ref_id=0, $obj_id=0)
 
 sendOk ()
 
 getStudentId ()
 
 getStudentName ()
 
 sendParam ()
 

Data Fields

 $unit
 
 $ref_id
 
 $obj_id
 

Detailed Description

Definition at line 29 of file class.ilHACPResponse.php.

Member Function Documentation

◆ getStudentId()

ilHACPResponse::getStudentId ( )

Definition at line 53 of file class.ilHACPResponse.php.

References $ilUser.

Referenced by sendParam().

53  {
54  global $ilUser;
55  return $ilUser->getId();
56  }
global $ilUser
Definition: imgupload.php:15
+ Here is the caller graph for this function:

◆ getStudentName()

ilHACPResponse::getStudentName ( )

Definition at line 58 of file class.ilHACPResponse.php.

References $ilUser.

Referenced by sendParam().

58  {
59  global $ilUser;
60  return $ilUser->getFullname();
61  }
global $ilUser
Definition: imgupload.php:15
+ Here is the caller graph for this function:

◆ ilHACPResponse()

ilHACPResponse::ilHACPResponse (   $ref_id = 0,
  $obj_id = 0 
)

Definition at line 35 of file class.ilHACPResponse.php.

References $obj_id, and $ref_id.

35  {
36 
37  if (!empty($ref_id) && !empty($obj_id)) {
38  $this->ref_id=$ref_id;
39  $this->obj_id=$obj_id;
40 
41  $this->unit=new ilAICCUnit($obj_id);
42  $this->unit->read();
43  }
44 
45  }

◆ sendOk()

ilHACPResponse::sendOk ( )

Definition at line 47 of file class.ilHACPResponse.php.

47  {
48  echo "error=0\n";
49  echo "error_txt=Successful\n";
50  echo "version=3.0\n";
51  }

◆ sendParam()

ilHACPResponse::sendParam ( )

Definition at line 63 of file class.ilHACPResponse.php.

References $data, $ilLog, $ilUser, ilObject\_lookupObjId(), getStudentId(), and getStudentName().

63  {
64  global $ilUser, $ilDB, $ilLog;
65 
66  echo "error=0\n";
67  echo "error_txt=Successful\n";
68  echo "version=3.0\n";
69  echo "aicc_data=\n";
70 
71  $data["core"]["student_id"]=$this->getStudentId();
72  $data["core"]["student_name"]=$this->getStudentName();
73  $data["core"]["time"]="00:00:00";
74 
75  $data["core_vendor"]=$this->unit->getCoreVendor();
76 
77  $data["student_data"]["mastery_score"]=$this->unit->getMasteryScore();
78  $data["student_data"]["max_time_allowed"]=$this->unit->getMaxTimeAllowed();
79  $data["student_data"]["time_limit_action"]=$this->unit->getTimeLimitAction();
80 
81  $data["student_preferences"]["audio"]="-1";
82  $data["student_preferences"]["text"]="1";
83 
84  $data["core_lesson"]="";
85  $data["core"]["output_file"]="";
86  $data["core"]["credit"]="c";
87  $data["core"]["lesson_location"]="";
88  $data["core"]["lesson_status"]="n,a";
89  $data["core"]["path"]="";
90  $data["core"]["score"]="";
91 
92 //$ilLog->write("Read Trackingdata A");
93 
94  $slm_id = ilObject::_lookupObjId($this->ref_id);
95  //Read Trackingdata
96  if (is_object($ilUser))
97  {
98  $user_id = $ilUser->getId();
99 
100  $set = $ilDB->queryF('
101  SELECT * FROM scorm_tracking
102  WHERE user_id = %s
103  AND sco_id = %s
104  AND obj_id = %s',
105  array('integer','integer','integer'),
106  array($user_id, $this->obj_id,$slm_id));
107 
108  while ($rec = $ilDB->fetchAssoc($set))
109  {
110  $key=$rec["lvalue"];
111  $value=$rec["rvalue"];
112  $arr=explode(".", $key);
113  //delete useless prefix
114  array_shift($arr);
115  //analyse key and add it to the data array
116  if (count($arr)==1)
117  $data[$arr[0]]=$value;
118  else if (count($arr)==2)
119  $data[$arr[0]][$arr[1]]=$value;
120  }
121  }
122 
123  foreach ($data as $block=>$paar) {
124  echo "[$block]\n";
125  if (!is_array($paar)) {
126  $paar=str_replace("<CR>", "\n", $paar);
127  $paar=str_replace("<cr>", "\n", $paar);
128  echo $paar."\n";
129  continue;
130  }
131 
132  foreach ($paar as $key=>$value)
133  echo "$key=$value\n";
134  }
135 
136  //echo "[evaluation]";
137 
138  }
static _lookupObjId($a_id)
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

Field Documentation

◆ $obj_id

ilHACPResponse::$obj_id

Definition at line 33 of file class.ilHACPResponse.php.

Referenced by ilHACPResponse().

◆ $ref_id

ilHACPResponse::$ref_id

Definition at line 32 of file class.ilHACPResponse.php.

Referenced by ilHACPResponse().

◆ $unit

ilHACPResponse::$unit

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


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