• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Modules/ScormAicc/classes/AICC/class.ilAICCUnit.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2006 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00024 require_once("./Modules/ScormAicc/classes/AICC/class.ilAICCObject.php");
00025 
00026 class ilAICCUnit extends ilAICCObject
00027 {
00028 
00036         var $au_type;
00037         var $command_line;
00038         var $max_time_allowed;
00039         var $time_limit_action;
00040         var $max_score;
00041         var $core_vendor;
00042         var $system_vendor;
00043         var $file_name;
00044         var $mastery_score;
00045         var $web_launch;
00046         var $au_password;
00047 
00054         function ilAICCUnit($a_id = 0)
00055         {
00056                 parent::ilAICCObject($a_id);
00057                 $this->setType("sau");
00058         }
00059         
00060         function getAUType()
00061         {
00062                 return $this->au_type;
00063         }
00064         
00065         function setAUType($a_au_type)
00066         {
00067                 $this->au_type = $a_au_type;
00068         }
00069         
00070         function getCommand_line()
00071         {
00072                 return $this->command_line;
00073         }
00074 
00075         function setCommand_line($a_command_line)
00076         {
00077                 $this->command_line = $a_command_line;
00078         }
00079         
00080         function getMaxTimeAllowed()
00081         {
00082                 return $this->max_time_allowed;
00083         }
00084         
00085         function setMaxTimeAllowed($a_max_time_allowed)
00086         {
00087                 $this->max_time_allowed = $a_max_time_allowed;
00088         }
00089 
00090         function getTimeLimitAction()
00091         {
00092                 return $this->time_limit_action;
00093         }
00094         
00095         function setTimeLimitAction($a_time_limit_action)
00096         {
00097                 $this->time_limit_action = $a_time_limit_action;
00098         }
00099 
00100         function getMaxScore()
00101         {
00102                 return $this->max_score;
00103         }
00104         
00105         function setMaxScore($a_max_score)
00106         {
00107                 $this->max_score = $a_max_score;
00108         }
00109 
00110         function getCoreVendor()
00111         {
00112                 return $this->core_vendor;
00113         }
00114         
00115         function setCoreVendor($a_core_vendor)
00116         {
00117                 $this->core_vendor = $a_core_vendor;
00118         }
00119 
00120         function getSystemVendor()
00121         {
00122                 return $this->system_vendor;
00123         }
00124         
00125         function setSystemVendor($a_system_vendor)
00126         {
00127                 $this->system_vendor = $a_system_vendor;
00128         }
00129 
00130         function getFilename()
00131         {
00132                 return $this->file_name;
00133         }
00134         
00135         function setFilename($a_file_name)
00136         {
00137                 $this->file_name = $a_file_name;
00138         }
00139 
00140         function getMasteryScore()
00141         {
00142                 return $this->mastery_score;
00143         }
00144         
00145         function setMasteryScore($a_mastery_score)
00146         {
00147                 $this->mastery_score = $a_mastery_score;
00148         }
00149 
00150         function getWebLaunch()
00151         {
00152                 return $this->web_launch;
00153         }
00154         
00155         function setWebLaunch($a_web_launch)
00156         {
00157                 $this->web_launch = $a_web_launch;
00158         }
00159 
00160         function getAUPassword()
00161         {
00162                 return $this->au_password;
00163         }
00164 
00165         function setAUPassword($a_au_password)
00166         {
00167                 $this->au_password = $a_au_password;
00168         }
00169         
00170         function read()
00171         {
00172                 global $ilDB;
00173                 
00174                 parent::read();
00175 
00176                 $q = "SELECT * FROM aicc_units WHERE obj_id = ".$ilDB->quote($this->getId());
00177 
00178                 $obj_set = $this->ilias->db->query($q);
00179                 $obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
00180                 $this->setAUType($obj_rec["type"]);
00181                 $this->setCommand_line($obj_rec["command_line"]);
00182                 $this->setMaxTimeAllowed($obj_rec["max_time_allowed"]);
00183                 $this->setTimeLimitAction($obj_rec["time_limit_action"]);
00184                 $this->setMaxScore($obj_rec["max_score"]);
00185                 $this->setCoreVendor($obj_rec["core_vendor"]);
00186                 $this->setSystemVendor($obj_rec["system_vendor"]);
00187                 $this->setFilename($obj_rec["file_name"]);
00188                 $this->setMasteryScore($obj_rec["mastery_score"]);
00189                 $this->setWebLaunch($obj_rec["web_launch"]);
00190                 $this->setAUPassword($obj_rec["au_password"]);
00191         }
00192 
00193         function create()
00194         {
00195                 global $ilDB;
00196                 
00197                 parent::create();
00198 
00199                 $q = "INSERT INTO aicc_units (obj_id, type, command_line, max_time_allowed, time_limit_action,
00200                                                                         max_score, core_vendor, system_vendor, file_name, mastery_score,
00201                                                                         web_launch, au_password) VALUES (";
00202                 $q.=$ilDB->quote($this->getId()).", ";
00203                 $q.=$ilDB->quote($this->getAUType()).", ";
00204                 $q.=$ilDB->quote($this->getCommand_line()).", ";
00205                 $q.=$ilDB->quote($this->getMaxTimeAllowed()).", ";
00206                 $q.=$ilDB->quote($this->getTimeLimitAction()).", ";
00207                 $q.=$ilDB->quote($this->getMaxScore()).", ";
00208                 $q.=$ilDB->quote($this->getCoreVendor()).", ";
00209                 $q.=$ilDB->quote($this->getSystemVendor()).", ";
00210                 $q.=$ilDB->quote($this->getFilename()).", ";
00211                 $q.=$ilDB->quote($this->getMasteryScore()).", ";
00212                 $q.=$ilDB->quote($this->getWebLaunch()).", ";
00213                 $q.=$ilDB->quote($this->getAUPassword()).")";
00214 
00215                 $this->ilias->db->query($q);
00216         }
00217 
00218         function update()
00219         {
00220                 global $ilDB;
00221                 
00222                 parent::update();
00223                 
00224                 $q = "UPDATE aicc_units SET ";
00225                 $q.="type=".$ilDB->quote($this->getAUType()).", ";
00226                 $q.="command_line=".$ilDB->quote($this->getCommand_line()).", ";
00227                 $q.="max_time_allowed=".$ilDB->quote($this->getMaxTimeAllowed()).", ";
00228                 $q.="time_limit_action=".$ilDB->quote($this->getTimeLimitAction()).", ";
00229                 $q.="max_score=".$ilDB->quote($this->getMaxScore()).", ";
00230                 $q.="core_vendor=".$ilDB->quote($this->getCoreVendor()).", ";
00231                 $q.="system_vendor=".$ilDB->quote($this->getSystemVendor()).", ";
00232                 $q.="file_name=".$ilDB->quote($this->getFilename()).", ";
00233                 $q.="mastery_score=".$ilDB->quote($this->getMasteryScore()).", ";
00234                 $q.="web_launch=".$ilDB->quote($this->getWebLaunch()).", ";
00235                 $q.="au_password=".$ilDB->quote($this->getAUPassword())." ";            
00236                 $q.="WHERE obj_id = ".$ilDB->quote($this->getId());
00237                 $this->ilias->db->query($q);
00238         }
00239 
00240         function delete()
00241         {
00242                 global $ilDB, $ilLog;
00243 
00244                 parent::delete();
00245 
00246                 $q = "DELETE FROM aicc_units WHERE obj_id =".$ilDB->quote($this->getId());
00247                 $ilLog->write("SAHS Delete(Unit): ".$q);
00248                 $ilDB->query($q);
00249 
00250                 $q = "DELETE FROM scorm_tracking WHERE ".
00251                         "sco_id = ".$ilDB->quote($this->getId()).
00252                         " AND obj_id = ".$ilDB->quote($this->getALMId());
00253                 $ilDB->query($q);
00254 
00255         }
00256 
00262         function getTrackingDataOfUser($a_user_id = 0)
00263         {
00264                 global $ilDB, $ilUser;
00265 
00266                 if ($a_user_id == 0)
00267                 {
00268                         $a_user_id = $ilUser->getId();
00269                 }
00270 
00271                 $q = "SELECT * FROM scorm_tracking WHERE ".
00272                         "sco_id = ".$ilDB->quote($this->getId())." AND ".
00273                         "user_id = ".$ilDB->quote($a_user_id).
00274                         " AND obj_id = ".$ilDB->quote($this->getALMId());;
00275 
00276                 $track_set = $ilDB->query($q);
00277                 $trdata = array();
00278                 while ($track_rec = $track_set->fetchRow(DB_FETCHMODE_ASSOC))
00279                 {
00280                         $trdata[$track_rec["lvalue"]] = $track_rec["rvalue"];
00281                 }
00282 
00283                 return $trdata;
00284         }
00285         
00286         function insertTrackData($a_lval, $a_rval, $a_obj_id)
00287         {
00288                 require_once("./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php");
00289                 ilObjSCORMTracking::_insertTrackData($this->getId(), $a_lval, $a_rval, $a_obj_id);
00290         }
00291 
00292 }
00293 ?>

Generated on Fri Dec 13 2013 17:56:52 for ILIAS Release_3_9_x_branch .rev 46835 by  doxygen 1.7.1