4require_once
'Modules/Test/classes/class.ilTestQuestionSetConfig.php';
104 switch ($amountMode) {
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",
247 $row = $this->db->fetchAssoc(
$res);
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),
297 && $this->isQuestionAmountConfigComplete()
303 public function isQuestionAmountConfigComplete()
308 $sourcePoolDefinitionList->loadDefinitions();
310 foreach ($sourcePoolDefinitionList as $definition) {
313 if ($definition->getQuestionAmount() < 1) {
328 return $sourcePoolDefinitionList->savedDefinitionsExist();
334 $sourcePoolDefinitionList->loadDefinitions();
336 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolQuestionList.php';
339 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetBuilder.php';
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();
385 $this->testOBJ->setResultFilterTaxIds(array());
386 $this->testOBJ->saveToDb(
true);
404 $sourcePoolDefinitionList->loadDefinitions();
405 $definitionIdMap = $sourcePoolDefinitionList->cloneDefinitionsForTestId($cloneTestOBJ->
getTestId());
413 $sourcePoolDefinitionList->loadDefinitions();
414 $stagingPool->rebuild($sourcePoolDefinitionList);
415 $sourcePoolDefinitionList->saveDefinitions();
423 $ilLog =
$DIC[
'ilLog'];
425 require_once
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
428 foreach ($definitionIdMap as $originalDefinitionId => $cloneDefinitionId) {
429 $originalKey = $this->testOBJ->getRefId() .
'_rndSelDef_' . $originalDefinitionId;
430 $mappedKey = $cloneTestOBJ->
getRefId() .
'_rndSelDef_' . $cloneDefinitionId;
431 $cwo->appendMapping($originalKey, $mappedKey);
432 $ilLog->write(__METHOD__ .
": Added random selection definition id mapping $originalKey <-> $mappedKey");
438 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
444 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
448 $sourcePoolDefinitionFactory
451 return $sourcePoolDefinitionList;
456 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolBuilder.php';
467 'tst_rnd_quest_set_cfg',
469 'quest_sync_timestamp' => array(
'integer', (
int)
$timestamp)
472 'test_fi' => array(
'integer', $testId)
486 return $this->testOBJ->getAvailableQuestionpools(
504 return (
bool) $this->testOBJ->isTestFinalBroken();
509 return $lng->txt(
'tst_old_style_rnd_quest_set_broken');
516 switch ($nextClass) {
517 case 'ilobjectmetadatagui':
518 case 'ilpermissiongui':
526 'infoScreen',
'participants',
'npSetFilter',
'npResetFilter',
531 if (in_array($cmd, $cmds)) {
544 'assQuestions',
'settings',
'manscoring',
'scoringadjust',
'statistics',
'history',
'export'
553 $definitionList->loadDefinitions();
555 $poolTitles = array();
557 foreach ($definitionList as $definition) {
562 $title = $definition->getPoolTitle();
564 $poolTitles[$definition->getPoolId()] =
"<a href=\"$href\" alt=\"$title\">$title</a>";
567 return implode(
', ', $poolTitles);
foreach($mandatory_scripts as $file) $timestamp
An exception for terminatinating execution or to throw for unit testing.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
getTestId()
Gets the database id of the additional test data.
getRefId()
get reference id @access public
static _getAllReferences($a_id)
get all reference ids of object
Administration class for plugins.
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
__construct(ilTree $tree, ilDBInterface $db, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ)
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
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
foreach($_POST as $key=> $value) $res