/** * forward method */ public function forward() { $this->tabs->setTabActive('settings'); $this->lng->loadLanguageModule('tax'); require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php'; $questionList = new ilAssQuestionList($this->db, $this->lng, $this->pluginAdmin, $this->poolOBJ->getId()); $questionList->load(); require_once 'Services/Taxonomy/classes/class.ilObjTaxonomyGUI.php'; $taxGUI = new ilObjTaxonomyGUI(); $taxGUI->setAssignedObject($this->poolOBJ->getId()); $taxGUI->setMultiple(true); $taxGUI->activateAssignedItemSorting($questionList, 'qpl', $this->poolOBJ->getId(), 'quest'); $this->ctrl->forwardCommand($taxGUI); }
/** * @param array $taxIds * @global ilRbacSystem $rbacsystem * @global ilDB $ilDB * @global ilLanguage $lng * @global ilPluginAdmin $ilPluginAdmin * @return ilQuestionBrowserTableGUI */ private function buildQuestionBrowserTableGUI($taxIds) { global $rbacsystem, $ilDB, $lng, $ilPluginAdmin; include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php"; $table_gui = new ilQuestionBrowserTableGUI($this, 'questions', $rbacsystem->checkAccess('write', $_GET['ref_id']) ? true : false, false, $taxIds); $table_gui->setEditable($rbacsystem->checkAccess('write', $_GET['ref_id'])); require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php'; $questionList = new ilAssQuestionList($ilDB, $lng, $ilPluginAdmin, $this->object->getId()); foreach ($table_gui->getFilterItems() as $item) { if (substr($item->getPostVar(), 0, strlen('tax_')) == 'tax_') { $v = $item->getValue(); if (is_array($v) && count($v) && !(int) $v[0]) { continue; } $taxId = substr($item->getPostVar(), strlen('tax_')); $questionList->addTaxonomyFilter($taxId, $item->getValue()); } elseif ($item->getValue() !== false) { $questionList->addFieldFilter($item->getPostVar(), $item->getValue()); } } if ($this->object->isNavTaxonomyActive() && (int) $_GET['tax_node']) { $questionList->addTaxonomyFilter($this->object->getNavTaxonomyId(), array((int) $_GET['tax_node'])); } $questionList->load(); $data = $questionList->getQuestionDataArray(); $table_gui->setData($data); return $table_gui; }
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; } }
/** * show information screen */ function infoScreenForward() { global $ilErr, $ilAccess; if (!$ilAccess->checkAccess("visible", "", $this->ref_id)) { $ilErr->raiseError($this->lng->txt("msg_no_perm_read")); } include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); $info->enablePrivateNotes(); // standard meta data $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType()); $this->ctrl->forwardCommand($info); }
public function copyQuestionsToPoolObject($returnResult = false) { //var_dump($_REQUEST); include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php'; $qpool = new ilObjQuestionPool($_REQUEST['sel_qpl'], true); $qpool->setOnline(ilObjQuestionPool::_lookupOnline($_REQUEST['sel_qpl'], true)); $newIds = array(); foreach ($_REQUEST['q_id'] as $q_id) { $newId = $qpool->copyQuestion($q_id, $qpool->getId()); $newIds[$q_id] = $newId; } $result = new stdClass(); $result->ids = $newIds; $result->qpool = $qpool; if ($returnResult) { return $result; } else { $this->backObject(); } }