ILIAS  release_4-4 Revision
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 ()
 
 cloneQuestionSetRelatedData ($cloneTestOBJ)
 removes all question set config related data for cloned/copied test More...
 
 updateLastQuestionSyncTimestampForTestId ($testId, $timestamp)
 
 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...
 
 cloneQuestionSetRelatedData ($cloneTestOBJ)
 removes all question set config related data for cloned/copied test More...
 
 getQuestionPoolPathString ($poolId)
 

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 454 of file class.ilTestRandomQuestionSetConfig.php.

455  {
456  return (bool)$this->testOBJ->isTestFinalBroken();
457  }

◆ 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 401 of file class.ilTestRandomQuestionSetConfig.php.

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

402  {
403  require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
404  $sourcePoolDefinitionFactory = new ilTestRandomQuestionSetSourcePoolDefinitionFactory(
405  $this->db, $testOBJ
406  );
407 
408  require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
409  $sourcePoolDefinitionList = new ilTestRandomQuestionSetSourcePoolDefinitionList(
410  $this->db, $testOBJ, $sourcePoolDefinitionFactory
411  );
412 
413  return $sourcePoolDefinitionList;
414  }
+ Here is the caller graph for this function:

◆ buildStagingPoolBuilder()

ilTestRandomQuestionSetConfig::buildStagingPoolBuilder ( ilObjTest  $testOBJ)
private

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

Referenced by cloneQuestionSetRelatedData().

417  {
418  require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolBuilder.php';
419  $stagingPool = new ilTestRandomQuestionSetStagingPoolBuilder($this->db, $testOBJ);
420 
421  return $stagingPool;
422  }
+ 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 376 of file class.ilTestRandomQuestionSetConfig.php.

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

377  {
378  // clone general config
379 
380  $this->loadFromDb();
381  $this->cloneToDbForTestId($cloneTestOBJ->getTestId());
382 
383  // clone source pool definitions (selection rules)
384 
385  $sourcePoolDefinitionList = $this->buildSourcePoolDefinitionList($this->testOBJ);
386  $sourcePoolDefinitionList->loadDefinitions();
387  $sourcePoolDefinitionList->cloneDefinitionsForTestId($cloneTestOBJ->getTestId());
388 
389  // build new question stage for cloned test
390 
391  $sourcePoolDefinitionList = $this->buildSourcePoolDefinitionList($cloneTestOBJ);
392  $stagingPool = $this->buildStagingPoolBuilder($cloneTestOBJ);
393 
394  $sourcePoolDefinitionList->loadDefinitions();
395  $stagingPool->rebuild($sourcePoolDefinitionList);
396  $sourcePoolDefinitionList->saveDefinitions();
397 
398  $this->updateLastQuestionSyncTimestampForTestId($cloneTestOBJ->getTestId(), time());
399  }
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 447 of file class.ilTestRandomQuestionSetConfig.php.

References getSelectableQuestionPools().

448  {
449  return (bool)count($this->getSelectableQuestionPools());
450  }
+ Here is the call graph for this function:

◆ getDepenciesBrokenMessage()

ilTestRandomQuestionSetConfig::getDepenciesBrokenMessage ( ilLanguage  $lng)

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

References ilLanguage\txt().

460  {
461  return $lng->txt('tst_old_style_rnd_quest_set_broken');
462  }
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 495 of file class.ilTestRandomQuestionSetConfig.php.

496  {
497  return array(
498  'assQuestions', 'settings', 'manscoring', 'scoringadjust', 'statistics', 'history', 'export'
499  );
500  }

◆ 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 440 of file class.ilTestRandomQuestionSetConfig.php.

References arePoolsWithHomogeneousScoredQuestionsRequired().

Referenced by doesSelectableQuestionPoolsExist().

441  {
442  return $this->testOBJ->getAvailableQuestionpools(
443  true, $this->arePoolsWithHomogeneousScoredQuestionsRequired(), false, true, true
444  );
445  }
+ 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:

◆ isValidRequestOnBrokenQuestionSetDepencies()

ilTestRandomQuestionSetConfig::isValidRequestOnBrokenQuestionSetDepencies (   $nextClass,
  $cmd 
)

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

References $cmd.

465  {
466  //vd($nextClass, $cmd);
467 
468  switch( $nextClass )
469  {
470  case 'ilmdeditorgui':
471  case 'ilpermissiongui':
472 
473  return true;
474 
475  case 'ilobjtestgui':
476  case '':
477 
478  $cmds = array(
479  'infoScreen', 'participants', 'npSetFilter', 'npResetFilter',
480  //'deleteAllUserResults', 'confirmDeleteAllUserResults',
481  //'deleteSingleUserResults', 'confirmDeleteSelectedUserData', 'cancelDeleteSelectedUserData'
482  );
483 
484  if( in_array($cmd, $cmds) )
485  {
486  return true;
487  }
488 
489  break;
490  }
491 
492  return false;
493  }
$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(), and deleteFromDb().

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 
366  $stagingPool->reset();
367 
368  $this->deleteFromDb();
369  }
deleteFromDb()
deletes the question set config for current test from the database
+ Here is the call 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 426 of file class.ilTestRandomQuestionSetConfig.php.

References $timestamp.

Referenced by cloneQuestionSetRelatedData().

427  {
428  $this->db->update('tst_rnd_quest_set_cfg',
429  array(
430  'quest_sync_timestamp' => array('integer', (int)$timestamp)
431  ),
432  array(
433  'test_fi' => array('integer', $testId)
434  )
435  );
436  }
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: