ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 17 of file class.ilSCORM2004Utilities.php.

Member Function Documentation

◆ getAllowedActions()

ilSCORM2004Utilities::getAllowedActions ( )

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

130 {
131 global $ilDB,$ilLog;
132 $ilLog->write("SCORM: getAllowedActions for".$this->tree_node_id);
133 $query = "SELECT * FROM sahs_sc13_seq_item WHERE sahs_sc13_tree_node_id = ".
134 $ilDB->quote($this->getId(), "integer");
135 $obj_set = $ilDB->query($query);
136 $obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
137 return array("copy"=>!$obj_rec['nocopy'],"move"=>!$obj_rec['nomove'],"delete"=>!$obj_rec['nodelete']);
138 }
const DB_FETCHMODE_ASSOC
Definition: class.ilDB.php:10
global $ilDB

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

+ Here is the call graph for this function:

◆ getAllSequencingProperties()

ilSCORM2004Utilities::getAllSequencingProperties ( )

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

156 {
157 global $ilDB,$ilLog;
158 $query = "SELECT * FROM sahs_sc13_seq_seq WHERE (id = ".
159 $ilDB->quote($this->getSequencingId(), "text").
160 " AND importid=".$ilDB->quote($this->getImportIdent(), "text").")";
161 $obj_set = $ilDB->query($query);
162 $ilLog->write("SCORM: getAllSequencingProperties for".$this->getSequencingId());
163 $obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
164 $sprop = array(
165 'importId' => $obj_rec['importid'],
166 'activityAbsoluteDurationLimit' => $obj_rec['activityabsolutedurationlimit'],
167 'activityExperiencedDurationLimit' => $obj_rec['activityexperienceddurlimit'],
168 'attemptAbsoluteDurationLimit' => $obj_rec['attemptabsolutedurationlimit'],
169 'attemptExperiencedDurationLimit' => $obj_rec['attemptexperienceddurlimit'],
170 'attemptLimit' => $obj_rec['attemptlimit'],
171 'beginTimeLimit' => $obj_rec['begintimelimit'],
172 'completionSetByContent' => $obj_rec['completionsetbycontent'],
173 'constrainChoice' => $obj_rec['constrainchoice'],
174 'seqNodeId' => $obj_rec['seqnodeid'],
175 'endTimeLimit' => $obj_rec['endtimelimit'],
176 'id' => $obj_rec['id'],
177 'measureSatisfactionIfActive' => $obj_rec['measuresatisfactionifactive'],
178 'objectiveMeasureWeight' => $obj_rec['objectivemeasureweight'],
179 'objectiveSetByContent' => $obj_rec['objectivesetbycontent'],
180 'preventActivation' => $obj_rec['preventactivation'],
181 'randomizationTiming' => $obj_rec['randomizationtiming'],
182 'reorderChildren' => $obj_rec['reorderchildren'],
183 'requiredForCompleted' => $obj_rec['requiredforcompleted'],
184 'requiredForIncomplete' => $obj_rec['requiredforincomplete'],
185 'requiredForNotSatisfied' => $obj_rec['requiredfornotsatisfied'],
186 'requiredForSatisfied' => $obj_rec['requiredforsatisfied'],
187 'rollupObjectiveSatisfied' => $obj_rec['rollupobjectivesatisfied'],
188 'rollupProgressCompletion' => $obj_rec['rollupprogresscompletion'],
189 'selectCount' => $obj_rec['selectcount'],
190 'selectionTiming' => $obj_rec['selectiontiming'],
191 'sequencingId' => $obj_rec['sequencingid'],
192 'tracked' => $obj_rec['tracked'],
193 'useCurrentAttemptObjectiveInfo' => $obj_rec['usecurrentattemptobjectiveinfo'],
194 'useCurrentAttemptProgressInfo' => $obj_rec['usecurrentattemptprogressinfo'],
195 'flow' => $obj_rec['flow'],
196 'forwardOnly' => $obj_rec['forwardonly'],
197 'choice' => $obj_rec['choice'],
198 'choiceExit' => $obj_rec['choiceexit'] );
199 return $sprop;
200 }

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

Referenced by getSeqNodeId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getControlModeProperties()

ilSCORM2004Utilities::getControlModeProperties ( )

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

141 {
142 global $ilDB;
143 $query = "SELECT * FROM sahs_sc13_seq_seq WHERE id = ".
144 $ilDB->quote($this->getSequencingId(), "text");
145 $obj_set = $ilDB->query($query);
146 $obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
147 $c_properties = array(
148 'flow' => $obj_rec['flow'],
149 'forwardOnly' => $obj_rec['forwardonly'],
150 'choice' => $obj_rec['choice'],
151 'choiceExit' => $obj_rec['choiceexit'] );
152 return $c_properties;
153 }

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

+ Here is the call graph for this function:

◆ getId()

ilSCORM2004Utilities::getId ( )
private

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

References $id.

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

+ Here is the caller graph for this function:

◆ getImportIdent()

ilSCORM2004Utilities::getImportIdent ( )

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

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

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

Referenced by getAllSequencingProperties(), and getLeftRightInfo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getItemId()

ilSCORM2004Utilities::getItemId ( )
private

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

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

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

+ Here is the call graph for this function:

◆ getLeftRightInfo()

ilSCORM2004Utilities::getLeftRightInfo ( )

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

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

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

+ Here is the call graph for this function:

◆ getParentsForNode()

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

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

56 {
57 $parent_id = $tree->getParentId($id);
58 if ($parent_id != 0) {
59 array_push($a_parents,$parent_id);
60 $this->getParentsForNode($a_parents,$parent_id);
61 } else {
62 return $a_parents;
63 }
64 }
getParentsForNode($a_parents, $a_id)

References $id, and getParentsForNode().

Referenced by getParentsForNode(), and parentHasSeqTemplate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSeqNodeId()

ilSCORM2004Utilities::getSeqNodeId ( )
protected

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

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

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

Referenced by getLeftRightInfo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSequencingId()

ilSCORM2004Utilities::getSequencingId ( )
private

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

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

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

Referenced by getAllSequencingProperties(), and getControlModeProperties().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilSCORM2004Utilities()

ilSCORM2004Utilities::ilSCORM2004Utilities (   $a_id)

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

28 {
29 $this->id = $a_id;
30 }

◆ parentHasSeqTemplate()

ilSCORM2004Utilities::parentHasSeqTemplate (   $a_slm_id)

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

33 {
34 require_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004SeqTemplate.php");
35
36 global $ilDB,$ilLog;
37 $has_template = false;
38
39 $mtree = new ilTree($a_slm_id);
40 $mtree->setTableNames('sahs_sc13_tree','sahs_sc13_tree_node');
41 $mtree->setTreeTablePK("slm_id");
42 //get all parents for current node
43 $parents = $this -> getParentsForNode($a_parents=array(),$this->id);
44 for ($i=0;$i<count($parents);$i++)
45 {
46 $template = ilSCORM2004SeqTemplate::templateForChapter($parents[$i]);
47 if ($template) {
48 $has_template = true;
49 break;
50 }
51 }
52
53 return $has_template;
54 }
static templateForChapter($a_chapter_id)
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...

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

+ Here is the call graph for this function:

Field Documentation

◆ $id

ilSCORM2004Utilities::$id = null
private

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

Referenced by getId(), and getParentsForNode().


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