4 require_once
'Modules/Test/classes/class.ilTestQuestionSetConfig.php';
47 parent::__construct($tree, $db, $pluginAdmin, $testOBJ);
102 case self::QUESTION_AMOUNT_CONFIG_MODE_PER_POOL:
103 case self::QUESTION_AMOUNT_CONFIG_MODE_PER_TEST:
172 $res = $this->db->queryF(
173 "SELECT * FROM tst_rnd_quest_set_cfg WHERE test_fi = %s",
174 array(
'integer'),
array($this->testOBJ->getTestId())
177 while(
$row = $this->db->fetchAssoc(
$res) )
219 $this->db->manipulateF(
220 "DELETE FROM tst_rnd_quest_set_cfg WHERE test_fi = %s",
221 array(
'integer'),
array($this->testOBJ->getTestId())
235 $res = $this->db->queryF(
236 "SELECT COUNT(*) cnt FROM tst_rnd_quest_set_cfg WHERE test_fi = %s",
242 return (
bool)
$row[
'cnt'];
253 $this->db->update(
'tst_rnd_quest_set_cfg',
261 'test_fi' =>
array(
'integer', $testId)
274 $this->db->insert(
'tst_rnd_quest_set_cfg',
array(
275 'test_fi' =>
array(
'integer', $testId),
287 if( !$this->isQuestionAmountConfigComplete() )
305 public function isQuestionAmountConfigComplete()
311 $sourcePoolDefinitionList->loadDefinitions();
313 foreach($sourcePoolDefinitionList as $definition)
317 if( $definition->getQuestionAmount() < 1 )
335 return $sourcePoolDefinitionList->savedDefinitionsExist();
341 $sourcePoolDefinitionList->loadDefinitions();
343 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolQuestionList.php';
346 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetBuilder.php';
349 return $questionSetBuilder->checkBuildable();
361 if( $sourcePoolDefinitionList->savedDefinitionsExist() )
372 $sourcePoolDefinitionList->deleteDefinitions();
374 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolBuilder.php';
376 $this->db, $this->testOBJ
378 $stagingPool->reset();
387 $this->testOBJ->setResultFilterTaxIds(
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();
426 require_once
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
429 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");
440 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
445 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
447 $this->db, $testOBJ, $sourcePoolDefinitionFactory
450 return $sourcePoolDefinitionList;
455 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolBuilder.php';
465 $this->db->update(
'tst_rnd_quest_set_cfg',
470 'test_fi' =>
array(
'integer', $testId)
484 return $this->testOBJ->getAvailableQuestionpools(
498 return (
bool)$this->testOBJ->isTestFinalBroken();
503 return $lng->
txt(
'tst_old_style_rnd_quest_set_broken');
512 case 'ilobjectmetadatagui':
513 case 'ilpermissiongui':
521 'infoScreen',
'participants',
'npSetFilter',
'npResetFilter',
526 if( in_array(
$cmd, $cmds) )
540 'assQuestions',
'settings',
'manscoring',
'scoringadjust',
'statistics',
'history',
'export' 549 $definitionList->loadDefinitions();
551 $poolTitles =
array();
553 foreach($definitionList as $definition)
559 $title = $definition->getPoolTitle();
561 $poolTitles[$definition->getPoolId()] =
"<a href=\"$href\" alt=\"$title\">$title</a>";
564 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)
isResultTaxonomyFilterSupported()
doesSelectableQuestionPoolsExist()
buildSourcePoolDefinitionList(ilObjTest $testOBJ)
setQuestionAmountConfigurationMode($questionAmountConfigurationMode)
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()
static _getAllReferences($a_id)
get all reference ids of object
loadFromDb()
loads the question set config for current test from the database
Administration class for plugins.
isValidQuestionAmountConfigurationMode($amountMode)
initFromArray($dataArray)
initialises the current object instance with values from matching properties within the passed array ...
$lastQuestionSyncTimestamp
static _getInstance($a_copy_id)
Get instance of copy wizard options.
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
getQuestionAmountConfigurationMode()
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
removeQuestionSetRelatedData()
Create styles array
The data for the language used.
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 ...
__construct(ilTree $tree, ilDBInterface $db, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ)
getRefId()
get reference id public
resetQuestionSetRelatedTestSettings()
const QUESTION_AMOUNT_CONFIG_MODE_PER_TEST
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
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...
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
dbRecordExists($testId)
checks wether a question set config for current test exists in the database