Public Member Functions | |
ilObjAICCLearningModule ($a_id=0, $a_call_by_reference=true) | |
Constructor public. | |
readObject () | |
public | |
delete () | |
delete SCORM learning module and all related data | |
getTrackingItems () | |
get all tracking items of scorm object | |
_getTrackingItems ($a_obj_id) | |
get all tracking items of scorm object | |
getTrackedItems () | |
get all tracked items of current user | |
getTrackingData ($a_sco_id) |
Definition at line 37 of file class.ilObjAICCLearningModule.php.
ilObjAICCLearningModule::_getTrackingItems | ( | $ | a_obj_id | ) |
get all tracking items of scorm object
Reimplemented from ilObjSCORMLearningModule.
Definition at line 157 of file class.ilObjAICCLearningModule.php.
References $query, $res, and $row.
Referenced by ilLPCollections::_getPossibleSAHSItems(), ilLPStatusSCORM::_getStatusInfo(), and getTrackingItems().
{ global $ilDB; include_once("content/classes/AICC/class.ilAICCUnit.php"); $query = "SELECT obj_id,title FROM aicc_object ". "WHERE slm_id = '".$a_obj_id."' ". "AND type = 'sau'"; $res = $ilDB->query($query); while($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { $items[$row->obj_id]['obj_id'] = $row->obj_id; $items[$row->obj_id]['title'] = $row->title; } return $items ? $items : array(); /* include_once("content/classes/SCORM/class.ilSCORMTree.php"); $tree = new ilSCORMTree($a_obj_id); $root_id = $tree->readRootId(); $items = array(); $childs = $tree->getSubTree($tree->getNodeData($root_id)); foreach($childs as $child) { if($child["type"] == "sau") { include_once("content/classes/AICC/class.ilAICCUnit.php"); $ac_item =& new ilAICCUnit($child["obj_id"]); $items[count($items)] =& $ac_item; } } return $items; */ }
ilObjAICCLearningModule::delete | ( | ) |
delete SCORM learning module and all related data
this method has been tested on may 9th 2004 meta data, scorm lm data, scorm tree, scorm objects (organization(s), manifest, resources and items), tracking data and data directory have been deleted correctly as desired
public
Reimplemented from ilObjSAHSLearningModule.
Definition at line 100 of file class.ilObjAICCLearningModule.php.
References $q, ilUtil::delDir(), ilObject::deleteMetaData(), ilObjSAHSLearningModule::getDataDirectory(), and ilObject::getId().
{ global $ilDB; // always call parent delete function first!! if (!parent::delete()) { return false; } // delete meta data of scorm content object /* $nested = new ilNestedSetXML(); $nested->init($this->getId(), $this->getType()); $nested->deleteAllDBData(); */ $this->deleteMetaData(); // delete data directory ilUtil::delDir($this->getDataDirectory()); // delete scorm learning module record $q = "DELETE FROM sahs_lm WHERE id = ".$ilDB->quote($this->getId()); $this->ilias->db->query($q); // delete aicc data // this is highly dependent on the database $q = "DELETE FROM aicc_units USING aicc_object, aicc_units WHERE aicc_object.obj_id=aicc_units.obj_id and aicc_object.slm_id=".$ilDB->quote($this->getId()); $this->ilias->db->query($q); $q = "DELETE FROM aicc_course USING aicc_object, aicc_course WHERE aicc_object.obj_id=aicc_course.obj_id and aicc_object.slm_id=".$ilDB->quote($this->getId()); $this->ilias->db->query($q); $q = "DELETE FROM scorm_tree WHERE slm_id = ".$ilDB->quote($this->getId()); $this->ilias->db->query($q); $q = "DELETE FROM aicc_object WHERE slm_id = ".$ilDB->quote($this->getId()); $this->ilias->db->query($q); // always call parent delete function at the end!! return true; }
ilObjAICCLearningModule::getTrackedItems | ( | ) |
get all tracked items of current user
Reimplemented from ilObjSCORMLearningModule.
Definition at line 200 of file class.ilObjAICCLearningModule.php.
References $query, and ilObject::getId().
{ global $ilUser, $ilDB, $ilUser; $query = "SELECT DISTINCT sco_id FROM scorm_tracking WHERE". " obj_id = ".$ilDB->quote($this->getId()); $sco_set = $ilDB->query($query); $items = array(); while($sco_rec = $sco_set->fetchRow(DB_FETCHMODE_ASSOC)) { include_once("content/classes/AICC/class.ilAICCUnit.php"); $ac_item =& new ilAICCUnit($sco_rec["sco_id"]); $items[count($items)] =& $ac_item; } return $items; }
ilObjAICCLearningModule::getTrackingData | ( | $ | a_sco_id | ) |
Definition at line 221 of file class.ilObjAICCLearningModule.php.
References $data, $query, and ilObject::getId().
{ global $ilDB; $query = "SELECT * FROM scorm_tracking WHERE". " obj_id = ".$ilDB->quote($this->getId()). " AND sco_id = ".$ilDB->quote($a_sco_id). " ORDER BY user_id, lvalue"; $data_set = $ilDB->query($query); $data = array(); while($data_rec = $data_set->fetchRow(DB_FETCHMODE_ASSOC)) { $data[] = $data_rec; } return $data; }
ilObjAICCLearningModule::getTrackingItems | ( | ) |
get all tracking items of scorm object
Reimplemented from ilObjSCORMLearningModule.
Definition at line 148 of file class.ilObjAICCLearningModule.php.
References _getTrackingItems(), and ilObject::getId().
{ return ilObjAICCLearningModule::_getTrackingItems($this->getId()); }
ilObjAICCLearningModule::ilObjAICCLearningModule | ( | $ | a_id = 0 , |
|
$ | a_call_by_reference = true | |||
) |
Constructor public.
integer | reference_id or object_id | |
boolean | treat the id as reference_id (true) or object_id (false) |
Definition at line 47 of file class.ilObjAICCLearningModule.php.
References ilObject::ilObject().
{ $this->type = "sahs"; parent::ilObject($a_id,$a_call_by_reference); /* if ($a_id == 0) { $new_meta =& new ilMetaData(); $this->assignMetaData($new_meta); } */ }
ilObjAICCLearningModule::readObject | ( | ) |
public
Reimplemented from ilObjSCORMLearningModule.
Definition at line 63 of file class.ilObjAICCLearningModule.php.
References $_POST, ilObjSAHSLearningModule::getDataDirectory(), and ilObject::getId().
{ require_once("content/classes/class.ilObjAICCCourseInterchangeFiles.php"); $cifModule = new ilObjAICCCourseInterchangeFiles(); $cifModule->findFiles($this->getDataDirectory()); $cifModule->readFiles(); if (!empty($cifModule->errorText)) { $this->ilias->raiseError("<b>Error reading LM-File(s):</b><br>".implode("<br>", $cifModule->errorText), $this->ilias->error_obj->WARNING); } if ($_POST["validate"] == "y") { $cifModule->validate(); if (!empty($cifModule->errorText)) { $this->ilias->raiseError("<b>Validation Error(s):</b><br>".implode("<br>", $cifModule->errorText), $this->ilias->error_obj->WARNING); } } $cifModule->writeToDatabase($this->getId()); }