ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilTestRandomQuestionSetSourcePoolDefinition Class Reference
+ Collaboration diagram for ilTestRandomQuestionSetSourcePoolDefinition:

Public Member Functions

 __construct (ilDB $db, ilObjTest $testOBJ)
 
 setId ($id)
 
 getId ()
 
 setPoolId ($poolId)
 
 getPoolId ()
 
 setPoolTitle ($poolTitle)
 
 getPoolTitle ()
 
 setPoolPath ($poolPath)
 
 getPoolPath ()
 
 setPoolQuestionCount ($poolQuestionCount)
 
 getPoolQuestionCount ()
 
 setOriginalFilterTaxId ($originalFilterTaxId)
 
 getOriginalFilterTaxId ()
 
 setOriginalFilterTaxNodeId ($originalFilterNodeId)
 
 getOriginalFilterTaxNodeId ()
 
 setMappedFilterTaxId ($mappedFilterTaxId)
 
 getMappedFilterTaxId ()
 
 setMappedFilterTaxNodeId ($mappedFilterTaxNodeId)
 
 getMappedFilterTaxNodeId ()
 
 setQuestionAmount ($questionAmount)
 
 getQuestionAmount ()
 
 setSequencePosition ($sequencePosition)
 
 getSequencePosition ()
 
 initFromArray ($dataArray)
 
 loadFromDb ($id)
 
 saveToDb ()
 
 cloneToDbForTestId ($testId)
 
 deleteFromDb ()
 
 getPoolInfoLabel (ilLanguage $lng)
 

Protected Attributes

 $db = null
 
 $testOBJ = null
 

Private Member Functions

 updateDbRecord ($testId)
 
 insertDbRecord ($testId)
 

Private Attributes

 $id = null
 
 $poolId = null
 
 $poolTitle = null
 
 $poolPath = null
 
 $poolQuestionCount = null
 
 $originalFilterTaxId = null
 
 $originalFilterTaxNodeId = null
 
 $mappedFilterTaxId = null
 
 $mappedFilterTaxNodeId = null
 
 $questionAmount = null
 
 $sequencePosition = null
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTestRandomQuestionSetSourcePoolDefinition::__construct ( ilDB  $db,
ilObjTest  $testOBJ 
)

Member Function Documentation

◆ cloneToDbForTestId()

ilTestRandomQuestionSetSourcePoolDefinition::cloneToDbForTestId (   $testId)

Definition at line 222 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

References insertDbRecord().

+ Here is the call graph for this function:

◆ deleteFromDb()

ilTestRandomQuestionSetSourcePoolDefinition::deleteFromDb ( )

Definition at line 227 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

228 {
229 $this->db->manipulateF(
230 "DELETE FROM tst_rnd_quest_set_qpls WHERE def_id = %s", array('integer'), array($this->getId())
231 );
232 }

References getId().

+ Here is the call graph for this function:

◆ getId()

◆ getMappedFilterTaxId()

◆ getMappedFilterTaxNodeId()

◆ getOriginalFilterTaxId()

ilTestRandomQuestionSetSourcePoolDefinition::getOriginalFilterTaxId ( )

◆ getOriginalFilterTaxNodeId()

ilTestRandomQuestionSetSourcePoolDefinition::getOriginalFilterTaxNodeId ( )

◆ getPoolId()

◆ getPoolInfoLabel()

ilTestRandomQuestionSetSourcePoolDefinition::getPoolInfoLabel ( ilLanguage  $lng)

Definition at line 286 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

287 {
288 $poolInfoLabel = sprintf(
289 $lng->txt('tst_dynamic_question_set_source_questionpool_summary_string'),
290 $this->getPoolTitle(),
291 $this->getPoolPath(),
292 $this->getPoolQuestionCount()
293 );
294
295 return $poolInfoLabel;
296 }
global $lng
Definition: privfeed.php:40

References $lng.

Referenced by ilTestRandomQuestionSetPoolDefinitionFormGUI\build().

+ Here is the caller graph for this function:

◆ getPoolPath()

ilTestRandomQuestionSetSourcePoolDefinition::getPoolPath ( )

Definition at line 89 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

References $poolPath.

Referenced by insertDbRecord(), and updateDbRecord().

+ Here is the caller graph for this function:

◆ getPoolQuestionCount()

ilTestRandomQuestionSetSourcePoolDefinition::getPoolQuestionCount ( )

Definition at line 99 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

References $poolQuestionCount.

Referenced by insertDbRecord(), and updateDbRecord().

+ Here is the caller graph for this function:

◆ getPoolTitle()

ilTestRandomQuestionSetSourcePoolDefinition::getPoolTitle ( )

◆ getQuestionAmount()

ilTestRandomQuestionSetSourcePoolDefinition::getQuestionAmount ( )

◆ getSequencePosition()

ilTestRandomQuestionSetSourcePoolDefinition::getSequencePosition ( )

Definition at line 159 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

References $sequencePosition.

Referenced by insertDbRecord(), and updateDbRecord().

+ Here is the caller graph for this function:

◆ initFromArray()

ilTestRandomQuestionSetSourcePoolDefinition::initFromArray (   $dataArray)
Parameters
array$dataArray

Definition at line 169 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

170 {
171 foreach($dataArray as $field => $value)
172 {
173 switch($field)
174 {
175 case 'def_id': $this->setId($value); break;
176 case 'pool_fi': $this->setPoolId($value); break;
177 case 'pool_title': $this->setPoolTitle($value); break;
178 case 'pool_path': $this->setPoolPath($value); break;
179 case 'pool_quest_count': $this->setPoolQuestionCount($value); break;
180 case 'origin_tax_fi': $this->setOriginalFilterTaxId($value); break;
181 case 'origin_node_fi': $this->setOriginalFilterTaxNodeId($value); break;
182 case 'mapped_tax_fi': $this->setMappedFilterTaxId($value); break;
183 case 'mapped_node_fi': $this->setMappedFilterTaxNodeId($value); break;
184 case 'quest_amount': $this->setQuestionAmount($value); break;
185 case 'sequence_pos': $this->setSequencePosition($value); break;
186 }
187 }
188 }

References setId(), setMappedFilterTaxId(), setMappedFilterTaxNodeId(), setOriginalFilterTaxId(), setOriginalFilterTaxNodeId(), setPoolId(), setPoolPath(), setPoolQuestionCount(), setPoolTitle(), setQuestionAmount(), and setSequencePosition().

Referenced by loadFromDb().

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

◆ insertDbRecord()

ilTestRandomQuestionSetSourcePoolDefinition::insertDbRecord (   $testId)
private
Parameters
$testId

Definition at line 262 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

263 {
264 $nextId = $this->db->nextId('tst_rnd_quest_set_qpls');
265
266 $this->db->insert('tst_rnd_quest_set_qpls', array(
267 'def_id' => array('integer', $nextId),
268 'test_fi' => array('integer', $testId),
269 'pool_fi' => array('integer', $this->getPoolId()),
270 'pool_title' => array('text', $this->getPoolTitle()),
271 'pool_path' => array('text', $this->getPoolPath()),
272 'pool_quest_count' => array('integer', $this->getPoolQuestionCount()),
273 'origin_tax_fi' => array('integer', $this->getOriginalFilterTaxId()),
274 'origin_node_fi' => array('integer', $this->getOriginalFilterTaxNodeId()),
275 'mapped_tax_fi' => array('integer', $this->getMappedFilterTaxId()),
276 'mapped_node_fi' => array('integer', $this->getMappedFilterTaxNodeId()),
277 'quest_amount' => array('integer', $this->getQuestionAmount()),
278 'sequence_pos' => array('integer', $this->getSequencePosition())
279 ));
280
281 $this->setId($nextId);
282 }

References getMappedFilterTaxId(), getMappedFilterTaxNodeId(), getOriginalFilterTaxId(), getOriginalFilterTaxNodeId(), getPoolId(), getPoolPath(), getPoolQuestionCount(), getPoolTitle(), getQuestionAmount(), getSequencePosition(), and setId().

Referenced by cloneToDbForTestId(), and saveToDb().

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

◆ loadFromDb()

ilTestRandomQuestionSetSourcePoolDefinition::loadFromDb (   $id)
Parameters
integer$poolId
Returns
boolean

Definition at line 194 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

195 {
196 $res = $this->db->queryF(
197 "SELECT * FROM tst_rnd_quest_set_qpls WHERE def_id = %s", array('integer'), array($id)
198 );
199
200 while( $row = $this->db->fetchAssoc($res) )
201 {
202 $this->initFromArray($row);
203
204 return true;
205 }
206
207 return false;
208 }

References $id, $res, $row, and initFromArray().

+ Here is the call graph for this function:

◆ saveToDb()

ilTestRandomQuestionSetSourcePoolDefinition::saveToDb ( )

Definition at line 210 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

211 {
212 if( $this->getId() )
213 {
214 $this->updateDbRecord($this->testOBJ->getTestId());
215 }
216 else
217 {
218 $this->insertDbRecord($this->testOBJ->getTestId());
219 }
220 }

References getId(), insertDbRecord(), and updateDbRecord().

+ Here is the call graph for this function:

◆ setId()

ilTestRandomQuestionSetSourcePoolDefinition::setId (   $id)

Definition at line 54 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

55 {
56 $this->id = $id;
57 }

References $id.

Referenced by initFromArray(), and insertDbRecord().

+ Here is the caller graph for this function:

◆ setMappedFilterTaxId()

ilTestRandomQuestionSetSourcePoolDefinition::setMappedFilterTaxId (   $mappedFilterTaxId)

Definition at line 124 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

125 {
126 $this->mappedFilterTaxId = $mappedFilterTaxId;
127 }

References $mappedFilterTaxId.

Referenced by initFromArray().

+ Here is the caller graph for this function:

◆ setMappedFilterTaxNodeId()

ilTestRandomQuestionSetSourcePoolDefinition::setMappedFilterTaxNodeId (   $mappedFilterTaxNodeId)

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

135 {
136 $this->mappedFilterTaxNodeId = $mappedFilterTaxNodeId;
137 }

References $mappedFilterTaxNodeId.

Referenced by initFromArray().

+ Here is the caller graph for this function:

◆ setOriginalFilterTaxId()

ilTestRandomQuestionSetSourcePoolDefinition::setOriginalFilterTaxId (   $originalFilterTaxId)

Definition at line 104 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

105 {
106 $this->originalFilterTaxId = $originalFilterTaxId;
107 }

References $originalFilterTaxId.

Referenced by ilTestRandomQuestionSetPoolDefinitionFormGUI\applySubmit(), and initFromArray().

+ Here is the caller graph for this function:

◆ setOriginalFilterTaxNodeId()

ilTestRandomQuestionSetSourcePoolDefinition::setOriginalFilterTaxNodeId (   $originalFilterNodeId)

Definition at line 114 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

115 {
116 $this->originalFilterTaxNodeId = $originalFilterNodeId;
117 }

Referenced by ilTestRandomQuestionSetPoolDefinitionFormGUI\applySubmit(), and initFromArray().

+ Here is the caller graph for this function:

◆ setPoolId()

ilTestRandomQuestionSetSourcePoolDefinition::setPoolId (   $poolId)

Definition at line 64 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

65 {
66 $this->poolId = $poolId;
67 }

References $poolId.

Referenced by initFromArray().

+ Here is the caller graph for this function:

◆ setPoolPath()

ilTestRandomQuestionSetSourcePoolDefinition::setPoolPath (   $poolPath)

Definition at line 84 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

85 {
86 $this->poolPath = $poolPath;
87 }

References $poolPath.

Referenced by initFromArray().

+ Here is the caller graph for this function:

◆ setPoolQuestionCount()

ilTestRandomQuestionSetSourcePoolDefinition::setPoolQuestionCount (   $poolQuestionCount)

Definition at line 94 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

95 {
96 $this->poolQuestionCount = $poolQuestionCount;
97 }

References $poolQuestionCount.

Referenced by initFromArray().

+ Here is the caller graph for this function:

◆ setPoolTitle()

ilTestRandomQuestionSetSourcePoolDefinition::setPoolTitle (   $poolTitle)

Definition at line 74 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

75 {
76 $this->poolTitle = $poolTitle;
77 }

References $poolTitle.

Referenced by initFromArray().

+ Here is the caller graph for this function:

◆ setQuestionAmount()

ilTestRandomQuestionSetSourcePoolDefinition::setQuestionAmount (   $questionAmount)

Definition at line 144 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

145 {
146 $this->questionAmount = $questionAmount;
147 }

References $questionAmount.

Referenced by ilTestRandomQuestionSetPoolDefinitionFormGUI\applySubmit(), and initFromArray().

+ Here is the caller graph for this function:

◆ setSequencePosition()

ilTestRandomQuestionSetSourcePoolDefinition::setSequencePosition (   $sequencePosition)

Definition at line 154 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

155 {
156 $this->sequencePosition = $sequencePosition;
157 }

References $sequencePosition.

Referenced by initFromArray().

+ Here is the caller graph for this function:

◆ updateDbRecord()

ilTestRandomQuestionSetSourcePoolDefinition::updateDbRecord (   $testId)
private
Parameters
$testId

Definition at line 237 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

238 {
239 $this->db->update('tst_rnd_quest_set_qpls',
240 array(
241 'test_fi' => array('integer', $testId),
242 'pool_fi' => array('integer', $this->getPoolId()),
243 'pool_title' => array('text', $this->getPoolTitle()),
244 'pool_path' => array('text', $this->getPoolPath()),
245 'pool_quest_count' => array('integer', $this->getPoolQuestionCount()),
246 'origin_tax_fi' => array('integer', $this->getOriginalFilterTaxId()),
247 'origin_node_fi' => array('integer', $this->getOriginalFilterTaxNodeId()),
248 'mapped_tax_fi' => array('integer', $this->getMappedFilterTaxId()),
249 'mapped_node_fi' => array('integer', $this->getMappedFilterTaxNodeId()),
250 'quest_amount' => array('integer', $this->getQuestionAmount()),
251 'sequence_pos' => array('integer', $this->getSequencePosition())
252 ),
253 array(
254 'def_id' => array('integer', $this->getId())
255 )
256 );
257 }

References getId(), getMappedFilterTaxId(), getMappedFilterTaxNodeId(), getOriginalFilterTaxId(), getOriginalFilterTaxNodeId(), getPoolId(), getPoolPath(), getPoolQuestionCount(), getPoolTitle(), getQuestionAmount(), and getSequencePosition().

Referenced by saveToDb().

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

Field Documentation

◆ $db

ilTestRandomQuestionSetSourcePoolDefinition::$db = null
protected

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

Referenced by __construct().

◆ $id

ilTestRandomQuestionSetSourcePoolDefinition::$id = null
private

Definition at line 26 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

Referenced by getId(), loadFromDb(), and setId().

◆ $mappedFilterTaxId

ilTestRandomQuestionSetSourcePoolDefinition::$mappedFilterTaxId = null
private

◆ $mappedFilterTaxNodeId

ilTestRandomQuestionSetSourcePoolDefinition::$mappedFilterTaxNodeId = null
private

◆ $originalFilterTaxId

ilTestRandomQuestionSetSourcePoolDefinition::$originalFilterTaxId = null
private

◆ $originalFilterTaxNodeId

ilTestRandomQuestionSetSourcePoolDefinition::$originalFilterTaxNodeId = null
private

◆ $poolId

ilTestRandomQuestionSetSourcePoolDefinition::$poolId = null
private

Definition at line 28 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

Referenced by getPoolId(), and setPoolId().

◆ $poolPath

ilTestRandomQuestionSetSourcePoolDefinition::$poolPath = null
private

◆ $poolQuestionCount

ilTestRandomQuestionSetSourcePoolDefinition::$poolQuestionCount = null
private

◆ $poolTitle

ilTestRandomQuestionSetSourcePoolDefinition::$poolTitle = null
private

◆ $questionAmount

ilTestRandomQuestionSetSourcePoolDefinition::$questionAmount = null
private

◆ $sequencePosition

ilTestRandomQuestionSetSourcePoolDefinition::$sequencePosition = null
private

◆ $testOBJ

ilTestRandomQuestionSetSourcePoolDefinition::$testOBJ = null
protected

Definition at line 24 of file class.ilTestRandomQuestionSetSourcePoolDefinition.php.

Referenced by __construct().


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