ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestRandomQuestionSetConfig Class Reference
+ Inheritance diagram for ilTestRandomQuestionSetConfig:
+ Collaboration diagram for ilTestRandomQuestionSetConfig:

Public Member Functions

 __construct (ilTree $tree, ilDB $db, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ)
 
 setPoolsWithHomogeneousScoredQuestionsRequired ($requirePoolsWithHomogeneousScoredQuestions)
 
 arePoolsWithHomogeneousScoredQuestionsRequired ()
 
 setQuestionAmountConfigurationMode ($questionAmountConfigurationMode)
 
 getQuestionAmountConfigurationMode ()
 
 isQuestionAmountConfigurationModePerPool ()
 
 isQuestionAmountConfigurationModePerTest ()
 
 setQuestionAmountPerTest ($questionAmountPerTest)
 
 getQuestionAmountPerTest ()
 
 setLastQuestionSyncTimestamp ($lastQuestionSyncTimestamp)
 
 getLastQuestionSyncTimestamp ()
 
 initFromArray ($dataArray)
 initialises the current object instance with values from matching properties within the passed array More...
 
 loadFromDb ()
 loads the question set config for current test from the database More...
 
 saveToDb ()
 saves the question set config for current test to the database More...
 
 cloneToDbForTestId ($testId)
 saves the question set config for test with given id to the database More...
 
 deleteFromDb ()
 deletes the question set config for current test from the database More...
 
 isQuestionSetConfigured ()
 
 hasSourcePoolDefinitions ()
 
 isQuestionSetBuildable ()
 
 doesQuestionSetRelatedDataExist ()
 
 removeQuestionSetRelatedData ()
 
 resetQuestionSetRelatedTestSettings ()
 
 cloneQuestionSetRelatedData ($cloneTestOBJ)
 removes all question set config related data for cloned/copied test More...
 
 updateLastQuestionSyncTimestampForTestId ($testId, $timestamp)
 
 isResultTaxonomyFilterSupported ()
 
 getSelectableQuestionPools ()
 
 doesSelectableQuestionPoolsExist ()
 
 areDepenciesBroken ()
 
 getDepenciesBrokenMessage (ilLanguage $lng)
 
 isValidRequestOnBrokenQuestionSetDepencies ($nextClass, $cmd)
 
 getHiddenTabsOnBrokenDepencies ()
 
- Public Member Functions inherited from ilTestQuestionSetConfig
 __construct (ilTree $tree, ilDB $db, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ)
 
 loadFromDb ()
 loads the question set config for current test from the database More...
 
 saveToDb ()
 saves the question set config for current test to the database More...
 
 cloneToDbForTestId ($testId)
 saves the question set config for test with given id to the database More...
 
 deleteFromDb ()
 deletes the question set config for current test from the database More...
 
 areDepenciesInVulnerableState ()
 
 getDepenciesInVulnerableStateMessage (ilLanguage $lng)
 
 areDepenciesBroken ()
 
 getDepenciesBrokenMessage (ilLanguage $lng)
 
 isValidRequestOnBrokenQuestionSetDepencies ($nextClass, $cmd)
 
 getHiddenTabsOnBrokenDepencies ()
 
 isQuestionSetConfigured ()
 
 doesQuestionSetRelatedDataExist ()
 checks wether question set config related data exists or not More...
 
 removeQuestionSetRelatedData ()
 removes all question set config related data More...
 
 resetQuestionSetRelatedTestSettings ()
 resets all test settings that depends on a non changed question set config More...
 
 cloneQuestionSetRelatedData ($cloneTestOBJ)
 removes all question set config related data for cloned/copied test More...
 
 getQuestionPoolPathString ($poolId)
 
 isResultTaxonomyFilterSupported ()
 

Data Fields

const QUESTION_AMOUNT_CONFIG_MODE_PER_TEST = 'TEST'
 
const QUESTION_AMOUNT_CONFIG_MODE_PER_POOL = 'POOL'
 

Private Member Functions

 dbRecordExists ($testId)
 checks wether a question set config for current test exists in the database More...
 
 updateDbRecord ($testId)
 updates the record in the database that corresponds to the question set config for the current test More...
 
 insertDbRecord ($testId)
 inserts a new record for the question set config for the current test into the database More...
 
 buildSourcePoolDefinitionList (ilObjTest $testOBJ)
 
 buildStagingPoolBuilder (ilObjTest $testOBJ)
 

