4 require_once
'Modules/Test/classes/class.ilTestQuestionSetConfig.php';
51 parent::__construct($tree, $db, $pluginAdmin, $testOBJ);
104 switch ($amountMode) {
105 case self::QUESTION_AMOUNT_CONFIG_MODE_PER_POOL:
106 case self::QUESTION_AMOUNT_CONFIG_MODE_PER_TEST:
163 foreach ($dataArray as $field => $value) {
180 $res = $this->db->queryF(
181 "SELECT * FROM tst_rnd_quest_set_cfg WHERE test_fi = %s",
183 array($this->testOBJ->getTestId())
186 while (
$row = $this->db->fetchAssoc(
$res)) {
224 $this->db->manipulateF(
225 "DELETE FROM tst_rnd_quest_set_cfg WHERE test_fi = %s",
227 array($this->testOBJ->getTestId())
241 $res = $this->db->queryF(
242 "SELECT COUNT(*) cnt FROM tst_rnd_quest_set_cfg WHERE test_fi = %s",
249 return (
bool)
$row[
'cnt'];
261 'tst_rnd_quest_set_cfg',
269 'test_fi' => array(
'integer', $testId)
282 $this->db->insert(
'tst_rnd_quest_set_cfg', array(
283 'test_fi' => array(
'integer', $testId),
301 if (!$this->isQuestionAmountConfigComplete()) {
316 public function isQuestionAmountConfigComplete()
321 $sourcePoolDefinitionList->loadDefinitions();
323 foreach ($sourcePoolDefinitionList as $definition) {
326 if ($definition->getQuestionAmount() < 1) {
341 return $sourcePoolDefinitionList->savedDefinitionsExist();
347 $sourcePoolDefinitionList->loadDefinitions();
349 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolQuestionList.php';
352 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetBuilder.php';
356 $buildable = $questionSetBuilder->checkBuildable();
357 $this->buildableMessages = $questionSetBuilder->getCheckMessages();
361 return $questionSetBuilder->checkBuildable();
372 if ($sourcePoolDefinitionList->savedDefinitionsExist()) {
382 $sourcePoolDefinitionList->deleteDefinitions();
384 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolBuilder.php';
389 $stagingPool->reset();
398 $this->testOBJ->setResultFilterTaxIds(array());
399 $this->testOBJ->saveToDb(
true);
417 $sourcePoolDefinitionList->loadDefinitions();
418 $definitionIdMap = $sourcePoolDefinitionList->cloneDefinitionsForTestId($cloneTestOBJ->
getTestId());
426 $sourcePoolDefinitionList->loadDefinitions();
427 $stagingPool->rebuild($sourcePoolDefinitionList);
428 $sourcePoolDefinitionList->saveDefinitions();
438 require_once
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
441 foreach ($definitionIdMap as $originalDefinitionId => $cloneDefinitionId) {
442 $originalKey = $this->testOBJ->getRefId() .
'_rndSelDef_' . $originalDefinitionId;
443 $mappedKey = $cloneTestOBJ->
getRefId() .
'_rndSelDef_' . $cloneDefinitionId;
444 $cwo->appendMapping($originalKey, $mappedKey);
445 $ilLog->write(__METHOD__ .
": Added random selection definition id mapping $originalKey <-> $mappedKey");
451 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
457 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
461 $sourcePoolDefinitionFactory
464 return $sourcePoolDefinitionList;
469 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolBuilder.php';
480 'tst_rnd_quest_set_cfg',
482 'quest_sync_timestamp' => array(
'integer', (
int)
$timestamp)
485 'test_fi' => array(
'integer', $testId)
499 return $this->testOBJ->getAvailableQuestionpools(
517 return (
bool) $this->testOBJ->isTestFinalBroken();
522 return $lng->
txt(
'tst_old_style_rnd_quest_set_broken');
529 switch ($nextClass) {
530 case 'ilobjectmetadatagui':
531 case 'ilpermissiongui':
539 'infoScreen',
'participants',
'npSetFilter',
'npResetFilter',
544 if (in_array($cmd, $cmds)) {
557 'assQuestions',
'settings',
'manscoring',
'scoringadjust',
'statistics',
'history',
'export' 566 $definitionList->loadDefinitions();
568 $poolTitles = array();
570 foreach ($definitionList as $definition) {
575 $title = $definition->getPoolTitle();
577 $poolTitles[$definition->getPoolId()] =
"<a href=\"$href\" alt=\"$title\">$title</a>";
580 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.
foreach($_POST as $key=> $value) $res
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()
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
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