ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSCORM2004Sequencing.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2008 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 
36 require_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Item.php");
37 
38 
40 {
41 
42 
43 // **********************
44 // ATTRIBUTE DECLARATION
45 // **********************
46 
51 var $attemptLimit= 0;
52 var $beginTimeLimit = 0 ;
53 var $choice = true;
54 var $choiceExit = true;
56 var $constrainChoice = false;
57 var $seqNodeId = null;
58 var $endTimeLimit = null ;
59 var $flow = false;
60 var $forwardOnly = false;
61 var $id = 0;
65 var $preventActivation = false;
66 var $randomizationTiming = "never";
67 var $reorderChildren = false;
68 var $requiredForCompleted = "always";
69 var $requiredForIncomplete = "always";
70 var $requiredForNotSatisfied ="always";
71 var $requiredForSatisfied ="always";
74 var $selectCount = 0;
75 var $selectionTiming = false;
76 var $sequencingId = null;
77 var $tracked = true;
80 var $importid = null;
81 var $node = null;
82 
83 // **********************
84 // CONSTRUCTOR METHOD
85 // **********************
86 
91 function ilSCORM2004Sequencing($a_treeid = null,$a_rootlevel=false)
92 {
93  parent::ilSCORM2004Item($a_treeid, $a_rootlevel);
94 
95  if ($a_treeid != null) {
96  $xpath_obj = new DOMXPath($this->dom);
97  $obj_node_list = $xpath_obj->query('//controlMode');
98  $this->setNode($obj_node_list->item(0));
99  if ($obj_node_list->length!=1 ) {
100  $obj_con = $this->dom->createElement("controlMode");
101  $root = $this->dom->getElementsByTagName("sequencing")->item(0);
102  $root->appendChild($obj_con);
103  $this->node =$this->dom->getElementsByTagName("controlMode")->item(0);
104  $this->setFlow(true);
105  $this->setChoice(true);
106  $this->setForwardOnly(false);
107  }
108  }
109 }
110 
111 
112 // **********************
113 // GETTER METHODS
114 // **********************
115 
116 
118 {
120 }
121 
123 {
125 }
126 
128 {
130 }
131 
133 {
135 }
136 
137 function getAttemptLimit()
138 {
139  return $this->attemptLimit;
140 }
141 
143 {
144  return $this->beginTimeLimit;
145 }
146 
147 function getChoice()
148 {
149  return self::convertStringToBool($this->node->getAttribute("choice"));
150 }
151 
152 function getChoiceExit()
153 {
154  return self::convertStringToBool($this->node->getAttribute("choiceExit"));
155 }
156 
158 {
160 }
161 
163 {
164  return $this->constrainChoice;
165 }
166 
167 function getSeqNodeId()
168 {
169  return $this->seqNodeId;
170 }
171 
172 function getEndTimeLimit()
173 {
174  return $this->endTimeLimit;
175 }
176 
177 function getFlow()
178 {
179  return self::convertStringToBool($this->node->getAttribute("flow"));
180 }
181 
182 function getForwardOnly()
183 {
184  return self::convertStringToBool($this->node->getAttribute("forwardOnly"));
185 }
186 
187 function getId()
188 {
189 return $this->id;
190 }
191 
193 {
195 }
196 
198 {
200 }
201 
203 {
205 }
206 
208 {
210 }
211 
213 {
215 }
216 
218 {
219  return $this->reorderChildren;
220 }
221 
223 {
225 }
226 
228 {
230 }
231 
233 {
235 }
236 
238 {
240 }
241 
243 {
245 }
246 
248 {
250 }
251 
252 function getSelectCount()
253 {
254  return $this->selectCount;
255 }
256 
258 {
259  return $this->selectionTiming;
260 }
261 
262 function getSequencingId()
263 {
264  return $this->sequencingId;
265 }
266 
267 function getTracked()
268 {
269  return $this->tracked;
270 }
271 
273 {
275 }
276 
278 {
280 }
281 
282 // **********************
283 // SETTER METHODS
284 // **********************
285 
286 
288 {
289  $this->activityAbsoluteDurationLimit = $val;
290 }
291 
293 {
294  $this->activityExperiencedDurationLimit = $val;
295 }
296 
298 {
299  $this->attemptAbsoluteDurationLimit = $val;
300 }
301 
303 {
304  $this->attemptExperiencedDurationLimit = $val;
305 }
306 
307 function setAttemptLimit($val)
308 {
309  $this->attemptLimit = $val;
310 }
311 
312 function setBeginTimeLimit($val)
313 {
314  $this->beginTimeLimit = $val;
315 }
316 
317 function setChoice($a_choice)
318 {
319  $this->node->setAttribute("choice",$a_choice ? "true": "false");
320 }
321 
322 function setChoiceExit($a_choicexit)
323 {
324  $this->node->setAttribute("choiceExit",$a_choicexit ? "true": "false");
325 }
326 
328 {
329  $this->completionSetByContent = $val;
330 }
331 
332 function setConstrainChoice($val)
333 {
334  $this->constrainChoice = $val;
335 }
336 
337 function setSeqNodeId($a_seqnodeid)
338 {
339  $this->seqNodeId = $a_seqnodeid;
340 }
341 
342 function setEndTimeLimit($val)
343 {
344  $this->endTimeLimit = $val;
345 }
346 
347 function setFlow($a_flow)
348 {
349  $this->node->setAttribute("flow",$a_flow ? "true": "false");
350 }
351 
352 function setForwardOnly($a_forwardonly)
353 {
354  $this->node->setAttribute("forwardOnly",$a_forwardonly ? "true": "false");
355 }
356 
357 function setId($val)
358 {
359  $this->id = $val;
360 }
361 
363 {
364  $this->measureSatisfactionIfActive = $val;
365 }
366 
368 {
369  $this->objectiveMeasureWeight = $val;
370 }
371 
373 {
374  $this->objectiveSetByContent = $val;
375 }
376 
377 function setPreventActivation($val)
378 {
379  $this->preventActivation = $val;
380 }
381 
383 {
384  $this->randomizationTiming = $val;
385 }
386 
387 function setReorderChildren($val)
388 {
389  $this->reorderChildren = $val;
390 }
391 
393 {
394  $this->requiredForCompleted = $val;
395 }
396 
398 {
399  $this->requiredForIncomplete = $val;
400 }
401 
403 {
404  $this->requiredForNotSatisfied = $val;
405 }
406 
408 {
409  $this->requiredForSatisfied = $val;
410 }
411 
413 {
414  $this->rollupObjectiveSatisfied = $val;
415 }
416 
418 {
419  $this->rollupProgressCompletion = $val;
420 }
421 
422 function setSelectCount($val)
423 {
424  $this->selectCount = $val;
425 }
426 
427 function setSelectionTiming($val)
428 {
429  $this->selectionTiming = $val;
430 }
431 
432 function setSequencingId($val)
433 {
434  $this->sequencingId = $val;
435 }
436 
437 function setTracked($val)
438 {
439  $this->tracked = $val;
440 }
441 
443 {
444  $this->useCurrentAttemptObjectiveInfo = $val;
445 }
446 
448 {
449  $this->useCurrentAttemptProgressInfo = $val;
450 }
451 
452 
453 public function setImportid($a_importid)
454 {
455  $this->importid = $a_importid;
456 }
457 
458 
459 public function setNode($a_node)
460 {
461  $this->node = $a_node;
462 }
463 
464 public function setDom($a_dom)
465 {
466  $this->dom = $a_dom;
467 }
468 
469 //helper
470 private static function convertStringToBool($a_string){
471  switch ($a_string) {
472  case 'true':
473  return true;
474  break;
475 
476  case 'false':
477  return false;
478  break;
479 
480  default:
481  # code...
482  break;
483  }
484 }
485 
486 
487 } // class : end
488 
489 ?>