ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilLORandomTestQuestionPools Class Reference

Class ilLOEditorGUI. More...

+ Collaboration diagram for ilLORandomTestQuestionPools:

Public Member Functions

 __construct ($a_container_id, $a_objective_id, $a_test_type)
 Constructor. More...
 
 setContainerId ($a_id)
 
 getContainerId ()
 
 setObjectiveId ($a_id)
 
 getObjectiveId ()
 
 setTestType ($a_type)
 
 getTestType ()
 
 setTestId ($a_id)
 
 getTestId ()
 
 setQplSequence ($a_id)
 
 getQplSequence ()
 
 setLimit ($a_id)
 
 getLimit ()
 
 read ()
 
 delete ()
 
 create ()
 

Static Public Member Functions

static lookupLimit ($a_container_id, $a_objective_id, $a_test_type)
 
static lookupSequence ($a_container_id, $a_objective_id, $a_test_id)
 

Protected Attributes

 $container_id = 0
 
 $objective_id = 0
 
 $test_type = 0
 
 $test_id = 0
 
 $qpl_seq = 0
 
 $limit = 50
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilLORandomTestQuestionPools::__construct (   $a_container_id,
  $a_objective_id,
  $a_test_type 
)

Constructor.

Parameters
type$a_container_id
type$a_objective_id

Definition at line 30 of file class.ilLORandomTestQuestionPools.php.

31 {
32 $this->container_id = $a_container_id;
33 $this->objective_id = $a_objective_id;
34 $this->test_type = $a_test_type;
35
36 $this->read();
37 }

References read().

+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilLORandomTestQuestionPools::create ( )

Definition at line 164 of file class.ilLORandomTestQuestionPools.php.

165 {
166 global $ilDB;
167
168 $query = 'INSERT INTO loc_rnd_qpl ' .
169 '(container_id, objective_id, tst_type, tst_id, qp_seq, percentage) '.
170 'VALUES ( '.
171 $ilDB->quote($this->getContainerId(),'integer').', '.
172 $ilDB->quote($this->getObjectiveId(),'integer').', '.
173 $ilDB->quote($this->getTestType(),'integer').', '.
174 $ilDB->quote($this->getTestId(),'integer').', '.
175 $ilDB->quote($this->getQplSequence(),'integer').', '.
176 $ilDB->quote($this->getLimit()).' '.
177 ')';
178 $ilDB->manipulate($query);
179 }
global $ilDB

References $ilDB, $query, getContainerId(), getLimit(), getObjectiveId(), getQplSequence(), getTestId(), and getTestType().

+ Here is the call graph for this function:

◆ delete()

ilLORandomTestQuestionPools::delete ( )

Definition at line 153 of file class.ilLORandomTestQuestionPools.php.

154 {
155 global $ilDB;
156
157 $query = 'DELETE FROM loc_rnd_qpl '.
158 'WHERE container_id = '.$ilDB->quote($this->getContainerId(),'integer').' '.
159 'AND objective_id = '.$ilDB->quote($this->getObjectiveId(),'integer').' '.
160 'AND tst_type = '.$ilDB->quote($this->getTestType(),'integer');
161 $ilDB->manipulate($query);
162 }

References $ilDB, $query, and getContainerId().

+ Here is the call graph for this function:

◆ getContainerId()

ilLORandomTestQuestionPools::getContainerId ( )

Definition at line 78 of file class.ilLORandomTestQuestionPools.php.

References $container_id.

Referenced by create(), delete(), and read().

+ Here is the caller graph for this function:

◆ getLimit()

ilLORandomTestQuestionPools::getLimit ( )

Definition at line 128 of file class.ilLORandomTestQuestionPools.php.

References $limit.

Referenced by create().

+ Here is the caller graph for this function:

◆ getObjectiveId()

ilLORandomTestQuestionPools::getObjectiveId ( )

Definition at line 88 of file class.ilLORandomTestQuestionPools.php.

References $objective_id.

Referenced by create(), and read().

+ Here is the caller graph for this function:

◆ getQplSequence()

ilLORandomTestQuestionPools::getQplSequence ( )

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

References $qpl_seq.

Referenced by create().

+ Here is the caller graph for this function:

◆ getTestId()

ilLORandomTestQuestionPools::getTestId ( )

Definition at line 108 of file class.ilLORandomTestQuestionPools.php.

References $test_id.

Referenced by create().

+ Here is the caller graph for this function:

◆ getTestType()

ilLORandomTestQuestionPools::getTestType ( )

Definition at line 98 of file class.ilLORandomTestQuestionPools.php.

References $test_type.

Referenced by create(), and read().

+ Here is the caller graph for this function:

◆ lookupLimit()

static ilLORandomTestQuestionPools::lookupLimit (   $a_container_id,
  $a_objective_id,
  $a_test_type 
)
static

Definition at line 39 of file class.ilLORandomTestQuestionPools.php.