Private Attributes

 $requirePoolsWithHomogeneousScoredQuestions = null
 
 $questionAmountConfigurationMode = null
 
 $questionAmountPerTest = null
 
 $lastQuestionSyncTimestamp = null
 

Additional Inherited Members

- Protected Attributes inherited from ilTestQuestionSetConfig
 $tree = null
 
 $db = null
 
 $pluginAdmin = null
 
 $testOBJ = null
 

Detailed Description

Definition at line 14 of file class.ilTestRandomQuestionSetConfig.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestRandomQuestionSetConfig::__construct ( ilTree  $tree,
ilDB  $db,
ilPluginAdmin  $pluginAdmin,
ilObjTest  $testOBJ 
)
Parameters
ilTree$tree
ilDB$db
ilPluginAdmin$pluginAdmin
ilObjTest$testOBJ

Definition at line 45 of file class.ilTestRandomQuestionSetConfig.php.

46  {
47  parent::__construct($tree, $db, $pluginAdmin, $testOBJ);
48  }

Member Function Documentation

◆ areDepenciesBroken()

ilTestRandomQuestionSetConfig::areDepenciesBroken ( )

Definition at line 466 of file class.ilTestRandomQuestionSetConfig.php.

467  {
468  return (bool)$this->testOBJ->isTestFinalBroken();
469  }

◆ arePoolsWithHomogeneousScoredQuestionsRequired()

ilTestRandomQuestionSetConfig::arePoolsWithHomogeneousScoredQuestionsRequired ( )
Returns
boolean

Definition at line 61 of file class.ilTestRandomQuestionSetConfig.php.

References $requirePoolsWithHomogeneousScoredQuestions.

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

+ Here is the caller graph for this function:

◆ buildSourcePoolDefinitionList()

ilTestRandomQuestionSetConfig::buildSourcePoolDefinitionList ( ilObjTest  $testOBJ)
private

Definition at line 408 of file class.ilTestRandomQuestionSetConfig.php.

Referenced by cloneQuestionSetRelatedData(), doesQuestionSetRelatedDataExist(), hasSourcePoolDefinitions(), isQuestionSetBuildable(), isQuestionSetConfigured(), and removeQuestionSetRelatedData().

409  {
410  require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
411  $sourcePoolDefinitionFactory = new ilTestRandomQuestionSetSourcePoolDefinitionFactory(
412  $this->db, $testOBJ
413  );
414 
415  require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
416  $sourcePoolDefinitionList = new ilTestRandomQuestionSetSourcePoolDefinitionList(
417  $this->db, $testOBJ, $sourcePoolDefinitionFactory
418  );
419 
420  return $sourcePoolDefinitionList;
421  }
+ Here is the caller graph for this function:

◆ buildStagingPoolBuilder()

ilTestRandomQuestionSetConfig::buildStagingPoolBuilder ( ilObjTest  $testOBJ)
private

Definition at line 423 of file class.ilTestRandomQuestionSetConfig.php.

Referenced by cloneQuestionSetRelatedData().

424  {
425  require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolBuilder.php';
426  $stagingPool = new ilTestRandomQuestionSetStagingPoolBuilder($this->db, $testOBJ);
427 
428  return $stagingPool;
429  }
+ Here is the caller graph for this function:

◆ cloneQuestionSetRelatedData()

ilTestRandomQuestionSetConfig::cloneQuestionSetRelatedData (   $cloneTestOBJ)

removes all question set config related data for cloned/copied test

Parameters
ilObjTest$cloneTestOBJ

Definition at line 383 of file class.ilTestRandomQuestionSetConfig.php.

References buildSourcePoolDefinitionList(), buildStagingPoolBuilder(), cloneToDbForTestId(), loadFromDb(), and updateLastQuestionSyncTimestampForTestId().

