/** * Save questionpool properties */ function savePropertiesObject() { $qpl_online = $_POST["online"]; if (strlen($qpl_online) == 0) { $qpl_online = "0"; } $this->object->setOnline($qpl_online); $this->object->saveToDb(); ilUtil::sendSuccess($this->lng->txt("saved_successfully"), true); $this->ctrl->redirect($this, "properties"); }
/** * Creates a new questionpool and returns the reference id * * Creates a new questionpool and returns the reference id * * @return integer Reference id of the newly created questionpool * @access public */ function createQuestionPool($name = "Dummy") { global $tree; $parent_ref = $tree->getParentId($_GET["ref_id"]); include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php"; $qpl = new ilObjQuestionPool(); $qpl->setType("qpl"); $qpl->setTitle($name); $qpl->setDescription(""); $qpl->create(); $qpl->createReference(); $qpl->putInTree($parent_ref); $qpl->setPermissions($parent_ref); $qpl->setOnline(1); // must be online to be available $qpl->saveToDb(); return $qpl->getRefId(); }
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(); } }