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

Public Member Functions

 __construct (ilTree $tree, ilDBInterface $db, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ)
 
 setPoolsWithHomogeneousScoredQuestionsRequired ($requirePoolsWithHomogeneousScoredQuestions)
 
 arePoolsWithHomogeneousScoredQuestionsRequired ()
 
 setQuestionAmountConfigurationMode ($questionAmountConfigurationMode)
 
 getQuestionAmountConfigurationMode ()
 
 isQuestionAmountConfigurationModePerPool ()
 
 isQuestionAmountConfigurationModePerTest ()
 
 isValidQuestionAmountConfigurationMode ($amountMode)
 
 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 ()
 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 (ilObjTest $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 ()
 
 getCommaSeparatedSourceQuestionPoolLinks ()
 
- Public Member Functions inherited from ilTestQuestionSetConfig
 __construct (ilTree $tree, ilDBInterface $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 (ilObjTest $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...
 
 registerClonedSourcePoolDefinitionIdMapping (ilObjTest $cloneTestOBJ, $definitionIdMap)
 
 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()

Member Function Documentation

◆ areDepenciesBroken()

ilTestRandomQuestionSetConfig::areDepenciesBroken ( )

Reimplemented from ilTestQuestionSetConfig.

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

497 {
498 return (bool)$this->testOBJ->isTestFinalBroken();
499 }

◆ arePoolsWithHomogeneousScoredQuestionsRequired()

ilTestRandomQuestionSetConfig::arePoolsWithHomogeneousScoredQuestionsRequired ( )

◆ buildSourcePoolDefinitionList()

ilTestRandomQuestionSetConfig::buildSourcePoolDefinitionList ( ilObjTest  $testOBJ)
private

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

439 {
440 require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
441 $sourcePoolDefinitionFactory = new ilTestRandomQuestionSetSourcePoolDefinitionFactory(
442 $this->db, $testOBJ
443 );
444
445 require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
446 $sourcePoolDefinitionList = new ilTestRandomQuestionSetSourcePoolDefinitionList(
447 $this->db, $testOBJ, $sourcePoolDefinitionFactory
448 );
449
450 return $sourcePoolDefinitionList;
451 }

References ilTestQuestionSetConfig\$testOBJ.

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

+ Here is the caller graph for this function:

◆ buildStagingPoolBuilder()

ilTestRandomQuestionSetConfig::buildStagingPoolBuilder ( ilObjTest  $testOBJ)
private

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

454 {
455 require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolBuilder.php';
456 $stagingPool = new ilTestRandomQuestionSetStagingPoolBuilder($this->db, $testOBJ);
457
458 return $stagingPool;
459 }

References ilTestQuestionSetConfig\$testOBJ.

Referenced by cloneQuestionSetRelatedData().

+ Here is the caller graph for this function:

◆ cloneQuestionSetRelatedData()

ilTestRandomQuestionSetConfig::cloneQuestionSetRelatedData ( ilObjTest  $cloneTestOBJ)

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

Parameters
ilObjTest$cloneTestOBJ

Reimplemented from ilTestQuestionSetConfig.

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

397 {
398 // clone general config
399
400 $this->loadFromDb();
401 $this->cloneToDbForTestId($cloneTestOBJ->getTestId());
402
403 // clone source pool definitions (selection rules)
404
405 $sourcePoolDefinitionList = $this->buildSourcePoolDefinitionList($this->testOBJ);
406 $sourcePoolDefinitionList->loadDefinitions();
407 $definitionIdMap = $sourcePoolDefinitionList->cloneDefinitionsForTestId($cloneTestOBJ->getTestId());
408 $this->registerClonedSourcePoolDefinitionIdMapping($cloneTestOBJ, $definitionIdMap);
409
410 // build new question stage for cloned test
411
412 $sourcePoolDefinitionList = $this->buildSourcePoolDefinitionList($cloneTestOBJ);
413 $stagingPool = $this->buildStagingPoolBuilder($cloneTestOBJ);
414
415 $sourcePoolDefinitionList->loadDefinitions();
416 $stagingPool->rebuild($sourcePoolDefinitionList);
417 $sourcePoolDefinitionList->saveDefinitions();
418
419 $this->updateLastQuestionSyncTimestampForTestId($cloneTestOBJ->getTestId(), time());
420 }
getTestId()
Gets the database id of the additional test data.
cloneToDbForTestId($testId)
saves the question set config for test with given id to the database
registerClonedSourcePoolDefinitionIdMapping(ilObjTest $cloneTestOBJ, $definitionIdMap)
loadFromDb()
loads the question set config for current test from the database

References buildSourcePoolDefinitionList(), buildStagingPoolBuilder(), cloneToDbForTestId(), ilObjTest\getTestId(), loadFromDb(), registerClonedSourcePoolDefinitionIdMapping(), and updateLastQuestionSyncTimestampForTestId().

+ 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

Reimplemented from ilTestQuestionSetConfig.

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

210 {
211 $this->insertDbRecord($testId);
212 }
insertDbRecord($testId)
inserts a new record for the question set config for the current test into the database

References insertDbRecord().

Referenced by cloneQuestionSetRelatedData().

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

234 {
235 $res = $this->db->queryF(
236 "SELECT COUNT(*) cnt FROM tst_rnd_quest_set_cfg WHERE test_fi = %s",
237 array('integer'), array($testId)
238 );
239
240 $row = $this->db->fetchAssoc($res);
241
242 return (bool)$row['cnt'];
243 }

References $res, and $row.

Referenced by doesQuestionSetRelatedDataExist(), and saveToDb().

+ Here is the caller graph for this function:

◆ deleteFromDb()

ilTestRandomQuestionSetConfig::deleteFromDb ( )

deletes the question set config for current test from the database

Reimplemented from ilTestQuestionSetConfig.

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

218 {
219 $this->db->manipulateF(
220 "DELETE FROM tst_rnd_quest_set_cfg WHERE test_fi = %s",
221 array('integer'), array($this->testOBJ->getTestId())
222 );
223 }

Referenced by removeQuestionSetRelatedData().

+ Here is the caller graph for this function:

◆ doesQuestionSetRelatedDataExist()

ilTestRandomQuestionSetConfig::doesQuestionSetRelatedDataExist ( )

checks wether question set config related data exists or not

Reimplemented from ilTestQuestionSetConfig.

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

353 {
354 if( $this->dbRecordExists($this->testOBJ->getTestId()) )
355 {
356 return true;
357 }
358
359 $sourcePoolDefinitionList = $this->buildSourcePoolDefinitionList($this->testOBJ);
360
361 if( $sourcePoolDefinitionList->savedDefinitionsExist() )
362 {
363 return true;
364 }
365
366 return false;
367 }
dbRecordExists($testId)
checks wether a question set config for current test exists in the database

References buildSourcePoolDefinitionList(), and dbRecordExists().

+ Here is the call graph for this function:

◆ doesSelectableQuestionPoolsExist()

ilTestRandomQuestionSetConfig::doesSelectableQuestionPoolsExist ( )

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

490 {
491 return (bool)count($this->getSelectableQuestionPools());
492 }

References getSelectableQuestionPools().

+ Here is the call graph for this function:

◆ getCommaSeparatedSourceQuestionPoolLinks()

ilTestRandomQuestionSetConfig::getCommaSeparatedSourceQuestionPoolLinks ( )

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

547 {
548 $definitionList = $this->buildSourcePoolDefinitionList($this->testOBJ);
549 $definitionList->loadDefinitions();
550
551 $poolTitles = array();
552
553 foreach($definitionList as $definition)
554 {
555 /* @var ilTestRandomQuestionSetSourcePoolDefinition $definition */
556
557 $refId = current(ilObject::_getAllReferences($definition->getPoolId()));
558 $href = ilLink::_getLink($refId, 'qpl');
559 $title = $definition->getPoolTitle();
560
561 $poolTitles[$definition->getPoolId()] = "<a href=\"$href\" alt=\"$title\">$title</a>";
562 }
563
564 return implode(', ', $poolTitles);
565 }
static _getAllReferences($a_id)
get all reference ids of object

References $title, ilObject\_getAllReferences(), ilLink\_getLink(), and buildSourcePoolDefinitionList().

+ Here is the call graph for this function:

◆ getDepenciesBrokenMessage()

ilTestRandomQuestionSetConfig::getDepenciesBrokenMessage ( ilLanguage  $lng)

Reimplemented from ilTestQuestionSetConfig.

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

502 {
503 return $lng->txt('tst_old_style_rnd_quest_set_broken');
504 }
global $lng
Definition: privfeed.php:17

References $lng.

◆ getHiddenTabsOnBrokenDepencies()

ilTestRandomQuestionSetConfig::getHiddenTabsOnBrokenDepencies ( )

Reimplemented from ilTestQuestionSetConfig.

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

538 {
539 return array(
540 'assQuestions', 'settings', 'manscoring', 'scoringadjust', 'statistics', 'history', 'export'
541 );
542 }

◆ getLastQuestionSyncTimestamp()

ilTestRandomQuestionSetConfig::getLastQuestionSyncTimestamp ( )
Returns
integer

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

References $lastQuestionSyncTimestamp.

Referenced by insertDbRecord(), and updateDbRecord().

+ Here is the caller graph for this function:

◆ getQuestionAmountConfigurationMode()

ilTestRandomQuestionSetConfig::getQuestionAmountConfigurationMode ( )

◆ getQuestionAmountPerTest()

ilTestRandomQuestionSetConfig::getQuestionAmountPerTest ( )
Returns
integer

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

References $questionAmountPerTest.

Referenced by insertDbRecord(), and updateDbRecord().

+ Here is the caller graph for this function:

◆ getSelectableQuestionPools()

ilTestRandomQuestionSetConfig::getSelectableQuestionPools ( )

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

483 {
484 return $this->testOBJ->getAvailableQuestionpools(
485 true, $this->arePoolsWithHomogeneousScoredQuestionsRequired(), false, true, true
486 );
487 }

References arePoolsWithHomogeneousScoredQuestionsRequired().

Referenced by doesSelectableQuestionPoolsExist().

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

◆ hasSourcePoolDefinitions()

ilTestRandomQuestionSetConfig::hasSourcePoolDefinitions ( )

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

332 {
333 $sourcePoolDefinitionList = $this->buildSourcePoolDefinitionList($this->testOBJ);
334
335 return $sourcePoolDefinitionList->savedDefinitionsExist();
336 }

References buildSourcePoolDefinitionList().

Referenced by isQuestionSetConfigured().

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

152 {
153 foreach($dataArray as $field => $value)
154 {
155 switch($field)
156 {
157 case 'req_pools_homo_scored': $this->setPoolsWithHomogeneousScoredQuestionsRequired($value); break;
158 case 'quest_amount_cfg_mode': $this->setQuestionAmountConfigurationMode($value); break;
159 case 'quest_amount_per_test': $this->setQuestionAmountPerTest($value); break;
160 case 'quest_sync_timestamp': $this->setLastQuestionSyncTimestamp($value); break;
161 }
162 }
163 }
$dataArray
setQuestionAmountConfigurationMode($questionAmountConfigurationMode)
setLastQuestionSyncTimestamp($lastQuestionSyncTimestamp)
setPoolsWithHomogeneousScoredQuestionsRequired($requirePoolsWithHomogeneousScoredQuestions)

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

Referenced by loadFromDb().

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

273 {
274 $this->db->insert('tst_rnd_quest_set_cfg', array(
275 'test_fi' => array('integer', $testId),
276 'req_pools_homo_scored' => array('integer', (int)$this->arePoolsWithHomogeneousScoredQuestionsRequired()),
277 'quest_amount_cfg_mode' => array('text', $this->getQuestionAmountConfigurationMode()),
278 'quest_amount_per_test' => array('integer', (int)$this->getQuestionAmountPerTest()),
279 'quest_sync_timestamp' => array('integer', (int)$this->getLastQuestionSyncTimestamp())
280 ));
281 }

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

Referenced by cloneToDbForTestId(), and saveToDb().

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

◆ isQuestionAmountConfigurationModePerPool()

ilTestRandomQuestionSetConfig::isQuestionAmountConfigurationModePerPool ( )

◆ isQuestionAmountConfigurationModePerTest()

ilTestRandomQuestionSetConfig::isQuestionAmountConfigurationModePerTest ( )

◆ isQuestionSetBuildable()

ilTestRandomQuestionSetConfig::isQuestionSetBuildable ( )

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

339 {
340 $sourcePoolDefinitionList = $this->buildSourcePoolDefinitionList($this->testOBJ);
341 $sourcePoolDefinitionList->loadDefinitions();
342
343 require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolQuestionList.php';
344 $stagingPoolQuestionList = new ilTestRandomQuestionSetStagingPoolQuestionList($this->db, $this->pluginAdmin);
345
346 require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetBuilder.php';
347 $questionSetBuilder = ilTestRandomQuestionSetBuilder::getInstance($this->db, $this->testOBJ, $this, $sourcePoolDefinitionList, $stagingPoolQuestionList);
348
349 return $questionSetBuilder->checkBuildable();
350 }
static getInstance(ilDBInterface $db, ilObjTest $testOBJ, ilTestRandomQuestionSetConfig $questionSetConfig, ilTestRandomQuestionSetSourcePoolDefinitionList $sourcePoolDefinitionList, ilTestRandomQuestionSetStagingPoolQuestionList $stagingPoolQuestionList)

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

Referenced by isQuestionSetConfigured().

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

◆ isQuestionSetConfigured()

ilTestRandomQuestionSetConfig::isQuestionSetConfigured ( )

Reimplemented from ilTestQuestionSetConfig.

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

286 {
287 if( !$this->isQuestionAmountConfigComplete() )
288 {
289 return false;
290 }
291
292 if( !$this->hasSourcePoolDefinitions() )
293 {
294 return false;
295 }
296
297 if( !$this->isQuestionSetBuildable() )
298 {
299 return false;
300 }
301
302 return true;
303 }

References hasSourcePoolDefinitions(), and isQuestionSetBuildable().

+ Here is the call graph for this function:

◆ isResultTaxonomyFilterSupported()

ilTestRandomQuestionSetConfig::isResultTaxonomyFilterSupported ( )

Reimplemented from ilTestQuestionSetConfig.

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

476 {
477 return true;
478 }

◆ isValidQuestionAmountConfigurationMode()

ilTestRandomQuestionSetConfig::isValidQuestionAmountConfigurationMode (   $amountMode)

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

99 {
100 switch($amountMode)
101 {
104
105 return true;
106 }
107
108 return false;
109 }

References QUESTION_AMOUNT_CONFIG_MODE_PER_POOL, and QUESTION_AMOUNT_CONFIG_MODE_PER_TEST.

◆ isValidRequestOnBrokenQuestionSetDepencies()

ilTestRandomQuestionSetConfig::isValidRequestOnBrokenQuestionSetDepencies (   $nextClass,
  $cmd 
)

Reimplemented from ilTestQuestionSetConfig.

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

507 {
508 //vd($nextClass, $cmd);
509
510 switch( $nextClass )
511 {
512 case 'ilobjectmetadatagui':
513 case 'ilpermissiongui':
514
515 return true;
516
517 case 'ilobjtestgui':
518 case '':
519
520 $cmds = array(
521 'infoScreen', 'participants', 'npSetFilter', 'npResetFilter',
522 //'deleteAllUserResults', 'confirmDeleteAllUserResults',
523 //'deleteSingleUserResults', 'confirmDeleteSelectedUserData', 'cancelDeleteSelectedUserData'
524 );
525
526 if( in_array($cmd, $cmds) )
527 {
528 return true;
529 }
530
531 break;
532 }
533
534 return false;
535 }
$cmd
Definition: sahs_server.php:35

References $cmd.

◆ loadFromDb()

ilTestRandomQuestionSetConfig::loadFromDb ( )

loads the question set config for current test from the database

Returns
boolean

Reimplemented from ilTestQuestionSetConfig.

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

171 {
172 $res = $this->db->queryF(
173 "SELECT * FROM tst_rnd_quest_set_cfg WHERE test_fi = %s",
174 array('integer'), array($this->testOBJ->getTestId())
175 );
176
177 while( $row = $this->db->fetchAssoc($res) )
178 {
179 $this->initFromArray($row);
180
181 return true;
182 }
183
184 return false;
185 }
initFromArray($dataArray)
initialises the current object instance with values from matching properties within the passed array

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

Referenced by cloneQuestionSetRelatedData().

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

◆ registerClonedSourcePoolDefinitionIdMapping()

ilTestRandomQuestionSetConfig::registerClonedSourcePoolDefinitionIdMapping ( ilObjTest  $cloneTestOBJ,
  $definitionIdMap 
)
private

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

423 {
424 global $ilLog;
425
426 require_once 'Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
428
429 foreach($definitionIdMap as $originalDefinitionId => $cloneDefinitionId)
430 {
431 $originalKey = $this->testOBJ->getRefId().'_rndSelDef_'.$originalDefinitionId;
432 $mappedKey = $cloneTestOBJ->getRefId().'_rndSelDef_'.$cloneDefinitionId;
433 $cwo->appendMapping($originalKey, $mappedKey);
434 $ilLog->write(__METHOD__.": Added random selection definition id mapping $originalKey <-> $mappedKey");
435 }
436 }
static _getInstance($a_copy_id)
Get instance of copy wizard options.
getRefId()
get reference id @access public

References $ilLog, ilCopyWizardOptions\_getInstance(), ilObject\getRefId(), and ilObjTest\getTmpCopyWizardCopyId().

Referenced by cloneQuestionSetRelatedData().

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

◆ removeQuestionSetRelatedData()

ilTestRandomQuestionSetConfig::removeQuestionSetRelatedData ( )

removes all question set config related data

Reimplemented from ilTestQuestionSetConfig.

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

370 {
371 $sourcePoolDefinitionList = $this->buildSourcePoolDefinitionList($this->testOBJ);
372 $sourcePoolDefinitionList->deleteDefinitions();
373
374 require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolBuilder.php';
376 $this->db, $this->testOBJ
377 );
378 $stagingPool->reset();
379
381
382 $this->deleteFromDb();
383 }
resetQuestionSetRelatedTestSettings()
resets all test settings that depends on a non changed question set config
deleteFromDb()
deletes the question set config for current test from the database

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

+ Here is the call graph for this function:

◆ resetQuestionSetRelatedTestSettings()

ilTestRandomQuestionSetConfig::resetQuestionSetRelatedTestSettings ( )

resets all test settings that depends on a non changed question set config

Reimplemented from ilTestQuestionSetConfig.

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

386 {
387 $this->testOBJ->setResultFilterTaxIds(array());
388 $this->testOBJ->saveToDb(true);
389 }

Referenced by removeQuestionSetRelatedData().

+ Here is the caller graph for this function:

◆ saveToDb()

ilTestRandomQuestionSetConfig::saveToDb ( )

saves the question set config for current test to the database

Returns
boolean

Reimplemented from ilTestQuestionSetConfig.

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

193 {
194 if( $this->dbRecordExists($this->testOBJ->getTestId()) )
195 {
196 $this->updateDbRecord($this->testOBJ->getTestId());
197 }
198 else
199 {
200 $this->insertDbRecord($this->testOBJ->getTestId());
201 }
202 }
updateDbRecord($testId)
updates the record in the database that corresponds to the question set config for the current test

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

+ Here is the call graph for this function:

◆ setLastQuestionSyncTimestamp()

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

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

131 {
132 $this->lastQuestionSyncTimestamp = $lastQuestionSyncTimestamp;
133 }

References $lastQuestionSyncTimestamp.

Referenced by initFromArray().

+ Here is the caller graph for this function:

◆ setPoolsWithHomogeneousScoredQuestionsRequired()

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

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

54 {
55 $this->requirePoolsWithHomogeneousScoredQuestions = $requirePoolsWithHomogeneousScoredQuestions;
56 }

References $requirePoolsWithHomogeneousScoredQuestions.

Referenced by initFromArray().

+ Here is the caller graph for this function:

◆ setQuestionAmountConfigurationMode()

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

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

70 {
71 $this->questionAmountConfigurationMode = $questionAmountConfigurationMode;
72 }

References $questionAmountConfigurationMode.

Referenced by initFromArray().

+ Here is the caller graph for this function:

◆ setQuestionAmountPerTest()

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

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

115 {
116 $this->questionAmountPerTest = $questionAmountPerTest;
117 }

References $questionAmountPerTest.

Referenced by initFromArray().

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

252 {
253 $this->db->update('tst_rnd_quest_set_cfg',
254 array(
255 'req_pools_homo_scored' => array('integer', (int)$this->arePoolsWithHomogeneousScoredQuestionsRequired()),
256 'quest_amount_cfg_mode' => array('text', $this->getQuestionAmountConfigurationMode()),
257 'quest_amount_per_test' => array('integer', (int)$this->getQuestionAmountPerTest()),
258 'quest_sync_timestamp' => array('integer', (int)$this->getLastQuestionSyncTimestamp())
259 ),
260 array(
261 'test_fi' => array('integer', $testId)
262 )
263 );
264 }

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

Referenced by saveToDb().

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

◆ updateLastQuestionSyncTimestampForTestId()

ilTestRandomQuestionSetConfig::updateLastQuestionSyncTimestampForTestId (   $testId,
  $timestamp 
)

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

464 {
465 $this->db->update('tst_rnd_quest_set_cfg',
466 array(
467 'quest_sync_timestamp' => array('integer', (int)$timestamp)
468 ),
469 array(
470 'test_fi' => array('integer', $testId)
471 )
472 );
473 }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81

References $timestamp.

Referenced by cloneQuestionSetRelatedData().

+ 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: