ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTestRandomQuestionSetConfigGUI Class Reference
+ Collaboration diagram for ilTestRandomQuestionSetConfigGUI:

Public Member Functions

 __construct (ilCtrl $ctrl, ilAccessHandler $access, ilTabsGUI $tabs, ilLanguage $lng, ilTemplate $tpl, ilDB $db, ilTree $tree, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ)
 executeCommand ()

Data Fields

const CMD_SHOW_GENERAL_CONFIG_FORM = 'showGeneralConfigForm'
const CMD_SAVE_GENERAL_CONFIG_FORM = 'saveGeneralConfigForm'
const CMD_SHOW_SRC_POOL_DEF_LIST = 'showSourcePoolDefinitionList'
const CMD_SAVE_SRC_POOL_DEF_LIST = 'saveSourcePoolDefinitionList'
const CMD_DELETE_SINGLE_SRC_POOL_DEF = 'deleteSingleSourcePoolDefinition'
const CMD_DELETE_MULTI_SRC_POOL_DEFS = 'deleteMultipleSourcePoolDefinitions'
const CMD_SHOW_CREATE_SRC_POOL_DEF_FORM = 'showCreateSourcePoolDefinitionForm'
const CMD_SAVE_CREATE_SRC_POOL_DEF_FORM = 'saveCreateSourcePoolDefinitionForm'
const CMD_SAVE_AND_NEW_CREATE_SRC_POOL_DEF_FORM = 'saveCreateAndNewSourcePoolDefinitionForm'
const CMD_SHOW_EDIT_SRC_POOL_DEF_FORM = 'showEditSourcePoolDefinitionForm'
const CMD_SAVE_EDIT_SRC_POOL_DEF_FORM = 'saveEditSourcePoolDefinitionForm'
const CMD_BUILD_QUESTION_STAGE = 'buildQuestionStage'
const HTTP_PARAM_AFTER_REBUILD_QUESTION_STAGE_CMD = 'afterRebuildQuestionStageCmd'
 $ctrl = null
 $access = null
 $tabs = null
 $lng = null
 $tpl = null
 $db = null
 $tree = null
 $pluginAdmin = null
 $testOBJ = null

Protected Attributes

 $questionSetConfig = null
 $sourcePoolDefinitionFactory = null
 $sourcePoolDefinitionList = null
 $stagingPool = null

Private Member Functions

 isAvoidManipulationRedirectRequired ()
 isManipulationCommand ()
 handleTabs ()
 buildQuestionStageCmd ()
 fetchAfterRebuildQuestionStageCmdParameter ()
 showGeneralConfigFormCmd (ilTestRandomQuestionSetGeneralConfigFormGUI $form=null)
 saveGeneralConfigFormCmd ()
 buildGeneralConfigFormGUI ()
 showSourcePoolDefinitionListCmd ()
 saveSourcePoolDefinitionListCmd ()
 buildSourcePoolDefinitionListToolbarGUI ()
 buildSourcePoolDefinitionListTableGUI ()
 deleteSingleSourcePoolDefinitionCmd ()
 deleteMultipleSourcePoolDefinitionsCmd ()
 deleteSourcePoolDefinitions ($definitionIds)
 showCreateSourcePoolDefinitionFormCmd (ilTestRandomQuestionSetPoolDefinitionFormGUI $form=null)
 saveCreateAndNewSourcePoolDefinitionFormCmd ()
 saveCreateSourcePoolDefinitionFormCmd ($redirect_back_to_form=false)
 buildCreateSourcePoolDefinitionFormGUI ()
 showEditSourcePoolDefinitionFormCmd (ilTestRandomQuestionSetPoolDefinitionFormGUI $form=null)
 saveEditSourcePoolDefinitionFormCmd ()
 buildEditSourcePoolDefinitionFormGUI ()
 fetchQuestionPoolIdParameter ()
 fetchSingleSourcePoolDefinitionIdParameter ()
 fetchMultiSourcePoolDefinitionIdsParameter ()
 getSourcePoolDefinitionByAvailableQuestionPoolId ($poolId)
 handleConfigurationStateMessages ($currentRequestCmd)
 buildQuestionStageRebuildLink ($afterRebuildQuestionStageCmd)
 buildGeneralConfigSubTabLink ()
 buildQuestionSelectionSubTabLink ()
 isNoAvailableQuestionPoolsHintRequired ($currentRequestCmd)
 isQuestionAmountConfigPerPoolHintRequired ($currentRequestCmd)
 isQuestionAmountConfigPerTestHintRequired ($currentRequestCmd)

Detailed Description

Definition at line 24 of file class.ilTestRandomQuestionSetConfigGUI.php.

Constructor & Destructor Documentation

ilTestRandomQuestionSetConfigGUI::__construct ( ilCtrl  $ctrl,
ilAccessHandler  $access,
ilTabsGUI  $tabs,
ilLanguage  $lng,
ilTemplate  $tpl,
ilDB  $db,
ilTree  $tree,
ilPluginAdmin  $pluginAdmin,
ilObjTest  $testOBJ 
)

Definition at line 105 of file class.ilTestRandomQuestionSetConfigGUI.php.

References $access, $ctrl, $db, $lng, $pluginAdmin, $tabs, $testOBJ, $tpl, and $tree.

{
$this->ctrl = $ctrl;
$this->access = $access;
$this->tabs = $tabs;
$this->lng = $lng;
$this->tpl = $tpl;
$this->db = $db;
$this->tree = $tree;
$this->pluginAdmin = $pluginAdmin;
$this->testOBJ = $testOBJ;
$this->questionSetConfig = new ilTestRandomQuestionSetConfig(
$this->tree, $this->db, $this->pluginAdmin, $this->testOBJ
);
$this->sourcePoolDefinitionFactory = new ilTestRandomQuestionSetSourcePoolDefinitionFactory(
$this->db, $this->testOBJ
);
$this->sourcePoolDefinitionList = new ilTestRandomQuestionSetSourcePoolDefinitionList(
$this->db, $this->testOBJ, $this->sourcePoolDefinitionFactory
);
$this->db, $this->testOBJ
);
}

Member Function Documentation

ilTestRandomQuestionSetConfigGUI::buildCreateSourcePoolDefinitionFormGUI ( )
private

Definition at line 535 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by saveCreateSourcePoolDefinitionFormCmd(), and showCreateSourcePoolDefinitionFormCmd().

{
require_once 'Modules/Test/classes/forms/class.ilTestRandomQuestionSetPoolDefinitionFormGUI.php';
$this->ctrl, $this->lng, $this->testOBJ, $this, $this->questionSetConfig
);
$form->setSaveCommand(self::CMD_SAVE_CREATE_SRC_POOL_DEF_FORM);
$form->setSaveAndNewCommand(self::CMD_SAVE_AND_NEW_CREATE_SRC_POOL_DEF_FORM);
return $form;
}

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::buildEditSourcePoolDefinitionFormGUI ( )
private

Definition at line 603 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by saveEditSourcePoolDefinitionFormCmd(), and showEditSourcePoolDefinitionFormCmd().

{
require_once 'Modules/Test/classes/forms/class.ilTestRandomQuestionSetPoolDefinitionFormGUI.php';
$this->ctrl, $this->lng, $this->testOBJ, $this, $this->questionSetConfig
);
$form->setSaveCommand(self::CMD_SAVE_EDIT_SRC_POOL_DEF_FORM);
return $form;
}

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::buildGeneralConfigFormGUI ( )
private

Definition at line 321 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by saveGeneralConfigFormCmd(), and showGeneralConfigFormCmd().

{
require_once 'Modules/Test/classes/forms/class.ilTestRandomQuestionSetGeneralConfigFormGUI.php';
$this->ctrl, $this->lng, $this->testOBJ, $this, $this->questionSetConfig
);
$form->build();
return $form;
}

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::buildGeneralConfigSubTabLink ( )
private

Definition at line 762 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by handleConfigurationStateMessages().

{
$href = $this->ctrl->getLinkTarget($this, self::CMD_SHOW_GENERAL_CONFIG_FORM);
$label = $this->lng->txt('tst_rnd_quest_cfg_tab_general');
return "<a href=\"{$href}\">{$label}</a>";
}

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::buildQuestionSelectionSubTabLink ( )
private

Definition at line 770 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by handleConfigurationStateMessages().

{
$href = $this->ctrl->getLinkTarget($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
$label = $this->lng->txt('tst_rnd_quest_cfg_tab_pool');
return "<a href=\"{$href}\">{$label}</a>";
}

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::buildQuestionStageCmd ( )
private

Definition at line 248 of file class.ilTestRandomQuestionSetConfigGUI.php.

References fetchAfterRebuildQuestionStageCmdParameter(), and ilUtil\sendSuccess().

{
$this->sourcePoolDefinitionList->loadDefinitions();
$this->stagingPool->rebuild( $this->sourcePoolDefinitionList );
$this->sourcePoolDefinitionList->saveDefinitions();
$this->questionSetConfig->loadFromDb();
$this->questionSetConfig->setLastQuestionSyncTimestamp(time());
$this->questionSetConfig->saveToDb();
$this->testOBJ->saveCompleteStatus( $this->questionSetConfig );
ilUtil::sendSuccess($this->lng->txt("tst_msg_random_question_set_synced"), true);
$this->ctrl->redirect($this, $this->fetchAfterRebuildQuestionStageCmdParameter());
}

+ Here is the call graph for this function:

ilTestRandomQuestionSetConfigGUI::buildQuestionStageRebuildLink (   $afterRebuildQuestionStageCmd)
private
Parameters
$afterRebuildQuestionStageCmd
Returns
string

Definition at line 750 of file class.ilTestRandomQuestionSetConfigGUI.php.

{
$this->ctrl->setParameter(
$this, self::HTTP_PARAM_AFTER_REBUILD_QUESTION_STAGE_CMD, $afterRebuildQuestionStageCmd
);
$href = $this->ctrl->getLinkTarget($this, self::CMD_BUILD_QUESTION_STAGE);
$label = $this->lng->txt('tst_btn_rebuild_random_question_stage');
return "<a href=\"{$href}\">{$label}</a>";
}
ilTestRandomQuestionSetConfigGUI::buildSourcePoolDefinitionListTableGUI ( )
private

Definition at line 394 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by saveSourcePoolDefinitionListCmd(), and showSourcePoolDefinitionListCmd().

{
require_once 'Modules/Test/classes/tables/class.ilTestRandomQuestionSetSourcePoolDefinitionListTableGUI.php';
$this->ctrl, $this->lng, $this, self::CMD_SHOW_SRC_POOL_DEF_LIST
);
if( !$this->testOBJ->participantDataExist() )
{
$table->setDefinitionEditModeEnabled(true);
}
$table->setQuestionAmountColumnEnabled(
$this->questionSetConfig->isQuestionAmountConfigurationModePerPool()
);
require_once 'Modules/Test/classes/class.ilTestTaxonomyFilterLabelTranslater.php';
$translater = new ilTestTaxonomyFilterLabelTranslater($this->db);
$translater->loadLabels($this->sourcePoolDefinitionList);
$table->setTaxonomyFilterLabelTranslater($translater);
$table->build();
return $table;
}

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::buildSourcePoolDefinitionListToolbarGUI ( )
private

