本文整理汇总了PHP中ilObjTest::getAvailableQuestionpools方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjTest::getAvailableQuestionpools方法的具体用法?PHP ilObjTest::getAvailableQuestionpools怎么用?PHP ilObjTest::getAvailableQuestionpools使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjTest
的用法示例。
在下文中一共展示了ilObjTest::getAvailableQuestionpools方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: build
public function build()
{
$availablePools = $this->testOBJ->getAvailableQuestionpools(true, $this->questionSetConfig->arePoolsWithHomogeneousScoredQuestionsRequired(), false, true, true);
require_once 'Services/Form/classes/class.ilSelectInputGUI.php';
$poolSelection = new ilSelectInputGUI(null, 'quest_pool_id');
$poolSelection->setOptions($this->buildSourcePoolSelectOptionsArray($availablePools));
$this->addInputItem($poolSelection, true);
$this->setFormAction($this->ctrl->getFormAction($this->questionSetConfigGUI));
$this->addFormButton($this->lng->txt('tst_rnd_quest_set_tb_add_pool_btn'), ilTestRandomQuestionSetConfigGUI::CMD_SHOW_CREATE_SRC_POOL_DEF_FORM);
}
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:10,代码来源:class.ilTestRandomQuestionSetSourcePoolDefinitionListToolbarGUI.php
示例2: buildForm
/**
* builds the question set config form and initialises the fields
* with the config currently saved in database
*
* @return ilPropertyFormGUI $form
*/
private function buildForm()
{
$this->questionSetConfig->loadFromDb($this->testOBJ->getTestId());
require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setId("tst_form_dynamic_question_set_config");
$form->setTitle($this->lng->txt('tst_form_dynamic_question_set_config'));
$form->setTableWidth("100%");
$hiddenInputTaxSelectOptAsyncUrl = new ilHiddenInputGUI('taxSelectOptAsyncUrl');
$hiddenInputTaxSelectOptAsyncUrl->setValue($this->ctrl->getLinkTarget($this, self::CMD_GET_TAXONOMY_OPTIONS_ASYNC, '', true));
$form->addItem($hiddenInputTaxSelectOptAsyncUrl);
if ($this->testOBJ->participantDataExist()) {
$pool = new ilNonEditableValueGUI($this->lng->txt('tst_input_dynamic_question_set_source_questionpool'), 'source_qpl_title');
$pool->setValue($this->questionSetConfig->getSourceQuestionPoolSummaryString($this->lng, $this->tree));
$pool->setDisabled(true);
$form->addItem($pool);
} else {
$poolInput = new ilSelectInputGUI($this->lng->txt('tst_input_dynamic_question_set_source_questionpool'), 'source_qpl_id');
$poolInput->setOptions($this->buildQuestionPoolSelectInputOptionArray($this->testOBJ->getAvailableQuestionpools(true, false, false, true, true)));
$poolInput->setValue($this->questionSetConfig->getSourceQuestionPoolId());
$poolInput->setRequired(true);
$form->addItem($poolInput);
}
$questionOderingInput = new ilRadioGroupInputGUI($this->lng->txt('tst_input_dynamic_question_set_question_ordering'), 'question_ordering');
$questionOderingInput->setValue($this->questionSetConfig->getOrderingTaxonomyId() ? self::QUESTION_ORDERING_TYPE_TAXONOMY : self::QUESTION_ORDERING_TYPE_UPDATE_DATE);
$optionOrderByDate = new ilRadioOption($this->lng->txt('tst_input_dynamic_question_set_question_ordering_by_date'), self::QUESTION_ORDERING_TYPE_UPDATE_DATE, $this->lng->txt('tst_inp_dyn_quest_set_quest_ordering_by_date_desc'));
$questionOderingInput->addOption($optionOrderByDate);
$optionOrderByTax = new ilRadioOption($this->lng->txt('tst_input_dynamic_question_set_question_ordering_by_tax'), self::QUESTION_ORDERING_TYPE_TAXONOMY, $this->lng->txt('tst_inp_dyn_quest_set_quest_ordering_by_tax_desc'));
$orderTaxInput = new ilSelectInputGUI($this->lng->txt('tst_input_dynamic_question_set_ordering_tax'), 'ordering_tax');
$orderTaxInput->setInfo($this->lng->txt('tst_input_dynamic_question_set_ordering_tax_description'));
$orderTaxInput->setValue($this->questionSetConfig->getOrderingTaxonomyId());
$orderTaxInput->setRequired(true);
$orderTaxInput->setOptions($this->buildTaxonomySelectInputOptionArray($this->questionSetConfig->getSourceQuestionPoolId()));
$optionOrderByTax->addSubItem($orderTaxInput);
$questionOderingInput->addOption($optionOrderByTax);
$form->addItem($questionOderingInput);
$taxFilterInput = new ilCheckboxInputGUI($this->lng->txt('tst_input_dynamic_question_set_taxonomie_filter_enabled'), 'tax_filter_enabled');
$taxFilterInput->setValue(1);
$taxFilterInput->setChecked($this->questionSetConfig->isTaxonomyFilterEnabled());
$form->addItem($taxFilterInput);
$answStatusFilterInput = new ilCheckboxInputGUI($this->lng->txt('tst_input_dyn_quest_set_answer_status_filter_enabled'), 'answer_status_filter_enabled');
$answStatusFilterInput->setValue(1);
$answStatusFilterInput->setChecked($this->questionSetConfig->isAnswerStatusFilterEnabled());
$form->addItem($answStatusFilterInput);
$previousQuestionsListInput = new ilCheckboxInputGUI($this->lng->txt('tst_input_dyn_quest_set_prev_quest_list_enabled'), 'prev_quest_list_enabled');
$previousQuestionsListInput->setValue(1);
$previousQuestionsListInput->setChecked($this->questionSetConfig->isPreviousQuestionsListEnabled());
$form->addItem($previousQuestionsListInput);
if ($this->testOBJ->participantDataExist()) {
$questionOderingInput->setDisabled(true);
$taxFilterInput->setDisabled(true);
$answStatusFilterInput->setDisabled(true);
$previousQuestionsListInput->setDisabled(true);
} else {
$form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt('save'));
}
return $form;
}
示例3: getSourcePoolDefinitionByAvailableQuestionPoolId
private function getSourcePoolDefinitionByAvailableQuestionPoolId($poolId)
{
$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';
throw new ilTestQuestionPoolNotAvailableAsSourcePoolException();
}
示例4: createQuestionpoolTargetObject
/**
* Called when a new question should be created from a test
* Important: $cmd may be overwritten if no question pool is available
*
* @access public
*/
function createQuestionpoolTargetObject($cmd)
{
global $ilUser, $ilTabs;
$this->getQuestionsSubTabs();
$ilTabs->activateSubTab('edit_test_questions');
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_qpl_select_copy.html", "Modules/Test");
$questionpools =& $this->object->getAvailableQuestionpools(FALSE, FALSE, FALSE, TRUE, FALSE, "write");
if (count($questionpools) == 0) {
$this->tpl->setCurrentBlock("option");
$this->tpl->setVariable("VALUE_QPL", "");
$this->tpl->parseCurrentBlock();
} else {
foreach ($questionpools as $key => $value) {
$this->tpl->setCurrentBlock("option");
$this->tpl->setVariable("VALUE_OPTION", $key);
$this->tpl->setVariable("TEXT_OPTION", $value["title"]);
$this->tpl->parseCurrentBlock();
}
}
if (isset($_REQUEST['q_id']) && is_array($_REQUEST['q_id'])) {
foreach ($_REQUEST['q_id'] as $id) {
$this->tpl->setCurrentBlock("hidden");
$this->tpl->setVariable("HIDDEN_NAME", "q_id[]");
$this->tpl->setVariable("HIDDEN_VALUE", $id);
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("adm_content");
}
}
$this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
if (count($questionpools) == 0) {
$this->tpl->setVariable("TXT_QPL_SELECT", $this->lng->txt("tst_enter_questionpool"));
$cmd = 'createQuestionPoolAndCopy';
} else {
$this->tpl->setVariable("TXT_QPL_SELECT", $this->lng->txt("tst_select_questionpool"));
}
$this->tpl->setVariable("CMD_SUBMIT", $cmd);
$this->tpl->setVariable("BTN_SUBMIT", $this->lng->txt("submit"));
$this->tpl->setVariable("BTN_CANCEL", $this->lng->txt("cancel"));
$createForm = $this->getQuestionpoolCreationForm();
switch ($cmd) {
case 'copyAndLinkQuestionsToPool':
$hidden = new ilHiddenInputGUI('link');
$hidden->setValue(1);
$createForm->addItem($hidden);
break;
case 'copyQuestionsToPool':
break;
}
$createForm->setFormAction($this->ctrl->getFormAction($this));
$this->tpl->parseCurrentBlock();
}