384  {
385  // clone general config
386 
387  $this->loadFromDb();
388  $this->cloneToDbForTestId($cloneTestOBJ->getTestId());
389 
390  // clone source pool definitions (selection rules)
391 
392  $sourcePoolDefinitionList = $this->buildSourcePoolDefinitionList($this->testOBJ);
393  $sourcePoolDefinitionList->loadDefinitions();
394  $sourcePoolDefinitionList->cloneDefinitionsForTestId($cloneTestOBJ->getTestId());
395 
396  // build new question stage for cloned test
397 
398  $sourcePoolDefinitionList = $this->buildSourcePoolDefinitionList($cloneTestOBJ);
399  $stagingPool = $this->buildStagingPoolBuilder($cloneTestOBJ);
400 
401  $sourcePoolDefinitionList->loadDefinitions();
402  $stagingPool->rebuild($sourcePoolDefinitionList);
403  $sourcePoolDefinitionList->saveDefinitions();
404 
405  $this->updateLastQuestionSyncTimestampForTestId($cloneTestOBJ->getTestId(), time());
406  }
loadFromDb()
loads the question set config for current test from the database
cloneToDbForTestId($testId)
saves the question set config for test with given id to the database
+ Here is the call graph for this function:

◆ cloneToDbForTestId()

ilTestRandomQuestionSetConfig::cloneToDbForTestId (   $testId)

saves the question set config for test with given id to the database

Parameters
$testId

Definition at line 196 of file class.ilTestRandomQuestionSetConfig.php.

References insertDbRecord().

Referenced by cloneQuestionSetRelatedData().

197  {
198  $this->insertDbRecord($testId);
199  }
insertDbRecord($testId)
inserts a new record for the question set config for the current test into the database ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dbRecordExists()

ilTestRandomQuestionSetConfig::dbRecordExists (   $testId)
private

checks wether a question set config for current test exists in the database

Parameters
$testId
Returns
boolean

Definition at line 220 of file class.ilTestRandomQuestionSetConfig.php.

References $res, and $row.

Referenced by doesQuestionSetRelatedDataExist(), and saveToDb().

221  {
222  $res = $this->db->queryF(
223  "SELECT COUNT(*) cnt FROM tst_rnd_quest_set_cfg WHERE test_fi = %s",
224  array('integer'), array($testId)
225  );
226 
227  $row = $this->db->fetchAssoc($res);
228 
229  return (bool)$row['cnt'];
230  }
+ Here is the caller graph for this function:

◆ deleteFromDb()

ilTestRandomQuestionSetConfig::deleteFromDb ( )

deletes the question set config for current test from the database

Definition at line 204 of file class.ilTestRandomQuestionSetConfig.php.

Referenced by removeQuestionSetRelatedData().

205  {
206  $this->db->manipulateF(
207  "DELETE FROM tst_rnd_quest_set_cfg WHERE test_fi = %s",
208  array('integer'), array($this->testOBJ->getTestId())
209  );
210  }
+ Here is the caller graph for this function:

◆ doesQuestionSetRelatedDataExist()

ilTestRandomQuestionSetConfig::doesQuestionSetRelatedDataExist ( )

Definition at line 339 of file class.ilTestRandomQuestionSetConfig.php.

References buildSourcePoolDefinitionList(), and dbRecordExists().

340  {
341  if( $this->dbRecordExists($this->testOBJ->getTestId()) )
342  {
343  return true;
344  }
345 
346  $sourcePoolDefinitionList = $this->buildSourcePoolDefinitionList($this->testOBJ);
347 
348  if( $sourcePoolDefinitionList->savedDefinitionsExist() )
349  {
350  return true;
351  }
352 
353  return false;
354  }
dbRecordExists($testId)
checks wether a question set config for current test exists in the database
+ Here is the call graph for this function:

◆ doesSelectableQuestionPoolsExist()

ilTestRandomQuestionSetConfig::doesSelectableQuestionPoolsExist ( )

Definition at line 459 of file class.ilTestRandomQuestionSetConfig.php.

References getSelectableQuestionPools().

460  {
461  return (bool)count($this->getSelectableQuestionPools());
462  }
+ Here is the call graph for this function:

◆ getDepenciesBrokenMessage()

ilTestRandomQuestionSetConfig::getDepenciesBrokenMessage ( ilLanguage  $lng)

Definition at line 471 of file class.ilTestRandomQuestionSetConfig.php.

References ilLanguage\txt().

472  {
473  return $lng->txt('tst_old_style_rnd_quest_set_broken');
474  }
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:

◆ getHiddenTabsOnBrokenDepencies()

ilTestRandomQuestionSetConfig::getHiddenTabsOnBrokenDepencies ( )

Definition at line 507 of file class.ilTestRandomQuestionSetConfig.php.

508  {
509  return array(
510  'assQuestions', 'settings', 'manscoring', 'scoringadjust', 'statistics', 'history', 'export'
511  );
512  }

◆ getLastQuestionSyncTimestamp()

ilTestRandomQuestionSetConfig::getLastQuestionSyncTimestamp ( )
Returns
integer

Definition at line 125 of file class.ilTestRandomQuestionSetConfig.php.

References $lastQuestionSyncTimestamp.

Referenced by insertDbRecord(), and updateDbRecord().

+ Here is the caller graph for this function:

◆ getQuestionAmountConfigurationMode()

◆ getQuestionAmountPerTest()

ilTestRandomQuestionSetConfig::getQuestionAmountPerTest ( )
Returns
integer

Definition at line 109 of file class.ilTestRandomQuestionSetConfig.php.

References $questionAmountPerTest.

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

+ Here is the caller graph for this function:

◆ getSelectableQuestionPools()

ilTestRandomQuestionSetConfig::getSelectableQuestionPools ( )

Definition at line 452 of file class.ilTestRandomQuestionSetConfig.php.

References arePoolsWithHomogeneousScoredQuestionsRequired().

Referenced by doesSelectableQuestionPoolsExist().

