ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilSCORM2004Utilities Class Reference

Class ilSCORM2004Utilities. More...

+ Collaboration diagram for ilSCORM2004Utilities:

Public Member Functions

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

Protected Member Functions

 getSeqNodeId ()
 

Protected Attributes

 $db
 
 $log
 

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.

Constructor & Destructor Documentation

◆ __construct()

ilSCORM2004Utilities::__construct (   $a_id)

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

References $DIC.

38  {
39  global $DIC;
40 
41  $this->db = $DIC->database();
42  $this->log = $DIC["ilLog"];
43  $this->id = $a_id;
44  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ getAllowedActions()

ilSCORM2004Utilities::getAllowedActions ( )

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

References $db, $ilDB, $ilLog, $log, $query, array, ilDBConstants\FETCHMODE_ASSOC, and getId().

150  {
151  $ilDB = $this->db;
152  $ilLog = $this->log;
153  $ilLog->write("SCORM: getAllowedActions for" . $this->tree_node_id);
154  $query = "SELECT * FROM sahs_sc13_seq_item WHERE sahs_sc13_tree_node_id = " .
155  $ilDB->quote($this->getId(), "integer");
156  $obj_set = $ilDB->query($query);
157  $obj_rec = $obj_set->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
158  return array("copy"=>!$obj_rec['nocopy'],"move"=>!$obj_rec['nomove'],"delete"=>!$obj_rec['nodelete']);
159  }
$query
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ getAllSequencingProperties()

ilSCORM2004Utilities::getAllSequencingProperties ( )

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

References $db, $ilDB, $ilLog, $log, $query, array, ilDBConstants\FETCHMODE_ASSOC, getImportIdent(), and getSequencingId().

Referenced by getSeqNodeId().

177  {
178  $ilDB = $this->db;
179  $ilLog = $this->log;
180  $query = "SELECT * FROM sahs_sc13_seq_seq WHERE (id = " .
181  $ilDB->quote($this->getSequencingId(), "text") .
182  " AND importid=" . $ilDB->quote($this->getImportIdent(), "text") . ")";
183  $obj_set = $ilDB->query($query);
184  $ilLog->write("SCORM: getAllSequencingProperties for" . $this->getSequencingId());
185  $obj_rec = $obj_set->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
186  $sprop = array(
187  'importId' => $obj_rec['importid'],
188  'activityAbsoluteDurationLimit' => $obj_rec['activityabsolutedurationlimit'],
189  'activityExperiencedDurationLimit' => $obj_rec['activityexperienceddurlimit'],
190  'attemptAbsoluteDurationLimit' => $obj_rec['attemptabsolutedurationlimit'],
191  'attemptExperiencedDurationLimit' => $obj_rec['attemptexperienceddurlimit'],
192  'attemptLimit' => $obj_rec['attemptlimit'],
193  'beginTimeLimit' => $obj_rec['begintimelimit'],
194  'completionSetByContent' => $obj_rec['completionsetbycontent'],
195  'constrainChoice' => $obj_rec['constrainchoice'],
196  'seqNodeId' => $obj_rec['seqnodeid'],
197  'endTimeLimit' => $obj_rec['endtimelimit'],
198  'id' => $obj_rec['id'],
199  'measureSatisfactionIfActive' => $obj_rec['measuresatisfactionifactive'],
200  'objectiveMeasureWeight' => $obj_rec['objectivemeasureweight'],
201  'objectiveSetByContent' => $obj_rec['objectivesetbycontent'],
202  'preventActivation' => $obj_rec['preventactivation'],
203  'randomizationTiming' => $obj_rec['randomizationtiming'],
204  'reorderChildren' => $obj_rec['reorderchildren'],
205  'requiredForCompleted' => $obj_rec['requiredforcompleted'],
206  'requiredForIncomplete' => $obj_rec['requiredforincomplete'],
207  'requiredForNotSatisfied' => $obj_rec['requiredfornotsatisfied'],
208  'requiredForSatisfied' => $obj_rec['requiredforsatisfied'],
209  'rollupObjectiveSatisfied' => $obj_rec['rollupobjectivesatisfied'],
210  'rollupProgressCompletion' => $obj_rec['rollupprogresscompletion'],
211  'selectCount' => $obj_rec['selectcount'],
212  'selectionTiming' => $obj_rec['selectiontiming'],
213  'sequencingId' => $obj_rec['sequencingid'],
214  'tracked' => $obj_rec['tracked'],
215  'useCurrentAttemptObjectiveInfo' => $obj_rec['usecurrentattemptobjectiveinfo'],
216  'useCurrentAttemptProgressInfo' => $obj_rec['usecurrentattemptprogressinfo'],
217  'flow' => $obj_rec['flow'],
218  'forwardOnly' => $obj_rec['forwardonly'],
219  'choice' => $obj_rec['choice'],
220  'choiceExit' => $obj_rec['choiceexit'] );
221  return $sprop;
222  }
$query
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getControlModeProperties()

ilSCORM2004Utilities::getControlModeProperties ( )

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

References $db, $ilDB, $query, array, ilDBConstants\FETCHMODE_ASSOC, and getSequencingId().

162  {
163  $ilDB = $this->db;
164  $query = "SELECT * FROM sahs_sc13_seq_seq WHERE id = " .
165  $ilDB->quote($this->getSequencingId(), "text");
166  $obj_set = $ilDB->query($query);
167  $obj_rec = $obj_set->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
168  $c_properties = array(
169  'flow' => $obj_rec['flow'],
170  'forwardOnly' => $obj_rec['forwardonly'],
171  'choice' => $obj_rec['choice'],
172  'choiceExit' => $obj_rec['choiceexit'] );
173  return $c_properties;
174  }
$query
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ getId()

ilSCORM2004Utilities::getId ( )
private

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

References $id.

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

145  {
146  return $this->id;
147  }
+ Here is the caller graph for this function:

◆ getImportIdent()

ilSCORM2004Utilities::getImportIdent ( )

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

References $db, $ilDB, $ilLog, $log, $query, ilDBConstants\FETCHMODE_ASSOC, and getId().

Referenced by getAllSequencingProperties(), and getLeftRightInfo().

131  {
132  $ilDB = $this->db;
133  $ilLog = $this->log;
134  $ilLog->write("SCORM: getImportIdent for" . $this->getId);
135  $query = "SELECT * FROM sahs_sc13_seq_item WHERE sahs_sc13_tree_node_id = " .
136  $ilDB->quote($this->getId(), "integer");
137  $obj_set = $ilDB->query($query);
138  $obj_rec = $obj_set->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
139  return $obj_rec['importid'];
140  }
$query
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getItemId()

ilSCORM2004Utilities::getItemId ( )
private

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

References $db, $ilDB, $ilLog, $log, $query, ilDBConstants\FETCHMODE_ASSOC, and getId().

119  {
120  $ilDB = $this->db;
121  $ilLog = $this->log;
122  $ilLog->write("SCORM: getSequencingId for" . $this->getId);
123  $query = "SELECT * FROM sahs_sc13_seq_item WHERE sahs_sc13_tree_node_id = " .
124  $ilDB->quote($this->getId(), "integer");
125  $obj_set = $ilDB->query($query);
126  $obj_rec = $obj_set->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
127  return $obj_rec['seqnodeid'];
128  }
$query
global $ilDB
+ Here is the call graph for this function:

◆ getLeftRightInfo()

ilSCORM2004Utilities::getLeftRightInfo ( )

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

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

83  {
84  $ilDB = $this->db;
86  $ilLog->write("SCORM: getLeftRightInfo");
87  $query = "SELECT * FROM sahs_sc13_seq_tree WHERE (child = " .
88  $ilDB->quote($this->getSeqNodeId(), "integer") .
89  " AND importid=" . $ilDB->quote($this->getImportIdent(), "text") . ")";
90  $obj_set = $ilDB->query($query);
91  $ilLog->write("SCORM: getLeftRightInfo executed" . $query);
92  $obj_rec = $ilDB->fetchAssoc($obj_set);
93  return array("left"=> $obj_rec["lft"], "right" => $obj_rec["rgt"]);
94  }
$query
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ getParentsForNode()

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

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

References $id.

Referenced by parentHasSeqTemplate().

71  {
72  $parent_id = $tree->getParentId($id);
73  if ($parent_id != 0) {
74  array_push($a_parents, $parent_id);
75  $this->getParentsForNode($a_parents, $parent_id);
76  } else {
77  return $a_parents;
78  }
79  }
getParentsForNode($a_parents, $a_id)
+ Here is the caller graph for this function:

◆ getSeqNodeId()

ilSCORM2004Utilities::getSeqNodeId ( )
protected

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

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

Referenced by getLeftRightInfo().

98  {
99  $ilDB = $this->db;
100  $ilLog = $this->log;
101  $all_props = $this->getAllSequencingProperties();
102  $ilLog->write("SCORM: getSeqNodeId: " . $all_props["seqnodeid"]);
103  return $all_props["seqnodeid"];
104  }
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSequencingId()

ilSCORM2004Utilities::getSequencingId ( )
private

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

References $db, $ilDB, $ilLog, $log, $query, ilDBConstants\FETCHMODE_ASSOC, and getId().

Referenced by getAllSequencingProperties(), and getControlModeProperties().

107  {
108  $ilDB = $this->db;
109  $ilLog = $this->log;
110  $ilLog->write("SCORM: getSequencingId for" . $this->getId());
111  $query = "SELECT * FROM sahs_sc13_seq_item WHERE sahs_sc13_tree_node_id = " .
112  $ilDB->quote($this->getId(), "integer");
113  $obj_set = $ilDB->query($query);
114  $obj_rec = $obj_set->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
115  return $obj_rec['sequencingid'];
116  }
$query
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parentHasSeqTemplate()

ilSCORM2004Utilities::parentHasSeqTemplate (   $a_slm_id)

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

References $db, $i, $ilDB, $ilLog, $log, $template, array, getParentsForNode(), and ilSCORM2004SeqTemplate\templateForChapter().

47  {
48  require_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004SeqTemplate.php");
49 
50  $ilDB = $this->db;
52  $has_template = false;
53 
54  $mtree = new ilTree($a_slm_id);
55  $mtree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
56  $mtree->setTreeTablePK("slm_id");
57  //get all parents for current node
58  $parents = $this -> getParentsForNode($a_parents=array(), $this->id);
59  for ($i=0;$i<count($parents);$i++) {
61  if ($template) {
62  $has_template = true;
63  break;
64  }
65  }
66 
67  return $has_template;
68  }
getParentsForNode($a_parents, $a_id)
$template
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Create styles array
The data for the language used.
global $ilDB
$i
Definition: disco.tpl.php:19
static templateForChapter($a_chapter_id)
+ Here is the call graph for this function:

Field Documentation

◆ $db

◆ $id

ilSCORM2004Utilities::$id = null
private

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

Referenced by getId(), and getParentsForNode().

◆ $log


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