40 {
41 global $ilDB;
42
43 $query = 'SELECT * FROM loc_rnd_qpl '.
44 'WHERE container_id = '.$ilDB->quote($a_container_id,'integer').' '.
45 'AND objective_id = '.$ilDB->quote($a_objective_id,'integer').' '.
46 'AND tst_type = '.$ilDB->quote($a_test_type,'integer');
47 $res = $ilDB->query($query);
48 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
49 {
50 return $row->percentage;
51 }
52 return 0;
53 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilLOUtils\lookupObjectiveRequiredPercentage().

+ Here is the caller graph for this function:

◆ lookupSequence()

static ilLORandomTestQuestionPools::lookupSequence (   $a_container_id,
  $a_objective_id,
  $a_test_id 
)
static

Definition at line 55 of file class.ilLORandomTestQuestionPools.php.

56 {
57 global $ilDB;
58
59 $query = 'SELECT * FROM loc_rnd_qpl '.
60 'WHERE container_id = '.$ilDB->quote($a_container_id,'integer').' '.
61 'AND objective_id = '.$ilDB->quote($a_objective_id,'integer').' '.
62 'AND tst_id = '.$ilDB->quote($a_test_id,'integer');
63 $res = $ilDB->query($query);
64 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
65 {
66 return $row->qp_seq;
67 }
68 return 0;
69
70 }

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilLOEditorStatus\lookupQuestionsAssigned().

+ Here is the caller graph for this function:

◆ read()

ilLORandomTestQuestionPools::read ( )

Definition at line 134 of file class.ilLORandomTestQuestionPools.php.

135 {
136 global $ilDB;
137
138 $query = 'SELECT * FROM loc_rnd_qpl '.
139 'WHERE container_id = '.$ilDB->quote($this->getContainerId(),'integer').' '.
140 'AND objective_id = '.$ilDB->quote($this->getObjectiveId(),'integer').' '.
141 'AND tst_type = '.$ilDB->quote($this->getTestType(),'integer');
142
143 $res = $ilDB->query($query);
144 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
145 {
146 $this->setLimit($row->percentage);
147 $this->setTestId($row->tst_id);
148 $this->setQplSequence($row->qp_seq);
149 }
150 return true;
151 }

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, getContainerId(), getObjectiveId(), getTestType(), setLimit(), setQplSequence(), and setTestId().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setContainerId()

ilLORandomTestQuestionPools::setContainerId (   $a_id)

Definition at line 73 of file class.ilLORandomTestQuestionPools.php.

74 {
75 $this->container_id = $a_id;
76 }

◆ setLimit()

ilLORandomTestQuestionPools::setLimit (   $a_id)

Definition at line 123 of file class.ilLORandomTestQuestionPools.php.

124 {
125 $this->limit = $a_id;
126 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setObjectiveId()

ilLORandomTestQuestionPools::setObjectiveId (   $a_id)

Definition at line 83 of file class.ilLORandomTestQuestionPools.php.

84 {
85 $this->objective_id = $a_id;
86 }

◆ setQplSequence()

ilLORandomTestQuestionPools::setQplSequence (   $a_id)

Definition at line 113 of file class.ilLORandomTestQuestionPools.php.

114 {
115 $this->qpl_seq = $a_id;
116 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTestId()

ilLORandomTestQuestionPools::setTestId (   $a_id)

Definition at line 103 of file class.ilLORandomTestQuestionPools.php.

104 {
105 $this->test_id = $a_id;
106 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTestType()

ilLORandomTestQuestionPools::setTestType (   $a_type)

Definition at line 93 of file class.ilLORandomTestQuestionPools.php.

94 {
95 $this->test_type = $a_type;
96 }

Field Documentation

◆ $container_id

ilLORandomTestQuestionPools::$container_id = 0
protected

Definition at line 17 of file class.ilLORandomTestQuestionPools.php.

Referenced by getContainerId().

◆ $limit

ilLORandomTestQuestionPools::$limit = 50
protected

Definition at line 22 of file class.ilLORandomTestQuestionPools.php.

Referenced by getLimit().

◆ $objective_id

ilLORandomTestQuestionPools::$objective_id = 0
protected

Definition at line 18 of file class.ilLORandomTestQuestionPools.php.

Referenced by getObjectiveId().

◆ $qpl_seq

ilLORandomTestQuestionPools::$qpl_seq = 0
protected

Definition at line 21 of file class.ilLORandomTestQuestionPools.php.

Referenced by getQplSequence().

◆ $test_id

ilLORandomTestQuestionPools::$test_id = 0
protected

Definition at line 20 of file class.ilLORandomTestQuestionPools.php.

Referenced by getTestId().

◆ $test_type

ilLORandomTestQuestionPools::$test_type = 0
protected

Definition at line 19 of file class.ilLORandomTestQuestionPools.php.

Referenced by getTestType().


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