Go to the documentation of this file.00001 <?php
00002
00003 require_once("content/classes/AICC/class.ilAICCObject.php");
00004
00005 class ilAICCUnit extends ilAICCObject
00006 {
00007
00017 var $au_type;
00018 var $command_line;
00019 var $max_time_allowed;
00020 var $time_limit_action;
00021 var $max_score;
00022 var $core_vendor;
00023 var $system_vendor;
00024 var $file_name;
00025 var $mastery_score;
00026 var $web_launch;
00027 var $au_password;
00028
00035 function ilAICCUnit($a_id = 0)
00036 {
00037 parent::ilAICCObject($a_id);
00038 $this->setType("sau");
00039 }
00040
00041 function getAUType()
00042 {
00043 return $this->au_type;
00044 }
00045
00046 function setAUType($a_au_type)
00047 {
00048 $this->au_type = $a_au_type;
00049 }
00050
00051 function getCommand_line()
00052 {
00053 return $this->command_line;
00054 }
00055
00056 function setCommand_line($a_command_line)
00057 {
00058 $this->command_line = $a_command_line;
00059 }
00060
00061 function getMaxTimeAllowed()
00062 {
00063 return $this->max_time_allowed;
00064 }
00065
00066 function setMaxTimeAllowed($a_max_time_allowed)
00067 {
00068 $this->max_time_allowed = $a_max_time_allowed;
00069 }
00070
00071 function getTimeLimitAction()
00072 {
00073 return $this->time_limit_action;
00074 }
00075
00076 function setTimeLimitAction($a_time_limit_action)
00077 {
00078 $this->time_limit_action = $a_time_limit_action;
00079 }
00080
00081 function getMaxScore()
00082 {
00083 return $this->max_score;
00084 }
00085
00086 function setMaxScore($a_max_score)
00087 {
00088 $this->max_score = $a_max_score;
00089 }
00090
00091 function getCoreVendor()
00092 {
00093 return $this->core_vendor;
00094 }
00095
00096 function setCoreVendor($a_core_vendor)
00097 {
00098 $this->core_vendor = $a_core_vendor;
00099 }
00100
00101 function getSystemVendor()
00102 {
00103 return $this->system_vendor;
00104 }
00105
00106 function setSystemVendor($a_system_vendor)
00107 {
00108 $this->system_vendor = $a_system_vendor;
00109 }
00110
00111 function getFilename()
00112 {
00113 return $this->file_name;
00114 }
00115
00116 function setFilename($a_file_name)
00117 {
00118 $this->file_name = $a_file_name;
00119 }
00120
00121 function getMasteryScore()
00122 {
00123 return $this->mastery_score;
00124 }
00125
00126 function setMasteryScore($a_mastery_score)
00127 {
00128 $this->mastery_score = $a_mastery_score;
00129 }
00130
00131 function getWebLaunch()
00132 {
00133 return $this->web_launch;
00134 }
00135
00136 function setWebLaunch($a_web_launch)
00137 {
00138 $this->web_launch = $a_web_launch;
00139 }
00140
00141 function getAUPassword()
00142 {
00143 return $this->au_password;
00144 }
00145
00146 function setAUPassword($a_au_password)
00147 {
00148 $this->au_password = $a_au_password;
00149 }
00150
00151 function read()
00152 {
00153 parent::read();
00154
00155 $q = "SELECT * FROM aicc_units WHERE obj_id = '".$this->getId()."'";
00156
00157 $obj_set = $this->ilias->db->query($q);
00158 $obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
00159 $this->setAUType($obj_rec["type"]);
00160 $this->setCommand_line($obj_rec["command_line"]);
00161 $this->setMaxTimeAllowed($obj_rec["max_time_allowed"]);
00162 $this->setTimeLimitAction($obj_rec["time_limit_action"]);
00163 $this->setMaxScore($obj_rec["max_score"]);
00164 $this->setCoreVendor($obj_rec["core_vendor"]);
00165 $this->setSystemVendor($obj_rec["system_vendor"]);
00166 $this->setFilename($obj_rec["file_name"]);
00167 $this->setMasteryScore($obj_rec["mastery_score"]);
00168 $this->setWebLaunch($obj_rec["web_launch"]);
00169 $this->setAUPassword($obj_rec["au_password"]);
00170 }
00171
00172 function create()
00173 {
00174 parent::create();
00175
00176 $q = "INSERT INTO aicc_units (obj_id, type, command_line, max_time_allowed, time_limit_action,
00177 max_score, core_vendor, system_vendor, file_name, mastery_score,
00178 web_launch, au_password) VALUES (";
00179 $q.="'".$this->getId()."', ";
00180 $q.="'".$this->prepForStore($this->getAUType())."', ";
00181 $q.="'".$this->prepForStore($this->getCommand_line())."', ";
00182 $q.="'".$this->prepForStore($this->getMaxTimeAllowed())."', ";
00183 $q.="'".$this->prepForStore($this->getTimeLimitAction())."', ";
00184 $q.="'".$this->prepForStore($this->getMaxScore())."', ";
00185 $q.="'".$this->prepForStore($this->getCoreVendor())."', ";
00186 $q.="'".$this->prepForStore($this->getSystemVendor())."', ";
00187 $q.="'".$this->prepForStore($this->getFilename())."', ";
00188 $q.="'".$this->prepForStore($this->getMasteryScore())."', ";
00189 $q.="'".$this->prepForStore($this->getWebLaunch())."', ";
00190 $q.="'".$this->prepForStore($this->getAUPassword())."')";
00191
00192 $this->ilias->db->query($q);
00193 }
00194
00195 function update()
00196 {
00197 parent::update();
00198
00199 $q = "UPDATE aicc_units SET ";
00200 $q.="type='".$this->prepForStore($this->getAUType())."', ";
00201 $q.="command_line='".$this->prepForStore($this->getCommand_line())."', ";
00202 $q.="max_time_allowed='".$this->prepForStore($this->getMaxTimeAllowed())."', ";
00203 $q.="time_limit_action='".$this->prepForStore($this->getTimeLimitAction())."', ";
00204 $q.="max_score='".$this->prepForStore($this->getMaxScore())."', ";
00205 $q.="core_vendor='".$this->prepForStore($this->getCoreVendor())."', ";
00206 $q.="system_vendor='".$this->prepForStore($this->getSystemVendor())."', ";
00207 $q.="file_name='".$this->prepForStore($this->getFilename())."', ";
00208 $q.="mastery_score='".$this->prepForStore($this->getMasteryScore())."', ";
00209 $q.="web_launch='".$this->prepForStore($this->getWebLaunch())."', ";
00210 $q.="au_password='".$this->prepForStore($this->getAUPassword())."' ";
00211 $q.="WHERE obj_id = '".$this->getId()."'";
00212 $this->ilias->db->query($q);
00213 }
00214
00215 function delete()
00216 {
00217 global $ilDB;
00218
00219 parent::delete();
00220
00221 $q = "DELETE FROM aicc_units WHERE obj_id =".$ilDB->quote($this->getId());
00222 $ilDB->query($q);
00223
00224 $q = "DELETE FROM scorm_tracking WHERE ".
00225 "sco_id = ".$ilDB->quote($this->getId());
00226 $ilDB->query($q);
00227
00228 }
00229
00235 function getTrackingDataOfUser($a_user_id = 0)
00236 {
00237 global $ilDB, $ilUser;
00238
00239 if ($a_user_id == 0)
00240 {
00241 $a_user_id = $ilUser->getId();
00242 }
00243
00244 $q = "SELECT * FROM scorm_tracking WHERE ".
00245 "sco_id = '".$this->getId()."' AND ".
00246 "user_id = '".$a_user_id."'";
00247
00248 $track_set = $ilDB->query($q);
00249 $trdata = array();
00250 while ($track_rec = $track_set->fetchRow(DB_FETCHMODE_ASSOC))
00251 {
00252 $trdata[$track_rec["lvalue"]] = $track_rec["rvalue"];
00253 }
00254
00255 return $trdata;
00256 }
00257
00258 function insertTrackData($a_lval, $a_rval, $a_ref_id)
00259 {
00260 require_once("content/classes/SCORM/class.ilObjSCORMTracking.php");
00261 ilObjSCORMTracking::_insertTrackData($this->getId(), $a_lval, $a_rval, $a_ref_id);
00262 }
00263
00264 }
00265 ?>