Definition at line 381 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by showSourcePoolDefinitionListCmd().

{
require_once 'Modules/Test/classes/toolbars/class.ilTestRandomQuestionSetSourcePoolDefinitionListToolbarGUI.php';
$this->ctrl, $this->lng, $this, $this->questionSetConfig
);
$toolbar->build();
return $toolbar;
}

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::deleteMultipleSourcePoolDefinitionsCmd ( )
private

Definition at line 430 of file class.ilTestRandomQuestionSetConfigGUI.php.

References deleteSourcePoolDefinitions(), fetchMultiSourcePoolDefinitionIdsParameter(), and ilUtil\sendSuccess().

{
$definitionIds = $this->fetchMultiSourcePoolDefinitionIdsParameter();
$this->deleteSourcePoolDefinitions( $definitionIds );
ilUtil::sendSuccess($this->lng->txt("tst_msg_source_pool_definitions_deleted"), true);
$this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
}

+ Here is the call graph for this function:

ilTestRandomQuestionSetConfigGUI::deleteSingleSourcePoolDefinitionCmd ( )
private

Definition at line 421 of file class.ilTestRandomQuestionSetConfigGUI.php.

References deleteSourcePoolDefinitions(), fetchSingleSourcePoolDefinitionIdParameter(), and ilUtil\sendSuccess().

{
$this->deleteSourcePoolDefinitions( array($definitionId) );
ilUtil::sendSuccess($this->lng->txt("tst_msg_source_pool_definitions_deleted"), true);
$this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
}

+ Here is the call graph for this function:

ilTestRandomQuestionSetConfigGUI::deleteSourcePoolDefinitions (   $definitionIds)
private

Definition at line 439 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by deleteMultipleSourcePoolDefinitionsCmd(), and deleteSingleSourcePoolDefinitionCmd().

{
foreach($definitionIds as $definitionId)
{
$definition = $this->sourcePoolDefinitionFactory->getSourcePoolDefinitionByDefinitionId($definitionId);
$definition->deleteFromDb();
}
$this->sourcePoolDefinitionList->loadDefinitions();
$this->sourcePoolDefinitionList->reindexPositions();
$this->sourcePoolDefinitionList->saveDefinitions();
$this->sourcePoolDefinitionList->loadDefinitions();
$this->stagingPool->rebuild( $this->sourcePoolDefinitionList );
$this->sourcePoolDefinitionList->saveDefinitions();
$this->questionSetConfig->setLastQuestionSyncTimestamp(time());
$this->questionSetConfig->saveToDb();
$this->testOBJ->saveCompleteStatus( $this->questionSetConfig );
}

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::executeCommand ( )

Definition at line 138 of file class.ilTestRandomQuestionSetConfigGUI.php.

References $cmd, handleTabs(), isAvoidManipulationRedirectRequired(), and ilUtil\sendFailure().

{
if (!$this->access->checkAccess("write", "", $this->testOBJ->getRefId()))
{
ilUtil::sendFailure($this->lng->txt("cannot_edit_test"), true);
$this->ctrl->redirectByClass('ilObjTestGUI', "infoScreen");
}
{
ilUtil::sendFailure($this->lng->txt("tst_msg_cannot_modify_random_question_set_conf_due_to_part"), true);
$this->ctrl->redirect($this);
}
$this->handleTabs();
$nextClass = $this->ctrl->getNextClass();
switch($nextClass)
{
case 'ilTestRandomQuestionSetPoolDefinitionFormGUI':
$this->ctrl, $this->lng, $this->testOBJ, $this, $this->questionSetConfig
);
$this->ctrl->forwardCommand($formGUI);
break;
default:
$cmd = $this->ctrl->getCmd(self::CMD_SHOW_GENERAL_CONFIG_FORM).'Cmd';
$this->$cmd();
}
}

+ Here is the call graph for this function:

ilTestRandomQuestionSetConfigGUI::fetchAfterRebuildQuestionStageCmdParameter ( )
private

Definition at line 264 of file class.ilTestRandomQuestionSetConfigGUI.php.

