private function initFilteredQuestionList(ilObjTestDynamicQuestionSetConfig $dynamicQuestionSetConfig, $taxonomyFilterSelection)
 {
     $questionList = new ilAssQuestionList($this->db, $this->lng, $this->pluginAdmin, $dynamicQuestionSetConfig->getSourceQuestionPoolId());
     if ($dynamicQuestionSetConfig->isTaxonomyFilterEnabled()) {
         require_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
         $questionList->setAvailableTaxonomyIds(ilObjTaxonomy::getUsageOfObject($dynamicQuestionSetConfig->getSourceQuestionPoolId()));
         foreach ($taxonomyFilterSelection as $taxId => $taxNodes) {
             $questionList->addTaxonomyFilter($taxId, $taxNodes);
         }
     } elseif ($dynamicQuestionSetConfig->getOrderingTaxonomyId()) {
         $questionList->setAvailableTaxonomyIds(array($dynamicQuestionSetConfig->getOrderingTaxonomyId()));
     }
     $questionList->load();
     return $questionList;
 }
 private function initFilteredQuestionList(ilObjTestDynamicQuestionSetConfig $dynamicQuestionSetConfig, ilTestDynamicQuestionSetFilterSelection $filterSelection)
 {
     $questionList = new ilAssQuestionList($this->db, $this->lng, $this->pluginAdmin);
     $questionList->setParentObjIdsFilter(array($dynamicQuestionSetConfig->getSourceQuestionPoolId()));
     $questionList->setAnswerStatusActiveId($filterSelection->getAnswerStatusActiveId());
     if ($dynamicQuestionSetConfig->isAnswerStatusFilterEnabled()) {
         $questionList->setAnswerStatusFilter($filterSelection->getAnswerStatusSelection());
     }
     if ($dynamicQuestionSetConfig->isTaxonomyFilterEnabled()) {
         require_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
         $questionList->setAvailableTaxonomyIds(ilObjTaxonomy::getUsageOfObject($dynamicQuestionSetConfig->getSourceQuestionPoolId()));
         foreach ($filterSelection->getTaxonomySelection() as $taxId => $taxNodes) {
             $questionList->addTaxonomyFilter($taxId, $taxNodes, $dynamicQuestionSetConfig->getSourceQuestionPoolId(), 'qpl');
         }
     } elseif ($dynamicQuestionSetConfig->getOrderingTaxonomyId()) {
         $questionList->setAvailableTaxonomyIds(array($dynamicQuestionSetConfig->getOrderingTaxonomyId()));
     }
     $questionList->setForcedQuestionIds($filterSelection->getForcedQuestionIds());
     $questionList->load();
     return $questionList;
 }
 /**
  * @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;
 }
 protected function getFilteredTestResult($active_id, $pass)
 {
     global $ilDB, $ilPluginAdmin;
     $testResults = $this->object->getTestResult($active_id, $pass);
     $questionIds = array();
     foreach ($testResults as $resultItemKey => $resultItemValue) {
         if ($resultItemKey === 'test' || $resultItemKey === 'pass') {
             continue;
         }
         $questionIds[] = $resultItemValue['qid'];
     }
     $table_gui = $this->buildPassDetailsOverviewTableGUI($this, 'outUserPassDetails');
     $table_gui->initFilter();
     require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
     $questionList = new ilAssQuestionList($ilDB, $this->lng, $ilPluginAdmin, null);
     $questionList->setQuestionIdsFilter($questionIds);
     $questionList->setQuestionInstanceTypeFilter(null);
     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());
         }
     }
     $questionList->load();
     $filteredTestResult = array();
     foreach ($testResults as $resultItemKey => $resultItemValue) {
         if ($resultItemKey === 'test' || $resultItemKey === 'pass') {
             continue;
         }
         if (!$questionList->isInList($resultItemValue['qid'])) {
             continue;
         }
         $filteredTestResult[] = $resultItemValue;
     }
     return $filteredTestResult;
 }