106 switch ($amountMode) {
107 case self::QUESTION_AMOUNT_CONFIG_MODE_PER_POOL:
108 case self::QUESTION_AMOUNT_CONFIG_MODE_PER_TEST:
165 foreach ($dataArray as $field => $value) {
186 $res = $this->db->queryF(
187 "SELECT * FROM tst_rnd_quest_set_cfg WHERE test_fi = %s",
189 array($this->testOBJ->getTestId())
192 while ($row = $this->db->fetchAssoc(
$res)) {
228 $this->db->manipulateF(
229 "DELETE FROM tst_rnd_quest_set_cfg WHERE test_fi = %s",
231 array($this->testOBJ->getTestId())
245 $res = $this->db->queryF(
246 "SELECT COUNT(*) cnt FROM tst_rnd_quest_set_cfg WHERE test_fi = %s",
251 $row = $this->db->fetchAssoc(
$res);
253 return (
bool) $row[
'cnt'];
265 'tst_rnd_quest_set_cfg',
273 'test_fi' => array(
'integer', $testId)
286 $this->db->insert(
'tst_rnd_quest_set_cfg', array(
287 'test_fi' => array(
'integer', $testId),
312 $sourcePoolDefinitionList->loadDefinitions();
314 foreach ($sourcePoolDefinitionList as $definition) {
315 if ($definition->getQuestionAmount() < 1) {
330 return $sourcePoolDefinitionList->savedDefinitionsExist();
336 $sourcePoolDefinitionList->loadDefinitions();
343 $buildable = $questionSetBuilder->checkBuildable();
344 $this->buildableMessages = $questionSetBuilder->getCheckMessages();
348 return $questionSetBuilder->checkBuildable();
359 if ($sourcePoolDefinitionList->savedDefinitionsExist()) {
369 $sourcePoolDefinitionList->deleteDefinitions();
371 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolBuilder.php';
376 $stagingPool->reset();
383 $this->testOBJ->getScoreSettingsRepository()->store(
384 $this->testOBJ->getScoreSettings()->withResultDetailsSettings(
385 $this->testOBJ->getScoreSettings()->getResultDetailsSettings()->withTaxonomyFilterIds(array())
388 $this->testOBJ->saveToDb(
true);
406 $sourcePoolDefinitionList->loadDefinitions();
407 $definitionIdMap = $sourcePoolDefinitionList->cloneDefinitionsForTestId($cloneTestOBJ->
getTestId());
415 $sourcePoolDefinitionList->loadDefinitions();
416 $stagingPool->rebuild($sourcePoolDefinitionList);
417 $sourcePoolDefinitionList->saveDefinitions();
425 $ilLog = $DIC[
'ilLog'];
427 require_once
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
430 foreach ($definitionIdMap as $originalDefinitionId => $cloneDefinitionId) {
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");
452 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolBuilder.php';
463 'tst_rnd_quest_set_cfg',
465 'quest_sync_timestamp' => array(
'integer', (
int)
$timestamp)
468 'test_fi' => array(
'integer', $testId)
482 return $this->testOBJ->getAvailableQuestionpools(
500 return $this->testOBJ->isTestFinalBroken();
505 return $lng->
txt(
'tst_old_style_rnd_quest_set_broken');
512 switch ($nextClass) {
513 case 'ilobjectmetadatagui':
514 case 'ilpermissiongui':
522 'infoScreen',
'participants',
'npSetFilter',
'npResetFilter',
527 if (in_array($cmd, $cmds)) {
540 'assQuestions',
'settings',
'manscoring',
'scoringadjust',
'statistics',
'history',
'export' 549 $definitionList->loadDefinitions();
551 $poolTitles = array();
553 foreach ($definitionList as $definition) {
558 $title = $definition->getPoolTitle();
560 $poolTitles[$definition->getPoolId()] =
"<a href=\"$href\" alt=\"$title\">$title</a>";
563 return implode(
', ', $poolTitles);
buildStagingPoolBuilder(ilObjTest $testOBJ)
insertDbRecord($testId)
inserts a new record for the question set config for the current test into the database ...
cloneQuestionSetRelatedData(ilObjTest $cloneTestOBJ)
removes all question set config related data for cloned/copied test
getCommaSeparatedSourceQuestionPoolLinks()
isValidRequestOnBrokenQuestionSetDepencies($nextClass, $cmd)
txt(string $a_topic, string $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...
isResultTaxonomyFilterSupported()
doesSelectableQuestionPoolsExist()
buildSourcePoolDefinitionList(ilObjTest $testOBJ)
setQuestionAmountConfigurationMode($questionAmountConfigurationMode)
static _getAllReferences(int $id)
get all reference ids for object ID
getTestId()
Gets the database id of the additional test data.
$questionAmountConfigurationMode
registerClonedSourcePoolDefinitionIdMapping(ilObjTest $cloneTestOBJ, $definitionIdMap)
getDepenciesBrokenMessage(ilLanguage $lng)
isQuestionAmountConfigurationModePerPool()
isQuestionAmountConfigurationModePerTest()
const QUESTION_AMOUNT_CONFIG_MODE_PER_POOL
getSelectableQuestionPools()
arePoolsWithHomogeneousScoredQuestionsRequired()
loadFromDb()
loads the question set config for current test from the database
isValidQuestionAmountConfigurationMode($amountMode)
initFromArray($dataArray)
initialises the current object instance with values from matching properties within the passed array ...
$lastQuestionSyncTimestamp
updateLastQuestionSyncTimestampForTestId($testId, $timestamp)
getQuestionAmountPerTest()
cloneToDbForTestId($testId)
saves the question set config for test with given id to the database
setLastQuestionSyncTimestamp($lastQuestionSyncTimestamp)
isQuestionSetConfigured()
getHiddenTabsOnBrokenDepencies()
setPoolsWithHomogeneousScoredQuestionsRequired($requirePoolsWithHomogeneousScoredQuestions)
static getInstance(ilDBInterface $db, ilObjTest $testOBJ, ilTestRandomQuestionSetConfig $questionSetConfig, ilTestRandomQuestionSetSourcePoolDefinitionList $sourcePoolDefinitionList, ilTestRandomQuestionSetStagingPoolQuestionList $stagingPoolQuestionList)
setQuestionAmountPerTest($questionAmountPerTest)
saveToDb()
saves the question set config for current test to the database
static _getLink(?int $a_ref_id, string $a_type='', array $a_params=array(), string $append="")
getQuestionAmountConfigurationMode()
removeQuestionSetRelatedData()
doesQuestionSetRelatedDataExist()
getLastQuestionSyncTimestamp()
foreach($mandatory_scripts as $file) $timestamp
deleteFromDb()
deletes the question set config for current test from the database
hasSourcePoolDefinitions()
$requirePoolsWithHomogeneousScoredQuestions
updateDbRecord($testId)
updates the record in the database that corresponds to the question set config for the current test ...
resetQuestionSetRelatedTestSettings()
const QUESTION_AMOUNT_CONFIG_MODE_PER_TEST
static _getInstance(int $a_copy_id)
isQuestionAmountConfigComplete()
dbRecordExists($testId)
checks wether a question set config for current test exists in the database