References $_GET, CMD_SHOW_GENERAL_CONFIG_FORM, and HTTP_PARAM_AFTER_REBUILD_QUESTION_STAGE_CMD.

Referenced by buildQuestionStageCmd().

{
if( !isset($_GET[self::HTTP_PARAM_AFTER_REBUILD_QUESTION_STAGE_CMD]) )
{
}
if( !strlen($_GET[self::HTTP_PARAM_AFTER_REBUILD_QUESTION_STAGE_CMD]) )
{
}
}

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::fetchMultiSourcePoolDefinitionIdsParameter ( )
private

Definition at line 648 of file class.ilTestRandomQuestionSetConfigGUI.php.

References $_POST.

Referenced by deleteMultipleSourcePoolDefinitionsCmd().

{
if( !isset($_POST['src_pool_def_ids']) || !is_array($_POST['src_pool_def_ids']) )
{
require_once 'Modules/Test/exceptions/class.ilTestMissingSourcePoolDefinitionParameterException.php';
}
$definitionIds = array();
foreach($_POST['src_pool_def_ids'] as $definitionId)
{
$definitionId = (int)$definitionId;
if( !$definitionId )
{
require_once 'Modules/Test/exceptions/class.ilTestMissingSourcePoolDefinitionParameterException.php';
}
$definitionIds[] = $definitionId;
}
return $definitionIds;
}

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::fetchQuestionPoolIdParameter ( )
private

Definition at line 616 of file class.ilTestRandomQuestionSetConfigGUI.php.

References $_GET, and $_POST.

Referenced by saveCreateSourcePoolDefinitionFormCmd(), and showCreateSourcePoolDefinitionFormCmd().

{
if( isset($_POST['quest_pool_id']) && (int)$_POST['quest_pool_id'] )
{
return (int)$_POST['quest_pool_id'];
}
if( isset($_GET['quest_pool_id']) && (int)$_GET['quest_pool_id'] )
{
return (int)$_GET['quest_pool_id'];
}
require_once 'Modules/Test/exceptions/class.ilTestMissingQuestionPoolIdParameterException.php';
}

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::fetchSingleSourcePoolDefinitionIdParameter ( )
private

Definition at line 632 of file class.ilTestRandomQuestionSetConfigGUI.php.

References $_GET, and $_POST.

Referenced by deleteSingleSourcePoolDefinitionCmd(), saveEditSourcePoolDefinitionFormCmd(), and showEditSourcePoolDefinitionFormCmd().

{
if( isset($_POST['src_pool_def_id']) && (int)$_POST['src_pool_def_id'] )
{
return (int)$_POST['src_pool_def_id'];
}
if( isset($_GET['src_pool_def_id']) && (int)$_GET['src_pool_def_id'] )
{
return (int)$_GET['src_pool_def_id'];
}
require_once 'Modules/Test/exceptions/class.ilTestMissingSourcePoolDefinitionParameterException.php';
}

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::getSourcePoolDefinitionByAvailableQuestionPoolId (   $poolId)
private

Definition at line 674 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by saveCreateSourcePoolDefinitionFormCmd(), and showCreateSourcePoolDefinitionFormCmd().

{
$availablePools = $this->testOBJ->getAvailableQuestionpools(
true, $this->questionSetConfig->arePoolsWithHomogeneousScoredQuestionsRequired(), false, true, true
);
if( isset($availablePools[$poolId]) )
{
$originalPoolData = $availablePools[$poolId];
$originalPoolData['qpl_path'] = $this->questionSetConfig->getQuestionPoolPathString($poolId);
return $this->sourcePoolDefinitionFactory->getSourcePoolDefinitionByOriginalPoolData($originalPoolData);
}
require_once 'Modules/Test/exceptions/class.ilTestQuestionPoolNotAvailableAsSourcePoolException.php';
}

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::handleConfigurationStateMessages (   $currentRequestCmd)
private

Definition at line 693 of file class.ilTestRandomQuestionSetConfigGUI.php.

References buildGeneralConfigSubTabLink(), buildQuestionSelectionSubTabLink(), ilDatePresentation\formatDate(), IL_CAL_UNIX, isNoAvailableQuestionPoolsHintRequired(), isQuestionAmountConfigPerPoolHintRequired(), isQuestionAmountConfigPerTestHintRequired(), and ilUtil\sendInfo().

Referenced by showGeneralConfigFormCmd(), and showSourcePoolDefinitionListCmd().

