ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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

ilHACPResponse::getStudentId ( )

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

References $ilUser.

Referenced by sendParam().

{
global $ilUser;
return $ilUser->getId();
}

+ Here is the caller graph for this function:

ilHACPResponse::getStudentName ( )

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

References $ilUser.

Referenced by sendParam().

{
global $ilUser;
return $ilUser->getFullname();
}

+ Here is the caller graph for this function:

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

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

References $obj_id, and $ref_id.

{
if (!empty($ref_id) && !empty($obj_id)) {
$this->ref_id=$ref_id;
$this->obj_id=$obj_id;
$this->unit=new ilAICCUnit($obj_id);
$this->unit->read();
}
}
ilHACPResponse::sendOk ( )

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

{
echo "error=0\n";
echo "error_txt=Successful\n";
echo "version=3.0\n";
}
ilHACPResponse::sendParam ( )

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

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

{
global $ilUser, $ilDB, $ilLog;
echo "error=0\n";
echo "error_txt=Successful\n";
echo "version=3.0\n";
echo "aicc_data=\n";
$data["core"]["student_id"]=$this->getStudentId();
$data["core"]["student_name"]=$this->getStudentName();
$data["core"]["time"]="00:00:00";
$data["core_vendor"]=$this->unit->getCoreVendor();
$data["student_data"]["mastery_score"]=$this->unit->getMasteryScore();
$data["student_data"]["max_time_allowed"]=$this->unit->getMaxTimeAllowed();
$data["student_data"]["time_limit_action"]=$this->unit->getTimeLimitAction();
$data["student_preferences"]["audio"]="-1";
$data["student_preferences"]["text"]="1";
$data["core_lesson"]="";
$data["core"]["output_file"]="";
$data["core"]["credit"]="c";
$data["core"]["lesson_location"]="";
$data["core"]["lesson_status"]="n,a";
$data["core"]["path"]="";
$data["core"]["score"]="";
//$ilLog->write("Read Trackingdata A");
$slm_id = ilObject::_lookupObjId($this->ref_id);
//Read Trackingdata
if (is_object($ilUser))
{
$user_id = $ilUser->getId();
$set = $ilDB->queryF('
SELECT * FROM scorm_tracking
WHERE user_id = %s
AND sco_id = %s
AND obj_id = %s',
array('integer','integer','integer'),
array($user_id, $this->obj_id,$slm_id));
while ($rec = $ilDB->fetchAssoc($set))
{
$key=$rec["lvalue"];
$value=$rec["rvalue"];
$arr=explode(".", $key);
//delete useless prefix
array_shift($arr);
//analyse key and add it to the data array
if (count($arr)==1)
$data[$arr[0]]=$value;
else if (count($arr)==2)
$data[$arr[0]][$arr[1]]=$value;
}
}
foreach ($data as $block=>$paar) {
echo "[$block]\n";
if (!is_array($paar)) {
$paar=str_replace("<CR>", "\n", $paar);
$paar=str_replace("<cr>", "\n", $paar);
echo $paar."\n";
continue;
}
foreach ($paar as $key=>$value)
echo "$key=$value\n";
}
//echo "[evaluation]";
}

+ Here is the call graph for this function:

Field Documentation

ilHACPResponse::$obj_id

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

Referenced by ilHACPResponse().

ilHACPResponse::$ref_id

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

Referenced by ilHACPResponse().

ilHACPResponse::$unit

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


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