ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 ()
 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, 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 (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 483 of file class.ilTestRandomQuestionSetConfig.php.

484 {
485 return (bool)$this->testOBJ->isTestFinalBroken();
486 }

◆ arePoolsWithHomogeneousScoredQuestionsRequired()

ilTestRandomQuestionSetConfig::arePoolsWithHomogeneousScoredQuestionsRequired ( )

◆ buildSourcePoolDefinitionList()

ilTestRandomQuestionSetConfig::buildSourcePoolDefinitionList ( ilObjTest  $testOBJ)
private

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

426 {
427 require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
428 $sourcePoolDefinitionFactory = new ilTestRandomQuestionSetSourcePoolDefinitionFactory(
429 $this->db, $testOBJ
430 );
431
432 require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
433 $sourcePoolDefinitionList = new ilTestRandomQuestionSetSourcePoolDefinitionList(
434 $this->db, $testOBJ, $sourcePoolDefinitionFactory
435 );
436
437 return $sourcePoolDefinitionList;
438 }

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

441 {
442 require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolBuilder.php';
443 $stagingPool = new ilTestRandomQuestionSetStagingPoolBuilder($this->db, $testOBJ);
444
445 return $stagingPool;
446 }

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

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 $definitionIdMap = $sourcePoolDefinitionList->cloneDefinitionsForTestId($cloneTestOBJ->getTestId());
395 $this->registerClonedSourcePoolDefinitionIdMapping($cloneTestOBJ, $definitionIdMap);
396
397 // build new question stage for cloned test
398
399 $sourcePoolDefinitionList = $this->buildSourcePoolDefinitionList($cloneTestOBJ);
400 $stagingPool = $this->buildStagingPoolBuilder($cloneTestOBJ);
401
402 $sourcePoolDefinitionList->loadDefinitions();
403 $stagingPool->rebuild($sourcePoolDefinitionList);
404 $sourcePoolDefinitionList->saveDefinitions();
405
406 $this->updateLastQuestionSyncTimestampForTestId($cloneTestOBJ->getTestId(), time());
407 }
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 196 of file class.ilTestRandomQuestionSetConfig.php.

197 {
198 $this->insertDbRecord($testId);
199 }
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 220 of file class.ilTestRandomQuestionSetConfig.php.

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 }

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

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 }

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

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

References buildSourcePoolDefinitionList(), and dbRecordExists().

+ Here is the call graph for this function:

◆ doesSelectableQuestionPoolsExist()

ilTestRandomQuestionSetConfig::doesSelectableQuestionPoolsExist ( )

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

477 {
478 return (bool)count($this->getSelectableQuestionPools());
479 }

References getSelectableQuestionPools().

+ Here is the call graph for this function:

◆ getCommaSeparatedSourceQuestionPoolLinks()

ilTestRandomQuestionSetConfig::getCommaSeparatedSourceQuestionPoolLinks ( )

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

534 {
535 $definitionList = $this->buildSourcePoolDefinitionList($this->testOBJ);
536 $definitionList->loadDefinitions();
537
538 $poolTitles = array();
539
540 foreach($definitionList as $definition)
541 {
542 /* @var ilTestRandomQuestionSetSourcePoolDefinition $definition */
543
544 $refId = current(ilObject::_getAllReferences($definition->getPoolId()));
545 $href = ilLink::_getLink($refId, 'qpl');
546 $title = $definition->getPoolTitle();
547
548 $poolTitles[$definition->getPoolId()] = "<a href=\"$href\" alt=\"$title\">$title</a>";
549 }
550
551 return implode(', ', $poolTitles);
552 }
static _getAllReferences($a_id)
get all reference ids of object

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

489 {
490 return $lng->txt('tst_old_style_rnd_quest_set_broken');
491 }
global $lng
Definition: privfeed.php:40

References $lng.

◆ getHiddenTabsOnBrokenDepencies()

ilTestRandomQuestionSetConfig::getHiddenTabsOnBrokenDepencies ( )

Reimplemented from ilTestQuestionSetConfig.

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

525 {
526 return array(
527 'assQuestions', 'settings', 'manscoring', 'scoringadjust', 'statistics', 'history', 'export'
528 );
529 }

◆ 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(), and updateDbRecord().

+ Here is the caller graph for this function:

◆ getSelectableQuestionPools()

ilTestRandomQuestionSetConfig::getSelectableQuestionPools ( )

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

470 {
471 return $this->testOBJ->getAvailableQuestionpools(
472 true, $this->arePoolsWithHomogeneousScoredQuestionsRequired(), false, true, true
473 );
474 }

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

319 {
320 $sourcePoolDefinitionList = $this->buildSourcePoolDefinitionList($this->testOBJ);
321
322 return $sourcePoolDefinitionList->savedDefinitionsExist();
323 }

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

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)

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

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 }

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

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)

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

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 }

References hasSourcePoolDefinitions(), and isQuestionSetBuildable().

+ Here is the call graph for this function:

◆ isResultTaxonomyFilterSupported()

ilTestRandomQuestionSetConfig::isResultTaxonomyFilterSupported ( )

Reimplemented from ilTestQuestionSetConfig.

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

463 {
464 return true;
465 }

◆ isValidRequestOnBrokenQuestionSetDepencies()

ilTestRandomQuestionSetConfig::isValidRequestOnBrokenQuestionSetDepencies (   $nextClass,
  $cmd 
)

Reimplemented from ilTestQuestionSetConfig.

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

494 {
495 //vd($nextClass, $cmd);
496
497 switch( $nextClass )
498 {
499 case 'ilobjectmetadatagui':
500 case 'ilpermissiongui':
501
502 return true;
503
504 case 'ilobjtestgui':
505 case '':
506
507 $cmds = array(
508 'infoScreen', 'participants', 'npSetFilter', 'npResetFilter',
509 //'deleteAllUserResults', 'confirmDeleteAllUserResults',
510 //'deleteSingleUserResults', 'confirmDeleteSelectedUserData', 'cancelDeleteSelectedUserData'
511 );
512
513 if( in_array($cmd, $cmds) )
514 {
515 return true;
516 }
517
518 break;
519 }
520
521 return false;
522 }
$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 157 of file class.ilTestRandomQuestionSetConfig.php.

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

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

410 {
411 global $ilLog;
412
413 require_once 'Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
415
416 foreach($definitionIdMap as $originalDefinitionId => $cloneDefinitionId)
417 {
418 $originalKey = $this->testOBJ->getRefId().'_rndSelDef_'.$originalDefinitionId;
419 $mappedKey = $cloneTestOBJ->getRefId().'_rndSelDef_'.$cloneDefinitionId;
420 $cwo->appendMapping($originalKey, $mappedKey);
421 $ilLog->write(__METHOD__.": Added random selection definition id mapping $originalKey <-> $mappedKey");
422 }
423 }
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 356 of file class.ilTestRandomQuestionSetConfig.php.

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

373 {
374 $this->testOBJ->setResultFilterTaxIds(array());
375 $this->testOBJ->saveToDb(true);
376 }

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

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

118 {
119 $this->lastQuestionSyncTimestamp = $lastQuestionSyncTimestamp;
120 }

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

102 {
103 $this->questionAmountPerTest = $questionAmountPerTest;
104 }

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

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 }

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

451 {
452 $this->db->update('tst_rnd_quest_set_cfg',
453 array(
454 'quest_sync_timestamp' => array('integer', (int)$timestamp)
455 ),
456 array(
457 'test_fi' => array('integer', $testId)
458 )
459 );
460 }
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: