Public Member Functions | Data Fields

ilHACPResponse Class Reference

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 5 of file class.ilHACPResponse.php.


Member Function Documentation

ilHACPResponse::getStudentId (  ) 

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

Referenced by sendParam().

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

Here is the caller graph for this function:

ilHACPResponse::getStudentName (  ) 

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

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 11 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 23 of file class.ilHACPResponse.php.

                          {
                echo "error=0\n";
                echo "error_txt=Successful\n";
                echo "version=3.0\n";
        }

ilHACPResponse::sendParam (  ) 

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

References $data, $key, $set, $user_id, getStudentId(), and getStudentName().

                             {
                global $ilUser, $ilDB;
                
                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"]="";
                
                
                //Read Trackingdata
                if (is_object($ilUser)) {
                        $user_id = $ilUser->getId();
                        $stmt = "SELECT * FROM scorm_tracking WHERE user_id = ".$ilDB->quote($user_id).
                                        " AND sco_id = ".$ilDB->quote($this->obj_id);
                        $set = $ilDB->query($stmt);
                        $rec = $set->fetchRow(DB_FETCHMODE_ASSOC);
                        while ($rec = $set->fetchRow(DB_FETCHMODE_ASSOC))       {
                                $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 9 of file class.ilHACPResponse.php.

Referenced by ilHACPResponse().

ilHACPResponse::$ref_id

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

Referenced by ilHACPResponse().

ilHACPResponse::$unit

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


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