ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.assAnswerOrdering.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once "./Modules/TestQuestionPool/classes/class.assAnswerSimple.php";
5 include_once "./Modules/Test/classes/inc.AssessmentConstants.php";
6 
23  protected $random_id;
24 
25  public $answer_id = 0;
26  public $ordering_depth = 0;
27 
37  function ASS_AnswerOrdering (
38  $answertext = "",
39  $random_id = 0,
40  $depth = 0
41  )
42  {
44  $this->setRandomID($random_id);
45  $this->setOrderingDepth($depth);
46  }
47 
48 
55  public function getRandomID()
56  {
57  return $this->random_id;
58  }
59 
66  public function setRandomID($random_id = 0)
67  {
68  $this->random_id = $random_id;
69  }
70 
71  public function getAdditionalOrderingFieldsByRandomId($a_random_id)
72  {
73  global $ilDB;
74 
75  $res = $ilDB->queryF('SELECT * FROM qpl_a_ordering WHERE random_id = %s',
76  array('integer'), array($a_random_id));
77 
78  while($row = $ilDB->fetchAssoc($res))
79  {
80  $this->setAnswerId($row['answer_id']);
81  $this->setOrderingDepth($row['depth']);
82 }
83  }
84 
85  public function setAnswerId($a_answer_id)
86  {
87  $this->answer_id = $a_answer_id;
88  }
89  public function getAnswerId()
90  {
91  return $this->answer_id;
92  }
93 
94  public function setOrderingDepth($a_ordering_depth)
95  {
96  $this->ordering_depth = (int)$a_ordering_depth;
97  }
98  public function getOrderingDepth()
99  {
100  return $this->ordering_depth;
101  }
102 }
103 ?>