453  {
454  return $this->testOBJ->getAvailableQuestionpools(
455  true, $this->arePoolsWithHomogeneousScoredQuestionsRequired(), false, true, true
456  );
457  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasSourcePoolDefinitions()

ilTestRandomQuestionSetConfig::hasSourcePoolDefinitions ( )

Definition at line 318 of file class.ilTestRandomQuestionSetConfig.php.

References buildSourcePoolDefinitionList().

Referenced by isQuestionSetConfigured().

319  {
320  $sourcePoolDefinitionList = $this->buildSourcePoolDefinitionList($this->testOBJ);
321 
322  return $sourcePoolDefinitionList->savedDefinitionsExist();
323  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFromArray()

ilTestRandomQuestionSetConfig::initFromArray (   $dataArray)

initialises the current object instance with values from matching properties within the passed array

Parameters
array$dataArray

Definition at line 138 of file class.ilTestRandomQuestionSetConfig.php.

References setLastQuestionSyncTimestamp(), setPoolsWithHomogeneousScoredQuestionsRequired(), setQuestionAmountConfigurationMode(), and setQuestionAmountPerTest().

Referenced by loadFromDb().

139  {
140  foreach($dataArray as $field => $value)
141  {
142  switch($field)
143  {
144  case 'req_pools_homo_scored': $this->setPoolsWithHomogeneousScoredQuestionsRequired($value); break;
145  case 'quest_amount_cfg_mode': $this->setQuestionAmountConfigurationMode($value); break;
146  case 'quest_amount_per_test': $this->setQuestionAmountPerTest($value); break;
147  case 'quest_sync_timestamp': $this->setLastQuestionSyncTimestamp($value); break;
148  }
149  }
150  }
setQuestionAmountConfigurationMode($questionAmountConfigurationMode)
setLastQuestionSyncTimestamp($lastQuestionSyncTimestamp)
setPoolsWithHomogeneousScoredQuestionsRequired($requirePoolsWithHomogeneousScoredQuestions)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertDbRecord()

ilTestRandomQuestionSetConfig::insertDbRecord (   $testId)
private

inserts a new record for the question set config for the current test into the database

Parameters
$testId

Definition at line 259 of file class.ilTestRandomQuestionSetConfig.php.

References arePoolsWithHomogeneousScoredQuestionsRequired(), getLastQuestionSyncTimestamp(), getQuestionAmountConfigurationMode(), and getQuestionAmountPerTest().

Referenced by cloneToDbForTestId(), and saveToDb().

260  {
261  $this->db->insert('tst_rnd_quest_set_cfg', array(
262  'test_fi' => array('integer', $testId),
263  'req_pools_homo_scored' => array('integer', (int)$this->arePoolsWithHomogeneousScoredQuestionsRequired()),
264  'quest_amount_cfg_mode' => array('text', $this->getQuestionAmountConfigurationMode()),
265  'quest_amount_per_test' => array('integer', (int)$this->getQuestionAmountPerTest()),
266  'quest_sync_timestamp' => array('integer', (int)$this->getLastQuestionSyncTimestamp())
267  ));
268  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isQuestionAmountConfigurationModePerPool()

ilTestRandomQuestionSetConfig::isQuestionAmountConfigurationModePerPool ( )
Returns
boolean

Definition at line 85 of file class.ilTestRandomQuestionSetConfig.php.

References getQuestionAmountConfigurationMode().

Referenced by ilTestRandomQuestionSetBuilder\getInstance(), and isQuestionSetConfigured().

86  {
87  return $this->getQuestionAmountConfigurationMode() == self::QUESTION_AMOUNT_CONFIG_MODE_PER_POOL;
88  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isQuestionAmountConfigurationModePerTest()

ilTestRandomQuestionSetConfig::isQuestionAmountConfigurationModePerTest ( )
Returns
boolean

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

References getQuestionAmountConfigurationMode().

94  {
95  return $this->getQuestionAmountConfigurationMode() == self::QUESTION_AMOUNT_CONFIG_MODE_PER_TEST;
96  }
+ Here is the call graph for this function:

◆ isQuestionSetBuildable()

ilTestRandomQuestionSetConfig::isQuestionSetBuildable ( )

Definition at line 325 of file class.ilTestRandomQuestionSetConfig.php.

References buildSourcePoolDefinitionList(), and ilTestRandomQuestionSetBuilder\getInstance().

Referenced by isQuestionSetConfigured().

326  {
327  $sourcePoolDefinitionList = $this->buildSourcePoolDefinitionList($this->testOBJ);
328  $sourcePoolDefinitionList->loadDefinitions();
329 
330  require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolQuestionList.php';
331  $stagingPoolQuestionList = new ilTestRandomQuestionSetStagingPoolQuestionList($this->db, $this->pluginAdmin);
332 
333  require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetBuilder.php';
334  $questionSetBuilder = ilTestRandomQuestionSetBuilder::getInstance($this->db, $this->testOBJ, $this, $sourcePoolDefinitionList, $stagingPoolQuestionList);
335 
336  return $questionSetBuilder->checkBuildable();
337  }
static getInstance(ilDB $db, ilObjTest $testOBJ, ilTestRandomQuestionSetConfig $questionSetConfig, ilTestRandomQuestionSetSourcePoolDefinitionList $sourcePoolDefinitionList, ilTestRandomQuestionSetStagingPoolQuestionList $stagingPoolQuestionList)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isQuestionSetConfigured()

ilTestRandomQuestionSetConfig::isQuestionSetConfigured ( )

Definition at line 272 of file class.ilTestRandomQuestionSetConfig.php.

References buildSourcePoolDefinitionList(), getQuestionAmountPerTest(), hasSourcePoolDefinitions(), isQuestionAmountConfigurationModePerPool(), and isQuestionSetBuildable().

273  {
274  if( !$this->isQuestionAmountConfigComplete() )
275  {
276  return false;
277  }
278 
279  if( !$this->hasSourcePoolDefinitions() )
280  {
281  return false;
282  }
283 
284  if( !$this->isQuestionSetBuildable() )
285  {
286  return false;
287  }
288 
289  return true;
290  }
+ Here is the call graph for this function:

◆ isResultTaxonomyFilterSupported()

ilTestRandomQuestionSetConfig::isResultTaxonomyFilterSupported ( )

Definition at line 445 of file class.ilTestRandomQuestionSetConfig.php.

446  {
447  return true;
448  }

◆ isValidRequestOnBrokenQuestionSetDepencies()

ilTestRandomQuestionSetConfig::isValidRequestOnBrokenQuestionSetDepencies (   $nextClass,
  $cmd 
)

Definition at line 476 of file class.ilTestRandomQuestionSetConfig.php.

References $cmd.

477  {
478  //vd($nextClass, $cmd);
479 
480  switch( $nextClass )
481  {
482  case 'ilmdeditorgui':
483  case 'ilpermissiongui':
484 
485  return true;
486 
487  case 'ilobjtestgui':
488  case '':
489 
490  $cmds = array(
491  'infoScreen', 'participants', 'npSetFilter', 'npResetFilter',
492  //'deleteAllUserResults', 'confirmDeleteAllUserResults',
493  //'deleteSingleUserResults', 'confirmDeleteSelectedUserData', 'cancelDeleteSelectedUserData'
494  );
495 
496  if( in_array($cmd, $cmds) )
497  {
498  return true;
499  }
500 
501  break;
502  }
503 
504  return false;
505  }
$cmd
Definition: sahs_server.php:35

◆ loadFromDb()

ilTestRandomQuestionSetConfig::loadFromDb ( )

loads the question set config for current test from the database

Returns
boolean

Definition at line 157 of file class.ilTestRandomQuestionSetConfig.php.

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

Referenced by cloneQuestionSetRelatedData().

158  {
159  $res = $this->db->queryF(
160  "SELECT * FROM tst_rnd_quest_set_cfg WHERE test_fi = %s",
161  array('integer'), array($this->testOBJ->getTestId())
162  );
163 
164  while( $row = $this->db->fetchAssoc($res) )
165  {
166  $this->initFromArray($row);
167 
168  return true;
169  }
170 
171  return false;
172  }
initFromArray($dataArray)
initialises the current object instance with values from matching properties within the passed array ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeQuestionSetRelatedData()

ilTestRandomQuestionSetConfig::removeQuestionSetRelatedData ( )

Definition at line 356 of file class.ilTestRandomQuestionSetConfig.php.

References buildSourcePoolDefinitionList(), deleteFromDb(), and resetQuestionSetRelatedTestSettings().

357  {
358  $sourcePoolDefinitionList = $this->buildSourcePoolDefinitionList($this->testOBJ);
359  $sourcePoolDefinitionList->deleteDefinitions();
360 
361  require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolBuilder.php';
363  $this->db, $this->testOBJ
364  );
365  $stagingPool->reset();
366 
368 
369  $this->deleteFromDb();
370  }
deleteFromDb()
deletes the question set config for current test from the database
+ Here is the call graph for this function:

◆ resetQuestionSetRelatedTestSettings()

ilTestRandomQuestionSetConfig::resetQuestionSetRelatedTestSettings ( )

Definition at line 372 of file class.ilTestRandomQuestionSetConfig.php.

Referenced by removeQuestionSetRelatedData().

373  {
374  $this->testOBJ->setResultFilterTaxIds(array());
375  $this->testOBJ->saveToDb(true);
376  }
+ Here is the caller graph for this function:

◆ saveToDb()

ilTestRandomQuestionSetConfig::saveToDb ( )

saves the question set config for current test to the database

Returns
boolean

Definition at line 179 of file class.ilTestRandomQuestionSetConfig.php.

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

180  {
181  if( $this->dbRecordExists($this->testOBJ->getTestId()) )
182  {
183  $this->updateDbRecord($this->testOBJ->getTestId());
184  }
185  else
186  {
187  $this->insertDbRecord($this->testOBJ->getTestId());
188  }
189  }
insertDbRecord($testId)
inserts a new record for the question set config for the current test into the database ...
updateDbRecord($testId)
updates the record in the database that corresponds to the question set config for the current test ...
dbRecordExists($testId)
checks wether a question set config for current test exists in the database
+ Here is the call graph for this function:

◆ setLastQuestionSyncTimestamp()

ilTestRandomQuestionSetConfig::setLastQuestionSyncTimestamp (   $lastQuestionSyncTimestamp)
Parameters
integer$lastQuestionSyncTimestamp

Definition at line 117 of file class.ilTestRandomQuestionSetConfig.php.

References $lastQuestionSyncTimestamp.

Referenced by initFromArray().

118  {
119  $this->lastQuestionSyncTimestamp = $lastQuestionSyncTimestamp;
120  }
+ Here is the caller graph for this function:

◆ setPoolsWithHomogeneousScoredQuestionsRequired()

ilTestRandomQuestionSetConfig::setPoolsWithHomogeneousScoredQuestionsRequired (   $requirePoolsWithHomogeneousScoredQuestions)
Parameters
boolean$requirePoolsWithHomogeneousScoredQuestions

Definition at line 53 of file class.ilTestRandomQuestionSetConfig.php.

References $requirePoolsWithHomogeneousScoredQuestions.

Referenced by initFromArray().

54  {
55  $this->requirePoolsWithHomogeneousScoredQuestions = $requirePoolsWithHomogeneousScoredQuestions;
56  }
+ Here is the caller graph for this function:

◆ setQuestionAmountConfigurationMode()

ilTestRandomQuestionSetConfig::setQuestionAmountConfigurationMode (   $questionAmountConfigurationMode)
Parameters
string$questionAmountConfigurationMode

Definition at line 69 of file class.ilTestRandomQuestionSetConfig.php.

References $questionAmountConfigurationMode.

Referenced by initFromArray().

70  {
71  $this->questionAmountConfigurationMode = $questionAmountConfigurationMode;
72  }
+ Here is the caller graph for this function:

◆ setQuestionAmountPerTest()

ilTestRandomQuestionSetConfig::setQuestionAmountPerTest (   $questionAmountPerTest)
Parameters
integer$questionAmountPerTest

Definition at line 101 of file class.ilTestRandomQuestionSetConfig.php.

References $questionAmountPerTest.

Referenced by initFromArray().

102  {
103  $this->questionAmountPerTest = $questionAmountPerTest;
104  }
+ Here is the caller graph for this function:

◆ updateDbRecord()

ilTestRandomQuestionSetConfig::updateDbRecord (   $testId)
private

updates the record in the database that corresponds to the question set config for the current test

Parameters
$testId

Definition at line 238 of file class.ilTestRandomQuestionSetConfig.php.

References arePoolsWithHomogeneousScoredQuestionsRequired(), getLastQuestionSyncTimestamp(), getQuestionAmountConfigurationMode(), and getQuestionAmountPerTest().

Referenced by saveToDb().

239  {
240  $this->db->update('tst_rnd_quest_set_cfg',
241  array(
242  'req_pools_homo_scored' => array('integer', (int)$this->arePoolsWithHomogeneousScoredQuestionsRequired()),
243  'quest_amount_cfg_mode' => array('text', $this->getQuestionAmountConfigurationMode()),
244  'quest_amount_per_test' => array('integer', (int)$this->getQuestionAmountPerTest()),
245  'quest_sync_timestamp' => array('integer', (int)$this->getLastQuestionSyncTimestamp())
246  ),
247  array(
248  'test_fi' => array('integer', $testId)
249  )
250  );
251  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateLastQuestionSyncTimestampForTestId()

ilTestRandomQuestionSetConfig::updateLastQuestionSyncTimestampForTestId (   $testId,
  $timestamp 
)

Definition at line 433 of file class.ilTestRandomQuestionSetConfig.php.

References $timestamp.

Referenced by cloneQuestionSetRelatedData().

434  {
435  $this->db->update('tst_rnd_quest_set_cfg',
436  array(
437  'quest_sync_timestamp' => array('integer', (int)$timestamp)
438  ),
439  array(
440  'test_fi' => array('integer', $testId)
441  )
442  );
443  }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
+ Here is the caller graph for this function:

Field Documentation

◆ $lastQuestionSyncTimestamp

ilTestRandomQuestionSetConfig::$lastQuestionSyncTimestamp = null
private

◆ $questionAmountConfigurationMode

ilTestRandomQuestionSetConfig::$questionAmountConfigurationMode = null
private

◆ $questionAmountPerTest

ilTestRandomQuestionSetConfig::$questionAmountPerTest = null
private

◆ $requirePoolsWithHomogeneousScoredQuestions

ilTestRandomQuestionSetConfig::$requirePoolsWithHomogeneousScoredQuestions = null
private

◆ QUESTION_AMOUNT_CONFIG_MODE_PER_POOL

◆ QUESTION_AMOUNT_CONFIG_MODE_PER_TEST


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