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

Modules/ScormAicc/classes/AICC/class.ilAICCCourse.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 ilAICCCourse extends ilAICCObject
00027 {
00028 
00037         var $course_creator;
00038         var $course_id;
00039         var $course_system;
00040         var $course_title;
00041         var $level;
00042         var $max_fields_cst;
00043         var $max_fields_ort;
00044         var $total_aus;
00045         var $total_blocks;
00046         var $total_complex_obj;
00047         var $total_objectives;
00048         var $version;
00049         var $max_normal;
00050         var $description;
00051 
00058         function ilAICCCourse($a_id = 0)
00059         {
00060                 parent::ilAICCObject($a_id);
00061                 $this->setType("shd");
00062         }
00063         
00064         function getCourseCreator()
00065         {
00066                 return $this->course_creator;
00067         }
00068         
00069         function setCourseCreator($a_course_creator)
00070         {
00071                 $this->course_creator = $a_course_creator;
00072         }
00073         
00074         function getCourseId()
00075         {
00076                 return $this->course_id;
00077         }
00078         
00079         function setCourseId($a_course_id)
00080         {
00081                 $this->course_id = $a_course_id;
00082         }
00083         
00084         function getCourseSystem()
00085         {
00086                 return $this->course_system;
00087         }
00088         
00089         function setCourseSystem($a_course_system)
00090         {
00091                 $this->course_system = $a_course_system;
00092         }
00093         
00094         function getCourseTitle()
00095         {
00096                 return $this->course_title;
00097         }
00098         
00099         function setCourseTitle($a_course_title)
00100         {
00101                 $this->course_title = $a_course_title;
00102         }
00103         
00104         function getLevel()
00105         {
00106                 return $this->level;
00107         }
00108         
00109         function setLevel($a_level)
00110         {
00111                 $this->level = $a_level;
00112         }
00113         
00114         function getMaxFieldsCst()
00115         {
00116                 return $this->max_fields_cst;
00117         }
00118         
00119         function setMaxFieldsCst($a_max_fields_cst)
00120         {
00121                 $this->max_fields_cst = $a_max_fields_cst;
00122         }
00123         
00124         function getMaxFieldsOrt()
00125         {
00126                 return $this->max_fields_ort;
00127         }
00128         
00129         function setMaxFieldsOrt($a_max_fields_ort)
00130         {
00131                 $this->max_fields_ort = $a_max_fields_ort;
00132         }
00133         
00134         function getTotalAUs()
00135         {
00136                 return $this->total_aus;
00137         }
00138         
00139         function setTotalAUs($a_total_aus)
00140         {
00141                 $this->total_aus = $a_total_aus;
00142         }
00143         
00144         function getTotalBlocks()
00145         {
00146                 return $this->total_blocks;
00147         }
00148         
00149         function setTotalBlocks($a_total_blocks)
00150         {
00151                 $this->total_blocks = $a_total_blocks;
00152         }
00153         
00154         function getTotalComplexObj()
00155         {
00156                 return $this->total_complex_obj;
00157         }
00158         
00159         function setTotalComplexObj($a_total_complex_obj)
00160         {
00161                 $this->total_complex_obj = $a_total_complex_obj;
00162         }
00163         
00164         function getTotalObjectives()
00165         {
00166                 return $this->total_objectives;
00167         }
00168         
00169         function setTotalObjectives($a_total_objectives)
00170         {
00171                 $this->total_objectives = $a_total_objectives;
00172         }
00173         
00174         function getVersion()
00175         {
00176                 return $this->version;
00177         }
00178         
00179         function setVersion($a_version)
00180         {
00181                 $this->version = $a_version;
00182         }
00183         
00184         function getMaxNormal()
00185         {
00186                 return $this->max_normal;
00187         }
00188         
00189         function setMaxNormal($a_max_normal)
00190         {
00191                 $this->max_normal = $a_max_normal;
00192         }
00193         
00194         function getDescription()
00195         {
00196                 return $this->description;
00197         }
00198         
00199         function setDescription($a_description)
00200         {
00201                 $this->description = $a_description;
00202         }
00203 
00204         function read()
00205         {
00206                 global $ilDB;
00207                 
00208                 parent::read();
00209 
00210                 $q = "SELECT * FROM aicc_course WHERE obj_id = ".$ilDB->quote($this->getId());
00211 
00212                 $obj_set = $this->ilias->db->query($q);
00213                 $obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
00214                 $this->setCourseCreator($obj_rec["course_creator"]);
00215                 $this->setCourseId($obj_rec["course_id"]);
00216                 $this->setCourseSystem($obj_rec["course_system"]);
00217                 $this->setCourseTitle($obj_rec["course_title"]);
00218                 $this->setLevel($obj_rec["level"]);
00219                 $this->setMaxFieldsCst($obj_rec["max_fields_cst"]);
00220                 $this->setMaxFieldsOrt($obj_rec["max_fields_ort"]);
00221                 $this->setTotalAUs($obj_rec["total_aus"]);
00222                 $this->setTotalBlocks($obj_rec["total_blocks"]);
00223                 $this->setTotalComplexObj($obj_rec["total_complex_obj"]);
00224                 $this->setTotalObjectives($obj_rec["total_objectives"]);
00225                 $this->setVersion($obj_rec["_version"]);
00226                 $this->setMaxNormal($obj_rec["max_normal"]);
00227                 $this->setDescription($obj_rec["description"]);
00228         }
00229 
00230         function create()
00231         {
00232                 global $ilDB;
00233                 
00234                 parent::create();
00235 
00236                 $q = "INSERT INTO aicc_course (obj_id, course_creator, course_id, course_system, course_title,
00237                                                                                                                                         level, max_fields_cst, max_fields_ort, total_aus, total_blocks,
00238                                                                                                                                         total_complex_obj, total_objectives, version, max_normal,
00239                                                                                                                                         description) VALUES (";
00240                 $q.= $ilDB->quote($this->getId()).", ";
00241                 $q.= $ilDB->quote($this->getCourseCreator()).", ";
00242                 $q.= $ilDB->quote($this->getCourseId()).", ";
00243                 $q.= $ilDB->quote($this->getCourseSystem()).", ";
00244                 $q.= $ilDB->quote($this->getCourseTitle()).", ";
00245                 $q.= $ilDB->quote($this->getLevel()).", ";
00246                 $q.= $ilDB->quote($this->getMaxFieldsCst()).", ";
00247                 $q.= $ilDB->quote($this->getMaxFieldsOrt()).", ";
00248                 $q.= $ilDB->quote($this->getTotalAUs()).", ";
00249                 $q.= $ilDB->quote($this->getTotalBlocks()).", ";
00250                 $q.= $ilDB->quote($this->getTotalComplexObj()).", ";
00251                 $q.= $ilDB->quote($this->getTotalObjectives()).", ";
00252                 $q.= $ilDB->quote($this->getVersion()).", ";
00253                 $q.= $ilDB->quote($this->getMaxNormal()).", ";
00254                 $q.= $ilDB->quote($this->getDescription()).")";
00255                 $this->ilias->db->query($q);
00256         }
00257 
00258         function update()
00259         {
00260                 global $ilDB;
00261                 
00262                 parent::update();
00263                 
00264                 $q = "UPDATE aicc_course SET ";
00265                 $q.="course_creator=".$ilDB->quote($this->getCourseCreator()).", ";
00266                 $q.="course_id=".$ilDB->quote($this->getCourseId()).", ";
00267                 $q.="course_system=".$ilDB->quote($this->getCourseSystem()).", ";
00268                 $q.="course_title=".$ilDB->quote($this->getCourseTitle()).", ";
00269                 $q.="level=".$ilDB->quote($this->getLevel()).", ";
00270                 $q.="max_fields_cst=".$ilDB->quote($this->getMaxFieldsCst()).", ";
00271                 $q.="max_fields_ort=".$ilDB->quote($this->getMaxFieldsOrt()).", ";
00272                 $q.="total_aus=".$ilDB->quote($this->getTotalAUs()).", ";
00273                 $q.="total_blocks=".$ilDB->quote($this->getTotalBlocks()).", ";
00274                 $q.="total_complex_obj=".$ilDB->quote($this->getTotalComplexObj()).", ";
00275                 $q.="total_objectives=".$ilDB->quote($this->getTotalObjectives()).", ";
00276                 $q.="version=".$ilDB->quote($this->getVersion()).", ";
00277                 $q.="max_normal=".$ilDB->quote($this->getMaxNormal()).", ";
00278                 $q.="description=".$ilDB->quote($this->getDescription())." ";           
00279                 $q.="WHERE obj_id = ".$ilDB->quote($this->getId());
00280                 $this->ilias->db->query($q);
00281         }
00282 
00283         function delete()
00284         {
00285                 global $ilDB, $ilLog;
00286 
00287                 parent::delete();
00288 
00289                 $q = "DELETE FROM aicc_course WHERE obj_id =".$ilDB->quote($this->getId());
00290                 $ilDB->query($q);
00291 
00292                 $q = "DELETE FROM scorm_tracking WHERE ".
00293                         "sco_id = ".$ilDB->quote($this->getId()).
00294                         " AND obj_id = ".$ilDB->quote($this->getALMId());
00295                 $ilLog->write("SAHS Delete: ".$q);
00296                 $ilDB->query($q);
00297 
00298         }
00299 
00305         function getTrackingDataOfUser($a_user_id = 0)
00306         {
00307                 global $ilDB, $ilUser;
00308 
00309                 if ($a_user_id == 0)
00310                 {
00311                         $a_user_id = $ilUser->getId();
00312                 }
00313 
00314                 $q = "SELECT * FROM scorm_tracking WHERE ".
00315                         "sco_id = ".$ilDB->quote($this->getId())." AND ".
00316                         "user_id = ".$ilDB->quote($a_user_id).
00317                         " AND obj_id = ".$ilDB->quote($this->getALMId());
00318 
00319                 $track_set = $ilDB->query($q);
00320                 $trdata = array();
00321                 while ($track_rec = $track_set->fetchRow(DB_FETCHMODE_ASSOC))
00322                 {
00323                         $trdata[$track_rec["lvalue"]] = $track_rec["rvalue"];
00324                 }
00325 
00326                 return $trdata;
00327         }
00328         
00329         function insertTrackData($a_lval, $a_rval, $a_obj_id)
00330         {
00331                 require_once("./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php");
00332                 ilObjSCORMTracking::_insertTrackData($this->getId(), $a_lval, $a_rval, $a_obj_id);
00333         }
00334 
00335 }
00336 ?>

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