106 switch ($amountMode) {
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);
foreach($mandatory_scripts as $file) $timestamp
static _getInstance(int $a_copy_id)
static _getLink(?int $a_ref_id, string $a_type='', array $a_params=array(), string $append="")
getTestId()
Gets the database id of the additional test data.
static _getAllReferences(int $id)
get all reference ids for object ID
static getInstance(ilDBInterface $db, ilObjTest $testOBJ, ilTestRandomQuestionSetConfig $questionSetConfig, ilTestRandomQuestionSetSourcePoolDefinitionList $sourcePoolDefinitionList, ilTestRandomQuestionSetStagingPoolQuestionList $stagingPoolQuestionList)
getQuestionAmountConfigurationMode()
const QUESTION_AMOUNT_CONFIG_MODE_PER_POOL
cloneToDbForTestId($testId)
saves the question set config for test with given id to the database
initFromArray($dataArray)
initialises the current object instance with values from matching properties within the passed array
updateLastQuestionSyncTimestampForTestId($testId, $timestamp)
dbRecordExists($testId)
checks wether a question set config for current test exists in the database
isQuestionAmountConfigComplete()
getSelectableQuestionPools()
removeQuestionSetRelatedData()
removes all question set config related data
isResultTaxonomyFilterSupported()
saveToDb()
saves the question set config for current test to the database
setQuestionAmountConfigurationMode($questionAmountConfigurationMode)
getDepenciesBrokenMessage(ilLanguage $lng)
setLastQuestionSyncTimestamp($lastQuestionSyncTimestamp)
isQuestionSetConfigured()
doesSelectableQuestionPoolsExist()
$lastQuestionSyncTimestamp
getCommaSeparatedSourceQuestionPoolLinks()
setQuestionAmountPerTest($questionAmountPerTest)
const QUESTION_AMOUNT_CONFIG_MODE_PER_TEST
isQuestionAmountConfigurationModePerPool()
getLastQuestionSyncTimestamp()
isValidQuestionAmountConfigurationMode($amountMode)
cloneQuestionSetRelatedData(ilObjTest $cloneTestOBJ)
removes all question set config related data for cloned/copied test
registerClonedSourcePoolDefinitionIdMapping(ilObjTest $cloneTestOBJ, $definitionIdMap)
loadFromDb()
loads the question set config for current test from the database
doesQuestionSetRelatedDataExist()
checks wether question set config related data exists or not
arePoolsWithHomogeneousScoredQuestionsRequired()
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
updateDbRecord($testId)
updates the record in the database that corresponds to the question set config for the current test
setPoolsWithHomogeneousScoredQuestionsRequired($requirePoolsWithHomogeneousScoredQuestions)
getQuestionAmountPerTest()
$requirePoolsWithHomogeneousScoredQuestions
isQuestionAmountConfigurationModePerTest()
getHiddenTabsOnBrokenDepencies()
hasSourcePoolDefinitions()
buildSourcePoolDefinitionList(ilObjTest $testOBJ)
insertDbRecord($testId)
inserts a new record for the question set config for the current test into the database
buildStagingPoolBuilder(ilObjTest $testOBJ)
isValidRequestOnBrokenQuestionSetDepencies($nextClass, $cmd)
$questionAmountConfigurationMode