ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilSCORM2004Utilities Class Reference

Class ilSCORM2004Utilities. More...

+ Collaboration diagram for ilSCORM2004Utilities:

Public Member Functions

 ilSCORM2004Utilities ($a_id)
 parentHasSeqTemplate ($a_slm_id)
 getLeftRightInfo ()
 getImportIdent ()
 getAllowedActions ()
 getControlModeProperties ()
 getAllSequencingProperties ()

Protected Member Functions

 getSeqNodeId ()

Private Member Functions

 getParentsForNode ($a_parents, $a_id)
 getSequencingId ()
 getItemId ()
 getId ()

Private Attributes

 $id = null

Detailed Description

Class ilSCORM2004Utilities.

Sequencing Utilities class for SCORM 2004 Editing

Author
Hendrik Holtmann holtm.nosp@m.ann@.nosp@m.me.co.nosp@m.m
Version
$Id$

Definition at line 36 of file class.ilSCORM2004Utilities.php.

Member Function Documentation

ilSCORM2004Utilities::getAllowedActions ( )

Definition at line 148 of file class.ilSCORM2004Utilities.php.

References $ilDB, $ilLog, $query, DB_FETCHMODE_ASSOC, and getId().

{
global $ilDB,$ilLog;
$ilLog->write("SCORM: getAllowedActions for".$this->tree_node_id);
$query = "SELECT * FROM sahs_sc13_seq_item WHERE sahs_sc13_tree_node_id = ".
$ilDB->quote($this->getId(), "integer");
$obj_set = $ilDB->query($query);
$obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
return array("copy"=>!$obj_rec['nocopy'],"move"=>!$obj_rec['nomove'],"delete"=>!$obj_rec['nodelete']);
}

+ Here is the call graph for this function:

ilSCORM2004Utilities::getAllSequencingProperties ( )

Definition at line 174 of file class.ilSCORM2004Utilities.php.

References $ilDB, $ilLog, $query, DB_FETCHMODE_ASSOC, getImportIdent(), and getSequencingId().

Referenced by getSeqNodeId().

{
global $ilDB,$ilLog;
$query = "SELECT * FROM sahs_sc13_seq_seq WHERE (id = ".
$ilDB->quote($this->getSequencingId(), "text").
" AND importid=".$ilDB->quote($this->getImportIdent(), "text").")";
$obj_set = $ilDB->query($query);
$ilLog->write("SCORM: getAllSequencingProperties for".$this->getSequencingId());
$obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
$sprop = array(
'importId' => $obj_rec['importid'],
'activityAbsoluteDurationLimit' => $obj_rec['activityabsolutedurationlimit'],
'activityExperiencedDurationLimit' => $obj_rec['activityexperienceddurlimit'],
'attemptAbsoluteDurationLimit' => $obj_rec['attemptabsolutedurationlimit'],
'attemptExperiencedDurationLimit' => $obj_rec['attemptexperienceddurlimit'],
'attemptLimit' => $obj_rec['attemptlimit'],
'beginTimeLimit' => $obj_rec['begintimelimit'],
'completionSetByContent' => $obj_rec['completionsetbycontent'],
'constrainChoice' => $obj_rec['constrainchoice'],
'seqNodeId' => $obj_rec['seqnodeid'],
'endTimeLimit' => $obj_rec['endtimelimit'],
'id' => $obj_rec['id'],
'measureSatisfactionIfActive' => $obj_rec['measuresatisfactionifactive'],
'objectiveMeasureWeight' => $obj_rec['objectivemeasureweight'],
'objectiveSetByContent' => $obj_rec['objectivesetbycontent'],
'preventActivation' => $obj_rec['preventactivation'],
'randomizationTiming' => $obj_rec['randomizationtiming'],
'reorderChildren' => $obj_rec['reorderchildren'],
'requiredForCompleted' => $obj_rec['requiredforcompleted'],
'requiredForIncomplete' => $obj_rec['requiredforincomplete'],
'requiredForNotSatisfied' => $obj_rec['requiredfornotsatisfied'],
'requiredForSatisfied' => $obj_rec['requiredforsatisfied'],
'rollupObjectiveSatisfied' => $obj_rec['rollupobjectivesatisfied'],
'rollupProgressCompletion' => $obj_rec['rollupprogresscompletion'],
'selectCount' => $obj_rec['selectcount'],
'selectionTiming' => $obj_rec['selectiontiming'],
'sequencingId' => $obj_rec['sequencingid'],
'tracked' => $obj_rec['tracked'],
'useCurrentAttemptObjectiveInfo' => $obj_rec['usecurrentattemptobjectiveinfo'],
'useCurrentAttemptProgressInfo' => $obj_rec['usecurrentattemptprogressinfo'],
'flow' => $obj_rec['flow'],
'forwardOnly' => $obj_rec['forwardonly'],
'choice' => $obj_rec['choice'],
'choiceExit' => $obj_rec['choiceexit'] );
return $sprop;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSCORM2004Utilities::getControlModeProperties ( )

Definition at line 159 of file class.ilSCORM2004Utilities.php.

References $ilDB, $query, DB_FETCHMODE_ASSOC, and getSequencingId().

{
global $ilDB;
$query = "SELECT * FROM sahs_sc13_seq_seq WHERE id = ".
$ilDB->quote($this->getSequencingId(), "text");
$obj_set = $ilDB->query($query);
$obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
$c_properties = array(
'flow' => $obj_rec['flow'],
'forwardOnly' => $obj_rec['forwardonly'],
'choice' => $obj_rec['choice'],
'choiceExit' => $obj_rec['choiceexit'] );
return $c_properties;
}

+ Here is the call graph for this function:

ilSCORM2004Utilities::getId ( )
private

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

References $id.

Referenced by getAllowedActions(), getImportIdent(), getItemId(), and getSequencingId().

{
return $this->id;
}

+ Here is the caller graph for this function:

ilSCORM2004Utilities::getImportIdent ( )

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

References $ilDB, $ilLog, $query, DB_FETCHMODE_ASSOC, and getId().

Referenced by getAllSequencingProperties(), and getLeftRightInfo().

{
global $ilDB,$ilLog;
$ilLog->write("SCORM: getImportIdent for".$this->getId);
$query = "SELECT * FROM sahs_sc13_seq_item WHERE sahs_sc13_tree_node_id = ".
$ilDB->quote($this->getId(), "integer");
$obj_set = $ilDB->query($query);
$obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
return $obj_rec['importid'];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSCORM2004Utilities::getItemId ( )
private

Definition at line 119 of file class.ilSCORM2004Utilities.php.

References $ilDB, $ilLog, $query, DB_FETCHMODE_ASSOC, and getId().

{
global $ilDB,$ilLog;
$ilLog->write("SCORM: getSequencingId for".$this->getId);
$query = "SELECT * FROM sahs_sc13_seq_item WHERE sahs_sc13_tree_node_id = ".
$ilDB->quote($this->getId(), "integer");
$obj_set = $ilDB->query($query);
$obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
return $obj_rec['seqnodeid'];
}

+ Here is the call graph for this function:

ilSCORM2004Utilities::getLeftRightInfo ( )

Definition at line 86 of file class.ilSCORM2004Utilities.php.

References $ilDB, $ilLog, $query, getImportIdent(), and getSeqNodeId().

{
global $ilDB,$ilLog;
$ilLog->write("SCORM: getLeftRightInfo");
$query = "SELECT * FROM sahs_sc13_seq_tree WHERE (child = ".
$ilDB->quote($this->getSeqNodeId(), "integer").
" AND importid=".$ilDB->quote($this->getImportIdent(), "text").")";
$obj_set = $ilDB->query($query);
$ilLog->write("SCORM: getLeftRightInfo executed".$query);
$obj_rec = $ilDB->fetchAssoc($obj_set);
return array("left"=> $obj_rec["lft"], "right" => $obj_rec["rgt"]);
}

+ Here is the call graph for this function:

ilSCORM2004Utilities::getParentsForNode (   $a_parents,
  $a_id 
)
private

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

References $id.

Referenced by parentHasSeqTemplate().

{
$parent_id = $tree->getParentId($id);
if ($parent_id != 0) {
array_push($a_parents,$parent_id);
$this->getParentsForNode($a_parents,$parent_id);
} else {
return $a_parents;
}
}

+ Here is the caller graph for this function:

ilSCORM2004Utilities::getSeqNodeId ( )
protected

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

References $ilDB, $ilLog, and getAllSequencingProperties().

Referenced by getLeftRightInfo().

{
global $ilDB,$ilLog;
$all_props = $this->getAllSequencingProperties();
$ilLog->write("SCORM: getSeqNodeId: ".$all_props["seqnodeid"]);
return $all_props["seqnodeid"];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSCORM2004Utilities::getSequencingId ( )
private

Definition at line 108 of file class.ilSCORM2004Utilities.php.

References $ilDB, $ilLog, $query, DB_FETCHMODE_ASSOC, and getId().

Referenced by getAllSequencingProperties(), and getControlModeProperties().

{
global $ilDB,$ilLog;
$ilLog->write("SCORM: getSequencingId for".$this->getId());
$query = "SELECT * FROM sahs_sc13_seq_item WHERE sahs_sc13_tree_node_id = ".
$ilDB->quote($this->getId(), "integer");
$obj_set = $ilDB->query($query);
$obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
return $obj_rec['sequencingid'];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSCORM2004Utilities::ilSCORM2004Utilities (   $a_id)

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

{
$this->id = $a_id;
}
ilSCORM2004Utilities::parentHasSeqTemplate (   $a_slm_id)

Definition at line 51 of file class.ilSCORM2004Utilities.php.

References $ilDB, $ilLog, getParentsForNode(), and ilSCORM2004SeqTemplate\templateForChapter().

{
require_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Template.php");
global $ilDB,$ilLog;
$has_template = false;
$mtree = new ilTree($a_slm_id);
$mtree->setTableNames('sahs_sc13_tree','sahs_sc13_tree_node');
$mtree->setTreeTablePK("slm_id");
//get all parents for current node
$parents = $this -> getParentsForNode($a_parents=array(),$this->id);
for ($i=0;$i<count($parents);$i++)
{
$template = ilSCORM2004SeqTemplate::templateForChapter($parents[$i]);
if ($template) {
$has_template = true;
break;
}
}
return $has_template;
}

+ Here is the call graph for this function:

Field Documentation

ilSCORM2004Utilities::$id = null
private

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

Referenced by getId(), and getParentsForNode().


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