4 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
54 $this->
ilObject($a_id,$a_call_by_reference);
81 $result = parent::createReference();
95 if (!parent::update())
108 include_once
"./Services/MetaData/classes/class.ilMD.php";
110 $md_gen =& $md->getGeneral();
111 if ($md_gen ==
false)
113 include_once
"./Services/MetaData/classes/class.ilMDCreator.php";
115 $md_creator->setTitle($this->
getTitle());
116 $md_creator->setTitleLanguage($ilUser->getPref(
'language'));
117 $md_creator->create();
119 parent::updateMetaData();
127 function read($a_force_db =
false)
129 parent::read($a_force_db);
143 if (!parent::delete())
161 if (count($questions))
163 foreach ($questions as $question_id)
170 include_once
"./Services/Utilities/classes/class.ilUtil.php";
172 $directory = $qpl_data_dir.
"/qpl_".$this->
getId();
173 if (is_dir($directory))
175 include_once
"./Services/Utilities/classes/class.ilUtil.php";
205 function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
245 if ($a_node_id==
$_GET[
"ref_id"])
247 $parent_obj =& $this->
ilias->obj_factory->getInstanceByRefId($a_node_id);
248 $parent_type = $parent_obj->getType();
249 if($parent_type == $this->
getType())
251 $a_node_id = (int) $tree->getParentId($a_node_id);
255 parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
266 include_once
"./Modules/Test/classes/class.ilObjTest.php";
267 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
271 $question->delete($question_id);
296 $result = $ilDB->queryF(
"SELECT * FROM qpl_questionpool WHERE obj_fi = %s",
298 array($this->
getId())
318 $result = $ilDB->queryF(
"SELECT id_questionpool FROM qpl_questionpool WHERE obj_fi = %s",
320 array($this->
getId())
325 $result = $ilDB->update(
'qpl_questionpool',
327 'isonline' => array(
'text', $this->
getOnline()),
330 'tstamp' => array(
'integer', time())
333 'obj_fi' => array(
'integer', $this->
getId())
339 $next_id = $ilDB->nextId(
'qpl_questionpool');
341 $result = $ilDB->insert(
'qpl_questionpool', array(
342 'id_questionpool' => array(
'integer', $next_id),
343 'isonline' => array(
'text', $this->
getOnline()),
346 'tstamp' => array(
'integer', time()),
347 'obj_fi' => array(
'integer', $this->
getId())
363 if ($question_id < 1)
368 $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",
375 return $data[
"type_tag"];
390 return parent::getDescription();
398 parent::setDescription($a_description);
408 return parent::getTitle();
416 parent::setTitle($a_title);
430 $result = $ilDB->queryF(
"SELECT COUNT(solution_id) solution_count FROM tst_solutions WHERE question_fi = %s",
435 return $row[
"solution_count"];
440 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
443 $question_type_gui = $question_type .
"GUI";
444 $question_gui =&
new $question_type_gui();
445 return $question_gui;
457 $newtitle = $question->object->getTitle();
458 if ($question->object->questionTitleExists($this->getId(), $question->object->getTitle()))
461 while ($question->object->questionTitleExists($this->getId(), $question->object->getTitle() .
" ($counter)"))
465 $newtitle = $question->object->getTitle() .
" ($counter)";
467 $new_id = $question->object->duplicate(
false, $newtitle);
483 if ($question_gui->object->getObjId() == $questionpool_to)
491 $newtitle = $question_gui->object->getTitle();
492 if ($question_gui->object->questionTitleExists($this->getId(), $question_gui->object->getTitle()))
495 while ($question_gui->object->questionTitleExists($this->getId(), $question_gui->object->getTitle() .
" ($counter)"))
499 $newtitle = $question_gui->object->getTitle() .
" ($counter)";
501 return $question_gui->object->copyObject($this->
getId(), $newtitle);
514 $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",
516 array($this->
getId())
520 if ($query_result->numRows())
522 while (
$row = $ilDB->fetchAssoc($query_result))
524 $row[
'ttype'] = $types[
$row[
'type_tag']];
529 array_push($rows, $row);
534 array_push($rows, $row);
547 function exportPagesXML(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog, $questions)
551 $this->mob_ids = array();
552 $this->file_ids = array();
555 $attrs[
"Type"] =
"Questionpool_Test";
556 $a_xml_writer->xmlStartTag(
"ContentObject", $attrs);
562 $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export Page Objects");
563 $ilBench->start(
"ContentObjectExport",
"exportPageObjects");
565 $ilBench->stop(
"ContentObjectExport",
"exportPageObjects");
566 $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export Page Objects");
569 $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export Media Objects");
570 $ilBench->start(
"ContentObjectExport",
"exportMediaObjects");
572 $ilBench->stop(
"ContentObjectExport",
"exportMediaObjects");
573 $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export Media Objects");
576 $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export File Items");
577 $ilBench->start(
"ContentObjectExport",
"exportFileItems");
579 $ilBench->stop(
"ContentObjectExport",
"exportFileItems");
580 $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export File Items");
582 $a_xml_writer->xmlEndTag(
"ContentObject");
593 include_once(
"Services/MetaData/classes/class.ilMD2XML.php");
595 $md2xml->setExportMode(
true);
596 $md2xml->startExport();
597 $a_xml_writer->appendXML($md2xml->getXML());
602 if ($a_tag ==
"Identifier" && $a_param ==
"Entry")
604 include_once
"./Services/Utilities/classes/class.ilUtil.php";
622 include_once
"./Modules/LearningModule/classes/class.ilLMPageObject.php";
624 foreach ($questions as $question_id)
626 $ilBench->start(
"ContentObjectExport",
"exportPageObject");
627 $expLog->write(date(
"[y-m-d H:i:s] ").
"Page Object ".$question_id);
630 $a_xml_writer->xmlStartTag(
"PageObject", $attrs);
634 $ilBench->start(
"ContentObjectExport",
"exportPageObject_XML");
635 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php");
637 $page_object->buildDom();
638 $page_object->insertInstIntoIDs($a_inst);
639 $mob_ids = $page_object->collectMediaObjects(
false);
640 require_once
'Services/COPage/classes/class.ilPCFileList.php';
642 $xml = $page_object->getXMLFromDom(
false,
false,
false,
"",
true);
643 $xml = str_replace(
"&",
"&", $xml);
644 $a_xml_writer->appendXML($xml);
645 $page_object->freeDom();
646 unset ($page_object);
648 $ilBench->stop(
"ContentObjectExport",
"exportPageObject_XML");
651 $ilBench->start(
"ContentObjectExport",
"exportPageObject_CollectMedia");
653 foreach($mob_ids as $mob_id)
655 $this->mob_ids[$mob_id] = $mob_id;
657 $ilBench->stop(
"ContentObjectExport",
"exportPageObject_CollectMedia");
660 $ilBench->start(
"ContentObjectExport",
"exportPageObject_CollectFileItems");
662 foreach($file_ids as $file_id)
664 $this->file_ids[$file_id] = $file_id;
666 $ilBench->stop(
"ContentObjectExport",
"exportPageObject_CollectFileItems");
668 $a_xml_writer->xmlEndTag(
"PageObject");
671 $ilBench->stop(
"ContentObjectExport",
"exportPageObject");
685 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
687 foreach ($this->mob_ids as $mob_id)
689 $expLog->write(date(
"[y-m-d H:i:s] ").
"Media Object ".$mob_id);
693 $media_obj->exportXML($a_xml_writer, $a_inst);
694 $media_obj->exportFiles($a_target_dir);
706 include_once(
"./Modules/File/classes/class.ilObjFile.php");
708 foreach ($this->file_ids as $file_id)
710 $expLog->write(date(
"[y-m-d H:i:s] ").
"File Item ".$file_id);
711 $file_obj =
new ilObjFile($file_id,
false);
712 $file_obj->export($a_target_dir);
724 include_once
"./Services/Utilities/classes/class.ilUtil.php";
727 if(!is_writable($qpl_data_dir))
729 $this->
ilias->raiseError(
"Questionpool Data Directory (".$qpl_data_dir
730 .
") not writeable.",$this->
ilias->error_obj->FATAL);
734 $qpl_dir = $qpl_data_dir.
"/qpl_".$this->
getId();
736 if(!@is_dir($qpl_dir))
738 $this->
ilias->raiseError(
"Creation of Questionpool Directory failed.",$this->
ilias->error_obj->FATAL);
744 $this->
ilias->raiseError(
"Creation of Export Directory failed.",$this->
ilias->error_obj->FATAL);
749 $this->
ilias->raiseError(
"Creation of Export Directory failed.",$this->
ilias->error_obj->FATAL);
758 include_once
"./Services/Utilities/classes/class.ilUtil.php";
763 $export_dir =
ilUtil::getDataDir().
"/qpl_data".
"/qpl_".$this->getId().
"/export_$type";
781 include_once
"./Services/Utilities/classes/class.ilUtil.php";
785 if(!is_writable($qpl_data_dir))
787 $ilias->raiseError(
"Questionpool Data Directory (".$qpl_data_dir
788 .
") not writeable.",$ilias->error_obj->FATAL);
792 $qpl_dir = $qpl_data_dir.
"/qpl_import";
794 if(!@is_dir($qpl_dir))
796 $ilias->raiseError(
"Creation of Questionpool Directory failed.",$ilias->error_obj->FATAL);
806 if (strlen($a_import_dir))
808 $_SESSION[
"qpl_import_dir"] = $a_import_dir;
842 $result = $ilDB->queryF(
"SELECT question_id FROM qpl_questions WHERE obj_fi = %s AND qpl_questions.tstamp > 0 AND original_id IS NULL",
844 array($this->
getId())
846 $questions = array();
849 array_push($questions,
$row[
"question_id"]);
858 $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",
859 array(
'integer',
'text'),
860 array($this->
getId(), 1)
862 $questions = array();
863 if ($query_result->numRows())
865 while (
$row = $ilDB->fetchAssoc($query_result))
871 array_push($questions,
$row[
"question_id"]);
876 array_push($questions,
$row[
"question_id"]);
889 if (!is_array($this->import_mapping))
895 return $this->import_mapping;
910 if (count($questions) > 0)
912 foreach ($questions as $key => $value)
915 $xml .= $question->object->toXML();
917 if (count($questions) > 1)
919 $xml = preg_replace(
"/<\/questestinterop>\s*<.xml.*?>\s*<questestinterop>/",
"", $xml);
922 $xml = preg_replace(
"/(<\?xml[^>]*?>)/",
"\\1" .
"<!DOCTYPE questestinterop SYSTEM \"ims_qtiasiv1p2p1.dtd\">", $xml);
937 if ($complete_questions_only)
939 $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",
940 array(
'integer',
'text'),
941 array($questionpool_id, 1)
946 $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",
948 array($questionpool_id)
952 return $row[
"question_count"];
964 switch ($a_online_status)
968 $this->online = $a_online_status;
978 if (strcmp($this->online,
"") == 0) $this->online =
"0";
1013 $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",
1020 $result = $ilDB->queryF(
"SELECT isonline FROM qpl_questionpool WHERE obj_fi = %s",
1028 return $row[
"isonline"];
1045 $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",
1052 $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",
1060 if (
$row[
"equal_points"] == 1)
1082 if (array_key_exists(
"qpl_clipboard",
$_SESSION))
1085 foreach (
$_SESSION[
"qpl_clipboard"] as $question_object)
1087 if (strcmp($question_object[
"action"],
"move") == 0)
1089 $result = $ilDB->queryF(
"SELECT obj_fi FROM qpl_questions WHERE question_id = %s",
1091 array($question_object[
"question_id"])
1096 $source_questionpool =
$row[
"obj_fi"];
1098 $affectedRows = $ilDB->manipulateF(
"UPDATE qpl_questions SET obj_fi = %s WHERE question_id = %s",
1099 array(
'integer',
'integer'),
1100 array($this->
getId(), $question_object[
"question_id"])
1108 $source_path = CLIENT_WEB_DIR .
"/assessment/" . $source_questionpool .
"/" . $question_object[
"question_id"] .
"/";
1109 if (@is_dir($source_path))
1111 $target_path = CLIENT_WEB_DIR .
"/assessment/" . $this->
getId() .
"/";
1112 if (!@is_dir($target_path))
1114 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1117 @rename($source_path, $target_path . $question_object[
"question_id"]);
1125 $new_question_id = $this->
copyQuestion($question_object[
"question_id"], $this->
getId());
1126 if(!$new_question_id)
1148 if (!array_key_exists(
"qpl_clipboard",
$_SESSION))
1152 $_SESSION[
"qpl_clipboard"][$question_id] = array(
"question_id" => $question_id,
"action" =>
"copy");
1163 if (!array_key_exists(
"qpl_clipboard",
$_SESSION))
1167 $_SESSION[
"qpl_clipboard"][$question_id] = array(
"question_id" => $question_id,
"action" =>
"move");
1172 if( !isset(
$_SESSION[
'qpl_clipboard']) )
1177 if( !isset(
$_SESSION[
'qpl_clipboard'][$deletedQuestionId]) )
1182 unset(
$_SESSION[
'qpl_clipboard'][$deletedQuestionId]);
1184 if( !count(
$_SESSION[
'qpl_clipboard']) )
1201 include_once
"./Services/Object/classes/class.ilObject.php";
1228 $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");
1229 if ($query_result->numRows())
1231 while (
$row = $ilDB->fetchAssoc($query_result))
1252 $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");
1253 if ($query_result->numRows())
1255 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1256 while (
$row = $ilDB->fetchAssoc($query_result))
1271 $duplicate_id = $question->object->duplicate(
true);
1272 if ($duplicate_id > 0)
1275 $affectedRows = $ilDB->manipulateF(
"UPDATE tst_solutions SET question_fi = %s WHERE question_fi = %s",
1276 array(
'integer',
'integer'),
1277 array($duplicate_id,
$row[
"question_id"])
1281 $affectedRows = $ilDB->manipulateF(
"UPDATE tst_test_rnd_qst SET question_fi = %s WHERE question_fi = %s",
1282 array(
'integer',
'integer'),
1283 array($duplicate_id,
$row[
"question_id"])
1287 $affectedRows = $ilDB->manipulateF(
"UPDATE tst_test_result SET question_fi = %s WHERE question_fi = %s",
1288 array(
'integer',
'integer'),
1289 array($duplicate_id,
$row[
"question_id"])
1293 $affectedRows = $ilDB->manipulateF(
"UPDATE ass_log SET question_fi = %s WHERE question_fi = %s",
1294 array(
'integer',
'integer'),
1295 array($duplicate_id,
$row[
"question_id"])
1319 foreach (
$path as $item)
1321 if (($counter > 0) && ($counter < count(
$path)-1))
1323 array_push($items, $item[
"title"]);
1327 $fullpath = join(
" > ", $items);
1328 include_once
"./Services/Utilities/classes/class.ilStr.php";
1329 if (strlen($fullpath) > 60)
1342 function &
_getAvailableQuestionpools($use_object_id = FALSE, $equal_points = FALSE, $could_be_offline = FALSE, $showPath = FALSE, $with_questioncount = FALSE, $permission =
"read",
$usr_id =
"")
1347 $result_array = array();
1348 $permission = (strlen($permission) == 0) ?
"read" : $permission;
1357 if (count($obj_ids))
1359 $in = $ilDB->in(
'object_data.obj_id', $obj_ids,
false,
'integer');
1360 if ($could_be_offline)
1362 $result = $ilDB->query(
"SELECT qpl_questionpool.*, object_data.title FROM qpl_questionpool, object_data WHERE ".
1363 "qpl_questionpool.obj_fi = object_data.obj_id AND $in ORDER BY object_data.title");
1367 $result = $ilDB->queryF(
"SELECT qpl_questionpool.*, object_data.title FROM qpl_questionpool, object_data WHERE ".
1368 "qpl_questionpool.obj_fi = object_data.obj_id AND $in AND qpl_questionpool.isonline = %s ".
1369 "ORDER BY object_data.title",
1386 $ref_id = array_search(
$row[
"obj_fi"], $obj_ids);
1387 $title = (($showPath) ? $titles[$ref_id] :
$row[
"title"]);
1388 if ($with_questioncount)
1390 $title .=
" [" . $row[
"questioncount"] .
" " . ($row[
"questioncount"] == 1 ? $this->lng->txt(
"ass_question") : $this->lng->txt(
"assQuestions")) .
"]";
1395 $result_array[$row[
"obj_fi"]] = array(
1396 'qpl_id' => $row[
'obj_fi'],
1397 'qpl_title' => $row[
'title'],
1399 "count" => $row[
"questioncount"]
1404 $result_array[
$ref_id] = array(
1405 'qpl_id' => $row[
'obj_fi'],
1406 'qpl_title' => $row[
'title'],
1408 "count" => $row[
"questioncount"]
1414 return $result_array;
1421 $questions = array();
1422 $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",
1424 array($this->
getId())
1428 array_push($questions,
$row[
"question_id"]);
1441 $newObj = parent::cloneObject($a_target_id,$a_copy_id);
1443 $newObj->saveToDb();
1446 foreach ($questions as $question_id)
1448 $newObj->copyQuestion($question_id, $newObj->getId());
1452 include_once
"./Services/MetaData/classes/class.ilMD.php";
1454 $new_md =& $md->cloneMD($newObj->getId(),0,$newObj->getType());
1457 $newObj->updateMetaData();
1471 include_once
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
1473 $lng->loadLanguageModule(
"assessment");
1474 $result = $ilDB->query(
"SELECT * FROM qpl_qst_type");
1478 if ($all_tags || (!in_array(
$row[
"question_type_id"], $forbidden_types)))
1482 if (
$row[
"plugin"] == 0)
1484 $types[$lng->txt(
$row[
"type_tag"])] =
$row;
1488 global $ilPluginAdmin;
1489 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_MODULE,
"TestQuestionPool",
"qst");
1490 foreach ($pl_names as $pl_name)
1493 if (strcmp($pl->getQuestionType(),
$row[
"type_tag"]) == 0)
1495 $types[$pl->getQuestionTypeTranslation()] =
$row;
1502 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionTypeOrderer.php';
1505 $types = $orderer->getOrderedTypes();
1512 $query =
"SELECT type_tag FROM qpl_qst_type WHERE question_type_id = %s";
1513 $types = array(
'integer');
1514 $values = array($type_id);
1517 return $row[
'type_tag'];
1526 global $ilPluginAdmin;
1528 $lng->loadLanguageModule(
"assessment");
1529 $result = $ilDB->query(
"SELECT * FROM qpl_qst_type");
1533 if (
$row[
"plugin"] == 0)
1535 $types[
$row[
'type_tag']] = $lng->txt($row[
"type_tag"]);
1539 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_MODULE,
"TestQuestionPool",
"qst");
1540 foreach ($pl_names as $pl_name)
1543 if (strcmp($pl->getQuestionType(),
$row[
"type_tag"]) == 0)
1545 $types[
$row[
'type_tag']] = $pl->getQuestionTypeTranslation();
1573 $allowed_types = array(
1574 "assSingleChoice" => 1,
1575 "assMultipleChoice" => 2,
1576 "assClozeTest" => 3,
1577 "assMatchingQuestion" => 4,
1578 "assOrderingQuestion" => 5,
1579 "assOrderingHorizontal" => 6,
1580 "assImagemapQuestion" => 7,
1581 "assTextSubset" => 9,
1582 "assErrorText" => 10
1586 foreach($qtypes as $k =>
$t)
1589 if (isset($allowed_types[
$t[
"type_tag"]]))
1591 $t[
"order"] = $allowed_types[$t[
"type_tag"]];
1603 $questions = array();
1604 $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",
1606 array($this->
getId())
1610 array_push($questions,
$row);
1624 $result = $ilDB->manipulateF(
"UPDATE qpl_questionpool SET questioncount = %s, tstamp = %s WHERE obj_fi = %s",
1625 array(
'integer',
'integer',
'integer'),
1638 global $ilPluginAdmin;
1639 if ($ilPluginAdmin->isActive(
IL_COMP_MODULE,
"TestQuestionPool",
"qst", $a_pname))
1656 require_once
'Modules/TestQuestionPool/classes/class.ilAssIncompleteQuestionPurger.php';
1658 $incompleteQuestionPurger->setOwnerId($ilUser->getId());
1659 $incompleteQuestionPurger->purge();
1669 require_once
'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin object.
static makeDirParents($a_dir)
Create a new directory and all parent directories.
const ORDER_MODE_FIX
order mode with fixed priority for ordering
exportXMLMetaData(&$a_xml_writer)
export content objects meta data to xml (see ilias_co.dtd)
setTitle($a_title)
set title of glossary object
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
exportXMLPageObjects(&$a_xml_writer, $a_inst, &$expLog, $questions)
export page objects to xml (see ilias_co.dtd)
static _includeClass($question_type, $gui=0)
Include the php class file for a given question type.
const ORDER_MODE_ALPHA
order mode that orders by alphanumerical priority
exportFileItems($a_target_dir, &$expLog)
export files of file itmes
moveToClipboard($question_id)
Moves a question to the clipboard.
exportXMLMediaObjects(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
export media objects to xml (see ilias_co.dtd)
static _prepareCloneSelection($a_ref_ids, $new_type, $show_path=true)
Prepare copy wizard object selection.
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
_isWriteable($object_id, $user_id)
Returns true, if the question pool is writeable by a given user.
addQuestionChangeListeners(assQuestion $question)
getQuestiontype($question_id)
Returns the question type of a question with a given id.
setNavTaxonomyId($navTaxonomyId)
pasteFromClipboard()
Copies/Moves a question from the clipboard.
Abstract basic class which is to be extended by the concrete assessment question type classes...
Class ilObject Basic functions for all objects.
static getQuestionTypeByTypeId($type_id)
static & _instanciateQuestionGUI($question_id)
Creates an instance of a question gui with a given question 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, instead it parses the serialized rbac_pa entries.
getExportDirectory($type="")
get export directory of questionpool
getDescription()
get description of content object
_setImportDirectory($a_import_dir=null)
set import directory
deleteQuestion($question_id)
Deletes a question from the question pool.
createReference()
Creates a database reference id for the object (saves the object to the database and creates a refere...
createMetaData()
create meta data entry
_getFullPathToQpl($ref_id)
Retrieves the full path to a question pool with a given reference id.
getPrintviewQuestions()
Calculates the data for the print view of the questionpool.
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...
& getQuestionDetails($question_ids)
Returns an array containing the qpl_question and qpl_qst_type fields for an array of question ids...
toXML($questions)
Returns a QTI xml representation of a list of questions.
copyQuestion($question_id, $questionpool_to)
Copies a question into another question pool.
getImportMapping()
get array of (two) new created questions for import id
saveToDb()
Saves a ilObjQuestionpool object to a database.
ilObject($a_id=0, $a_reference=true)
Constructor public.
static _getAllReferences($a_id)
get all reference ids of object
setOnline($a_online_status)
Sets the questionpool online status.
exportPagesXML(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog, $questions)
export pages of test to xml (see ilias_co.dtd)
& _getQuestionTypes($all_tags=FALSE, $fixOrder=false)
modifyExportIdentifier($a_tag, $a_param, $a_value)
fetchAssoc($a_set)
Fetch row as associative array from result set.
_getForbiddenQuestionTypes()
Returns the forbidden questiontypes for ILIAS.
duplicateQuestion($question_id)
Duplicates a question for a questionpool.
setShowTaxonomies($showTaxonomies)
static _updateQuestionCount($object_id)
Updates the number of available questions for a question pool in the database.
_hasEqualPoints($a_obj_id, $is_reference=FALSE)
Checks a question pool for questions with the same maximum points.
getId()
get object id public
static _lookupObjId($a_id)
static collectFileItems($a_page, $a_domdoc)
Get all file items that are used within the page.
_getImportDirectory()
get import directory of lm
cleanupClipboard($deletedQuestionId)
redirection script todo: (a better solution should control the processing via a xml file) ...
update()
update object data
createExportDirectory()
creates data directory for export files (data_dir/qpl_data/qpl_<id>/export, depending on data directo...
& createQuestion($question_type, $question_id=-1)
copyToClipboard($question_id)
Copies a question to the clipboard.
static getPoolQuestionChangeListeners(ilDB $db, $poolObjId)
read($a_force_db=false)
read object data from db into object
getType()
get object type public
isPluginActive($a_pname)
Checks wheather or not a question plugin with a given name is active.
_lookupOnline($a_obj_id, $is_reference=FALSE)
_isUsedInRandomTest($question_id="")
Checks whether the question is used in a random test or not.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
initDefaultRoles()
If your module does not require any default roles, delete this method (For an example how this method...
getTitle()
get title of glossary object
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
& getAllQuestions()
Retrieve an array containing all question ids of the questionpool.
cloneObject($a_target_id, $a_copy_id=0)
Creates a 1:1 copy of the object and places the copy in a given repository.
_hasUntrashedReference($a_obj_id)
checks wether an object has at least one reference that is not in trash
static getDataDir()
get data directory (outside webspace)
static & _getSelfAssessmentQuestionTypes($all_tags=FALSE)
Get all self assessment question types.
getTaxonomyIds()
get ids of all taxonomies corresponding to current pool
loadFromDb()
Loads a ilObjQuestionpool object from a database.
& getQuestionTypes($all_tags=FALSE, $fixOrder=false)
static insertInstIntoID($a_value)
inserts installation id into ILIAS id
deleteMetaData()
delete meta data entry
& _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.
static getQuestionTypeTranslations()
addQuestionChangeListener(ilQuestionChangeListener $listener)
static subStr($a_str, $a_start, $a_length=NULL)
ilObjQuestionPool($a_id=0, $a_call_by_reference=true)
Constructor public.
static _createImportDirectory()
creates data directory for import files (data_dir/qpl_data/qpl_<id>/import, depending on data directo...
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
setDescription($a_description)
set description of content object
_getQuestionCount($questionpool_id, $complete_questions_only=FALSE)
Returns the number of questions in a question pool.
create($a_upload=false)
create questionpool object
isInUse($question_id)
Checks whether the question is in use or not.
& getDeleteableQuestionDetails($question_ids)
Returns an array containing the qpl_question and qpl_qst_type fields of deleteable questions for an a...