Public Member Functions | Data Fields

ilObjAICCLearningModule Class Reference

Inheritance diagram for ilObjAICCLearningModule:
Collaboration diagram for ilObjAICCLearningModule:

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
 getTrackedItems ()
 get all tracked items of current user
 getTrackingData ($a_sco_id)

Data Fields

 $meta_data

Detailed Description

Definition at line 37 of file class.ilObjAICCLearningModule.php.


Member Function Documentation

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

Returns:
boolean true if all object data were removed; false if only a references were removed

Reimplemented from ilObjSAHSLearningModule.

Definition at line 98 of file class.ilObjAICCLearningModule.php.

References $q, ilUtil::delDir(), ilObjSAHSLearningModule::getDataDirectory(), ilObject::getId(), and ilObject::getType().

        {
                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();

                // 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;
        }

Here is the call graph for this function:

ilObjAICCLearningModule::getTrackedItems (  ) 

get all tracked items of current user

Reimplemented from ilObjSCORMLearningModule.

Definition at line 167 of file class.ilObjAICCLearningModule.php.

References $ilUser, $query, and ilObject::getRefId().

        {
                global $ilUser, $ilDB, $ilUser;

                $query = "SELECT DISTINCT sco_id FROM scorm_tracking WHERE".
                        " ref_id = ".$ilDB->quote($this->getRefId());

                $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;
        }

Here is the call graph for this function:

ilObjAICCLearningModule::getTrackingData ( a_sco_id  ) 

Definition at line 188 of file class.ilObjAICCLearningModule.php.

References $data, $query, and ilObject::getRefId().

        {
                global $ilDB;

                $query = "SELECT * FROM scorm_tracking WHERE".
                        " ref_id = ".$ilDB->quote($this->getRefId()).
                        " 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;
        }

Here is the call graph for this function:

ilObjAICCLearningModule::getTrackingItems (  ) 

get all tracking items of scorm object

Reimplemented from ilObjSCORMLearningModule.

Definition at line 143 of file class.ilObjAICCLearningModule.php.

References $tree, and ilObject::getId().

        {
                include_once("content/classes/SCORM/class.ilSCORMTree.php");
                $tree = new ilSCORMTree($this->getId());
                $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;
        }

Here is the call graph for this function:

ilObjAICCLearningModule::ilObjAICCLearningModule ( a_id = 0,
a_call_by_reference = true 
)

Constructor public.

Parameters:
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 ilObjSAHSLearningModule::assignMetaData(), and 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);
                }
        }

Here is the call graph for this function:

ilObjAICCLearningModule::readObject (  ) 

public

Reimplemented from ilObjSCORMLearningModule.

Definition at line 61 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());
        }

Here is the call graph for this function:


Field Documentation

ilObjAICCLearningModule::$meta_data

Reimplemented from ilObjSCORMLearningModule.

Reimplemented in ilObjHACPLearningModule.

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


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