/** * list questions of question pool */ public function questionsObject($arrFilter = null) { global $rbacsystem; global $ilUser; global $ilToolbar; if (get_class($this->object) == "ilObjSurvey") { if ($_GET["calling_survey"] > 0 || $_GET["new_for_survey"] > 0) { $ref_id = $_GET["calling_survey"]; if (!strlen($ref_id)) { $ref_id = $_GET["new_for_survey"]; } $addurl = ""; if (strlen($_GET["new_for_survey"])) { $addurl = "&new_id=" . $_GET["q_id"]; } if ($_REQUEST["pgov"]) { $addurl .= "&pgov=" . $_REQUEST["pgov"]; $addurl .= "&pgov_pos=" . $_REQUEST["pgov_pos"]; } ilUtil::redirect("ilias.php?baseClass=ilObjSurveyGUI&ref_id=" . $ref_id . "&cmd=questions" . $addurl); } } $this->object->purgeQuestions(); $_SESSION['q_id_table_nav'] = $_GET['q_id_table_nav']; if ($rbacsystem->checkAccess('write', $_GET['ref_id'])) { include_once "Services/Form/classes/class.ilSelectInputGUI.php"; $qtypes = new ilSelectInputGUI("", "sel_question_types"); $qtypes->setValue($ilUser->getPref("svy_lastquestiontype")); $ilToolbar->addInputItem($qtypes); $options = array(); foreach (ilObjSurveyQuestionPool::_getQuestionTypes() as $translation => $data) { $options[$data["type_tag"]] = $translation; } $qtypes->setOptions($options); $ilToolbar->setFormAction($this->ctrl->getFormAction($this)); $ilToolbar->addFormButton($this->lng->txt("create"), "createQuestion"); $ilToolbar->addSeparator(); $ilToolbar->addFormButton($this->lng->txt('import'), 'importQuestions'); } include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php"; $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions', $rbacsystem->checkAccess('write', $_GET['ref_id']) ? true : false); $table_gui->setEditable($rbacsystem->checkAccess('write', $_GET['ref_id'])); $arrFilter = array(); foreach ($table_gui->getFilterItems() as $item) { if ($item->getValue() !== false) { $arrFilter[$item->getPostVar()] = $item->getValue(); } } $table_gui->setData($this->object->getQuestionsData($arrFilter)); $this->tpl->setContent($table_gui->getHTML()); }
/** * list questions of question pool */ public function questionsObject($arrFilter = null) { global $rbacsystem; global $ilUser; global $ilToolbar; $this->object->purgeQuestions(); $_SESSION['q_id_table_nav'] = $_GET['q_id_table_nav']; if ($rbacsystem->checkAccess('write', $_GET['ref_id'])) { include_once "Services/Form/classes/class.ilSelectInputGUI.php"; $qtypes = new ilSelectInputGUI("", "sel_question_types"); $qtypes->setValue($ilUser->getPref("svy_lastquestiontype")); $ilToolbar->addInputItem($qtypes); $options = array(); foreach (ilObjSurveyQuestionPool::_getQuestionTypes() as $translation => $data) { $options[$data["type_tag"]] = $translation; } $qtypes->setOptions($options); $ilToolbar->setFormAction($this->ctrl->getFormAction($this)); include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php"; $button = ilSubmitButton::getInstance(); $button->setCaption("svy_create_question"); $button->setCommand("createQuestion"); $ilToolbar->addButtonInstance($button); $ilToolbar->addSeparator(); $button = ilSubmitButton::getInstance(); $button->setCaption("import"); $button->setCommand("importQuestions"); $ilToolbar->addButtonInstance($button); } include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php"; $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions', $rbacsystem->checkAccess('write', $_GET['ref_id']) ? true : false); $table_gui->setEditable($rbacsystem->checkAccess('write', $_GET['ref_id'])); $arrFilter = array(); foreach ($table_gui->getFilterItems() as $item) { if ($item->getValue() !== false) { $arrFilter[$item->getPostVar()] = $item->getValue(); } } $table_gui->setData($this->object->getQuestionsData($arrFilter)); $this->tpl->setContent($table_gui->getHTML()); }