Public Member Functions | Data Fields

ilSCORMItem Class Reference

Inheritance diagram for ilSCORMItem:
Collaboration diagram for ilSCORMItem:

Public Member Functions

 ilSCORMItem ($a_id=0)
 Constructor.
 getImportId ()
 setImportId ($a_import_id)
 getIdentifierRef ()
 setIdentifierRef ($a_id_ref)
 getVisible ()
 setVisible ($a_visible)
 getParameters ()
 setParameters ($a_par)
 getPrereqType ()
 setPrereqType ($a_p_type)
 getPrerequisites ()
 setPrerequisites ($a_pre)
 getMaxTimeAllowed ()
 setMaxTimeAllowed ($a_max)
 getTimeLimitAction ()
 setTimeLimitAction ($a_lim_act)
 getDataFromLms ()
 setDataFromLms ($a_data)
 getMasteryScore ()
 setMasteryScore ($a_score)
 read ()
 create ()
 Create database record for SCORM object.
 update ()
 Updates database record for SCORM object.
 getTrackingDataOfUser ($a_user_id=0)
 get tracking data of specified or current user
 _lookupTrackingDataOfUser ($a_item_id, $a_user_id=0)
 delete ()
 insertTrackData ($a_lval, $a_rval, $a_obj_id)
 _getItems ($a_obj_id)
 _lookupTitle ($a_obj_id)

Data Fields

 $import_id
 $identifierref
 $isvisible
 $parameters
 $prereq_type
 $prerequisites
 $maxtimeallowed
 $timelimitaction
 $datafromlms
 $masteryscore

Detailed Description

Definition at line 35 of file class.ilSCORMItem.php.


Member Function Documentation

ilSCORMItem::_getItems ( a_obj_id  ) 

Definition at line 303 of file class.ilSCORMItem.php.

References $query, $res, and $row.

        {
                global $ilDB;

                $query = "SELECT * FROM scorm_object ".
                        "WHERE slm_id = '".$a_obj_id."' ".
                        "AND type = 'sit'";

                $res = $ilDB->query($query);
                while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
                {
                        $item_ids[] = $row->obj_id;
                }
                return $item_ids ? $item_ids : array();
        }

ilSCORMItem::_lookupTitle ( a_obj_id  ) 

Definition at line 319 of file class.ilSCORMItem.php.

References $query, $res, and $row.

Referenced by ilLPStatusSCORM::_getStatusInfo().

        {
                global $ilDB;

                $query = "SELECT * FROM scorm_object ".
                        "WHERE obj_id = '".$a_obj_id."'";

                $res = $ilDB->query($query);
                while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
                {
                        return $row->title;
                }
                return '';
        }

Here is the caller graph for this function:

ilSCORMItem::_lookupTrackingDataOfUser ( a_item_id,
a_user_id = 0 
)

Definition at line 256 of file class.ilSCORMItem.php.

References $q.

Referenced by ilSCORMExplorer::getOutputIcons().

        {
                global $ilDB, $ilUser;

                if ($a_user_id == 0)
                {
                        $a_user_id = $ilUser->getId();
                }

                $q = "SELECT * FROM scorm_tracking WHERE ".
                        "sco_id = '".$a_item_id."' AND ".
                        "user_id = '".$a_user_id."'";

                $track_set = $ilDB->query($q);
                $trdata = array();
                while ($track_rec = $track_set->fetchRow(DB_FETCHMODE_ASSOC))
                {
                        $trdata[$track_rec["lvalue"]] = $track_rec["rvalue"];
                }

                return $trdata;
        }

Here is the caller graph for this function:

ilSCORMItem::create (  ) 

Create database record for SCORM object.

Reimplemented from ilSCORMObject.

Definition at line 187 of file class.ilSCORMItem.php.

References $q, getDataFromLms(), getIdentifierRef(), getImportId(), getMasteryScore(), getMaxTimeAllowed(), getPrereqType(), getTimeLimitAction(), and getVisible().

        {
                parent::create();

                $str_visible = ($this->getVisible())
                        ? "true"
                        : "false";

                $q = "INSERT INTO sc_item (obj_id, import_id, identifierref,".
                        "isvisible, parameters, prereq_type, prerequisites, maxtimeallowed,".
                        "timelimitaction, datafromlms, masteryscore) VALUES ".
                        "('".$this->getId()."', '".$this->getImportId()."','".$this->getIdentifierRef().
                        "','$str_visible','".$this->getParameters()."','".$this->getPrereqType().
                        "','".$this->getPrerequisites()."','".$this->getMaxTimeAllowed()."','".
                        $this->getTimeLimitAction()."','".$this->getDataFromLms()."','".
                        $this->getMasteryScore()."')";
                $this->ilias->db->query($q);
        }

Here is the call graph for this function:

ilSCORMItem::delete (  ) 

Reimplemented from ilSCORMObject.

Definition at line 279 of file class.ilSCORMItem.php.

