ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilSCORM2004Sequencing.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
16 require_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Item.php");
17 
18 
20 {
21 
22 
23 // **********************
24  // ATTRIBUTE DECLARATION
25  // **********************
26 
31  public $attemptLimit = 0;
32  public $beginTimeLimit = 0 ;
33  public $choice = true;
34  public $choiceExit = true;
35  public $completionSetByContent = false;
36  public $constrainChoice = false;
37  public $seqNodeId = null;
38  public $endTimeLimit = null ;
39  public $flow = false;
40  public $forwardOnly = false;
41  public $id = 0;
44  public $objectiveSetByContent = false;
45  public $preventActivation = false;
46  public $randomizationTiming = "never";
47  public $reorderChildren = false;
48  public $requiredForCompleted = "always";
49  public $requiredForIncomplete = "always";
50  public $requiredForNotSatisfied = "always";
51  public $requiredForSatisfied = "always";
54  public $selectCount = 0;
55  public $selectionTiming = false;
56  public $sequencingId = null;
57  public $tracked = true;
60  public $importid = null;
61  public $node = null;
62 
63  // **********************
64  // CONSTRUCTOR METHOD
65  // **********************
66 
71  public function __construct($a_treeid = null, $a_rootlevel = false)
72  {
73  parent::__construct($a_treeid, $a_rootlevel);
74 
75  if ($a_treeid != null) {
76  $xpath_obj = new DOMXPath($this->dom);
77  $obj_node_list = $xpath_obj->query('//controlMode');
78  $this->setNode($obj_node_list->item(0));
79  if ($obj_node_list->length != 1) {
80  $obj_con = $this->dom->createElement("controlMode");
81  $root = $this->dom->getElementsByTagName("sequencing")->item(0);
82  $root->appendChild($obj_con);
83  $this->node = $this->dom->getElementsByTagName("controlMode")->item(0);
84  $this->setFlow(true);
85  $this->setChoice(true);
86  $this->setForwardOnly(false);
87  }
88  }
89  }
90 
91 
92  // **********************
93  // GETTER METHODS
94  // **********************
95 
96 
98  {
100  }
101 
103  {
105  }
106 
108  {
110  }
111 
113  {
115  }
116 
117  public function getAttemptLimit()
118  {
119  return $this->attemptLimit;
120  }
121 
122  public function getBeginTimeLimit()
123  {
124  return $this->beginTimeLimit;
125  }
126 
127  public function getChoice()
128  {
129  return self::convertStringToBool($this->node->getAttribute("choice"));
130  }
131 
132  public function getChoiceExit()
133  {
134  return self::convertStringToBool($this->node->getAttribute("choiceExit"));
135  }
136 
137  public function getCompletionSetByContent()
138  {
140  }
141 
142  public function getConstrainChoice()
143  {
144  return $this->constrainChoice;
145  }
146 
147  public function getSeqNodeId()
148  {
149  return $this->seqNodeId;
150  }
151 
152  public function getEndTimeLimit()
153  {
154  return $this->endTimeLimit;
155  }
156 
157  public function getFlow()
158  {
159  return self::convertStringToBool($this->node->getAttribute("flow"));
160  }
161 
162  public function getForwardOnly()
163  {
164  return self::convertStringToBool($this->node->getAttribute("forwardOnly"));
165  }
166 
167  public function getId()
168  {
169  return $this->id;
170  }
171 
173  {
175  }
176 
177  public function getObjectiveMeasureWeight()
178  {
180  }
181 
182  public function getObjectiveSetByContent()
183  {
185  }
186 
187  public function getPreventActivation()
188  {
190  }
191 
192  public function getRandomizationTiming()
193  {
195  }
196 
197  public function getReorderChildren()
198  {
199  return $this->reorderChildren;
200  }
201 
202  public function getRequiredForCompleted()
203  {
205  }
206 
207  public function getRequiredForIncomplete()
208  {
210  }
211 
212  public function getRequiredForNotSatisfied()
213  {
215  }
216 
217  public function getRequiredForSatisfied()
218  {
220  }
221 
222  public function getRollupObjectiveSatisfied()
223  {
225  }
226 
227  public function getRollupProgressCompletion()
228  {
230  }
231 
232  public function getSelectCount()
233  {
234  return $this->selectCount;
235  }
236 
237  public function getSelectionTiming()
238  {
239  return $this->selectionTiming;
240  }
241 
242  public function getSequencingId()
243  {
244  return $this->sequencingId;
245  }
246 
247  public function getTracked()
248  {
249  return $this->tracked;
250  }
251 
253  {
255  }
256 
258  {
260  }
261 
262  // **********************
263  // SETTER METHODS
264  // **********************
265 
266 
267  public function setActivityAbsoluteDurationLimit($val)
268  {
269  $this->activityAbsoluteDurationLimit = $val;
270  }
271 
273  {
274  $this->activityExperiencedDurationLimit = $val;
275  }
276 
277  public function setAttemptAbsoluteDurationLimit($val)
278  {
279  $this->attemptAbsoluteDurationLimit = $val;
280  }
281 
283  {
284  $this->attemptExperiencedDurationLimit = $val;
285  }
286 
287  public function setAttemptLimit($val)
288  {
289  $this->attemptLimit = $val;
290  }
291 
292  public function setBeginTimeLimit($val)
293  {
294  $this->beginTimeLimit = $val;
295  }
296 
297  public function setChoice($a_choice)
298  {
299  $this->node->setAttribute("choice", $a_choice ? "true": "false");
300  }
301 
302  public function setChoiceExit($a_choicexit)
303  {
304  $this->node->setAttribute("choiceExit", $a_choicexit ? "true": "false");
305  }
306 
307  public function setCompletionSetByContent($val)
308  {
309  $this->completionSetByContent = $val;
310  }
311 
312  public function setConstrainChoice($val)
313  {
314  $this->constrainChoice = $val;
315  }
316 
317  public function setSeqNodeId($a_seqnodeid)
318  {
319  $this->seqNodeId = $a_seqnodeid;
320  }
321 
322  public function setEndTimeLimit($val)
323  {
324  $this->endTimeLimit = $val;
325  }
326 
327  public function setFlow($a_flow)
328  {
329  $this->node->setAttribute("flow", $a_flow ? "true": "false");
330  }
331 
332  public function setForwardOnly($a_forwardonly)
333  {
334  $this->node->setAttribute("forwardOnly", $a_forwardonly ? "true": "false");
335  }
336 
337  public function setId($val)
338  {
339  $this->id = $val;
340  }
341 
342  public function setMeasureSatisfactionIfActive($val)
343  {
344  $this->measureSatisfactionIfActive = $val;
345  }
346 
347  public function setObjectiveMeasureWeight($val)
348  {
349  $this->objectiveMeasureWeight = $val;
350  }
351 
352  public function setObjectiveSetByContent($val)
353  {
354  $this->objectiveSetByContent = $val;
355  }
356 
357  public function setPreventActivation($val)
358  {
359  $this->preventActivation = $val;
360  }
361 
362  public function setRandomizationTiming($val)
363  {
364  $this->randomizationTiming = $val;
365  }
366 
367  public function setReorderChildren($val)
368  {
369  $this->reorderChildren = $val;
370  }
371 
372  public function setRequiredForCompleted($val)
373  {
374  $this->requiredForCompleted = $val;
375  }
376 
377  public function setRequiredForIncomplete($val)
378  {
379  $this->requiredForIncomplete = $val;
380  }
381 
382  public function setRequiredForNotSatisfied($val)
383  {
384  $this->requiredForNotSatisfied = $val;
385  }
386 
387  public function setRequiredForSatisfied($val)
388  {
389  $this->requiredForSatisfied = $val;
390  }
391 
392  public function setRollupObjectiveSatisfied($val)
393  {
394  $this->rollupObjectiveSatisfied = $val;
395  }
396 
397  public function setRollupProgressCompletion($val)
398  {
399  $this->rollupProgressCompletion = $val;
400  }
401 
402  public function setSelectCount($val)
403  {
404  $this->selectCount = $val;
405  }
406 
407  public function setSelectionTiming($val)
408  {
409  $this->selectionTiming = $val;
410  }
411 
412  public function setSequencingId($val)
413  {
414  $this->sequencingId = $val;
415  }
416 
417  public function setTracked($val)
418  {
419  $this->tracked = $val;
420  }
421 
422  public function setUseCurrentAttemptObjectiveInfo($val)
423  {
424  $this->useCurrentAttemptObjectiveInfo = $val;
425  }
426 
427  public function setUseCurrentAttemptProgressInfo($val)
428  {
429  $this->useCurrentAttemptProgressInfo = $val;
430  }
431 
432 
433  public function setImportid($a_importid)
434  {
435  $this->importid = $a_importid;
436  }
437 
438 
439  public function setNode($a_node)
440  {
441  $this->node = $a_node;
442  }
443 
444  public function setDom($a_dom)
445  {
446  $this->dom = $a_dom;
447  }
448 
449  //helper
450  private static function convertStringToBool($a_string)
451  {
452  switch ($a_string) {
453  case 'true':
454  return true;
455  break;
456 
457  case 'false':
458  return false;
459  break;
460 
461  default:
462  # code...
463  break;
464  }
465  }
466 } // class : end
Class ilSCORM2004Condition.
$root
Definition: sabredav.php:45
Class ilSCORM2004Sequencing.
__construct($a_treeid=null, $a_rootlevel=false)
Constructor public.