4include_once 
"./Modules/Test/classes/inc.AssessmentConstants.php";
 
   59                $this->
ilObject($a_id,$a_call_by_reference);
 
   62                $this->skillServiceEnabled = 
false;
 
   88                $result = parent::createReference();
 
  102                if (!parent::update())
 
  115                include_once 
"./Services/MetaData/classes/class.ilMD.php";
 
  117                $md_gen =& $md->getGeneral();
 
  118                if ($md_gen == 
false)
 
  120                        include_once 
"./Services/MetaData/classes/class.ilMDCreator.php";
 
  122                        $md_creator->setTitle($this->
getTitle());
 
  123                        $md_creator->setTitleLanguage(
$ilUser->getPref(
'language'));
 
  124                        $md_creator->create();
 
  126                parent::updateMetaData();
 
  134        function read($a_force_db = 
false)
 
  136                parent::read($a_force_db);
 
  150                if (!parent::delete())
 
  168                if (count($questions))
 
  170                        foreach ($questions as $question_id)
 
  177                include_once 
"./Services/Utilities/classes/class.ilUtil.php";
 
  179                $directory = $qpl_data_dir.
"/qpl_".$this->
getId();
 
  180                if (is_dir($directory))
 
  182                        include_once 
"./Services/Utilities/classes/class.ilUtil.php";
 
  201        function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
 
  241                if ($a_node_id==
$_GET[
"ref_id"])
 
  243                        $parent_obj =& $this->
ilias->obj_factory->getInstanceByRefId($a_node_id);
 
  244                        $parent_type = $parent_obj->getType();
 
  245                        if($parent_type == $this->
getType())
 
  247                                $a_node_id = (int) $tree->getParentId($a_node_id);
 
  251                parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
 
  262                include_once 
"./Modules/Test/classes/class.ilObjTest.php";
 
  263                include_once 
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
 
  267                $question->delete($question_id);
 
  292                $result = 