References $q, and ilSCORMObject::getId().

        {
                global $ilDB;

                parent::delete();

                $q = "DELETE FROM sc_item WHERE obj_id =".$ilDB->quote($this->getId());
                $ilDB->query($q);

                $q = "DELETE FROM scorm_tracking WHERE ".
                        "sco_id = ".$ilDB->quote($this->getId());
                $ilDB->query($q);

        }

Here is the call graph for this function:

ilSCORMItem::getDataFromLms (  ) 

Definition at line 140 of file class.ilSCORMItem.php.

Referenced by create().

        {
                return $this->datafromlms;
        }

Here is the caller graph for this function:

ilSCORMItem::getIdentifierRef (  ) 

Definition at line 70 of file class.ilSCORMItem.php.

Referenced by create().

        {
                return $this->identifierref;
        }

Here is the caller graph for this function:

ilSCORMItem::getImportId (  ) 

Definition at line 60 of file class.ilSCORMItem.php.

Referenced by create().

        {
                return $this->import_id;
        }

Here is the caller graph for this function:

ilSCORMItem::getMasteryScore (  ) 

Definition at line 150 of file class.ilSCORMItem.php.

Referenced by create().

        {
                return $this->masteryscore;
        }

Here is the caller graph for this function:

ilSCORMItem::getMaxTimeAllowed (  ) 

Definition at line 120 of file class.ilSCORMItem.php.

Referenced by create().

        {
                return $this->maxtimeallowed;
        }

Here is the caller graph for this function:

ilSCORMItem::getParameters (  ) 

Definition at line 90 of file class.ilSCORMItem.php.

        {
                return $this->parameters;
        }

ilSCORMItem::getPrereqType (  ) 

Definition at line 100 of file class.ilSCORMItem.php.

Referenced by create().

        {
                return $this->prereq_type;
        }

Here is the caller graph for this function:

ilSCORMItem::getPrerequisites (  ) 

Definition at line 110 of file class.ilSCORMItem.php.

        {
                return $this->prerequisites;
        }

ilSCORMItem::getTimeLimitAction (  ) 

Definition at line 130 of file class.ilSCORMItem.php.

Referenced by create().

        {
                return $this->timelimitaction;
        }

Here is the caller graph for this function:

ilSCORMItem::getTrackingDataOfUser ( a_user_id = 0  ) 

get tracking data of specified or current user

Definition at line 233 of file class.ilSCORMItem.php.

References $q.

        {
                global $ilDB, $ilUser;

                if ($a_user_id == 0)
                {
                        $a_user_id = $ilUser->getId();
                }

                $q = "SELECT * FROM scorm_tracking WHERE ".
                        "sco_id = '".$this->getId()."' AND ".
                        "user_id = '".$a_user_id."'";

                $track_set = $ilDB->query($q);
                $trdata = array();
                while ($track_rec = $track_set->fetchRow(DB_FETCHMODE_ASSOC))
                {
                        $trdata[$track_rec["lvalue"]] = $track_rec["rvalue"];
                }

                return $trdata;
        }

ilSCORMItem::getVisible (  ) 

Definition at line 80 of file class.ilSCORMItem.php.

Referenced by create(), and update().

        {
                return $this->isvisible;
        }

Here is the caller graph for this function:

ilSCORMItem::ilSCORMItem ( a_id = 0  ) 

Constructor.

Parameters:
int $a_id Object ID public

Definition at line 54 of file class.ilSCORMItem.php.

References ilSCORMObject::ilSCORMObject(), and ilSCORMObject::setType().

        {
                parent::ilSCORMObject($a_id);
                $this->setType("sit");
        }

Here is the call graph for this function:

ilSCORMItem::insertTrackData ( a_lval,
a_rval,
a_obj_id 
)

Definition at line 295 of file class.ilSCORMItem.php.

References ilObjSCORMTracking::_insertTrackData(), and ilSCORMObject::getId().

        {
                require_once("content/classes/SCORM/class.ilObjSCORMTracking.php");
                //ilObjSCORMTracking::_insertTrackData($this->getId(), $a_lval, $a_rval, $a_ref_id);
                ilObjSCORMTracking::_insertTrackData($this->getId(), $a_lval, $a_rval, $a_obj_id);
        }

Here is the call graph for this function:

ilSCORMItem::read (  ) 

Reimplemented from ilSCORMObject.

Definition at line 160 of file class.ilSCORMItem.php.

References $q, setDataFromLms(), setIdentifierRef(), setImportId(), setMasteryScore(), setMaxTimeAllowed(), setParameters(), setPrereqType(), setPrerequisites(), setTimeLimitAction(), and setVisible().

        {
                parent::read();

                $q = "SELECT * FROM sc_item WHERE obj_id = '".$this->getId()."'";

                $obj_set = $this->ilias->db->query($q);
                $obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
                $this->setImportId($obj_rec["import_id"]);
                $this->setIdentifierRef($obj_rec["identifierref"]);
                if (strtolower($obj_rec["isvisible"]) == "false")
                {
                        $this->setVisible(false);
                }
                else
                {
                        $this->setVisible(true);
                }
                $this->setParameters($obj_rec["parameters"]);
                $this->setPrereqType($obj_rec["prereq_type"]);
                $this->setPrerequisites($obj_rec["prerequisites"]);
                $this->setMaxTimeAllowed($obj_rec["maxtimeallowed"]);
                $this->setTimeLimitAction($obj_rec["timelimitaction"]);
                $this->setDataFromLms($obj_rec["datafromlms"]);
                $this->setMasteryScore($obj_rec["masteryscore"]);
        }