{
if( !$this->questionSetConfig->isQuestionAmountConfigComplete() )
{
$infoMessage = $this->lng->txt('tst_msg_rand_quest_set_incomplete_quest_amount_cfg');
if( $this->isQuestionAmountConfigPerTestHintRequired($currentRequestCmd) )
{
$infoMessage .= '<br />'.sprintf(
$this->lng->txt('tst_msg_rand_quest_set_change_quest_amount_here'),
);
}
elseif( $this->isQuestionAmountConfigPerPoolHintRequired($currentRequestCmd) )
{
$infoMessage .= '<br />'.sprintf(
$this->lng->txt('tst_msg_rand_quest_set_change_quest_amount_here'),
);
}
}
elseif( !$this->questionSetConfig->hasSourcePoolDefinitions() )
{
$infoMessage = $this->lng->txt('tst_msg_rand_quest_set_no_src_pool_defs');
}
elseif( !$this->questionSetConfig->isQuestionSetBuildable() )
{
$infoMessage = $this->lng->txt('tst_msg_rand_quest_set_pass_not_buildable');
}
else
{
$syncDate = new ilDateTime(
$this->questionSetConfig->getLastQuestionSyncTimestamp(), IL_CAL_UNIX
);
$infoMessage = sprintf(
$this->lng->txt('tst_msg_rand_quest_set_stage_pool_last_sync'), ilDatePresentation::formatDate($syncDate)
);
if( !$this->testOBJ->participantDataExist() )
{
$infoMessage .= "<br />{$this->buildQuestionStageRebuildLink($currentRequestCmd)}";
}
}
if( $this->isNoAvailableQuestionPoolsHintRequired($currentRequestCmd) )
{
$infoMessage .= '<br />'.$this->lng->txt('tst_msg_rand_quest_set_no_pools_available');
}
ilUtil::sendInfo($infoMessage);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::handleTabs ( )
private

Definition at line 210 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by executeCommand().

{
$this->tabs->activateTab('assQuestions');
$this->tabs->addSubTab(
'tstRandQuestSetGeneralConfig',
$this->lng->txt('tst_rnd_quest_cfg_tab_general'),
$this->ctrl->getLinkTarget($this, self::CMD_SHOW_GENERAL_CONFIG_FORM)
);
$this->tabs->addSubTab(
'tstRandQuestSetPoolConfig',
$this->lng->txt('tst_rnd_quest_cfg_tab_pool'),
$this->ctrl->getLinkTarget($this, self::CMD_SHOW_SRC_POOL_DEF_LIST)
);
switch( $this->ctrl->getCmd(self::CMD_SHOW_GENERAL_CONFIG_FORM) )
{
case self::CMD_SHOW_GENERAL_CONFIG_FORM:
case self::CMD_SAVE_GENERAL_CONFIG_FORM:
$this->tabs->activateSubTab('tstRandQuestSetGeneralConfig');
break;
case self::CMD_SHOW_SRC_POOL_DEF_LIST:
case self::CMD_SAVE_SRC_POOL_DEF_LIST:
case self::CMD_DELETE_SINGLE_SRC_POOL_DEF:
case self::CMD_DELETE_MULTI_SRC_POOL_DEFS:
case self::CMD_SHOW_CREATE_SRC_POOL_DEF_FORM:
case self::CMD_SAVE_CREATE_SRC_POOL_DEF_FORM:
case self::CMD_SHOW_EDIT_SRC_POOL_DEF_FORM:
case self::CMD_SAVE_EDIT_SRC_POOL_DEF_FORM:
$this->tabs->activateSubTab('tstRandQuestSetPoolConfig');
break;
}
}

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::isAvoidManipulationRedirectRequired ( )
private

Definition at line 176 of file class.ilTestRandomQuestionSetConfigGUI.php.

References isManipulationCommand().

Referenced by executeCommand().

{
if( !$this->testOBJ->participantDataExist() )
{
return false;
}
if( !$this->isManipulationCommand() )
{
return false;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::isManipulationCommand ( )
private

Definition at line 191 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by isAvoidManipulationRedirectRequired().

{
switch( $this->ctrl->getCmd(self::CMD_SHOW_GENERAL_CONFIG_FORM) )
{
case self::CMD_SAVE_GENERAL_CONFIG_FORM:
case self::CMD_SAVE_SRC_POOL_DEF_LIST:
case self::CMD_DELETE_SINGLE_SRC_POOL_DEF:
case self::CMD_DELETE_MULTI_SRC_POOL_DEFS:
case self::CMD_SAVE_CREATE_SRC_POOL_DEF_FORM:
case self::CMD_SAVE_EDIT_SRC_POOL_DEF_FORM:
case self::CMD_SAVE_AND_NEW_CREATE_SRC_POOL_DEF_FORM:
case self::CMD_BUILD_QUESTION_STAGE:
return true;
}
return false;
}

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::isNoAvailableQuestionPoolsHintRequired (   $currentRequestCmd)
private
Parameters
$currentRequestCmd
Returns
bool

Definition at line 782 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by handleConfigurationStateMessages().

{
if( $currentRequestCmd != self::CMD_SHOW_SRC_POOL_DEF_LIST )
{
return false;
}
if( $this->questionSetConfig->doesSelectableQuestionPoolsExist() )
{
return false;
}
return true;
}

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::isQuestionAmountConfigPerPoolHintRequired (   $currentRequestCmd)
private
Parameters
$currentRequestCmd
Returns
bool

Definition at line 801 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by handleConfigurationStateMessages().

{
if( $currentRequestCmd != self::CMD_SHOW_GENERAL_CONFIG_FORM )
{
return false;
}
if( !$this->questionSetConfig->isQuestionAmountConfigurationModePerPool() )
{
return false;
}
return true;
}

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::isQuestionAmountConfigPerTestHintRequired (   $currentRequestCmd)
private
Parameters
$currentRequestCmd
Returns
bool

Definition at line 820 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by handleConfigurationStateMessages().

{
if( $currentRequestCmd != self::CMD_SHOW_SRC_POOL_DEF_LIST )
{
return false;
}
if( !$this->questionSetConfig->isQuestionAmountConfigurationModePerTest() )
{
return false;
}
return true;
}

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::saveCreateAndNewSourcePoolDefinitionFormCmd ( )
private

Definition at line 479 of file class.ilTestRandomQuestionSetConfigGUI.php.

References saveCreateSourcePoolDefinitionFormCmd().

+ Here is the call graph for this function:

ilTestRandomQuestionSetConfigGUI::saveCreateSourcePoolDefinitionFormCmd (   $redirect_back_to_form = false)
private
Parameters
bool$redirect_back_to_form

Definition at line 487 of file class.ilTestRandomQuestionSetConfigGUI.php.

References $errors, buildCreateSourcePoolDefinitionFormGUI(), fetchQuestionPoolIdParameter(), getSourcePoolDefinitionByAvailableQuestionPoolId(), ilObjTaxonomy\getUsageOfObject(), ilUtil\sendSuccess(), and showCreateSourcePoolDefinitionFormCmd().

Referenced by saveCreateAndNewSourcePoolDefinitionFormCmd().

{
$this->questionSetConfig->loadFromDb();
$poolId = $this->fetchQuestionPoolIdParameter();
$sourcePoolDefinition = $this->getSourcePoolDefinitionByAvailableQuestionPoolId($poolId);
$availableTaxonomyIds = ilObjTaxonomy::getUsageOfObject($sourcePoolDefinition->getPoolId());
$form->build($sourcePoolDefinition, $availableTaxonomyIds);
$errors = !$form->checkInput(); // ALWAYS CALL BEFORE setValuesByPost()
$form->setValuesByPost(); // NEVER CALL THIS BEFORE checkInput()
if($errors)
{
}
$form->applySubmit( $sourcePoolDefinition, $availableTaxonomyIds );
$this->sourcePoolDefinitionList->loadDefinitions();
$sourcePoolDefinition->setSequencePosition( $this->sourcePoolDefinitionList->getNextPosition() );
$sourcePoolDefinition->saveToDb();
$this->sourcePoolDefinitionList->addDefinition($sourcePoolDefinition);
$this->stagingPool->rebuild( $this->sourcePoolDefinitionList );
$this->sourcePoolDefinitionList->saveDefinitions();
$this->questionSetConfig->setLastQuestionSyncTimestamp(time());
$this->questionSetConfig->saveToDb();
$this->testOBJ->saveCompleteStatus( $this->questionSetConfig );
if($redirect_back_to_form)
{
ilUtil::sendSuccess($this->lng->txt("tst_msg_random_qsc_modified_add_new_rule"), true);
$this->ctrl->setParameter($this, 'src_pool_def_id', $sourcePoolDefinition->getId());
$this->ctrl->setParameter($this, 'quest_pool_id', $sourcePoolDefinition->getPoolId());
$this->ctrl->redirect($this, self::CMD_SHOW_CREATE_SRC_POOL_DEF_FORM);
}
else
{
ilUtil::sendSuccess($this->lng->txt("tst_msg_random_question_set_config_modified"), true);
$this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::saveEditSourcePoolDefinitionFormCmd ( )
private

Definition at line 566 of file class.ilTestRandomQuestionSetConfigGUI.php.

References $errors, buildEditSourcePoolDefinitionFormGUI(), fetchSingleSourcePoolDefinitionIdParameter(), ilObjTaxonomy\getUsageOfObject(), ilUtil\sendSuccess(), and showSourcePoolDefinitionListCmd().

{
$this->questionSetConfig->loadFromDb();
$sourcePoolDefinition = $this->sourcePoolDefinitionFactory->getSourcePoolDefinitionByDefinitionId($defId);
$availableTaxonomyIds = ilObjTaxonomy::getUsageOfObject($sourcePoolDefinition->getPoolId());
$form->build($sourcePoolDefinition, $availableTaxonomyIds);
$errors = !$form->checkInput(); // ALWAYS CALL BEFORE setValuesByPost()
$form->setValuesByPost(); // NEVER CALL THIS BEFORE checkInput()
if($errors)
{
return $this->showSourcePoolDefinitionListCmd($form);
}
$form->applySubmit($sourcePoolDefinition, $availableTaxonomyIds);
$sourcePoolDefinition->saveToDb();
$this->sourcePoolDefinitionList->loadDefinitions();
$this->stagingPool->rebuild( $this->sourcePoolDefinitionList );
$this->questionSetConfig->setLastQuestionSyncTimestamp(time());
$this->questionSetConfig->saveToDb();
$this->sourcePoolDefinitionList->saveDefinitions();
$this->testOBJ->saveCompleteStatus( $this->questionSetConfig );
ilUtil::sendSuccess($this->lng->txt("tst_msg_random_question_set_config_modified"), true);
$this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
}

+ Here is the call graph for this function:

ilTestRandomQuestionSetConfigGUI::saveGeneralConfigFormCmd ( )
private

Definition at line 292 of file class.ilTestRandomQuestionSetConfigGUI.php.

References $errors, buildGeneralConfigFormGUI(), ilUtil\sendSuccess(), and showGeneralConfigFormCmd().

{
$this->questionSetConfig->loadFromDb();
$form = $this->buildGeneralConfigFormGUI();
$errors = !$form->checkInput(); // ALWAYS CALL BEFORE setValuesByPost()
$form->setValuesByPost(); // NEVER CALL THIS BEFORE checkInput()
if($errors)
{
return $this->showGeneralConfigFormCmd($form);
}
$form->save();
$this->sourcePoolDefinitionList->loadDefinitions();
$this->stagingPool->rebuild( $this->sourcePoolDefinitionList );
$this->sourcePoolDefinitionList->saveDefinitions();
$this->questionSetConfig->setLastQuestionSyncTimestamp(time());
$this->questionSetConfig->saveToDb();
$this->testOBJ->saveCompleteStatus( $this->questionSetConfig );
ilUtil::sendSuccess($this->lng->txt("tst_msg_random_question_set_config_modified"), true);
$this->ctrl->redirect($this, self::CMD_SHOW_GENERAL_CONFIG_FORM);
}

+ Here is the call graph for this function:

ilTestRandomQuestionSetConfigGUI::saveSourcePoolDefinitionListCmd ( )
private

Definition at line 356 of file class.ilTestRandomQuestionSetConfigGUI.php.

References buildSourcePoolDefinitionListTableGUI(), and ilUtil\sendSuccess().

{
$this->questionSetConfig->loadFromDb();
$this->sourcePoolDefinitionList->loadDefinitions();
$table->applySubmit($this->sourcePoolDefinitionList);
$this->sourcePoolDefinitionList->reindexPositions();
$this->sourcePoolDefinitionList->saveDefinitions();
$this->stagingPool->rebuild( $this->sourcePoolDefinitionList );
$this->sourcePoolDefinitionList->saveDefinitions();
$this->questionSetConfig->setLastQuestionSyncTimestamp(time());
$this->questionSetConfig->saveToDb();
$this->testOBJ->saveCompleteStatus( $this->questionSetConfig );
ilUtil::sendSuccess($this->lng->txt("tst_msg_random_question_set_config_modified"), true);
$this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
}

+ Here is the call graph for this function:

ilTestRandomQuestionSetConfigGUI::showCreateSourcePoolDefinitionFormCmd ( ilTestRandomQuestionSetPoolDefinitionFormGUI  $form = null)
private

Definition at line 461 of file class.ilTestRandomQuestionSetConfigGUI.php.

References buildCreateSourcePoolDefinitionFormGUI(), fetchQuestionPoolIdParameter(), getSourcePoolDefinitionByAvailableQuestionPoolId(), and ilObjTaxonomy\getUsageOfObject().

Referenced by saveCreateSourcePoolDefinitionFormCmd().

{
$this->questionSetConfig->loadFromDb();
$poolId = $this->fetchQuestionPoolIdParameter();
$sourcePoolDefinition = $this->getSourcePoolDefinitionByAvailableQuestionPoolId($poolId);
$availableTaxonomyIds = ilObjTaxonomy::getUsageOfObject($sourcePoolDefinition->getPoolId());
if($form === null)
{
$form->build($sourcePoolDefinition, $availableTaxonomyIds);
}
$this->tpl->setContent( $this->ctrl->getHTML($form) );
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::showEditSourcePoolDefinitionFormCmd ( ilTestRandomQuestionSetPoolDefinitionFormGUI  $form = null)
private

Definition at line 549 of file class.ilTestRandomQuestionSetConfigGUI.php.

References buildEditSourcePoolDefinitionFormGUI(), fetchSingleSourcePoolDefinitionIdParameter(), and ilObjTaxonomy\getUsageOfObject().

{
$this->questionSetConfig->loadFromDb();
$sourcePoolDefinition = $this->sourcePoolDefinitionFactory->getSourcePoolDefinitionByDefinitionId($defId);
$availableTaxonomyIds = ilObjTaxonomy::getUsageOfObject($sourcePoolDefinition->getPoolId());
if($form === null)
{
$form->build($sourcePoolDefinition, $availableTaxonomyIds);
}
$this->tpl->setContent( $this->ctrl->getHTML($form) );
}

+ Here is the call graph for this function:

ilTestRandomQuestionSetConfigGUI::showGeneralConfigFormCmd ( ilTestRandomQuestionSetGeneralConfigFormGUI  $form = null)
private

Definition at line 279 of file class.ilTestRandomQuestionSetConfigGUI.php.

References buildGeneralConfigFormGUI(), and handleConfigurationStateMessages().

Referenced by saveGeneralConfigFormCmd().

{
if($form === null)
{
$this->questionSetConfig->loadFromDb();
$form = $this->buildGeneralConfigFormGUI();
}
$this->tpl->setContent( $this->ctrl->getHTML($form) );
$this->handleConfigurationStateMessages(self::CMD_SHOW_GENERAL_CONFIG_FORM);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestRandomQuestionSetConfigGUI::showSourcePoolDefinitionListCmd ( )
private

Definition at line 334 of file class.ilTestRandomQuestionSetConfigGUI.php.

References buildSourcePoolDefinitionListTableGUI(), buildSourcePoolDefinitionListToolbarGUI(), and handleConfigurationStateMessages().

Referenced by saveEditSourcePoolDefinitionFormCmd().

{
$this->questionSetConfig->loadFromDb();
$this->sourcePoolDefinitionList->loadDefinitions();
$content = '';
if( !$this->testOBJ->participantDataExist() )
{
$content .= $this->ctrl->getHTML($toolbar);
}
$table->init( $this->sourcePoolDefinitionList);
$content .= $this->ctrl->getHTML($table);
$this->tpl->setContent($content);
$this->handleConfigurationStateMessages(self::CMD_SHOW_SRC_POOL_DEF_LIST);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilTestRandomQuestionSetConfigGUI::$access = null

Definition at line 48 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by __construct().

ilTestRandomQuestionSetConfigGUI::$ctrl = null

Definition at line 43 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by __construct().

ilTestRandomQuestionSetConfigGUI::$db = null

Definition at line 68 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by __construct().

ilTestRandomQuestionSetConfigGUI::$lng = null

Definition at line 58 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by __construct().

ilTestRandomQuestionSetConfigGUI::$pluginAdmin = null

Definition at line 78 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by __construct().

ilTestRandomQuestionSetConfigGUI::$questionSetConfig = null
protected

Definition at line 88 of file class.ilTestRandomQuestionSetConfigGUI.php.

ilTestRandomQuestionSetConfigGUI::$sourcePoolDefinitionFactory = null
protected

Definition at line 93 of file class.ilTestRandomQuestionSetConfigGUI.php.

ilTestRandomQuestionSetConfigGUI::$sourcePoolDefinitionList = null
protected

Definition at line 98 of file class.ilTestRandomQuestionSetConfigGUI.php.

ilTestRandomQuestionSetConfigGUI::$stagingPool = null
protected

Definition at line 103 of file class.ilTestRandomQuestionSetConfigGUI.php.

ilTestRandomQuestionSetConfigGUI::$tabs = null

Definition at line 53 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by __construct().

ilTestRandomQuestionSetConfigGUI::$testOBJ = null

Definition at line 83 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by __construct().

ilTestRandomQuestionSetConfigGUI::$tpl = null

Definition at line 63 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by __construct().

ilTestRandomQuestionSetConfigGUI::$tree = null

Definition at line 73 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by __construct().

const ilTestRandomQuestionSetConfigGUI::CMD_BUILD_QUESTION_STAGE = 'buildQuestionStage'

Definition at line 37 of file class.ilTestRandomQuestionSetConfigGUI.php.

const ilTestRandomQuestionSetConfigGUI::CMD_DELETE_MULTI_SRC_POOL_DEFS = 'deleteMultipleSourcePoolDefinitions'
const ilTestRandomQuestionSetConfigGUI::CMD_DELETE_SINGLE_SRC_POOL_DEF = 'deleteSingleSourcePoolDefinition'
const ilTestRandomQuestionSetConfigGUI::CMD_SAVE_AND_NEW_CREATE_SRC_POOL_DEF_FORM = 'saveCreateAndNewSourcePoolDefinitionForm'

Definition at line 34 of file class.ilTestRandomQuestionSetConfigGUI.php.

const ilTestRandomQuestionSetConfigGUI::CMD_SAVE_CREATE_SRC_POOL_DEF_FORM = 'saveCreateSourcePoolDefinitionForm'

Definition at line 33 of file class.ilTestRandomQuestionSetConfigGUI.php.

const ilTestRandomQuestionSetConfigGUI::CMD_SAVE_EDIT_SRC_POOL_DEF_FORM = 'saveEditSourcePoolDefinitionForm'

Definition at line 36 of file class.ilTestRandomQuestionSetConfigGUI.php.

const ilTestRandomQuestionSetConfigGUI::CMD_SAVE_GENERAL_CONFIG_FORM = 'saveGeneralConfigForm'
const ilTestRandomQuestionSetConfigGUI::CMD_SAVE_SRC_POOL_DEF_LIST = 'saveSourcePoolDefinitionList'
const ilTestRandomQuestionSetConfigGUI::CMD_SHOW_CREATE_SRC_POOL_DEF_FORM = 'showCreateSourcePoolDefinitionForm'
const ilTestRandomQuestionSetConfigGUI::CMD_SHOW_EDIT_SRC_POOL_DEF_FORM = 'showEditSourcePoolDefinitionForm'
const ilTestRandomQuestionSetConfigGUI::CMD_SHOW_GENERAL_CONFIG_FORM = 'showGeneralConfigForm'
const ilTestRandomQuestionSetConfigGUI::CMD_SHOW_SRC_POOL_DEF_LIST = 'showSourcePoolDefinitionList'
const ilTestRandomQuestionSetConfigGUI::HTTP_PARAM_AFTER_REBUILD_QUESTION_STAGE_CMD = 'afterRebuildQuestionStageCmd'

The documentation for this class was generated from the following file: