/**
  * @param ilLanguage $lng
  * @return string
  */
 public function getFormAlert(ilLanguage $lng)
 {
     if ($this->getQuestionIndex() === null) {
         return sprintf($lng->txt("ass_lac_expression_not_supported_by_cur_question"), $this->getExpression());
     }
     return sprintf($lng->txt("ass_lac_expression_not_supported_by_question"), $this->getQuestionIndex(), $this->getExpression());
 }
 /**
  * @param ilLanguage $lng
  * @return string
  */
 public function getFormAlert(ilLanguage $lng)
 {
     if ($this->getQuestionIndex() === null) {
         return sprintf($lng->txt("ass_lac_answer_index_not_exist_cur_qst"), $this->getAnswerIndex());
     }
     return sprintf($lng->txt("ass_lac_answer_index_not_exist"), $this->getQuestionIndex(), $this->getAnswerIndex());
 }
 private function buildHeaderText($isFixedTest)
 {
     if ($isFixedTest) {
         return $this->lng->txt('tst_optional_questions_confirmation_fixed_test');
     }
     return $this->lng->txt('tst_optional_questions_confirmation_non_fixed_test');
 }
 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);
     }
 }
 private function saveSkillThresholdsCmd()
 {
     require_once 'Modules/Test/classes/class.ilTestSkillLevelThreshold.php';
     if (is_array($_POST['threshold'])) {
         $threshold = $_POST['threshold'];
         $assignmentList = $this->buildSkillQuestionAssignmentList();
         $assignmentList->loadFromDb();
         foreach ($assignmentList->getUniqueAssignedSkills() as $data) {
             $skill = $data['skill'];
             $skillKey = $data['skill_base_id'] . ':' . $data['skill_tref_id'];
             $levels = $skill->getLevelData();
             foreach ($levels as $level) {
                 if (isset($threshold[$skillKey]) && isset($threshold[$skillKey][$level['id']])) {
                     $skillLevelThreshold = new ilTestSkillLevelThreshold($this->db);
                     $skillLevelThreshold->setTestId($this->testOBJ->getTestId());
                     $skillLevelThreshold->setSkillBaseId($data['skill_base_id']);
                     $skillLevelThreshold->setSkillTrefId($data['skill_tref_id']);
                     $skillLevelThreshold->setSkillLevelId($level['id']);
                     $skillLevelThreshold->setThreshold($threshold[$skillKey][$level['id']]);
                     $skillLevelThreshold->saveToDb();
                 }
             }
         }
     }
     ilUtil::sendSuccess($this->lng->txt('tst_msg_skl_lvl_thresholds_saved'), true);
     $this->ctrl->redirect($this, self::CMD_SHOW_SKILL_THRESHOLDS);
 }
 public function getHTML()
 {
     $gui = new ilPersonalSkillsGUI();
     $gui->setGapAnalysisActualStatusModePerObject($this->testOBJ->getId(), $this->lng->txt('tst_test_result'));
     $gui->setProfileId($this->getSelectedSkillProfile());
     $html = $gui->getGapAnalysisHTML($this->getUsrId(), $this->getAvailableSkills());
     return $html;
 }
 private function saveEnteredPasswordCmd()
 {
     $this->passwordChecker->setUserEnteredPassword($_POST["password"]);
     if (!$this->passwordChecker->isUserEnteredPasswordCorrect()) {
         ilUtil::sendFailure($this->lng->txt("tst_password_entered_wrong_password"), true);
     }
     $this->ctrl->redirectByClass($this->getNextCommandClass(), $this->getNextCommandCmd());
 }
 protected function initColumns()
 {
     $this->addColumn('', 'check', '10%', true);
     $this->addColumn($this->lng->txt('title'), 'title', '30%');
     $this->addColumn($this->lng->txt('description'), 'description', '30%');
     $this->addColumn($this->lng->txt('members'), 'members', '20%');
     $this->addColumn($this->lng->txt('actions'), '', '10%');
 }
 private function populateNewQuestionSelectionRuleInputs()
 {
     $availablePools = $this->questionSetConfig->getSelectableQuestionPools();
     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->addFormButton($this->lng->txt('tst_rnd_quest_set_tb_add_pool_btn'), ilTestRandomQuestionSetConfigGUI::CMD_SHOW_CREATE_SRC_POOL_DEF_FORM);
 }
 public function manageTabs($activeSubTabId)
 {
     $link = $this->ctrl->getLinkTargetByClass('iltestskillquestionassignmentsgui', ilTestSkillQuestionAssignmentsGUI::CMD_SHOW_SKILL_QUEST_ASSIGNS);
     $this->tabs->addSubTab('iltestskillquestionassignmentsgui', $this->lng->txt('tst_skl_sub_tab_quest_assign'), $link);
     $link = $this->ctrl->getLinkTargetByClass('iltestskilllevelthresholdsgui', ilTestSkillLevelThresholdsGUI::CMD_SHOW_SKILL_THRESHOLDS);
     $this->tabs->addSubTab('iltestskilllevelthresholdsgui', $this->lng->txt('tst_skl_sub_tab_thresholds'), $link);
     $this->tabs->activateTab('tst_tab_competences');
     $this->tabs->activateSubTab($activeSubTabId);
 }
 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);
 }
 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);
     }
 }
 public function getHTML()
 {
     $gui = new ilPersonalSkillsGUI();
     $gui->setGapAnalysisActualStatusModePerObject($this->getTestId(), $this->lng->txt('tst_test_result'));
     // this is not required, we have no self evals in the test context,
     // getReachedSkillLevel is a "test evaluation"
     //$gui->setGapAnalysisSelfEvalLevels($this->getReachedSkillLevels());
     $gui->setProfileId($this->getSelectedSkillProfile());
     $html = $gui->getGapAnalysisHTML($this->getUsrId(), $this->getAvailableSkills());
     return $html;
 }
 private function buildEvaluationModeOptionsArray()
 {
     $options = array();
     if ($this->isNoSkillProfileOptionEnabled()) {
         $options[0] = $this->lng->txt('tst_all_test_competences');
     }
     foreach ($this->getAvailableSkillProfiles() as $skillProfileId => $skillProfileTitle) {
         $options[$skillProfileId] = "{$this->lng->txt('tst_gap_analysis')}: {$skillProfileTitle}";
     }
     return $options;
 }
 /**
  * @param ilLanguage $lng
  * @return string
  */
 public function getFormAlert(ilLanguage $lng)
 {
     if ($this->getQuestionIndex() === null && $this->getAnswerIndex() === null) {
         return sprintf($lng->txt("ass_lac_answer_value_not_exists_cur_qst_one_answer"), $this->getValue());
     }
     if ($this->getQuestionIndex() === null) {
         return sprintf($lng->txt("ass_lac_answer_value_not_exists_cur_qst"), $this->getValue(), $this->getAnswerIndex());
     }
     if ($this->getAnswerIndex() === null) {
         return sprintf($lng->txt("ass_lac_answer_value_not_exists_one_answer"), $this->getValue(), $this->getQuestionIndex());
     }
     return sprintf($lng->txt("ass_lac_answer_value_not_exists"), $this->getValue(), $this->getQuestionIndex(), $this->getAnswerIndex());
 }
 /**
  * Init settings property form
  *
  * @access private
  */
 private function initForm()
 {
     $this->setFormAction($this->ctrl->getFormAction($this->parent_gui));
     $name = new ilTextInputGUI($this->lng->txt("bibl_library_name"), 'name');
     $name->setRequired(true);
     $name->setValue('');
     $this->addItem($name);
     $url = new ilTextInputGUI($this->lng->txt("bibl_library_url"), 'url');
     $url->setRequired(true);
     $url->setValue('');
     $this->addItem($url);
     $img = new ilTextInputGUI($this->lng->txt("bibl_library_img"), 'img');
     $img->setValue('');
     $this->addItem($img);
     $show_in_list = new ilCheckboxInputGUI($this->lng->txt("bibl_library_show_in_list"), 'show_in_list');
     $show_in_list->setValue(1);
     $this->addItem($show_in_list);
     switch ($this->action) {
         case 'create':
             $this->setTitle($this->lng->txt("bibl_settings_new"));
             $this->addCommandButton('create', $this->lng->txt('save'));
             break;
         case 'update':
             $this->addCommandButton('update', $this->lng->txt('save'));
             $this->fillForm();
             $this->setTitle($this->lng->txt("bibl_settings_edit"));
             break;
     }
     $this->addCommandButton('cancel', $this->lng->txt("cancel"));
 }
 /**
  * @return string
  */
 public function getHtml()
 {
     global $ilCtrl;
     $tpl = new ilTemplate("tpl.dcl_tree.html", true, true, "Modules/DataCollection");
     $tpl->setVariable("FIELD_ID", $this->getPostVar());
     $tpl->setVariable("AJAX_LINK", $ilCtrl->getLinkTargetByClass("ildatacollectionrecordeditgui", "searchObjects"));
     $tpl->setVariable("LOADER_PATH", ilUtil::getImagePath("loader.svg"));
     $out = $this->title_input->getToolbarHTML();
     $out .= "<a href='#' style='display:inline-block;' id='remove_{$this->getPostVar()}'>" . ilGlyphGUI::get(ilGlyphGUI::REMOVE) . "</a>";
     $out .= $this->search_input->getTableFilterHTML();
     $out .= $this->hidden_input->getToolbarHTML();
     $out .= "<a href='#' id='search_button_" . $this->getPostVar() . "'>" . $this->lng->txt('search') . "</a>";
     $out .= $tpl->get();
     return $out;
 }
 /**
  *
  */
 protected function saveEctsForm()
 {
     if (!$this->objectSupportsEctsGrades() && $this->object->canEditEctsGrades()) {
         $this->showMarkSchema();
         return;
     }
     $ects_form = $this->getEctsForm();
     if (!$ects_form->checkInput()) {
         $ects_form->setValuesByPost();
         $this->showMarkSchema($ects_form);
         return;
     }
     $grades = array();
     for ($i = ord('a'); $i <= ord('e'); $i++) {
         $mark = chr($i);
         $grades[chr($i - 32)] = $ects_form->getInput('ects_grade_' . $mark);
     }
     $this->object->setECTSGrades($grades);
     $this->object->setECTSOutput((int) $ects_form->getInput('ectcs_status'));
     $this->object->setECTSFX($ects_form->getInput('use_ects_fx') && preg_match('/\\d+/', $ects_form->getInput('ects_fx_threshold')) ? $ects_form->getInput('ects_fx_threshold') : NULL);
     $this->object->saveECTSStatus();
     ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
     $ects_form->setValuesByPost();
     $this->showMarkSchema($ects_form);
 }
 function __showRolesTable($a_result_set, $a_from = "")
 {
     if (!$this->ilAccess->checkAccess("cat_administrate_users", "", $_GET["ref_id"])) {
         ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
         $this->ctrl->redirect($this, "");
     }
     $tbl =& $this->parent_gui->__initTableGUI();
     $tpl =& $tbl->getTemplateObject();
     // SET FORMAACTION
     $tpl->setCurrentBlock("tbl_form_header");
     $this->ctrl->setParameter($this, 'obj_id', $_GET['obj_id']);
     $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
     $tpl->parseCurrentBlock();
     // SET FOOTER BUTTONS
     $tpl->setVariable("COLUMN_COUNTS", 4);
     $tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.svg"));
     $tpl->setCurrentBlock("tbl_action_button");
     $tpl->setVariable("BTN_NAME", "assignSave");
     $tpl->setVariable("BTN_VALUE", $this->lng->txt("change_assignment"));
     $tpl->parseCurrentBlock();
     $tpl->setCurrentBlock("tbl_action_row");
     $tpl->setVariable("TPLPATH", $this->tpl->tplPath);
     $tpl->parseCurrentBlock();
     $tmp_obj =& ilObjectFactory::getInstanceByObjId($_GET['obj_id']);
     $title = $this->lng->txt('role_assignment') . ' (' . $tmp_obj->getFullname() . ')';
     $tbl->setTitle($title, "icon_role.svg", $this->lng->txt("role_assignment"));
     $tbl->setHeaderNames(array('', $this->lng->txt("title"), $this->lng->txt('description'), $this->lng->txt("type")));
     $tbl->setHeaderVars(array("", "title", "description", "type"), array("ref_id" => $this->object->getRefId(), "cmd" => "assignRoles", "obj_id" => $_GET['obj_id'], "cmdClass" => "ilobjcategorygui", "cmdNode" => $_GET["cmdNode"]));
     $tbl->setColumnWidth(array("4%", "35%", "45%", "16%"));
     $this->set_unlimited = true;
     $this->parent_gui->__setTableGUIBasicData($tbl, $a_result_set, $a_from, true);
     $tbl->render();
     $this->tpl->setVariable("ROLES_TABLE", $tbl->tpl->get());
     return true;
 }
 private function saveSkillPointsCmd()
 {
     if (is_array($_POST['quantifiers'])) {
         require_once 'Modules/Test/classes/class.ilTestSkillQuestionAssignment.php';
         $success = false;
         foreach ($_POST['quantifiers'] as $assignmentKey => $quantifier) {
             $assignmentKey = explode(':', $assignmentKey);
             $skillBaseId = (int) $assignmentKey[0];
             $skillTrefId = (int) $assignmentKey[1];
             $questionId = (int) $assignmentKey[2];
             if ($this->isTestQuestion($questionId) && (int) $quantifier > 0) {
                 $assignment = new ilTestSkillQuestionAssignment($this->db);
                 $assignment->setTestId($this->testOBJ->getTestId());
                 $assignment->setQuestionId($questionId);
                 $assignment->setSkillBaseId($skillBaseId);
                 $assignment->setSkillTrefId($skillTrefId);
                 if ($assignment->dbRecordExists()) {
                     $assignment->setSkillPoints((int) $quantifier);
                     $assignment->saveToDb();
                 }
             }
         }
     }
     ilUtil::sendSuccess($this->lng->txt('tst_msg_skl_qst_assign_points_saved'), true);
     $this->ctrl->redirect($this, self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
 }
 public function executeCommand()
 {
     if ($this->isAccessDenied()) {
         $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
     }
     $nextClass = $this->ctrl->getNextClass();
     $this->manageTabs($nextClass);
     switch ($nextClass) {
         case 'ilassquestionskillassignmentsgui':
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
             $questionList = new ilAssQuestionList($this->db, $this->lng, $this->pluginAdmin);
             $questionList->setParentObjId($this->poolOBJ->getId());
             $questionList->setQuestionInstanceTypeFilter(ilAssQuestionList::QUESTION_INSTANCE_TYPE_ORIGINALS);
             $questionList->load();
             $gui = new ilAssQuestionSkillAssignmentsGUI($this->ctrl, $this->access, $this->tpl, $this->lng, $this->db);
             $gui->setAssignmentEditingEnabled(true);
             $gui->setQuestionContainerId($this->poolOBJ->getId());
             $gui->setQuestionList($questionList);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilassquestionskillusagestablegui':
             $gui = new ilAssQuestionSkillUsagesTableGUI($this->ctrl, $this->tpl, $this->lng, $this->db, $this->poolOBJ->getId());
             $this->ctrl->forwardCommand($gui);
             break;
     }
 }
 protected function saveQuestion()
 {
     $question_id = $_POST['q_id'];
     $question_pool_id = $_POST['qpl_id'];
     $form = $this->buildAdjustQuestionForm($question_id, $question_pool_id);
     $form->setValuesByPost($_POST);
     if (!$form->checkInput()) {
         ilUtil::sendFailure($this->lng->txt('adjust_question_form_error'));
         $this->outputAdjustQuestionForm($form);
         return;
     }
     require_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
     /** @var $question assQuestionGUI|ilGuiQuestionScoringAdjustable */
     $question = assQuestion::instantiateQuestionGUI($question_id);
     if ($question instanceof ilGuiQuestionScoringAdjustable) {
         $question->writeQuestionSpecificPostData($form);
     }
     if ($question->object instanceof ilObjQuestionScoringAdjustable) {
         $question->object->saveAdditionalQuestionDataToDb();
     }
     if ($question instanceof ilGuiAnswerScoringAdjustable) {
         $question->writeAnswerSpecificPostData($form);
     }
     if ($question->object instanceof ilObjAnswerScoringAdjustable) {
         $question->object->saveAnswerSpecificDataToDb();
     }
     $question->object->setPoints($question->object->getMaximumPoints());
     $question->object->saveQuestionDataToDb();
     require_once './Modules/Test/classes/class.ilTestScoring.php';
     $scoring = new ilTestScoring($this->object);
     $scoring->setPreserveManualScores($_POST['preserve_manscoring'] == 1 ? true : false);
     $scoring->recalculateSolutions();
     ilUtil::sendSuccess($this->lng->txt('saved_adjustment'));
     $this->questionsObject();
 }
 public function showAttachments()
 {
     /**
      * @var $ilToolbar ilToolbarGUI
      */
     global $ilToolbar;
     $this->tpl->setTitle($this->lng->txt('mail'));
     require_once 'Services/Form/classes/class.ilFileInputGUI.php';
     $attachment = new ilFileInputGUI($this->lng->txt('upload'), 'userfile');
     $attachment->setRequired(true);
     $attachment->setSize(20);
     $ilToolbar->setFormAction($this->ctrl->getFormAction($this, 'uploadFile'), true);
     $ilToolbar->addInputItem($attachment);
     $ilToolbar->addFormButton($this->lng->txt('upload'), 'uploadFile');
     require_once 'Services/Mail/classes/class.ilMailAttachmentTableGUI.php';
     $table = new ilMailAttachmentTableGUI($this, 'showAttachments');
     $mailData = $this->umail->getSavedData();
     $files = $this->mfile->getUserFilesData();
     $data = array();
     $counter = 0;
     foreach ($files as $file) {
         $checked = false;
         if (is_array($mailData['attachments']) && in_array($file['name'], $mailData['attachments'])) {
             $checked = true;
         }
         $data[$counter] = array('checked' => $checked, 'filename' => $file['name'], 'filesize' => (int) $file['size'], 'filecreatedate' => (int) $file['ctime']);
         ++$counter;
     }
     $table->setData($data);
     $this->tpl->setContent($table->getHtml());
     $this->tpl->show();
 }
 /**
  * list fields
  */
 public function listFields()
 {
     // Show tables
     require_once "./Modules/DataCollection/classes/class.ilDataCollectionTable.php";
     $tables = $this->parent_obj->object->getTables();
     foreach ($tables as $table) {
         $options[$table->getId()] = $table->getTitle();
     }
     include_once './Services/Form/classes/class.ilSelectInputGUI.php';
     $table_selection = new ilSelectInputGUI('', 'table_id');
     $table_selection->setOptions($options);
     $table_selection->setValue($this->table_id);
     $this->toolbar->setFormAction($this->ctrl->getFormActionByClass("ilDataCollectionFieldListGUI", "doTableSwitch"));
     $this->toolbar->addText($this->lng->txt("dcl_table"));
     $this->toolbar->addInputItem($table_selection);
     $this->toolbar->addFormButton($this->lng->txt('change'), 'doTableSwitch');
     $this->toolbar->addSeparator();
     $this->toolbar->addButton($this->lng->txt("dcl_add_new_table"), $this->ctrl->getLinkTargetByClass("ildatacollectiontableeditgui", "create"));
     $this->toolbar->addSeparator();
     $this->ctrl->setParameterByClass("ildatacollectiontableeditgui", "table_id", $this->table_id);
     $this->toolbar->addButton($this->lng->txt("dcl_table_settings"), $this->ctrl->getLinkTargetByClass("ildatacollectiontableeditgui", "edit"));
     $this->toolbar->addButton($this->lng->txt("dcl_delete_table"), $this->ctrl->getLinkTargetByClass("ildatacollectiontableeditgui", "confirmDelete"));
     $this->toolbar->addButton($this->lng->txt("dcl_add_new_field"), $this->ctrl->getLinkTargetByClass("ildatacollectionfieldeditgui", "create"));
     // requested not to implement this way...
     //        $tpl->addJavaScript("Modules/DataCollection/js/fastTableSwitcher.js");
     require_once './Modules/DataCollection/classes/class.ilDataCollectionFieldListTableGUI.php';
     $list = new ilDataCollectionFieldListTableGUI($this, $this->ctrl->getCmd(), $this->table_id);
     $this->tpl->setContent($list->getHTML());
 }
 public function displayForm()
 {
     global $lng;
     $this->tpl->addBlockFile("CONTENT", "content", "tpl.startup_screen.html", "Services/Init");
     $this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.png"));
     $this->tpl->addBlockFile("STARTUP_CONTENT", "startup_content", "tpl.usr_registration.html", "Services/Registration");
     $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
     $this->tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("registration"));
     $lang_opts = array();
     foreach ($lng->getInstalledLanguages() as $lang_key) {
         $lang_opts[$lang_key] = ilLanguage::_lookupEntry($lang_key, "meta", "meta_l_" . $lang_key);
     }
     // #11237
     if (sizeof($lang_opts) > 1) {
         // language selection
         $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
         $this->tpl->setVariable("TXT_OK", $lng->txt("ok"));
         $this->tpl->setVariable("TXT_CHOOSE_LANGUAGE", $lng->txt("choose_language"));
         asort($lang_opts);
         $this->tpl->setCurrentBlock("languages");
         foreach ($lang_opts as $lang_key => $lang_caption) {
             $this->tpl->setVariable("LANG_NAME", $lang_caption);
             $this->tpl->setVariable("LANG_ICON", $lang_key);
             if ($lang_key == $lng->getLangKey()) {
                 $this->tpl->setVariable("SELECTED_LANG", " selected=\"selected\"");
             }
             $this->tpl->parseCurrentBlock();
         }
     }
     if (!$this->form) {
         $this->__initForm();
     }
     $this->tpl->setVariable("FORM", $this->form->getHTML());
 }
 public function build($activeId, $pass, $context)
 {
     $this->addHiddenItem('active_id', $activeId);
     $this->addHiddenItem('pass', $pass);
     switch ($context) {
         case self::CONTEXT_PASS_OVERVIEW:
         case self::CONTEXT_INFO_SCREEN:
         case self::CONTEXT_DYN_TEST_PLAYER:
             $this->addHiddenItem('context', $context);
             break;
         default:
             throw new ilTestException('invalid context given!');
     }
     $this->setCancel($this->lng->txt('cancel'), 'cancelDeletePass');
     $this->setConfirm($this->lng->txt('delete'), 'performDeletePass');
     $this->setHeaderText($this->lng->txt('conf_delete_pass'));
 }
 /**
  * This form is used to show a message to the user.
  * @param string $text
  */
 public function showMessageForm($text)
 {
     ilStartUpGUI::initStartUpTemplate('tpl.pwassist_message.html', true);
     $this->tpl->setVariable('TXT_PAGEHEADLINE', $this->lng->txt('password_assistance'));
     $this->tpl->setVariable('IMG_PAGEHEADLINE', ilUtil::getImagePath('icon_auth_b.png'));
     $this->tpl->setVariable('TXT_TEXT', str_replace("\\n", '<br />', $text));
     $this->tpl->show();
 }
 /**
  * Returns label for tab by $tabDefinition or $id
  * @param array  $tabDefinition
  * @param string $id
  * @return string
  * @todo: $tabDefinition sollte doch stets ein array und $id stets ein
  *      string sein, oder? Dann sollte man auch hier typehinten.
  * (array $tabDefinition, string $id)
  */
 private function getLabel($tabDefinition, $id)
 {
     if (isset($tabDefinition['lng'])) {
         return $this->lng->txt($tabDefinition['lng']);
     } else {
         return $this->lng->txt($id);
     }
 }
 protected function buildQuestionRelatedObjectivesString()
 {
     if (strlen($this->getQuestionRelatedObjectives())) {
         $label = $this->lng->txt('tst_res_lo_objectives_header');
         return '<div class="ilTestQuestionRelatedObjectivesInfo">' . $label . ': ' . $this->getQuestionRelatedObjectives();
     }
     return '';
 }
 private function getTaxonomySelectInputOptions()
 {
     $taxSelectOptions = array('0' => $this->lng->txt('qpl_settings_general_form_property_opt_notax_selected'));
     foreach ($this->poolOBJ->getTaxonomyIds() as $taxId) {
         $taxSelectOptions[$taxId] = ilObject::_lookupTitle($taxId);
     }
     return $taxSelectOptions;
 }