Here is the call graph for this function:

ilSCORMItem::setDataFromLms ( a_data  ) 

Definition at line 145 of file class.ilSCORMItem.php.

Referenced by read().

        {
                $this->datafromlms = $a_data;
        }

Here is the caller graph for this function:

ilSCORMItem::setIdentifierRef ( a_id_ref  ) 

Definition at line 75 of file class.ilSCORMItem.php.

Referenced by read().

        {
                $this->identifierref = $a_id_ref;
        }

Here is the caller graph for this function:

ilSCORMItem::setImportId ( a_import_id  ) 

Definition at line 65 of file class.ilSCORMItem.php.

Referenced by read().

        {
                $this->import_id = $a_import_id;
        }

Here is the caller graph for this function:

ilSCORMItem::setMasteryScore ( a_score  ) 

Definition at line 155 of file class.ilSCORMItem.php.

Referenced by read().

        {
                $this->masteryscore = $a_score;
        }

Here is the caller graph for this function:

ilSCORMItem::setMaxTimeAllowed ( a_max  ) 

Definition at line 125 of file class.ilSCORMItem.php.

Referenced by read().

        {
                $this->maxtimeallowed = $a_max;
        }

Here is the caller graph for this function:

ilSCORMItem::setParameters ( a_par  ) 

Definition at line 95 of file class.ilSCORMItem.php.

Referenced by read().

        {
                $this->parameters = $a_par;
        }

Here is the caller graph for this function:

ilSCORMItem::setPrereqType ( a_p_type  ) 

Definition at line 105 of file class.ilSCORMItem.php.

Referenced by read().

        {
                $this->prereq_type = $a_p_type;
        }

Here is the caller graph for this function:

ilSCORMItem::setPrerequisites ( a_pre  ) 

Definition at line 115 of file class.ilSCORMItem.php.

Referenced by read().

        {
                $this->prerequisites = $a_pre;
        }

Here is the caller graph for this function:

ilSCORMItem::setTimeLimitAction ( a_lim_act  ) 

Definition at line 135 of file class.ilSCORMItem.php.

Referenced by read().

        {
                $this->timelimitaction = $a_lim_act;
        }

Here is the caller graph for this function:

ilSCORMItem::setVisible ( a_visible  ) 

Definition at line 85 of file class.ilSCORMItem.php.

Referenced by read().

        {
                $this->isvisible = $a_visible;
        }

Here is the caller graph for this function:

ilSCORMItem::update (  ) 

Updates database record for SCORM object.

Reimplemented from ilSCORMObject.

Definition at line 206 of file class.ilSCORMItem.php.

References $q, and getVisible().

        {
                $str_visible = ($this->getVisible())
                        ? "true"
                        : "false";

                parent::update();
                $q = "UPDATE sc_item SET ".
                        "import_id = '".$this->getImportId()."', ".
                        "identifierref = '".$this->getIdentifierRef()."', ".
                        "isvisible = '".$str_visible."', ".
                        "parameters = '".$this->getParameters()."', ".
                        "prereq_type = '".$this->getPrereqType()."', ".
                        "prerequisites = '".$this->getPrerequisites()."', ".
                        "maxtimeallowed = '".$this->getMaxTimeAllowed()."', ".
                        "timelimitaction = '".$this->getTimeLimitAction()."', ".
                        "datafromlms = '".$this->getDataFromLms()."', ".
                        "masteryscore = '".$this->getMasteryScore()."' ".
                        "WHERE obj_id = '".$this->getId()."'";
                $this->ilias->db->query($q);
        }

Here is the call graph for this function:


Field Documentation

ilSCORMItem::$datafromlms

Definition at line 45 of file class.ilSCORMItem.php.

ilSCORMItem::$identifierref

Definition at line 38 of file class.ilSCORMItem.php.

ilSCORMItem::$import_id

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

ilSCORMItem::$isvisible

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

ilSCORMItem::$masteryscore

Definition at line 46 of file class.ilSCORMItem.php.

ilSCORMItem::$maxtimeallowed

Definition at line 43 of file class.ilSCORMItem.php.

ilSCORMItem::$parameters

Definition at line 40 of file class.ilSCORMItem.php.

ilSCORMItem::$prereq_type

Definition at line 41 of file class.ilSCORMItem.php.

ilSCORMItem::$prerequisites

Definition at line 42 of file class.ilSCORMItem.php.

ilSCORMItem::$timelimitaction

Definition at line 44 of file class.ilSCORMItem.php.


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