4 require_once
'Modules/Test/classes/class.ilTestQuestionSetConfig.php';
47 parent::__construct($tree, $db, $pluginAdmin, $testOBJ);
140 foreach($dataArray as $field => $value)
159 $res = $this->db->queryF(
160 "SELECT * FROM tst_rnd_quest_set_cfg WHERE test_fi = %s",
161 array(
'integer'), array($this->testOBJ->getTestId())
164 while(
$row = $this->db->fetchAssoc(
$res) )
206 $this->db->manipulateF(
207 "DELETE FROM tst_rnd_quest_set_cfg WHERE test_fi = %s",
208 array(
'integer'), array($this->testOBJ->getTestId())
222 $res = $this->db->queryF(
223 "SELECT COUNT(*) cnt FROM tst_rnd_quest_set_cfg WHERE test_fi = %s",
224 array(
'integer'), array($testId)
229 return (
bool)
$row[
'cnt'];
240 $this->db->update(
'tst_rnd_quest_set_cfg',
248 'test_fi' => array(
'integer', $testId)
261 $this->db->insert(
'tst_rnd_quest_set_cfg', array(
262 'test_fi' => array(
'integer', $testId),
274 if( !$this->isQuestionAmountConfigComplete() )
292 public function isQuestionAmountConfigComplete()
298 $sourcePoolDefinitionList->loadDefinitions();
300 foreach($sourcePoolDefinitionList as $definition)
304 if( $definition->getQuestionAmount() < 1 )
322 return $sourcePoolDefinitionList->savedDefinitionsExist();
328 $sourcePoolDefinitionList->loadDefinitions();
330 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolQuestionList.php';
333 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetBuilder.php';
336 return $questionSetBuilder->checkBuildable();
348 if( $sourcePoolDefinitionList->savedDefinitionsExist() )
359 $sourcePoolDefinitionList->deleteDefinitions();
361 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolBuilder.php';
363 $this->db, $this->testOBJ
365 $stagingPool->reset();
374 $this->testOBJ->setResultFilterTaxIds(array());
375 $this->testOBJ->saveToDb(
true);
393 $sourcePoolDefinitionList->loadDefinitions();
394 $definitionIdMap = $sourcePoolDefinitionList->cloneDefinitionsForTestId($cloneTestOBJ->
getTestId());
402 $sourcePoolDefinitionList->loadDefinitions();
403 $stagingPool->rebuild($sourcePoolDefinitionList);
404 $sourcePoolDefinitionList->saveDefinitions();
413 require_once
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
416 foreach($definitionIdMap as $originalDefinitionId => $cloneDefinitionId)
418 $originalKey = $this->testOBJ->getRefId().
'_rndSelDef_'.$originalDefinitionId;
419 $mappedKey = $cloneTestOBJ->
getRefId().
'_rndSelDef_'.$cloneDefinitionId;
420 $cwo->appendMapping($originalKey, $mappedKey);
421 $ilLog->write(__METHOD__.
": Added random selection definition id mapping $originalKey <-> $mappedKey");
427 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
432 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
434 $this->db, $testOBJ, $sourcePoolDefinitionFactory
437 return $sourcePoolDefinitionList;
442 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolBuilder.php';
452 $this->db->update(
'tst_rnd_quest_set_cfg',
454 'quest_sync_timestamp' => array(
'integer', (
int)
$timestamp)
457 'test_fi' => array(
'integer', $testId)
471 return $this->testOBJ->getAvailableQuestionpools(
485 return (
bool)$this->testOBJ->isTestFinalBroken();
490 return $lng->
txt(
'tst_old_style_rnd_quest_set_broken');
499 case 'ilobjectmetadatagui':
500 case 'ilpermissiongui':
508 'infoScreen',
'participants',
'npSetFilter',
'npResetFilter',
513 if( in_array(
$cmd, $cmds) )
527 'assQuestions',
'settings',
'manscoring',
'scoringadjust',
'statistics',
'history',
'export' 536 $definitionList->loadDefinitions();
538 $poolTitles = array();
540 foreach($definitionList as $definition)
546 $title = $definition->getPoolTitle();
548 $poolTitles[$definition->getPoolId()] =
"<a href=\"$href\" alt=\"$title\">$title</a>";
551 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)
static getInstance(ilDB $db, ilObjTest $testOBJ, ilTestRandomQuestionSetConfig $questionSetConfig, ilTestRandomQuestionSetSourcePoolDefinitionList $sourcePoolDefinitionList, ilTestRandomQuestionSetStagingPoolQuestionList $stagingPoolQuestionList)
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.
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)
__construct(ilTree $tree, ilDB $db, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ)
isQuestionSetConfigured()
getHiddenTabsOnBrokenDepencies()
setPoolsWithHomogeneousScoredQuestionsRequired($requirePoolsWithHomogeneousScoredQuestions)
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 ...
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