4require_once
'Modules/Test/classes/class.ilTestQuestionSetConfig.php';
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);
foreach($mandatory_scripts as $file) $timestamp
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(ilDB $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
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()
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)
__construct(ilTree $tree, ilDB $db, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ)
isValidRequestOnBrokenQuestionSetDepencies($nextClass, $cmd)
$questionAmountConfigurationMode
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...