/** * Is node visible * * @param array $a_node node data * @return bool visible true/false */ function isNodeVisible($a_node) { if (parent::isNodeVisible($a_node)) { //hide empty container if (count($this->getChildsOfNode($a_node["child"])) > 0 || $this->isNodeClickable($a_node)) { // #16523 if ($a_node["type"] == "qpl") { include_once "Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php"; return ilObjQuestionPool::_lookupOnline($a_node["obj_id"]); } return true; } } return false; }
/** * Get item properties * * @return array array of property arrays: * "alert" (boolean) => display as an alert property (usually in red) * "property" (string) => property name * "value" (string) => property value */ function getProperties() { global $lng, $ilUser; $props = array(); include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php"; if (!ilObjQuestionPool::_lookupOnline($this->obj_id)) { $props[] = array("alert" => true, "property" => $lng->txt("status"), "value" => $lng->txt("offline")); } return $props; }
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(); } }