ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 var $attemptLimit= 0;
32 var $beginTimeLimit = 0 ;
33 var $choice = true;
34 var $choiceExit = true;
36 var $constrainChoice = false;
37 var $seqNodeId = null;
38 var $endTimeLimit = null ;
39 var $flow = false;
40 var $forwardOnly = false;
41 var $id = 0;
45 var $preventActivation = false;
46 var $randomizationTiming = "never";
47 var $reorderChildren = false;
48 var $requiredForCompleted = "always";
49 var $requiredForIncomplete = "always";
50 var $requiredForNotSatisfied ="always";
51 var $requiredForSatisfied ="always";
54 var $selectCount = 0;
55 var $selectionTiming = false;
56 var $sequencingId = null;
57 var $tracked = true;
60 var $importid = null;
61 var $node = null;
62 
63 // **********************
64 // CONSTRUCTOR METHOD
65 // **********************
66 
71 function ilSCORM2004Sequencing($a_treeid = null,$a_rootlevel=false)
72 {
73  parent::ilSCORM2004Item($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 function getAttemptLimit()
118 {
119  return $this->attemptLimit;
120 }
121 
123 {
124  return $this->beginTimeLimit;
125 }
126 
127 function getChoice()
128 {
129  return self::convertStringToBool($this->node->getAttribute("choice"));
130 }
131 
132 function getChoiceExit()
133 {
134  return self::convertStringToBool($this->node->getAttribute("choiceExit"));
135 }
136 
138 {
140 }
141 
143 {
144  return $this->constrainChoice;
145 }
146 
147 function getSeqNodeId()
148 {
149  return $this->seqNodeId;
150 }
151 
152 function getEndTimeLimit()
153 {
154  return $this->endTimeLimit;
155 }
156 
157 function getFlow()
158 {
159  return self::convertStringToBool($this->node->getAttribute("flow"));
160 }
161 
162 function getForwardOnly()
163 {
164  return self::convertStringToBool($this->node->getAttribute("forwardOnly"));
165 }
166 
167 function getId()
168 {
169 return $this->id;
170 }
171 
173 {
175 }
176 
178 {
180 }
181 
183 {
185 }
186 
188 {
190 }
191 
193 {
195 }
196 
198 {
199  return $this->reorderChildren;
200 }
201 
203 {
205 }
206 
208 {
210 }
211 
213 {
215 }
216 
218 {
220 }
221 
223 {
225 }
226 
228 {
230 }
231 
232 function getSelectCount()
233 {
234  return $this->selectCount;
235 }
236 
238 {
239  return $this->selectionTiming;
240 }
241 
242 function getSequencingId()
243 {
244  return $this->sequencingId;
245 }
246 
247 function getTracked()
248 {
249  return $this->tracked;
250 }
251 
253 {
255 }
256 
258 {
260 }
261 
262 // **********************
263 // SETTER METHODS
264 // **********************
265 
266 
268 {
269  $this->activityAbsoluteDurationLimit = $val;
270 }
271 
273 {
274  $this->activityExperiencedDurationLimit = $val;
275 }
276 
278 {
279  $this->attemptAbsoluteDurationLimit = $val;
280 }
281 
283 {
284  $this->attemptExperiencedDurationLimit = $val;
285 }
286 
287 function setAttemptLimit($val)
288 {
289  $this->attemptLimit = $val;
290 }
291 
292 function setBeginTimeLimit($val)
293 {
294  $this->beginTimeLimit = $val;
295 }
296 
297 function setChoice($a_choice)
298 {
299  $this->node->setAttribute("choice",$a_choice ? "true": "false");
300 }
301 
302 function setChoiceExit($a_choicexit)
303 {
304  $this->node->setAttribute("choiceExit",$a_choicexit ? "true": "false");
305 }
306 
308 {
309  $this->completionSetByContent = $val;
310 }
311 
312 function setConstrainChoice($val)
313 {
314  $this->constrainChoice = $val;
315 }
316 
317 function setSeqNodeId($a_seqnodeid)
318 {
319  $this->seqNodeId = $a_seqnodeid;
320 }
321 
322 function setEndTimeLimit($val)
323 {
324  $this->endTimeLimit = $val;
325 }
326 
327 function setFlow($a_flow)
328 {
329  $this->node->setAttribute("flow",$a_flow ? "true": "false");
330 }
331 
332 function setForwardOnly($a_forwardonly)
333 {
334  $this->node->setAttribute("forwardOnly",$a_forwardonly ? "true": "false");
335 }
336 
337 function setId($val)
338 {
339  $this->id = $val;
340 }
341 
343 {
344  $this->measureSatisfactionIfActive = $val;
345 }
346 
348 {
349  $this->objectiveMeasureWeight = $val;
350 }
351 
353 {
354  $this->objectiveSetByContent = $val;
355 }
356 
357 function setPreventActivation($val)
358 {
359  $this->preventActivation = $val;
360 }
361 
363 {
364  $this->randomizationTiming = $val;
365 }
366 
367 function setReorderChildren($val)
368 {
369  $this->reorderChildren = $val;
370 }
371 
373 {
374  $this->requiredForCompleted = $val;
375 }
376 
378 {
379  $this->requiredForIncomplete = $val;
380 }
381 
383 {
384  $this->requiredForNotSatisfied = $val;
385 }
386 
388 {
389  $this->requiredForSatisfied = $val;
390 }
391 
393 {
394  $this->rollupObjectiveSatisfied = $val;
395 }
396 
398 {
399  $this->rollupProgressCompletion = $val;
400 }
401 
402 function setSelectCount($val)
403 {
404  $this->selectCount = $val;
405 }
406 
407 function setSelectionTiming($val)
408 {
409  $this->selectionTiming = $val;
410 }
411 
412 function setSequencingId($val)
413 {
414  $this->sequencingId = $val;
415 }
416 
417 function setTracked($val)
418 {
419  $this->tracked = $val;
420 }
421 
423 {
424  $this->useCurrentAttemptObjectiveInfo = $val;
425 }
426 
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  switch ($a_string) {
452  case 'true':
453  return true;
454  break;
455 
456  case 'false':
457  return false;
458  break;
459 
460  default:
461  # code...
462  break;
463  }
464 }
465 
466 
467 } // class : end
468 
469 ?>