$ilDB->queryF(
"SELECT * FROM qpl_questionpool WHERE obj_fi = %s",
 
  294                        array($this->
getId())
 
  315                $result = 
$ilDB->queryF(
"SELECT id_questionpool FROM qpl_questionpool WHERE obj_fi = %s",
 
  317                        array($this->
getId())
 
  322                        $result = $ilDB->update(
'qpl_questionpool',
 
  324                                        'isonline'                      => array(
'text', $this->
getOnline()),
 
  328                                        'tstamp'                        => array(
'integer', time())
 
  331                                        'obj_fi'                        => array(
'integer', $this->
getId())
 
  337                        $next_id = 
$ilDB->nextId(
'qpl_questionpool');
 
  340                                'id_questionpool'       => array(
'integer', $next_id),
 
  341                                'isonline'                      => array(
'text', $this->
getOnline()),
 
  345                                'tstamp'                        => array(
'integer', time()),
 
  346                                'obj_fi'                        => array(
'integer', $this->
getId())
 
  362                if ($question_id < 1)
 
  367                $result = 
$ilDB->queryF(
"SELECT qpl_qst_type.type_tag FROM qpl_questions, qpl_qst_type WHERE qpl_questions.question_type_fi = qpl_qst_type.question_type_id AND qpl_questions.question_id = %s",
 
  374                        return $data[
"type_tag"];
 
  389                return parent::getDescription();
 
  397                parent::setDescription($a_description);
 
  407                return parent::getTitle();
 
  415                parent::setTitle($a_title);
 
  429                $result = 
$ilDB->queryF(
"SELECT COUNT(solution_id) solution_count FROM tst_solutions WHERE question_fi = %s",
 
  434                return $row[
"solution_count"];
 
  439                include_once 
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
 
  442                $question_type_gui = $question_type . 
"GUI";
 
  443                $question_gui =& 
new $question_type_gui();
 
  444                return $question_gui;
 
  456                $newtitle = $question->object->getTitle(); 
 
  457                if ($question->object->questionTitleExists($this->getId(), $question->object->getTitle()))
 
  460                        while ($question->object->questionTitleExists($this->getId(), $question->object->getTitle() . 
" ($counter)"))
 
  464                        $newtitle = $question->object->getTitle() . 
" ($counter)";
 
  466                $new_id = $question->object->duplicate(
false, $newtitle);
 
  482                if ($question_gui->object->getObjId() == $questionpool_to)
 
  490                        $newtitle = $question_gui->object->getTitle(); 
 
  491                        if ($question_gui->object->questionTitleExists($this->getId(), $question_gui->object->getTitle()))
 
  494                                while ($question_gui->object->questionTitleExists($this->getId(), $question_gui->object->getTitle() . 
" ($counter)"))
 
  498                                $newtitle = $question_gui->object->getTitle() . 
" ($counter)";
 
  500                        return $question_gui->object->copyObject($this->
getId(), $newtitle);
 
  513                $query_result = 
$ilDB->queryF(
"SELECT qpl_questions.*, qpl_qst_type.type_tag, qpl_qst_type.plugin, qpl_questions.tstamp updated FROM qpl_questions, qpl_qst_type WHERE qpl_questions.original_id IS NULL AND qpl_questions.tstamp > 0 AND qpl_questions.question_type_fi = qpl_qst_type.question_type_id AND qpl_questions.obj_fi = %s",
 
  515                        array($this->
getId())
 
  519                if ($query_result->numRows())
 
  521                        while (
$row = 
$ilDB->fetchAssoc($query_result))
 
  523                                $row[
'ttype'] = $types[
$row[
'type_tag']];
 
  528                                                array_push($rows, 
$row);
 
  533                                        array_push($rows, 
$row);
 
  545                $xmlWriter->xmlStartTag(
'Settings');
 
  548                $xmlWriter->xmlElement(
'NavTaxonomy', 
null, (
int)$this->
getNavTaxonomyId());
 
  551                $xmlWriter->xmlEndTag(
'Settings');
 
  560        function exportPagesXML(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog, $questions)
 
  564                $this->mob_ids = array();
 
  565                $this->file_ids = array();
 
  568                $attrs[
"Type"] = 
"Questionpool_Test";
 
  569                $a_xml_writer->xmlStartTag(
"ContentObject", $attrs);
 
  578                $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export Page Objects");
 
  579                $ilBench->start(
"ContentObjectExport", 
"exportPageObjects");
 
  581                $ilBench->stop(
"ContentObjectExport", 
"exportPageObjects");
 
  582                $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export Page Objects");
 
  585                $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export Media Objects");
 
  586                $ilBench->start(
"ContentObjectExport", 
"exportMediaObjects");
 
  588                $ilBench->stop(
"ContentObjectExport", 
"exportMediaObjects");
 
  589                $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export Media Objects");
 
  592                $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export File Items");
 
  593                $ilBench->start(
"ContentObjectExport", 
"exportFileItems");
 
  595                $ilBench->stop(
"ContentObjectExport", 
"exportFileItems");
 
  596                $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export File Items");
 
  598                $a_xml_writer->xmlEndTag(
"ContentObject");
 
  609                include_once(
"Services/MetaData/classes/class.ilMD2XML.php");
 
  611                $md2xml->setExportMode(
true);
 
  612                $md2xml->startExport();
 
  613                $a_xml_writer->appendXML($md2xml->getXML());
 
  618                if ($a_tag == 
"Identifier" && $a_param == 
"Entry")
 
  620                        include_once 
"./Services/Utilities/classes/class.ilUtil.php";
 
  638                include_once 
"./Modules/LearningModule/classes/class.ilLMPageObject.php";
 
  640                foreach ($questions as $question_id)
 
  642                        $ilBench->start(
"ContentObjectExport", 
"exportPageObject");
 
  643                        $expLog->write(date(
"[y-m-d H:i:s] ").
"Page Object ".$question_id);
 
  646                        $a_xml_writer->xmlStartTag(
"PageObject", $attrs);
 
  650                        $ilBench->start(
"ContentObjectExport", 
"exportPageObject_XML");
 
  651                        include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php");
 
  653                        $page_object->buildDom();
 
  654                        $page_object->insertInstIntoIDs($a_inst);
 
  655                        $mob_ids = $page_object->collectMediaObjects(
false);
 
  656                        require_once 
'Services/COPage/classes/class.ilPCFileList.php';
 
  658                        $xml = $page_object->getXMLFromDom(
false, 
false, 
false, 
"", 
true);
 
  659                        $xml = str_replace(
"&",
"&", $xml);
 
  660                        $a_xml_writer->appendXML($xml);
 
  661                        $page_object->freeDom();
 
  662                        unset ($page_object);
 
  664                        $ilBench->stop(
"ContentObjectExport", 
"exportPageObject_XML");
 
  667                        $ilBench->start(
"ContentObjectExport", 
"exportPageObject_CollectMedia");
 
  669                        foreach($mob_ids as $mob_id)
 
  671                                $this->mob_ids[$mob_id] = $mob_id;
 
  673                        $ilBench->stop(
"ContentObjectExport", 
"exportPageObject_CollectMedia");
 
  676                        $ilBench->start(
"ContentObjectExport", 
"exportPageObject_CollectFileItems");
 
  678                        foreach($file_ids as $file_id)
 
  680                                $this->file_ids[$file_id] = $file_id;
 
  682                        $ilBench->stop(
"ContentObjectExport", 
"exportPageObject_CollectFileItems");
 
  684                        $a_xml_writer->xmlEndTag(
"PageObject");
 
  687                        $ilBench->stop(
"ContentObjectExport", 
"exportPageObject");
 
  701                include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
  703                foreach ($this->mob_ids as $mob_id)
 
  705                        $expLog->write(date(
"[y-m-d H:i:s] ").
"Media Object ".$mob_id);
 
  709                                $media_obj->exportXML($a_xml_writer, $a_inst);
 
  710                                $media_obj->exportFiles($a_target_dir);
 
  722                include_once(
"./Modules/File/classes/class.ilObjFile.php");
 
  724                foreach ($this->file_ids as $file_id)
 
  726                        $expLog->write(date(
"[y-m-d H:i:s] ").
"File Item ".$file_id);
 
  727                        $file_obj = 
new ilObjFile($file_id, 
false);
 
  728                        $file_obj->export($a_target_dir);
 
  740                include_once 
"./Services/Utilities/classes/class.ilUtil.php";
 
  743                if(!is_writable($qpl_data_dir))
 
  745                        $this->
ilias->raiseError(
"Questionpool Data Directory (".$qpl_data_dir
 
  746                                .
") not writeable.",$this->
ilias->error_obj->FATAL);
 
  750                $qpl_dir = $qpl_data_dir.
"/qpl_".$this->
getId();
 
  752                if(!@is_dir($qpl_dir))
 
  754                        $this->
ilias->raiseError(
"Creation of Questionpool Directory failed.",$this->
ilias->error_obj->FATAL);
 
  760                        $this->
ilias->raiseError(
"Creation of Export Directory failed.",$this->
ilias->error_obj->FATAL);
 
  765                        $this->
ilias->raiseError(
"Creation of Export Directory failed.",$this->
ilias->error_obj->FATAL);
 
  774                include_once 
"./Services/Utilities/classes/class.ilUtil.php";
 
  778                                include_once(
"./Services/Export/classes/class.ilExport.php");
 
  783                                $export_dir = 
ilUtil::getDataDir().
"/qpl_data".
"/qpl_".$this->getId().
"/export_$type";
 
  801                include_once 
"./Services/Utilities/classes/class.ilUtil.php";
 
  805                if(!is_writable($qpl_data_dir))
 
  807                        $ilias->raiseError(
"Questionpool Data Directory (".$qpl_data_dir
 
  808                                .
") not writeable.",
$ilias->error_obj->FATAL);
 
  812                $qpl_dir = $qpl_data_dir.
"/qpl_import";
 
  814                if(!@is_dir($qpl_dir))
 
  816                        $ilias->raiseError(
"Creation of Questionpool Directory failed.",
$ilias->error_obj->FATAL);
 
  826                if (strlen($a_import_dir))
 
  828                        $_SESSION[
"qpl_import_dir"] = $a_import_dir;
 
  862                $result = 
$ilDB->queryF(
"SELECT question_id FROM qpl_questions WHERE obj_fi = %s AND qpl_questions.tstamp > 0 AND original_id IS NULL",
 
  864                        array($this->
getId())
 
  866                $questions = array();
 
  869                        array_push($questions, 
$row[
"question_id"]);
 
  878                $query_result = 
$ilDB->queryF(
"SELECT question_id, qpl_qst_type.type_tag, qpl_qst_type.plugin FROM qpl_questions, qpl_qst_type WHERE original_id IS NULL AND qpl_questions.tstamp > 0 AND obj_fi = %s AND complete = %s AND qpl_questions.question_type_fi = qpl_qst_type.question_type_id",
 
  879                        array(
'integer',
'text'),
 
  880                        array($this->
getId(), 1)
 
  882                $questions = array();
 
  883                if ($query_result->numRows())
 
  885                        while (
$row = 
$ilDB->fetchAssoc($query_result))
 
  891                                                array_push($questions, 
$row[
"question_id"]);
 
  896                                        array_push($questions, 
$row[
"question_id"]);
 
  909                if (!is_array($this->import_mapping))
 
  915                        return $this->import_mapping;
 
  930                if (count($questions) > 0)
 
  932                        foreach ($questions as $key => $value)
 
  935                                $xml .= $question->object->toXML();
 
  937                        if (count($questions) > 1)
 
  939                                $xml = preg_replace(
"/<\/questestinterop>\s*<.xml.*?>\s*<questestinterop>/", 
"", $xml);
 
  942                $xml = preg_replace(
"/(<\?xml[^>]*?>)/", 
"\\1" . 
"<!DOCTYPE questestinterop SYSTEM \"ims_qtiasiv1p2p1.dtd\">", $xml);
 
  957                if ($complete_questions_only)
 
  959                        $result = 
$ilDB->queryF(
"SELECT COUNT(question_id) question_count FROM qpl_questions WHERE obj_fi = %s AND qpl_questions.tstamp > 0 AND original_id IS NULL AND complete = %s",
 
  960                                array(
'integer', 
'text'),
 
  961                                array($questionpool_id, 1)
 
  966                        $result = 
$ilDB->queryF(
"SELECT COUNT(question_id) question_count FROM qpl_questions WHERE obj_fi = %s AND qpl_questions.tstamp > 0 AND original_id IS NULL",
 
  968                                array($questionpool_id)
 
  972                return $row[
"question_count"];
 
  984                switch ($a_online_status)
 
  988                                $this->online = $a_online_status;
 
  998                if (strcmp($this->online, 
"") == 0) $this->online = 
"0";
 
 1033                        $result = 
$ilDB->queryF(
"SELECT qpl_questionpool.isonline FROM qpl_questionpool,object_reference WHERE object_reference.ref_id = %s AND object_reference.obj_id = qpl_questionpool.obj_fi",
 
 1040                        $result = 
$ilDB->queryF(
"SELECT isonline FROM qpl_questionpool WHERE obj_fi = %s",
 
 1048                        return $row[
"isonline"];
 
 1065                        $result = 
$ilDB->queryF(
"SELECT count(DISTINCT qpl_questions.points) equal_points FROM qpl_questions, object_reference WHERE object_reference.ref_id = %s AND qpl_questions.tstamp > 0 AND object_reference.obj_id = qpl_questions.obj_fi AND qpl_questions.original_id IS NULL",
 
 1072                        $result = 
$ilDB->queryF(
"SELECT count(DISTINCT points) equal_points FROM qpl_questions WHERE obj_fi = %s AND qpl_questions.tstamp > 0 AND qpl_questions.original_id IS NULL",
 
 1080                        if (
$row[
"equal_points"] == 1)
 
 1102                if (array_key_exists(
"qpl_clipboard", 
$_SESSION))
 
 1105                        foreach (
$_SESSION[
"qpl_clipboard"] as $question_object)
 
 1107                                if (strcmp($question_object[
"action"], 
"move") == 0)
 
 1109                                        $result = 
$ilDB->queryF(
"SELECT obj_fi FROM qpl_questions WHERE question_id = %s",
 
 1111                                                array($question_object[
"question_id"])
 
 1116                                                $source_questionpool = 
$row[
"obj_fi"];
 
 1118                                                $affectedRows = 
$ilDB->manipulateF(
"UPDATE qpl_questions SET obj_fi = %s WHERE question_id = %s",
 
 1119                                                        array(
'integer',
'integer'),
 
 1120                                                        array($this->
getId(), $question_object[
"question_id"])
 
 1128                                                $source_path = CLIENT_WEB_DIR . 
"/assessment/" . $source_questionpool . 
"/" . $question_object[
"question_id"] . 
"/";
 
 1129                                                if (@is_dir($source_path))
 
 1131                                                        $target_path = CLIENT_WEB_DIR . 
"/assessment/" . $this->
getId() . 
"/";
 
 1132                                                        if (!@is_dir($target_path))
 
 1134                                                                include_once 
"./Services/Utilities/classes/class.ilUtil.php";
 
 1137                                                        rename($source_path, $target_path . $question_object[
"question_id"]);
 
 1145                                        $new_question_id = $this->
copyQuestion($question_object[
"question_id"], $this->
getId());
 
 1146                                        if(!$new_question_id)
 
 1168                if (!array_key_exists(
"qpl_clipboard", 
$_SESSION))
 
 1172                $_SESSION[
"qpl_clipboard"][$question_id] = array(
"question_id" => $question_id, 
"action" => 
"copy");
 
 1183                if (!array_key_exists(
"qpl_clipboard", 
$_SESSION))
 
 1187                $_SESSION[
"qpl_clipboard"][$question_id] = array(
"question_id" => $question_id, 
"action" => 
"move");
 
 1192                if( !isset(
$_SESSION[
'qpl_clipboard']) )
 
 1197                if( !isset(
$_SESSION[
'qpl_clipboard'][$deletedQuestionId]) )
 
 1202                unset(
$_SESSION[
'qpl_clipboard'][$deletedQuestionId]);
 
 1204                if( !count(
$_SESSION[
'qpl_clipboard']) )
 
 1221                include_once 
"./Services/Object/classes/class.ilObject.php";
 
 1248                $query_result = 
$ilDB->query(
"SELECT qpl_questions.*, qpl_qst_type.type_tag FROM qpl_questions, qpl_qst_type WHERE qpl_questions.question_type_fi = qpl_qst_type.question_type_id AND " . 
$ilDB->in(
'qpl_questions.question_id', $question_ids, 
false, 
'integer') . 
" ORDER BY qpl_questions.title");
 
 1249                if ($query_result->numRows())
 
 1251                        while (
$row = 
$ilDB->fetchAssoc($query_result))
 
 1272                $query_result = 
$ilDB->query(
"SELECT qpl_questions.*, qpl_qst_type.type_tag FROM qpl_questions, qpl_qst_type WHERE qpl_questions.question_type_fi = qpl_qst_type.question_type_id AND " . 
$ilDB->in(
'qpl_questions.question_id', $question_ids, 
false, 
'integer') . 
" ORDER BY qpl_questions.title");
 
 1273                if ($query_result->numRows())
 
 1275                        include_once 
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
 
 1276                        while (
$row = 
$ilDB->fetchAssoc($query_result))
 
 1291                                        $duplicate_id = $question->object->duplicate(
true);
 
 1292                                        if ($duplicate_id > 0)
 
 1295                                                $affectedRows = 
$ilDB->manipulateF(
"UPDATE tst_solutions SET question_fi = %s WHERE question_fi = %s",
 
 1296                                                        array(
'integer',
'integer'),
 
 1297                                                        array($duplicate_id, 
$row[
"question_id"])
 
 1301                                                $affectedRows = 
$ilDB->manipulateF(
"UPDATE tst_test_rnd_qst SET question_fi = %s WHERE question_fi = %s",
 
 1302                                                        array(
'integer',
'integer'),
 
 1303                                                        array($duplicate_id, 
$row[
"question_id"])
 
 1307                                                $affectedRows = 
$ilDB->manipulateF(
"UPDATE tst_test_result SET question_fi = %s WHERE question_fi = %s",
 
 1308                                                        array(
'integer',
'integer'),
 
 1309                                                        array($duplicate_id, 
$row[
"question_id"])
 
 1313                                                $affectedRows = 
$ilDB->manipulateF(
"UPDATE ass_log SET question_fi = %s WHERE question_fi = %s",
 
 1314                                                        array(
'integer',
'integer'),
 
 1315                                                        array($duplicate_id, 
$row[
"question_id"])
 
 1339                foreach (
$path as $item)
 
 1341                        if (($counter > 0) && ($counter < count(
$path)-1))
 
 1343                                array_push($items, $item[
"title"]);
 
 1347                $fullpath = join(
" > ", $items);
 
 1348                include_once 
"./Services/Utilities/classes/class.ilStr.php";
 
 1349                if (strlen($fullpath) > 60)
 
 1362        function &
_getAvailableQuestionpools($use_object_id = FALSE, $equal_points = FALSE, $could_be_offline = FALSE, $showPath = FALSE, $with_questioncount = FALSE, $permission = 
"read", $usr_id = 
"")
 
 1366                $result_array = array();
 
 1367                $permission = (strlen($permission) == 0) ? 
"read" : $permission;
 
 1376                if (count($obj_ids))
 
 1378                        $in = 
$ilDB->in(
'object_data.obj_id', $obj_ids, 
false, 
'integer');
 
 1379                        if ($could_be_offline)
 
 1381                                $result = 
$ilDB->query(
"SELECT qpl_questionpool.*, object_data.title FROM qpl_questionpool, object_data WHERE ".
 
 1382                                        "qpl_questionpool.obj_fi = object_data.obj_id AND $in ORDER BY object_data.title");
 
 1386                                $result = 
$ilDB->queryF(
"SELECT qpl_questionpool.*, object_data.title FROM qpl_questionpool, object_data WHERE ".
 
 1387                                        "qpl_questionpool.obj_fi = object_data.obj_id AND $in AND qpl_questionpool.isonline = %s ".
 
 1388                                        "ORDER BY object_data.title",
 
 1407                                        if ($with_questioncount)
 
 1409                                                $title .= 
" [" . 
$row[
"questioncount"] . 
" " . (
$row[
"questioncount"] == 1 ? 
$lng->txt(
"ass_question") : 
$lng->txt(
"assQuestions")) . 
"]";
 
 1414                                                $result_array[
$row[
"obj_fi"]] = array(
 
 1415                                                        'qpl_id' => 
$row[
'obj_fi'],
 
 1416                                                        'qpl_title' => 
$row[
'title'],
 
 1418                                                        "count" => 
$row[
"questioncount"]
 
 1423                                                $result_array[
$ref_id] = array(
 
 1424                                                        'qpl_id' => 
$row[
'obj_fi'],
 
 1425                                                        'qpl_title' => 
$row[
'title'],
 
 1427                                                        "count" => 
$row[
"questioncount"]
 
 1433                return $result_array;
 
 1440                $questions = array();
 
 1441                $result = 
$ilDB->queryF(
"SELECT qpl_questions.question_id FROM qpl_questions WHERE qpl_questions.original_id IS NULL AND qpl_questions.tstamp > 0 AND qpl_questions.obj_fi = %s",
 
 1443                        array($this->
getId())
 
 1447                        array_push($questions, 
$row[
"question_id"]);
 
 1461                $newObj = parent::cloneObject($a_target_id,$a_copy_id);
 
 1466                if(!$cp_options->isRootNode($this->getRefId()))
 
 1473                $newObj->saveToDb();
 
 1477                $questionIdsMap = array();
 
 1478                foreach ($questions as $question_id)
 
 1480                        $newQuestionId = $newObj->copyQuestion($question_id, $newObj->getId());
 
 1481                        $questionIdsMap[$question_id] = $newQuestionId;
 
 1485                include_once 
"./Services/MetaData/classes/class.ilMD.php";
 
 1487                $new_md =& $md->cloneMD($newObj->getId(),0,$newObj->getType());
 
 1490                $newObj->updateMetaData();
 
 1492                require_once 
'Modules/TestQuestionPool/classes/class.ilQuestionPoolTaxonomiesDuplicator.php';
 
 1494                $duplicator->setSourceObjId($this->
getId());
 
 1495                $duplicator->setSourceObjType($this->
getType());
 
 1496                $duplicator->setTargetObjId($newObj->getId());
 
 1497                $duplicator->setTargetObjType($newObj->getType());
 
 1498                $duplicator->setQuestionIdMapping($questionIdsMap);
 
 1499                $duplicator->duplicate();
 
 1501                $duplicatedTaxKeyMap = $duplicator->getDuplicatedTaxonomiesKeysMap();
 
 1502                $newObj->setNavTaxonomyId($duplicatedTaxKeyMap->getMappedTaxonomyId($this->getNavTaxonomyId()));
 
 1503                $newObj->saveToDb();
 
 1518                include_once 
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
 
 1520                $lng->loadLanguageModule(
"assessment");
 
 1525                        if ($all_tags || (!in_array(
$row[
"question_type_id"], $forbidden_types)))
 
 1529                                if (
$row[
"plugin"] == 0)
 
 1535                                        global $ilPluginAdmin;
 
 1536                                        $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_MODULE, 
"TestQuestionPool", 
"qst");
 
 1537                                        foreach ($pl_names as $pl_name)
 
 1540                                                if (strcmp($pl->getQuestionType(), 
$row[
"type_tag"]) == 0)
 
 1542                                                        $types[$pl->getQuestionTypeTranslation()] = 
$row;
 
 1549                require_once 
'Modules/TestQuestionPool/classes/class.ilAssQuestionTypeOrderer.php';
 
 1552                $types = $orderer->getOrderedTypes();
 
 1559            $query = 
"SELECT type_tag FROM qpl_qst_type WHERE question_type_id = %s";
 
 1560            $types = array(
'integer');
 
 1561            $values = array($type_id);
 
 1564                return $row[
'type_tag'];
 
 1573                global $ilPluginAdmin;
 
 1575                $lng->loadLanguageModule(
"assessment");
 
 1580                        if (
$row[
"plugin"] == 0)
 
 1582                                $types[
$row[
'type_tag']] = 
$lng->txt(
$row[
"type_tag"]);
 
 1586                                $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_MODULE, 
"TestQuestionPool", 
"qst");
 
 1587                                foreach ($pl_names as $pl_name)
 
 1590                                        if (strcmp($pl->getQuestionType(), 
$row[
"type_tag"]) == 0)
 
 1592                                                $types[
$row[
'type_tag']] = $pl->getQuestionTypeTranslation();
 
 1620                $allowed_types = array(
 
 1621                        "assSingleChoice" => 1,
 
 1622                        "assMultipleChoice" => 2,
 
 1623                        "assKprimChoice" => 3,
 
 1624                        "assClozeTest" => 4,
 
 1625                        "assMatchingQuestion" => 5,
 
 1626                        "assOrderingQuestion" => 6,
 
 1627                        "assOrderingHorizontal" => 7,
 
 1628                        "assImagemapQuestion" => 8,
 
 1629                        "assTextSubset" => 9,
 
 1630                        "assErrorText" => 10,
 
 1635                foreach($qtypes as $k => 
$t)
 
 1638                        if (isset($allowed_types[
$t[
"type_tag"]]))
 
 1640                                $t[
"order"] = $allowed_types[
$t[
"type_tag"]];
 
 1652                $questions = array();
 
 1653                $result = 
$ilDB->queryF(
"SELECT qpl_questions.*, qpl_qst_type.* FROM qpl_questions, qpl_qst_type WHERE qpl_questions.original_id IS NULL AND qpl_questions.obj_fi = %s AND qpl_questions.tstamp > 0 AND qpl_questions.question_type_fi = qpl_qst_type.question_type_id",
 
 1655                        array($this->
getId())
 
 1659                        array_push($questions, 
$row);
 
 1673                $result = 
$ilDB->manipulateF(
"UPDATE qpl_questionpool SET questioncount = %s, tstamp = %s WHERE obj_fi = %s",
 
 1674                        array(
'integer',
'integer',
'integer'),
 
 1687                global $ilPluginAdmin;
 
 1688                if ($ilPluginAdmin->isActive(
IL_COMP_MODULE, 
"TestQuestionPool", 
"qst", $a_pname))
 
 1705                require_once 
'Modules/TestQuestionPool/classes/class.ilAssIncompleteQuestionPurger.php';
 
 1707                $incompleteQuestionPurger->setOwnerId(
$ilUser->getId());
 
 1708                $incompleteQuestionPurger->purge();
 
 1718                require_once 
'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
 
 1742                if( self::$isSkillManagementGloballyActivated === 
null )
 
 1744                        include_once 
'Services/Skill/classes/class.ilSkillManagementSettings.php';
 
 1747                        self::$isSkillManagementGloballyActivated = $skmgSet->isActivated();
 
 1755                require_once 
'Modules/TestQuestionPool/classes/class.ilObjQuestionPoolXMLParser.php';
 
 1757                $parser->startParsing();
 
Abstract basic class which is to be extended by the concrete assessment question type classes.
addQuestionChangeListener(ilQuestionChangeListener $listener)
_isUsedInRandomTest($question_id="")
Checks whether the question is used in a random test or not.
static & _instanciateQuestionGUI($question_id)
Creates an instance of a question gui with a given question id.
static _includeClass($question_type, $gui=0)
Include the php class file for a given question type.
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
const ORDER_MODE_FIX
order mode with fixed priority for ordering
const ORDER_MODE_ALPHA
order mode that orders by alphanumerical priority
static _getInstance($a_copy_id)
Get instance of copy wizard options.
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
_getForbiddenQuestionTypes()
Returns the forbidden questiontypes for ILIAS.
_getImportDirectory()
get import directory of lm
ilObjQuestionPool($a_id=0, $a_call_by_reference=true)
Constructor @access public.
exportPagesXML(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog, $questions)
export pages of test to xml (see ilias_co.dtd)
getExportDirectory($type="")
get export directory of questionpool
getImportMapping()
get array of (two) new created questions for import id
setDescription($a_description)
set description of content object
getTitle()
get title of glossary object
deleteQuestion($question_id)
Deletes a question from the question pool.
getQuestiontype($question_id)
Returns the question type of a question with a given id.
cleanupClipboard($deletedQuestionId)
getDescription()
get description of content object
& getQuestionDetails($question_ids)
Returns an array containing the qpl_question and qpl_qst_type fields for an array of question ids.
addQuestionChangeListeners(assQuestion $question)
& getDeleteableQuestionDetails($question_ids)
Returns an array containing the qpl_question and qpl_qst_type fields of deleteable questions for an a...
isPluginActive($a_pname)
Checks wheather or not a question plugin with a given name is active.
moveToClipboard($question_id)
Moves a question to the clipboard.
& _getQuestionTypes($all_tags=FALSE, $fixOrder=false)
_lookupOnline($a_obj_id, $is_reference=FALSE)
getTaxonomyIds()
get ids of all taxonomies corresponding to current pool
setOnline($a_online_status)
Sets the questionpool online status.
static isSkillManagementGloballyActivated()
static $isSkillManagementGloballyActivated
modifyExportIdentifier($a_tag, $a_param, $a_value)
& _getAvailableQuestionpools($use_object_id=FALSE, $equal_points=FALSE, $could_be_offline=FALSE, $showPath=FALSE, $with_questioncount=FALSE, $permission="read", $usr_id="")
Returns the available question pools for the active user.
getPrintviewQuestions()
Calculates the data for the print view of the questionpool.
setTitle($a_title)
set title of glossary object
setShowTaxonomies($showTaxonomies)
read($a_force_db=false)
read object data from db into object
static & _getSelfAssessmentQuestionTypes($all_tags=FALSE)
Get all self assessment question types.
static _createImportDirectory()
creates data directory for import files (data_dir/qpl_data/qpl_<id>/import, depending on data directo...
createReference()
Creates a database reference id for the object (saves the object to the database and creates a refere...
loadFromDb()
Loads a ilObjQuestionpool object from a database.
& getQuestionTypes($all_tags=FALSE, $fixOrder=false)
_getFullPathToQpl($ref_id)
Retrieves the full path to a question pool with a given reference id.
copyQuestion($question_id, $questionpool_to)
Copies a question into another question pool.
create($a_upload=false)
create questionpool object
exportXMLMediaObjects(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
export media objects to xml (see ilias_co.dtd)
_hasEqualPoints($a_obj_id, $is_reference=FALSE)
Checks a question pool for questions with the same maximum points.
createExportDirectory()
creates data directory for export files (data_dir/qpl_data/qpl_<id>/export, depending on data directo...
setNavTaxonomyId($navTaxonomyId)
duplicateQuestion($question_id)
Duplicates a question for a questionpool.
exportXMLPageObjects(&$a_xml_writer, $a_inst, &$expLog, $questions)
export page objects to xml (see ilias_co.dtd)
_setImportDirectory($a_import_dir=null)
set import directory
setSkillServiceEnabled($skillServiceEnabled)
static getQuestionTypeByTypeId($type_id)
exportXMLMetaData(&$a_xml_writer)
export content objects meta data to xml (see ilias_co.dtd)
static getQuestionTypeTranslations()
isInUse($question_id)
Checks whether the question is in use or not.
cloneObject($a_target_id, $a_copy_id=0)
Creates a 1:1 copy of the object and places the copy in a given repository.
update()
update object data
saveToDb()
Saves a ilObjQuestionpool object to a database.
copyToClipboard($question_id)
Copies a question to the clipboard.
exportXMLSettings($xmlWriter)
_isWriteable($object_id, $user_id)
Returns true, if the question pool is writeable by a given user.
notify($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
notifys an object about an event occured Based on the event happend, each object may decide how it re...
static _updateQuestionCount($object_id)
Updates the number of available questions for a question pool in the database.
toXML($questions)
Returns a QTI xml representation of a list of questions.
_getQuestionCount($questionpool_id, $complete_questions_only=FALSE)
Returns the number of questions in a question pool.
& createQuestion($question_type, $question_id=-1)
exportFileItems($a_target_dir, &$expLog)
export files of file itmes
pasteFromClipboard()
Copies/Moves a question from the clipboard.
& getAllQuestions()
Retrieve an array containing all question ids of the questionpool.
updateMetaData()
update meta data entry
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
static getPoolQuestionChangeListeners(ilDB $db, $poolObjId)
Class ilObject Basic functions for all objects.
getType()
get object type @access public
static _lookupObjId($a_id)
ilObject($a_id=0, $a_reference=true)
Constructor @access public.
deleteMetaData()
delete meta data entry
_hasUntrashedReference($a_obj_id)
checks wether an object has at least one reference that is not in trash
createMetaData()
create meta data entry
static _getAllReferences($a_id)
get all reference ids of object
getId()
get object id @access public
static _prepareCloneSelection($a_ref_ids, $new_type, $show_path=true)
Prepare copy wizard object selection.
static collectFileItems($a_page, $a_domdoc)
Get all file items that are used within the page.
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin object.
Skill management settings.
static subStr($a_str, $a_start, $a_length=NULL)
static getDataDir()
get data directory (outside webspace)
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static insertInstIntoID($a_value)
inserts installation id into ILIAS id
static _getObjectsByOperations($a_obj_type, $a_operation, $a_usr_id=0, $limit=0)
Get all objects of a specific type and check access This function is not recursive,...
static makeDirParents($a_dir)
Create a new directory and all parent directories.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
redirection script todo: (a better solution should control the processing via a xml file)