本文整理汇总了PHP中ilNumberInputGUI::allowDecimals方法的典型用法代码示例。如果您正苦于以下问题:PHP ilNumberInputGUI::allowDecimals方法的具体用法?PHP ilNumberInputGUI::allowDecimals怎么用?PHP ilNumberInputGUI::allowDecimals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilNumberInputGUI
的用法示例。
在下文中一共展示了ilNumberInputGUI::allowDecimals方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: build
public function build()
{
$this->setFormAction($this->ctrl->getFormAction($this->questionSetConfigGUI));
$this->setTitle($this->lng->txt('tst_rnd_quest_set_cfg_general_form'));
$this->setId('tstRndQuestSetCfgGeneralForm');
$this->addCommandButton(ilTestRandomQuestionSetConfigGUI::CMD_SAVE_GENERAL_CONFIG_FORM, $this->lng->txt('save'));
// Require Pools with Homogeneous Scored Questions
$requirePoolsQuestionsHomoScored = new ilCheckboxInputGUI($this->lng->txt('tst_inp_all_quest_points_equal_per_pool'), 'quest_points_equal_per_pool');
$requirePoolsQuestionsHomoScored->setInfo($this->lng->txt('tst_inp_all_quest_points_equal_per_pool_desc'));
$requirePoolsQuestionsHomoScored->setChecked($this->questionSetConfig->arePoolsWithHomogeneousScoredQuestionsRequired());
$this->addItem($requirePoolsQuestionsHomoScored);
// question amount config mode (per test / per pool)
$questionAmountConfigMode = new ilRadioGroupInputGUI($this->lng->txt('tst_inp_quest_amount_cfg_mode'), 'quest_amount_cfg_mode');
$questionAmountConfigMode->setValue($this->fetchValidQuestionAmountConfigModeWithFallbackModePerTest($this->questionSetConfig));
$questionAmountConfigModePerTest = new ilRadioOption($this->lng->txt('tst_inp_quest_amount_cfg_mode_test'), ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_TEST);
$questionAmountConfigMode->addOption($questionAmountConfigModePerTest);
$questionAmountConfigModePerPool = new ilRadioOption($this->lng->txt('tst_inp_quest_amount_cfg_mode_pool'), ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_POOL);
$questionAmountConfigMode->addOption($questionAmountConfigModePerPool);
$questionAmountConfigMode->setRequired(true);
$this->addItem($questionAmountConfigMode);
// question amount per test
$questionAmountPerTest = new ilNumberInputGUI($this->lng->txt('tst_inp_quest_amount_per_test'), 'quest_amount_per_test');
$questionAmountPerTest->setRequired(true);
$questionAmountPerTest->setMinValue(0);
$questionAmountPerTest->allowDecimals(false);
$questionAmountPerTest->setMinvalueShouldBeGreater(true);
$questionAmountPerTest->setSize(4);
$questionAmountPerTest->setValue($this->questionSetConfig->getQuestionAmountPerTest());
$questionAmountConfigModePerTest->addSubItem($questionAmountPerTest);
if ($this->testOBJ->participantDataExist()) {
$requirePoolsQuestionsHomoScored->setDisabled(true);
$questionAmountConfigMode->setDisabled(true);
$questionAmountPerTest->setDisabled(true);
}
}
示例2: fillRow
/**
* @param array $row
*/
public function fillRow(array $row)
{
$short_name = new ilTextInputGUI('', 'mark_short_' . $row['mark_id']);
$short_name->setValue($row['mark_short']);
$short_name->setDisabled(!$this->is_editable);
$short_name->setSize(10);
$official_name = new ilTextInputGUI('', 'mark_official_' . $row['mark_id']);
$official_name->setSize(20);
$official_name->setDisabled(!$this->object->canEditMarks());
$official_name->setValue($row['mark_official']);
$percentage = new ilNumberInputGUI('', 'mark_percentage_' . $row['mark_id']);
$percentage->allowDecimals(true);
$percentage->setValue($row['mark_percentage']);
$percentage->setSize(10);
$percentage->setDisabled(!$this->is_editable);
$percentage->setMinValue(0);
$percentage->setMaxValue(100);
$this->tpl->setVariable('VAL_MARK_ID', $row['mark_id']);
$this->tpl->setVariable('VAL_CHECKBOX', ilUtil::formCheckbox(false, 'marks[]', $row['mark_id'], !$this->is_editable));
$this->tpl->setVariable('VAL_SHORT_NAME', $short_name->render());
$this->tpl->setVariable('VAL_OFFICIAL_NAME', $official_name->render());
$this->tpl->setVariable('VAL_PERCENTAGE', $percentage->render());
$this->tpl->setVariable('VAL_PASSED_CHECKBOX', ilUtil::formCheckbox((bool) $row['mark_passed'], 'passed_' . $row['mark_id'], '1', !$this->is_editable));
}
示例3: initRoomAllocationForm
/**
* ilPropertyFormGUI initialisation
*
* @access private
*/
private function initRoomAllocationForm()
{
/**
* @var $ilCtrl ilCtrl
*/
global $lng, $ilCtrl;
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($ilCtrl->getFormAction($this, 'saveRoomAllocation'));
$this->form->setTitle($this->getPluginObject()->txt('room_allocation'));
$this->form->addCommandButton('saveRoomAllocation', $lng->txt('save'));
$this->form->addCommandButton('cancelRoomAllocation', $lng->txt('cancel'));
$form_max_pax = new ilNumberInputGUI($this->getPluginObject()->txt('max_pax'), 'max_pax');
$form_max_pax->setInfo($this->getPluginObject()->txt('max_pax_settings_desc'));
$form_max_pax->allowDecimals(false);
$form_max_pax->setSize(5);
$form_max_pax->setRequired(true);
$this->form->addItem($form_max_pax);
$form_ac_obj = new ilNumberInputGUI($this->getPluginObject()->txt('ac_interface_objects'), 'ac_interface_objects');
$form_ac_obj->setInfo($this->getPluginObject()->txt('enter_number_of_scos'));
$form_ac_obj->setSize(5);
$this->form->addItem($form_ac_obj);
$form_ac_buf = new ilNumberInputGUI($this->getPluginObject()->txt('ac_buffer'), 'ac_interface_objects_buffer');
$form_ac_buf->setInfo($this->getPluginObject()->txt('enter_number_of_sco_buffer'));
$form_ac_buf->setSize(5);
$this->form->addItem($form_ac_buf);
}
示例4: editPriceObject
public function editPriceObject()
{
$this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
$price_id = $_GET['price_id'] ? $_GET['price_id'] : $_POST['price_id'];
$price = ilPaymentPrices::_getPrice($price_id);
$this->ctrl->setParameter($this, 'pobject_id', (int) $_GET['pobject_id']);
$tmp_pobject = ilPaymentObject::_getObjectData($_GET['pobject_id']);
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$tmp_obj = ilObjectFactory::getInstanceByRefId($tmp_pobject['ref_id'], false);
if ($tmp_obj) {
$form->setTitle($tmp_obj->getTitle());
} else {
$form->setTitle($this->lng->txt('object_not_found'));
}
//price_type
$radio_group = new ilRadioGroupInputGUI('', 'price_type');
$radio_group->setTitle($this->lng->txt('duration'));
$radio_group->setRequired(true);
$radio_group->setValue($price['price_type']);
$radio_group->setPostVar('price_type');
$radio_option_1 = new ilRadioOption($this->lng->txt('duration_month'), ilPaymentPrices::TYPE_DURATION_MONTH);
// duration month
$oDuration = new ilNumberInputGUI();
$oDuration->setTitle($this->lng->txt('paya_months'));
$oDuration->setSize('20%');
$oDuration->setValue($price['duration']);
$oDuration->setPostVar('duration_month');
$radio_option_1->addSubItem($oDuration);
$radio_group->addOption($radio_option_1);
$radio_option_3 = new ilRadioOption($this->lng->txt('duration_date'), ilPaymentPrices::TYPE_DURATION_DATE);
// duration_date from
$o_date_from = new ilDateTimeInputGUI();
$o_date_from->setTitle($this->lng->txt('cal_from'));
$o_date_from->setDate(new ilDate($price['duration_from'], IL_CAL_DATE));
$o_date_from->setPostVar('duration_date_from');
$radio_option_3->addSubItem($o_date_from);
// duration_date until
$o_date_until = new ilDateTimeInputGUI();
$o_date_until->setTitle($this->lng->txt('cal_until'));
$o_date_until->setDate(new ilDate($price['duration_until'], IL_CAL_DATE));
$o_date_until->setPostVar('duration_date_until');
$radio_option_3->addSubItem($o_date_until);
$radio_group->addOption($radio_option_3);
$radio_option_2 = new ilRadioOption($this->lng->txt('unlimited_duration'), ilPaymentPrices::TYPE_UNLIMITED_DURATION);
$radio_group->addOption($radio_option_2);
$form->addItem($radio_group);
// description
$oDescription = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
$oDescription->setRows(4);
$oDescription->setCols(35);
$oDescription->setValue($price['description']);
$form->addItem($oDescription);
// price
$oPrice = new ilNumberInputGUI();
$oPrice->setTitle($this->lng->txt('price_a'));
$oPrice->setSize('20%');
$oPrice->setRequired(true);
$oPrice->setValue($price['price']);
include_once './Services/Payment/classes/class.ilPaymentSettings.php';
$genSet = ilPaymentSettings::_getInstance();
$oPrice->setInfo($genSet->get('currency_unit'));
$oPrice->setPostVar('price');
$oPrice->allowDecimals(true);
$form->addItem($oPrice);
//extension
$oExtension = new ilCheckboxInputGUI($this->lng->txt('extension_price'), 'extension');
$oExtension->setChecked($price['extension']);
$form->addItem($oExtension);
$o_hidden_1 = new ilHiddenInputGUI('pobject_id');
$o_hidden_1->setValue((int) $_GET['pobject_id']);
$o_hidden_1->setPostVar('pobject_id');
$o_hidden_2 = new ilHiddenInputGUI('price_id');
$o_hidden_2->setValue((int) $_GET['price_id']);
$o_hidden_2->setPostVar('price_id');
$form->addItem($o_hidden_1);
$form->addItem($o_hidden_2);
$form->addCommandButton('updatePrice', $this->lng->txt('save'));
$form->addCommandButton('editPrices', $this->lng->txt('cancel'));
$this->tpl->setVariable('FORM', $form->getHTML());
}
示例5: buildForm
/**
* builds the questions hints form
*
* @access private
* @global ilCtrl $ilCtrl
* @global ilLanguage $lng
* @return ilPropertyFormGUI $form
*/
private function buildForm(ilAssQuestionHint $questionHint = null)
{
global $ilCtrl, $lng;
require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
require_once 'Services/Form/classes/class.ilTextAreaInputGUI.php';
require_once 'Services/Form/classes/class.ilNumberInputGUI.php';
require_once 'Services/Form/classes/class.ilHiddenInputGUI.php';
$form = new ilPropertyFormGUI();
$form->setTableWidth('100%');
if (!$this->questionOBJ->isAdditionalContentEditingModePageObject()) {
// form input: hint text
$areaInp = new ilTextAreaInputGUI($lng->txt('tst_question_hints_form_label_hint_text'), 'hint_text');
$areaInp->setRequired(true);
$areaInp->setRows(10);
$areaInp->setCols(80);
if (!$this->questionOBJ->getPreventRteUsage()) {
$areaInp->setUseRte(true);
}
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$areaInp->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
$areaInp->setRTESupport($this->questionOBJ->getId(), 'qpl', 'assessment');
$areaInp->addPlugin("latex");
$areaInp->addButton("latex");
$areaInp->addButton("pastelatex");
$form->addItem($areaInp);
}
// form input: hint points
$numInp = new ilNumberInputGUI($lng->txt('tst_question_hints_form_label_hint_points'), 'hint_points');
$numInp->allowDecimals(true);
$numInp->setRequired(true);
$numInp->setSize(3);
$form->addItem($numInp);
if ($questionHint instanceof ilAssQuestionHint) {
// build form title for an existing hint
$form->setTitle(sprintf($lng->txt('tst_question_hints_form_header_edit'), $questionHint->getIndex(), $this->questionOBJ->getTitle()));
// hidden input: hint id
$hiddenInp = new ilHiddenInputGUI('hint_id');
$form->addItem($hiddenInp);
// init values
require_once 'Services/Utilities/classes/class.ilUtil.php';
if (!$this->questionOBJ->isAdditionalContentEditingModePageObject()) {
$areaInp->setValue(ilUtil::prepareTextareaOutput($questionHint->getText(), true));
}
$numInp->setValue($questionHint->getPoints());
$hiddenInp->setValue($questionHint->getId());
} else {
// build form title for a new hint
$form->setTitle(sprintf($lng->txt('tst_question_hints_form_header_create'), $this->questionOBJ->getTitle()));
}
if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
if ($questionHint instanceof ilAssQuestionHint) {
$saveCmdLabel = $lng->txt('tst_question_hints_form_cmd_save_points');
} else {
$saveCmdLabel = $lng->txt('tst_question_hints_form_cmd_save_points_and_edit_page');
}
} else {
$saveCmdLabel = $lng->txt('tst_question_hints_form_cmd_save');
}
$form->setFormAction($ilCtrl->getFormAction($this));
$form->addCommandButton(self::CMD_CANCEL_FORM, $lng->txt('cancel'));
$form->addCommandButton(self::CMD_SAVE_FORM, $saveCmdLabel);
return $form;
}
示例6: populateQuestionSpecificFormPart
public function populateQuestionSpecificFormPart(ilPropertyFormGUI $form)
{
// maxsize
$maxsize = new ilNumberInputGUI($this->lng->txt("maxsize"), "maxsize");
$maxsize->setValue($this->object->getMaxSize());
$maxsize->setInfo($this->lng->txt("maxsize_info"));
$maxsize->setSize(10);
$maxsize->setMinValue(0);
$maxsize->setMaxValue($this->determineMaxFilesize());
$maxsize->setRequired(FALSE);
$form->addItem($maxsize);
// allowedextensions
$allowedextensions = new ilTextInputGUI($this->lng->txt("allowedextensions"), "allowedextensions");
$allowedextensions->setInfo($this->lng->txt("allowedextensions_info"));
$allowedextensions->setValue($this->object->getAllowedExtensions());
$allowedextensions->setRequired(FALSE);
$form->addItem($allowedextensions);
// points
$points = new ilNumberInputGUI($this->lng->txt("points"), "points");
$points->allowDecimals(true);
$points->setValue(is_numeric($this->object->getPoints()) && $this->object->getPoints() >= 0 ? $this->object->getPoints() : '');
$points->setRequired(TRUE);
$points->setSize(3);
$points->setMinValue(0.0);
$points->setMinvalueShouldBeGreater(false);
$form->addItem($points);
$subcompl = new ilCheckboxInputGUI($this->lng->txt('ass_completion_by_submission'), 'completion_by_submission');
$subcompl->setInfo($this->lng->txt('ass_completion_by_submission_info'));
$subcompl->setValue(1);
$subcompl->setChecked($this->object->isCompletionBySubmissionEnabled());
$form->addItem($subcompl);
return $form;
}
示例7: fillRow
/**
* @global ilCtrl $ilCtrl
* @global ilLanguage $lng
* @param array $row
*/
public function fillRow($row)
{
/**
* @var $ilCtrl ilCtrl
*/
global $ilCtrl;
$this->tpl->setVariable('VAL_NAME', $row['participant']->getName());
$reached_points = new ilNumberInputGUI('', 'scoring[' . $row['pass_id'] . '][' . $row['active_id'] . '][' . $row['qst_id'] . ']');
$reached_points->allowDecimals(true);
$reached_points->setSize(5);
if (count($this->manPointsPostData)) {
if ($this->isMaxPointsExceededByPostValue($row['pass_id'], $row['active_id'], $row['qst_id'])) {
$reached_points->setAlert(sprintf($this->lng->txt('tst_manscoring_maxpoints_exceeded_input_alert'), $row['maximum_points']));
$this->tpl->setCurrentBlock("reached_points_alert");
$this->tpl->setVariable("REACHED_POINTS_IMG_ALERT", ilUtil::getImagePath("icon_alert.svg"));
$this->tpl->setVariable("REACHED_POINTS_ALT_ALERT", $this->lng->txt("alert"));
$this->tpl->setVariable("REACHED_POINTS_TXT_ALERT", $reached_points->getAlert());
$this->tpl->parseCurrentBlock();
}
$reached_points->setValue($this->manPointsPostData[$row['pass_id']][$row['active_id']][$row['qst_id']]);
} else {
$reached_points->setValue($row['reached_points']);
}
$this->tpl->setVariable('VAL_REACHED_POINTS', $reached_points->render());
$this->tpl->setVariable('VAL_ID', md5($row['pass_id'] . $row['active_id'] . $row['qst_id']));
$ilCtrl->setParameter($this->getParentObject(), 'qst_id', $row['qst_id']);
$ilCtrl->setParameter($this->getParentObject(), 'active_id', $row['active_id']);
$ilCtrl->setParameter($this->getParentObject(), 'pass_id', $row['pass_id']);
$this->tpl->setVariable('VAL_LINK_ANSWER', $ilCtrl->getLinkTarget($this->getParentObject(), 'getAnswerDetail', '', true, false));
$ilCtrl->setParameter($this->getParentObject(), 'qst_id', '');
$ilCtrl->setParameter($this->getParentObject(), 'active_id', '');
$ilCtrl->setParameter($this->getParentObject(), 'pass_id', '');
$this->tpl->setVariable('VAL_TXT_ANSWER', $this->lng->txt('tst_eval_show_answer'));
}
开发者ID:arlendotcn,项目名称:ilias,代码行数:39,代码来源:class.ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI.php
示例8: populateQuestionSpecificFormPart
public function populateQuestionSpecificFormPart(\ilPropertyFormGUI $form)
{
// ordertext
$ordertext = new ilTextAreaInputGUI($this->lng->txt("ordertext"), "ordertext");
$ordertext->setValue($this->object->prepareTextareaOutput($this->object->getOrderText()));
$ordertext->setRequired(TRUE);
$ordertext->setInfo(sprintf($this->lng->txt("ordertext_info"), $this->object->separator));
$ordertext->setRows(10);
$ordertext->setCols(80);
$form->addItem($ordertext);
// textsize
$textsize = new ilNumberInputGUI($this->lng->txt("textsize"), "textsize");
$textsize->setValue($this->object->getTextSize());
$textsize->setInfo($this->lng->txt("textsize_info"));
$textsize->setSize(6);
$textsize->setMinValue(10);
$textsize->setRequired(FALSE);
$form->addItem($textsize);
// points
$points = new ilNumberInputGUI($this->lng->txt("points"), "points");
$points->allowDecimals(true);
// mbecker: Fix for mantis bug 7866: Predefined values schould make sense.
// This implements a default value of "1" for this question type.
if ($this->object->getPoints() == null) {
$points->setValue("1");
} else {
$points->setValue($this->object->getPoints());
}
$points->setRequired(TRUE);
$points->setSize(3);
$points->setMinValue(0.0);
$points->setMinvalueShouldBeGreater(true);
$form->addItem($points);
}
示例9: build
public function build(ilTestRandomQuestionSetSourcePoolDefinition $sourcePool, $availableTaxonomyIds)
{
$this->setFormAction($this->ctrl->getFormAction($this->questionSetConfigGUI));
$this->setTitle($this->lng->txt('tst_rnd_quest_set_cfg_pool_form'));
$this->setId('tstRndQuestSetCfgPoolForm');
$this->addCommandButton($this->getSaveCommand(), $this->lng->txt('save_and_back'));
if (null !== $this->getSaveAndNewCommand()) {
$this->addCommandButton($this->getSaveAndNewCommand(), $this->lng->txt('tst_save_and_create_new_rule'));
}
$this->addCommandButton(ilTestRandomQuestionSetConfigGUI::CMD_SHOW_SRC_POOL_DEF_LIST, $this->lng->txt('cancel'));
$hiddenDefId = new ilHiddenInputGUI('src_pool_def_id');
$hiddenDefId->setValue($sourcePool->getId());
$this->addItem($hiddenDefId);
$hiddenPoolId = new ilHiddenInputGUI('quest_pool_id');
$hiddenPoolId->setValue($sourcePool->getPoolId());
$this->addItem($hiddenPoolId);
$nonEditablePoolLabel = new ilNonEditableValueGUI($this->lng->txt('tst_inp_source_pool_label'), 'quest_pool_label');
$nonEditablePoolLabel->setValue($sourcePool->getPoolInfoLabel($this->lng));
$this->addItem($nonEditablePoolLabel);
if (count($availableTaxonomyIds)) {
$taxRadio = new ilRadioGroupInputGUI($this->lng->txt('tst_inp_source_pool_filter_tax'), 'filter_tax');
$taxRadio->setRequired(true);
$taxRadio->addOption(new ilRadioOption($this->lng->txt('tst_inp_source_pool_no_tax_filter'), 0));
$taxRadio->setValue(0);
require_once 'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
foreach ($availableTaxonomyIds as $taxId) {
$taxonomy = new ilObjTaxonomy($taxId);
$label = sprintf($this->lng->txt('tst_inp_source_pool_filter_tax_x'), $taxonomy->getTitle());
$taxRadioOption = new ilRadioOption($label, $taxId);
$taxRadio->addOption($taxRadioOption);
$taxSelect = new ilTaxSelectInputGUI($taxId, "filter_tax_{$taxId}", false);
$taxSelect->setRequired(true);
$taxRadioOption->addSubItem($taxSelect);
if ($taxId == $sourcePool->getOriginalFilterTaxId()) {
$taxRadio->setValue($sourcePool->getOriginalFilterTaxId());
$taxSelect->setValue($sourcePool->getOriginalFilterTaxNodeId());
}
}
$this->addItem($taxRadio);
} else {
$hiddenNoTax = new ilHiddenInputGUI('filter_tax');
$hiddenNoTax->setValue(0);
$this->addItem($hiddenNoTax);
$nonEditableNoTax = new ilNonEditableValueGUI($this->lng->txt('tst_inp_source_pool_filter_tax'), 'no_tax_label');
$nonEditableNoTax->setValue($this->lng->txt('tst_inp_no_available_tax_hint'));
$this->addItem($nonEditableNoTax);
}
if ($this->questionSetConfig->isQuestionAmountConfigurationModePerPool()) {
$questionAmountPerSourcePool = new ilNumberInputGUI($this->lng->txt('tst_inp_quest_amount_per_source_pool'), 'question_amount_per_pool');
$questionAmountPerSourcePool->setRequired(true);
$questionAmountPerSourcePool->allowDecimals(false);
$questionAmountPerSourcePool->setMinValue(0);
$questionAmountPerSourcePool->setMinvalueShouldBeGreater(true);
$questionAmountPerSourcePool->setSize(4);
if ($sourcePool->getQuestionAmount()) {
$questionAmountPerSourcePool->setValue($sourcePool->getQuestionAmount());
}
$this->addItem($questionAmountPerSourcePool);
}
}
示例10: buildSettingsForm
private function buildSettingsForm()
{
/**
* @var $ilAccess ilAccessHandler
*/
global $ilAccess;
include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTableWidth("100%");
$form->setId("settings");
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt('settings'));
$form->addItem($header);
// question process locking behaviour (e.g. on saving users working data)
$chb = new ilCheckboxInputGUI($this->lng->txt('ass_process_lock'), 'ass_process_lock');
$chb->setChecked($this->object->getAssessmentProcessLockMode() != ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE);
$chb->setInfo($this->lng->txt('ass_process_lock_desc'));
$form->addItem($chb);
$rg = new ilRadioGroupInputGUI($this->lng->txt('ass_process_lock_mode'), 'ass_process_lock_mode');
$rg->setRequired(true);
$opt = new ilRadioOption($this->lng->txt('ass_process_lock_mode_file'), ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_FILE);
$opt->setInfo($this->lng->txt('ass_process_lock_mode_file_desc'));
$rg->addOption($opt);
$opt = new ilRadioOption($this->lng->txt('ass_process_lock_mode_db'), ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_DB);
$opt->setInfo($this->lng->txt('ass_process_lock_mode_db_desc'));
$rg->addOption($opt);
if ($this->object->getAssessmentProcessLockMode() != ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE) {
$rg->setValue($this->object->getAssessmentProcessLockMode());
}
$chb->addSubItem($rg);
$assessmentSetting = new ilSetting('assessment');
$imap_line_color = array_key_exists('imap_line_color', $_GET) ? $_GET['imap_line_color'] : $assessmentSetting->get('imap_line_color');
if (strlen($imap_line_color) == 0) {
$imap_line_color = 'FF0000';
}
$linepicker = new ilColorPickerInputGUI($this->lng->txt('assessment_imap_line_color'), 'imap_line_color');
$linepicker->setValue($imap_line_color);
$form->addItem($linepicker);
$user_criteria = array_key_exists('user_criteria', $_GET) ? $_GET['user_criteria'] : $assessmentSetting->get('user_criteria');
$userCriteria = new ilSelectInputGUI($this->lng->txt('user_criteria'), 'user_criteria');
$userCriteria->setInfo($this->lng->txt('user_criteria_desc'));
$userCriteria->setRequired(true);
$fields = array('usr_id', 'login', 'email', 'matriculation', 'ext_account');
$usr_fields = array();
foreach ($fields as $field) {
$usr_fields[$field] = $field;
}
$userCriteria->setOptions($usr_fields);
$userCriteria->setValue($user_criteria);
$form->addItem($userCriteria);
$numRequiredAnswers = new ilNumberInputGUI($this->lng->txt('tst_skill_triggerings_num_req_answers'), 'num_req_answers');
$numRequiredAnswers->setInfo($this->lng->txt('tst_skill_triggerings_num_req_answers_desc'));
$numRequiredAnswers->setSize(4);
$numRequiredAnswers->allowDecimals(false);
$numRequiredAnswers->setMinValue(1);
$numRequiredAnswers->setMinvalueShouldBeGreater(false);
$numRequiredAnswers->setValue($this->object->getSkillTriggeringNumAnswersBarrier());
$form->addItem($numRequiredAnswers);
// question settings
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("assf_questiontypes"));
$form->addItem($header);
// available question types
$allowed = new ilCheckboxGroupInputGUI($this->lng->txt('assf_allowed_questiontypes'), "chb_allowed_questiontypes");
$questiontypes =& ilObjQuestionPool::_getQuestionTypes(TRUE);
$forbidden_types = $this->object->_getForbiddenQuestionTypes();
$allowedtypes = array();
foreach ($questiontypes as $qt) {
if (!in_array($qt['question_type_id'], $forbidden_types)) {
array_push($allowedtypes, $qt['question_type_id']);
}
}
$allowed->setValue($allowedtypes);
foreach ($questiontypes as $type_name => $qtype) {
$allowed->addOption(new ilCheckboxOption($type_name, $qtype["question_type_id"]));
}
$allowed->setInfo($this->lng->txt('assf_allowed_questiontypes_desc'));
$form->addItem($allowed);
// manual scoring
$manual = new ilCheckboxGroupInputGUI($this->lng->txt('assessment_log_manual_scoring_activate'), "chb_manual_scoring");
$manscoring = $this->object->_getManualScoring();
$manual->setValue($manscoring);
foreach ($questiontypes as $type_name => $qtype) {
$manual->addOption(new ilCheckboxOption($type_name, $qtype["question_type_id"]));
}
$manual->setInfo($this->lng->txt('assessment_log_manual_scoring_desc'));
$form->addItem($manual);
// scoring adjustment active
$scoring_activation = new ilCheckboxInputGUI($this->lng->txt('assessment_scoring_adjust'), 'chb_scoring_adjust');
$scoring_activation->setChecked($this->object->getScoringAdjustmentEnabled());
$scoring_activation->setInfo($this->lng->txt('assessment_scoring_adjust_desc'));
$form->addItem($scoring_activation);
// scoring adjustment
$scoring = new ilCheckboxGroupInputGUI($this->lng->txt('assessment_log_scoring_adjustment_activate'), "chb_scoring_adjustment");
$scoring_active = $this->object->getScoringAdjustableQuestions();
$scoring->setValue($scoring_active);
foreach ($questiontypes as $type_name => $qtype) {
$scoring->addOption(new ilCheckboxOption($type_name, $qtype["question_type_id"]));
//.........这里部分代码省略.........
示例11: buildResultSkillPointsInputField
private function buildResultSkillPointsInputField()
{
$questResultSkillPoints = new ilNumberInputGUI($this->lng->txt('tst_comp_points'), 'q_res_skill_points');
$questResultSkillPoints->setRequired(true);
$questResultSkillPoints->setSize(4);
$questResultSkillPoints->setMinvalueShouldBeGreater(false);
$questResultSkillPoints->setMinValue(1);
$questResultSkillPoints->allowDecimals(false);
$questResultSkillPoints->setValue($this->assignment->getSkillPoints());
if (!$this->isManipulationEnabled()) {
$questResultSkillPoints->setDisabled(true);
}
return $questResultSkillPoints;
}
示例12: addCoupon
public function addCoupon()
{
$this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
if (isset($_GET['coupon_id'])) {
if ($this->error == '') {
$this->coupon_obj->getCouponById($_GET['coupon_id']);
}
$this->ctrl->setParameter($this, 'coupon_id', $this->coupon_obj->getId());
$this->__showButtons();
}
$oForm = new ilPropertyFormGUI();
$oForm->setId('frm_add_coupon');
$oForm->setFormAction($this->ctrl->getFormAction($this, 'saveCouponForm'));
$oForm->setTitle($this->coupon_obj->getId() ? $this->lng->txt('paya_coupons_edit') : $this->lng->txt('paya_coupons_add'));
// Title
$oTitle = new ilTextInputGUI($this->lng->txt(paya_coupons_title), 'title');
$oTitle->setValue($this->coupon_obj->getTitle());
$oTitle->setRequired(true);
$oForm->addItem($oTitle);
// Description
$oDescription = new ilTextAreaInputGUI($this->lng->txt(paya_coupons_description), 'description');
$oDescription->setValue($this->coupon_obj->getDescription());
$oForm->addItem($oDescription);
// Type
$o_coupon_type = new ilSelectInputGUI();
$coupon_option = array('fix' => $this->lng->txt('paya_coupons_fix'), 'percent' => $this->lng->txt('paya_coupons_percentaged'));
$o_coupon_type->setTitle($this->lng->txt('coupon_type'));
$o_coupon_type->setOptions($coupon_option);
$o_coupon_type->setValue($this->coupon_obj->getType());
$o_coupon_type->setRequired(true);
$o_coupon_type->setPostVar('coupon_type');
$oForm->addItem($o_coupon_type);
// Value
$o_coupon_value = new ilNumberInputGUI($this->lng->txt('paya_coupons_value'), 'coupon_value');
$o_coupon_value->setSize(5);
$o_coupon_value->allowDecimals(true);
$o_coupon_value->setValue($this->coupon_obj->getValue());
$o_coupon_value->setRequired(true);
$oForm->addItem($o_coupon_value);
// Date Valid From
$o_from_check = new ilCheckBoxInputGUI($this->lng->txt('paya_coupons_from'), 'from_check');
$o_from_check->setValue(1);
$o_from_check->setChecked($this->coupon_obj->getFromDateEnabled() ? 1 : 0);
$o_date_from = new ilDateTimeInputGUI();
$o_date_from->setPostVar('from');
$from_date = explode('-', $this->coupon_obj->getFromDate());
$date_f['from']['date']['d'] = $from_date[2] != '00' ? $from_date[2] : '';
$date_f['from']['date']['m'] = $from_date[1] != '00' ? $from_date[1] : '';
$date_f['from']['date']['y'] = $from_date[0] != '0000' ? $from_date[0] : '';
$_POST['from'] = $date_f['from'];
if ($this->coupon_obj->getFromDateEnabled() == '1') {
$o_date_from->checkInput();
}
$o_from_check->addSubItem($o_date_from);
$oForm->addItem($o_from_check);
// Date Valid Until
$o_until_check = new ilCheckBoxInputGUI($this->lng->txt('paya_coupons_till'), 'until_check');
$o_until_check->setValue(1);
$o_until_check->setChecked($this->coupon_obj->getTillDateEnabled() ? 1 : 0);
$o_date_until = new ilDateTimeInputGUI();
$o_date_until->setPostVar('til');
$till_date = explode('-', $this->coupon_obj->getTillDate());
$date_t['til']['date']['d'] = $till_date[2] != '00' ? $till_date[2] : '';
$date_t['til']['date']['m'] = $till_date[1] != '00' ? $till_date[1] : '';
$date_t['til']['date']['y'] = $till_date[0] != '0000' ? $till_date[0] : '';
$_POST['til'] = $date_t['til'];
if ($this->coupon_obj->getTillDateEnabled() == '1') {
$o_date_until->checkInput();
}
$o_until_check->addSubItem($o_date_until);
$oForm->addItem($o_until_check);
$o_usage = new ilNumberInputGUI($this->lng->txt('paya_coupons_availability'), 'usage');
$o_usage->setSize(5);
$o_usage->setValue($this->coupon_obj->getUses());
$oForm->addItem($o_usage);
$oForm->addCommandButton('saveCouponForm', $this->lng->txt('save'));
$oForm->addCommandButton('showCoupons', $this->lng->txt('cancel'));
$this->tpl->setVariable('FORM', $oForm->getHTML());
}
示例13: getEctsForm
/**
* @return ilPropertyFormGUI
*/
protected function getEctsForm()
{
require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, 'saveEctsForm'));
$form->addCommandButton('saveEctsForm', $this->lng->txt('save'));
$form->setTitle($this->lng->txt('ects_output_of_ects_grades'));
$allow_ects_marks = new ilCheckboxInputGUI($this->lng->txt('ects_allow_ects_grades'), 'ectcs_status');
for ($i = ord('a'); $i <= ord('e'); $i++) {
$mark = chr($i);
$mark_step = new ilNumberInputGUI(chr($i - 32) . ' - ' . $this->lng->txt('ects_grade_' . $mark . '_short'), 'ects_grade_' . $mark);
$mark_step->setSize(5);
$mark_step->allowDecimals(true);
$mark_step->setMinValue(0, true);
$mark_step->setMaxValue(100, true);
$mark_step->setSuffix($this->lng->txt('percentile'));
$mark_step->setRequired(true);
$allow_ects_marks->addSubItem($mark_step);
}
$use_ects_fx = new ilCheckboxInputGUI($this->lng->txt('use_ects_fx'), 'use_ects_fx');
$threshold = new ilNumberInputGUI($this->lng->txt('ects_fx_threshold'), 'ects_fx_threshold');
$threshold->setInfo($this->lng->txt('ects_fx_threshold_info'));
$threshold->setSuffix($this->lng->txt('percentile'));
$threshold->allowDecimals(true);
$threshold->setSize(5);
$threshold->setRequired(true);
$use_ects_fx->addSubItem($threshold);
$allow_ects_marks->addSubItem($use_ects_fx);
$form->addItem($allow_ects_marks);
return $form;
}
示例14: editQuestion
/**
* Creates an output of the edit form for the question
* @param bool $checkonly
* @return bool
*/
function editQuestion($checkonly = FALSE)
{
$save = $this->isSaveCommand();
$this->getQuestionTemplate();
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->outQuestionType());
$form->setMultipart(FALSE);
$form->setTableWidth('100%');
$form->setId('assformulaquestion');
// title, author, description, question, working time (assessment mode)
$this->addBasicQuestionFormProperties($form);
// Add info text
$question = $form->getItemByPostVar('question');
$question->setInfo($this->lng->txt('fq_question_desc'));
$variables = $this->object->getVariables();
$categorized_units = $this->object->getUnitrepository()->getCategorizedUnits();
$result_units = $this->object->__get('resultunits');
$unit_options = array();
$category_name = '';
$new_category = false;
foreach ((array) $categorized_units as $item) {
/**
* @var $item assFormulaQuestionUnitCategory|assFormulaQuestionUnit
*/
if ($item instanceof assFormulaQuestionUnitCategory) {
if ($category_name != $item->getDisplayString()) {
$new_category = true;
$category_name = $item->getDisplayString();
}
continue;
}
$unit_options[$item->getId()] = $item->getDisplayString() . ($new_category ? ' (' . $category_name . ')' : '');
$new_category = false;
}
if (count($variables)) {
uasort($variables, function (assFormulaQuestionVariable $v1, assFormulaQuestionVariable $v2) {
$num_v1 = (int) substr($v1->getVariable(), 2);
$num_v2 = (int) substr($v2->getVariable(), 2);
if ($num_v1 > $num_v2) {
return 1;
} else {
if ($num_v1 < $num_v2) {
return -1;
}
}
return 0;
});
foreach ($variables as $variable) {
/**
* @var $variable assFormulaQuestionVariable
*/
$variable_header = new ilFormSectionHeaderGUI();
$variable_header->setTitle(sprintf($this->lng->txt('variable_x'), $variable->getVariable()));
$range_min = new ilNumberInputGUI($this->lng->txt('range_min'), 'range_min_' . $variable->getVariable());
$range_min->allowDecimals(true);
$range_min->setSize(3);
$range_min->setRequired(true);
$range_min->setValue($variable->getRangeMin());
$range_max = new ilNumberInputGUI($this->lng->txt('range_max'), 'range_max_' . $variable->getVariable());
$range_max->allowDecimals(true);
$range_max->setSize(3);
$range_max->setRequired(true);
$range_max->setValue($variable->getRangeMax());
$units = new ilSelectInputGUI($this->lng->txt('unit'), 'unit_' . $variable->getVariable());
$units->setOptions(array(0 => $this->lng->txt('no_selection')) + $unit_options);
if (is_object($variable->getUnit())) {
$units->setValue($variable->getUnit()->getId());
}
$precision = new ilNumberInputGUI($this->lng->txt('precision'), 'precision_' . $variable->getVariable());
$precision->setRequired(true);
$precision->setSize(3);
$precision->setMinValue(0);
$precision->setValue($variable->getPrecision());
$precision->setInfo($this->lng->txt('fq_precision_info'));
$intprecision = new ilNumberInputGUI($this->lng->txt('intprecision'), 'intprecision_' . $variable->getVariable());
$intprecision->setSize(3);
$intprecision->setMinValue(1);
$intprecision->setValue($variable->getIntprecision());
$intprecision->setInfo($this->lng->txt('intprecision_info'));
$form->addItem($variable_header);
$form->addItem($range_min);
$form->addItem($range_max);
$form->addItem($units);
$form->addItem($precision);
$form->addItem($intprecision);
}
}
$results = $this->object->getResults();
if (count($results)) {
require_once 'Services/Form/classes/class.ilMultiSelectInputGUI.php';
uasort($results, function (assFormulaQuestionResult $r1, assFormulaQuestionResult $r2) {
$num_r1 = (int) substr($r1->getResult(), 2);
$num_r2 = (int) substr($r2->getResult(), 2);
//.........这里部分代码省略.........
示例15: initUnitForm
/**
* @param assFormulaQuestionUnitCategory $category
* @param assFormulaQuestionUnit $unit
* @return ilPropertyFormGUI
*/
protected function initUnitForm(assFormulaQuestionUnitCategory $category = null, assFormulaQuestionUnit $unit = null)
{
if ($this->unit_form instanceof ilPropertyFormGUI) {
return $this->unit_form;
}
$unit_in_use = false;
if ($unit instanceof assFormulaQuestionUnit && $this->repository->isUnitInUse($unit->getId())) {
$unit_in_use = true;
}
$this->unit_form = new ilPropertyFormGUI();
$title = new ilTextInputGUI($this->lng->txt('unit'), 'unit_title');
$title->setDisabled($unit_in_use);
$title->setRequired(true);
$this->unit_form->addItem($title);
$baseunit = new ilSelectInputGUI($this->lng->txt('baseunit'), 'base_unit');
$items = $this->repository->getCategorizedUnits();
$options = array();
$category_name = '';
$new_category = false;
foreach ((array) $items as $item) {
if ($unit instanceof assFormulaQuestionUnit && $unit->getId() == $item->getId()) {
continue;
}
/**
* @var $item assFormulaQuestionUnitCategory|assFormulaQuestionUnitCategory
*/
if ($item instanceof assFormulaQuestionUnitCategory) {
if ($category_name != $item->getDisplayString()) {
$new_category = true;
$category_name = $item->getDisplayString();
}
continue;
}
$options[$item->getId()] = $item->getDisplayString() . ($new_category ? ' (' . $category_name . ')' : '');
$new_category = false;
}
$baseunit->setDisabled($unit_in_use);
$baseunit->setOptions(array(0 => $this->lng->txt('no_selection')) + $options);
$this->unit_form->addItem($baseunit);
$factor = new ilNumberInputGUI($this->lng->txt('factor'), 'factor');
$factor->setRequired(true);
$factor->setSize(3);
$factor->setMinValue(0);
$factor->allowDecimals(true);
$factor->setDisabled($unit_in_use);
$this->unit_form->addItem($factor);
if (null === $unit) {
$this->unit_form->setTitle($this->lng->txt('new_unit'));
$this->unit_form->setFormAction($this->ctrl->getFormAction($this, 'addUnit'));
$this->unit_form->addCommandButton('addUnit', $this->lng->txt('save'));
} else {
$this->ctrl->setParameter($this, 'unit_id', $unit->getId());
if ($unit_in_use) {
$this->unit_form->setFormAction($this->ctrl->getFormAction($this, 'showUnitsOfCategory'));
} else {
$this->unit_form->addCommandButton('saveUnit', $this->lng->txt('save'));
$this->unit_form->setFormAction($this->ctrl->getFormAction($this, 'saveUnit'));
}
$this->unit_form->setTitle(sprintf($this->lng->txt('un_sel_cat_sel_unit'), $category->getDisplayString(), $unit->getDisplayString()));
}
$this->unit_form->addCommandButton('showUnitsOfCategory', $this->lng->txt('cancel'));
return $this->unit_form;
}