ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilTestRandomQuestionSetSourcePoolDefinition Class Reference
+ Collaboration diagram for ilTestRandomQuestionSetSourcePoolDefinition:

Public Member Functions

 __construct (ilDBInterface $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 ( ilDBInterface  $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.

References array, and getId().

228  {
229  $this->db->manipulateF(
230  "DELETE FROM tst_rnd_quest_set_qpls WHERE def_id = %s", array('integer'), array($this->getId())
231  );
232  }
Create styles array
The data for the language used.
+ 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.

References getPoolPath(), getPoolQuestionCount(), getPoolTitle(), and ilLanguage\txt().

Referenced by ilTestRandomQuestionSetPoolDefinitionFormGUI\build().

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  }
txt($a_topic, $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPoolPath()

ilTestRandomQuestionSetSourcePoolDefinition::getPoolPath ( )

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

References $poolPath.

Referenced by getPoolInfoLabel(), insertDbRecord(), and updateDbRecord().

+ Here is the caller graph for this function:

◆ getPoolQuestionCount()

ilTestRandomQuestionSetSourcePoolDefinition::getPoolQuestionCount ( )

◆ 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.

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

Referenced by loadFromDb().

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  }
$dataArray
+ 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.

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

Referenced by cloneToDbForTestId(), and saveToDb().

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  }
Create styles array
The data for the language used.
+ 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.

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

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  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ saveToDb()

ilTestRandomQuestionSetSourcePoolDefinition::saveToDb ( )

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

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

211  {
212  if( $this->getId() )
213  {
214  $this->updateDbRecord($this->testOBJ->getTestId());
215  }
216  else
217  {
218  $this->insertDbRecord($this->testOBJ->getTestId());
219  }
220  }
+ Here is the call graph for this function:

◆ setId()

ilTestRandomQuestionSetSourcePoolDefinition::setId (   $id)

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

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.

References $mappedFilterTaxId.

Referenced by ilObjTestXMLParser\importRandomQuestionSourcePoolDefinition(), and initFromArray().

+ Here is the caller graph for this function:

◆ setMappedFilterTaxNodeId()

ilTestRandomQuestionSetSourcePoolDefinition::setMappedFilterTaxNodeId (   $mappedFilterTaxNodeId)

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

References $mappedFilterTaxNodeId.

Referenced by ilObjTestXMLParser\importRandomQuestionSourcePoolDefinition(), and initFromArray().

+ Here is the caller graph for this function:

◆ setOriginalFilterTaxId()

ilTestRandomQuestionSetSourcePoolDefinition::setOriginalFilterTaxId (   $originalFilterTaxId)

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

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.

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

115  {
116  $this->originalFilterTaxNodeId = $originalFilterNodeId;
117  }
+ Here is the caller graph for this function:

◆ setPoolId()

ilTestRandomQuestionSetSourcePoolDefinition::setPoolId (   $poolId)

◆ setPoolPath()

ilTestRandomQuestionSetSourcePoolDefinition::setPoolPath (   $poolPath)

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

References $poolPath.

Referenced by initFromArray().

+ Here is the caller graph for this function:

◆ setPoolQuestionCount()

ilTestRandomQuestionSetSourcePoolDefinition::setPoolQuestionCount (   $poolQuestionCount)

◆ setPoolTitle()

ilTestRandomQuestionSetSourcePoolDefinition::setPoolTitle (   $poolTitle)

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

References $poolTitle.

Referenced by initFromArray().

+ Here is the caller graph for this function:

◆ setQuestionAmount()

ilTestRandomQuestionSetSourcePoolDefinition::setQuestionAmount (   $questionAmount)

◆ setSequencePosition()

ilTestRandomQuestionSetSourcePoolDefinition::setSequencePosition (   $sequencePosition)

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

References $sequencePosition.

Referenced by ilObjTestXMLParser\importRandomQuestionSourcePoolDefinition(), and 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.

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

Referenced by saveToDb().

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  }
Create styles array
The data for the language used.
+ 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: