4 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
56 public function __construct($a_id = 0,$a_call_by_reference =
true)
59 parent::__construct($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())
161 require_once
'Modules/TestQuestionPool/classes/questions/class.ilAssQuestionSkillAssignmentImportFails.php';
163 $qsaImportFails->deleteRegisteredImportFails();
172 if (count($questions))
174 foreach ($questions as $question_id)
181 include_once
"./Services/Utilities/classes/class.ilUtil.php";
183 $directory = $qpl_data_dir.
"/qpl_".$this->
getId();
184 if (is_dir($directory))
186 include_once
"./Services/Utilities/classes/class.ilUtil.php";
199 include_once
"./Modules/Test/classes/class.ilObjTest.php";
200 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
204 $question->delete($question_id);
229 $result = $ilDB->queryF(
"SELECT * FROM qpl_questionpool WHERE obj_fi = %s",
252 $result = $ilDB->queryF(
"SELECT id_questionpool FROM qpl_questionpool WHERE obj_fi = %s",
259 $result = $ilDB->update(
'qpl_questionpool',
274 $next_id = $ilDB->nextId(
'qpl_questionpool');
277 'id_questionpool' =>
array(
'integer', $next_id),
299 if ($question_id < 1)
304 $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",
311 return $data[
"type_tag"];
326 return parent::getDescription();
334 parent::setDescription($a_description);
344 return parent::getTitle();
352 parent::setTitle($a_title);
366 $result = $ilDB->queryF(
"SELECT COUNT(solution_id) solution_count FROM tst_solutions WHERE question_fi = %s",
371 return $row[
"solution_count"];
376 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
379 $question_type_gui = $question_type .
"GUI";
380 $question_gui =
new $question_type_gui();
381 return $question_gui;
393 $newtitle = $question->object->getTitle();
394 if ($question->object->questionTitleExists($this->getId(), $question->object->getTitle()))
397 while ($question->object->questionTitleExists($this->getId(), $question->object->getTitle() .
" ($counter)"))
401 $newtitle = $question->object->getTitle() .
" ($counter)";
403 $new_id = $question->object->duplicate(
false, $newtitle);
419 if ($question_gui->object->getObjId() == $questionpool_to)
427 $newtitle = $question_gui->object->getTitle();
428 if ($question_gui->object->questionTitleExists($this->getId(), $question_gui->object->getTitle()))
431 while ($question_gui->object->questionTitleExists($this->getId(), $question_gui->object->getTitle() .
" ($counter)"))
435 $newtitle = $question_gui->object->getTitle() .
" ($counter)";
437 return $question_gui->object->copyObject($this->
getId(), $newtitle);
450 $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",
456 if ($query_result->numRows())
458 while (
$row = $ilDB->fetchAssoc($query_result))
460 $row[
'ttype'] = $types[
$row[
'type_tag']];
465 array_push($rows, $row);
470 array_push($rows, $row);
482 $xmlWriter->xmlStartTag(
'Settings');
485 $xmlWriter->xmlElement(
'NavTaxonomy', null, (
int)$this->
getNavTaxonomyId());
488 $xmlWriter->xmlEndTag(
'Settings');
501 $this->mob_ids =
array();
502 $this->file_ids =
array();
505 $attrs[
"Type"] =
"Questionpool_Test";
506 $a_xml_writer->
xmlStartTag(
"ContentObject", $attrs);
515 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Start Export Page Objects");
516 $ilBench->start(
"ContentObjectExport",
"exportPageObjects");
518 $ilBench->stop(
"ContentObjectExport",
"exportPageObjects");
519 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Finished Export Page Objects");
522 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Start Export Media Objects");
523 $ilBench->start(
"ContentObjectExport",
"exportMediaObjects");
525 $ilBench->stop(
"ContentObjectExport",
"exportMediaObjects");
526 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Finished Export Media Objects");
529 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Start Export File Items");
530 $ilBench->start(
"ContentObjectExport",
"exportFileItems");
532 $ilBench->stop(
"ContentObjectExport",
"exportFileItems");
533 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Finished Export File Items");
538 $a_xml_writer->
xmlEndTag(
"ContentObject");
549 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentList.php';
551 $assignmentList->setParentObjId($this->
getId());
552 $assignmentList->loadFromDb();
553 $assignmentList->loadAdditionalSkillData();
555 require_once
'Modules/TestQuestionPool/classes/questions/class.ilAssQuestionSkillAssignmentExporter.php';
557 $skillQuestionAssignmentExporter->setXmlWriter($a_xml_writer);
558 $skillQuestionAssignmentExporter->setQuestionIds($questions);
559 $skillQuestionAssignmentExporter->setAssignmentList($assignmentList);
560 $skillQuestionAssignmentExporter->export();
571 include_once(
"Services/MetaData/classes/class.ilMD2XML.php");
573 $md2xml->setExportMode(
true);
574 $md2xml->startExport();
575 $a_xml_writer->appendXML($md2xml->getXML());
580 if ($a_tag ==
"Identifier" && $a_param ==
"Entry")
582 include_once
"./Services/Utilities/classes/class.ilUtil.php";
600 include_once
"./Modules/LearningModule/classes/class.ilLMPageObject.php";
602 foreach ($questions as $question_id)
604 $ilBench->start(
"ContentObjectExport",
"exportPageObject");
605 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Page Object ".$question_id);
608 $a_xml_writer->xmlStartTag(
"PageObject", $attrs);
612 $ilBench->start(
"ContentObjectExport",
"exportPageObject_XML");
613 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php");
615 $page_object->buildDom();
616 $page_object->insertInstIntoIDs($a_inst);
617 $mob_ids = $page_object->collectMediaObjects(
false);
618 require_once
'Services/COPage/classes/class.ilPCFileList.php';
620 $xml = $page_object->getXMLFromDom(
false,
false,
false,
"",
true);
621 $xml = str_replace(
"&",
"&", $xml);
622 $a_xml_writer->appendXML($xml);
623 $page_object->freeDom();
624 unset ($page_object);
626 $ilBench->stop(
"ContentObjectExport",
"exportPageObject_XML");
629 $ilBench->start(
"ContentObjectExport",
"exportPageObject_CollectMedia");
631 foreach($mob_ids as $mob_id)
633 $this->mob_ids[$mob_id] = $mob_id;
635 $ilBench->stop(
"ContentObjectExport",
"exportPageObject_CollectMedia");
638 $ilBench->start(
"ContentObjectExport",
"exportPageObject_CollectFileItems");
640 foreach($file_ids as $file_id)
642 $this->file_ids[$file_id] = $file_id;
644 $ilBench->stop(
"ContentObjectExport",
"exportPageObject_CollectFileItems");
646 $a_xml_writer->xmlEndTag(
"PageObject");
649 $ilBench->stop(
"ContentObjectExport",
"exportPageObject");
663 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
665 foreach ($this->mob_ids as $mob_id)
667 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Media Object ".$mob_id);
671 $media_obj->exportXML($a_xml_writer, $a_inst);
672 $media_obj->exportFiles($a_target_dir);
684 include_once(
"./Modules/File/classes/class.ilObjFile.php");
686 foreach ($this->file_ids as $file_id)
688 $expLog->write(
date(
"[y-m-d H:i:s] ").
"File Item ".$file_id);
689 $file_obj =
new ilObjFile($file_id,
false);
690 $file_obj->export($a_target_dir);
702 include_once
"./Services/Utilities/classes/class.ilUtil.php";
705 if(!is_writable($qpl_data_dir))
707 $this->
ilias->raiseError(
"Questionpool Data Directory (".$qpl_data_dir
708 .
") not writeable.",$this->
ilias->error_obj->FATAL);
712 $qpl_dir = $qpl_data_dir.
"/qpl_".$this->
getId();
714 if(!@is_dir($qpl_dir))
716 $this->
ilias->raiseError(
"Creation of Questionpool Directory failed.",$this->
ilias->error_obj->FATAL);
722 $this->
ilias->raiseError(
"Creation of Export Directory failed.",$this->
ilias->error_obj->FATAL);
727 $this->
ilias->raiseError(
"Creation of Export Directory failed.",$this->
ilias->error_obj->FATAL);
736 include_once
"./Services/Utilities/classes/class.ilUtil.php";
740 include_once(
"./Services/Export/classes/class.ilExport.php");
745 $export_dir =
ilUtil::getDataDir().
"/qpl_data".
"/qpl_".$this->getId().
"/export_$type";
763 include_once
"./Services/Utilities/classes/class.ilUtil.php";
767 if(!is_writable($qpl_data_dir))
769 $ilias->raiseError(
"Questionpool Data Directory (".$qpl_data_dir
770 .
") not writeable.",$ilias->error_obj->FATAL);
774 $qpl_dir = $qpl_data_dir.
"/qpl_import";
776 if(!@is_dir($qpl_dir))
778 $ilias->raiseError(
"Creation of Questionpool Directory failed.",$ilias->error_obj->FATAL);
788 if (strlen($a_import_dir))
790 $_SESSION[
"qpl_import_dir"] = $a_import_dir;
824 $result = $ilDB->queryF(
"SELECT question_id FROM qpl_questions WHERE obj_fi = %s AND qpl_questions.tstamp > 0 AND original_id IS NULL",
828 $questions =
array();
831 array_push($questions,
$row[
"question_id"]);
840 $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",
841 array(
'integer',
'text'),
844 $questions =
array();
845 if ($query_result->numRows())
847 while (
$row = $ilDB->fetchAssoc($query_result))
853 array_push($questions,
$row[
"question_id"]);
858 array_push($questions,
$row[
"question_id"]);
869 $row = $DIC->database()->fetchAssoc($DIC->database()->queryF(
870 "SELECT COUNT(question_id) cnt FROM qpl_questions WHERE question_id = %s AND obj_fi = %s",
874 return (
bool)
$row[
'cnt'];
883 if (!is_array($this->import_mapping))
889 return $this->import_mapping;
904 if (count($questions) > 0)
906 foreach ($questions as $key => $value)
909 $xml .= $question->object->toXML();
911 if (count($questions) > 1)
913 $xml = preg_replace(
"/<\/questestinterop>\s*<.xml.*?>\s*<questestinterop>/",
"", $xml);
916 $xml = preg_replace(
"/(<\?xml[^>]*?>)/",
"\\1" .
"<!DOCTYPE questestinterop SYSTEM \"ims_qtiasiv1p2p1.dtd\">", $xml);
931 if ($complete_questions_only)
933 $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",
934 array(
'integer',
'text'),
935 array($questionpool_id, 1)
940 $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",
942 array($questionpool_id)
946 return $row[
"question_count"];
958 switch ($a_online_status)
962 $this->online = $a_online_status;
972 if (strcmp($this->online,
"") == 0) $this->online =
"0";
1007 $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",
1014 $result = $ilDB->queryF(
"SELECT isonline FROM qpl_questionpool WHERE obj_fi = %s",
1022 return $row[
"isonline"];
1039 $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",
1046 $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",
1054 if (
$row[
"equal_points"] == 1)
1076 if (array_key_exists(
"qpl_clipboard",
$_SESSION))
1079 foreach (
$_SESSION[
"qpl_clipboard"] as $question_object)
1081 if (strcmp($question_object[
"action"],
"move") == 0)
1083 $result = $ilDB->queryF(
"SELECT obj_fi FROM qpl_questions WHERE question_id = %s",
1085 array($question_object[
"question_id"])
1090 $source_questionpool =
$row[
"obj_fi"];
1092 $affectedRows = $ilDB->manipulateF(
"UPDATE qpl_questions SET obj_fi = %s WHERE question_id = %s",
1093 array(
'integer',
'integer'),
1094 array($this->
getId(), $question_object[
"question_id"])
1102 $source_path = CLIENT_WEB_DIR .
"/assessment/" . $source_questionpool .
"/" . $question_object[
"question_id"] .
"/";
1103 if (@is_dir($source_path))
1105 $target_path = CLIENT_WEB_DIR .
"/assessment/" . $this->
getId() .
"/";
1106 if (!@is_dir($target_path))
1108 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1111 rename($source_path, $target_path . $question_object[
"question_id"]);
1119 $new_question_id = $this->
copyQuestion($question_object[
"question_id"], $this->
getId());
1120 if(!$new_question_id)
1142 if (!array_key_exists(
"qpl_clipboard",
$_SESSION))
1146 $_SESSION[
"qpl_clipboard"][$question_id] =
array(
"question_id" => $question_id,
"action" =>
"copy");
1157 if (!array_key_exists(
"qpl_clipboard",
$_SESSION))
1161 $_SESSION[
"qpl_clipboard"][$question_id] =
array(
"question_id" => $question_id,
"action" =>
"move");
1166 if( !isset(
$_SESSION[
'qpl_clipboard']) )
1171 if( !isset(
$_SESSION[
'qpl_clipboard'][$deletedQuestionId]) )
1176 unset(
$_SESSION[
'qpl_clipboard'][$deletedQuestionId]);
1178 if( !count(
$_SESSION[
'qpl_clipboard']) )
1195 include_once
"./Services/Object/classes/class.ilObject.php";
1222 $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");
1223 if ($query_result->numRows())
1225 while (
$row = $ilDB->fetchAssoc($query_result))
1246 $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");
1247 if ($query_result->numRows())
1249 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1250 while (
$row = $ilDB->fetchAssoc($query_result))
1265 $duplicate_id = $question->object->duplicate(
true);
1266 if ($duplicate_id > 0)
1269 $affectedRows = $ilDB->manipulateF(
"UPDATE tst_solutions SET question_fi = %s WHERE question_fi = %s",
1270 array(
'integer',
'integer'),
1271 array($duplicate_id,
$row[
"question_id"])
1275 $affectedRows = $ilDB->manipulateF(
"UPDATE tst_test_rnd_qst 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_result SET question_fi = %s WHERE question_fi = %s",
1282 array(
'integer',
'integer'),
1283 array($duplicate_id,
$row[
"question_id"])
1287 $affectedRows = $ilDB->manipulateF(
"UPDATE ass_log SET question_fi = %s WHERE question_fi = %s",
1288 array(
'integer',
'integer'),
1289 array($duplicate_id,
$row[
"question_id"])
1313 foreach (
$path as $item)
1317 array_push($items, $item[
"title"]);
1321 $fullpath = join(
" > ", $items);
1322 include_once
"./Services/Utilities/classes/class.ilStr.php";
1323 if (strlen($fullpath) > 60)
1336 public static function _getAvailableQuestionpools($use_object_id = FALSE, $equal_points = FALSE, $could_be_offline = FALSE, $showPath = FALSE, $with_questioncount = FALSE, $permission =
"read", $usr_id =
"")
1340 $result_array =
array();
1341 $permission = (strlen($permission) == 0) ?
"read" : $permission;
1350 if (count($obj_ids))
1352 $in = $ilDB->in(
'object_data.obj_id', $obj_ids,
false,
'integer');
1353 if ($could_be_offline)
1355 $result = $ilDB->query(
"SELECT qpl_questionpool.*, object_data.title FROM qpl_questionpool, object_data WHERE ".
1356 "qpl_questionpool.obj_fi = object_data.obj_id AND $in ORDER BY object_data.title");
1360 $result = $ilDB->queryF(
"SELECT qpl_questionpool.*, object_data.title FROM qpl_questionpool, object_data WHERE ".
1361 "qpl_questionpool.obj_fi = object_data.obj_id AND $in AND qpl_questionpool.isonline = %s ".
1362 "ORDER BY object_data.title",
1379 $ref_id = array_search(
$row[
"obj_fi"], $obj_ids);
1380 $title = (($showPath) ? $titles[$ref_id] :
$row[
"title"]);
1381 if ($with_questioncount)
1383 $title .=
" [" . $row[
"questioncount"] .
" " . ($row[
"questioncount"] == 1 ? $lng->txt(
"ass_question") : $lng->txt(
"assQuestions")) .
"]";
1388 $result_array[$row[
"obj_fi"]] =
array(
1389 'qpl_id' => $row[
'obj_fi'],
1390 'qpl_title' => $row[
'title'],
1392 "count" => $row[
"questioncount"]
1398 'qpl_id' => $row[
'obj_fi'],
1399 'qpl_title' => $row[
'title'],
1401 "count" => $row[
"questioncount"]
1407 return $result_array;
1414 $questions =
array();
1415 $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",
1421 array_push($questions,
$row[
"question_id"]);
1431 function cloneObject($a_target_id,$a_copy_id = 0, $a_omit_tree =
false)
1435 $newObj = parent::cloneObject($a_target_id,$a_copy_id, $a_omit_tree);
1440 if(!$cp_options->isRootNode($this->getRefId()))
1447 $newObj->saveToDb();
1451 $questionIdsMap =
array();
1452 foreach ($questions as $question_id)
1454 $newQuestionId = $newObj->copyQuestion($question_id, $newObj->getId());
1455 $questionIdsMap[$question_id] = $newQuestionId;
1459 include_once
"./Services/MetaData/classes/class.ilMD.php";
1461 $new_md =& $md->cloneMD($newObj->getId(),0,$newObj->getType());
1464 $newObj->updateMetaData();
1466 require_once
'Modules/TestQuestionPool/classes/class.ilQuestionPoolTaxonomiesDuplicator.php';
1468 $duplicator->setSourceObjId($this->
getId());
1469 $duplicator->setSourceObjType($this->
getType());
1470 $duplicator->setTargetObjId($newObj->getId());
1471 $duplicator->setTargetObjType($newObj->getType());
1472 $duplicator->setQuestionIdMapping($questionIdsMap);
1473 $duplicator->duplicate($duplicator->getAllTaxonomiesForSourceObject());
1475 $duplicatedTaxKeyMap = $duplicator->getDuplicatedTaxonomiesKeysMap();
1476 $newObj->setNavTaxonomyId($duplicatedTaxKeyMap->getMappedTaxonomyId($this->getNavTaxonomyId()));
1477 $newObj->saveToDb();
1484 return self::_getQuestionTypes($all_tags, $fixOrder);
1492 include_once
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
1494 $lng->loadLanguageModule(
"assessment");
1495 $result = $ilDB->query(
"SELECT * FROM qpl_qst_type");
1499 if ($all_tags || (!in_array(
$row[
"question_type_id"], $forbidden_types)))
1503 if (
$row[
"plugin"] == 0)
1505 $types[$lng->txt(
$row[
"type_tag"])] =
$row;
1509 global $ilPluginAdmin;
1510 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_MODULE,
"TestQuestionPool",
"qst");
1511 foreach ($pl_names as $pl_name)
1514 if (strcmp($pl->getQuestionType(),
$row[
"type_tag"]) == 0)
1516 $types[$pl->getQuestionTypeTranslation()] =
$row;
1523 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionTypeOrderer.php';
1526 $types = $orderer->getOrderedTypes();
1535 $query =
"SELECT type_tag FROM qpl_qst_type WHERE question_type_id = %s";
1536 $types =
array(
'integer');
1537 $values =
array($type_id);
1542 return $row[
'type_tag'];
1551 global $ilPluginAdmin;
1553 $lng->loadLanguageModule(
"assessment");
1554 $result = $ilDB->query(
"SELECT * FROM qpl_qst_type");
1558 if (
$row[
"plugin"] == 0)
1560 $types[
$row[
'type_tag']] = $lng->txt($row[
"type_tag"]);
1564 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_MODULE,
"TestQuestionPool",
"qst");
1565 foreach ($pl_names as $pl_name)
1568 if (strcmp($pl->getQuestionType(),
$row[
"type_tag"]) == 0)
1570 $types[
$row[
'type_tag']] = $pl->getQuestionTypeTranslation();
1598 $allowed_types =
array(
1599 "assSingleChoice" => 1,
1600 "assMultipleChoice" => 2,
1601 "assKprimChoice" => 3,
1602 "assClozeTest" => 4,
1603 "assMatchingQuestion" => 5,
1604 "assOrderingQuestion" => 6,
1605 "assOrderingHorizontal" => 7,
1606 "assImagemapQuestion" => 8,
1607 "assTextSubset" => 9,
1608 "assErrorText" => 10,
1613 foreach($qtypes as $k =>
$t)
1616 if (isset($allowed_types[
$t[
"type_tag"]]))
1618 $t[
"order"] = $allowed_types[$t[
"type_tag"]];
1630 $questions =
array();
1631 $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",
1637 array_push($questions,
$row);
1651 $result = $ilDB->manipulateF(
"UPDATE qpl_questionpool SET questioncount = %s, tstamp = %s WHERE obj_fi = %s",
1652 array(
'integer',
'integer',
'integer'),
1666 global $ilPluginAdmin;
1668 $plugins = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_MODULE,
"TestQuestionPool",
"qst");
1669 foreach($plugins as $pluginName)
1671 if( $pluginName == $questionType )
1679 if($plugin->getQuestionType() == $questionType)
1695 require_once
'Modules/TestQuestionPool/classes/class.ilAssIncompleteQuestionPurger.php';
1697 $incompleteQuestionPurger->setOwnerId($ilUser->getId());
1698 $incompleteQuestionPurger->purge();
1708 require_once
'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
1732 if( self::$isSkillManagementGloballyActivated === null )
1734 include_once
'Services/Skill/classes/class.ilSkillManagementSettings.php';
1737 self::$isSkillManagementGloballyActivated = $skmgSet->isActivated();
1740 return self::$isSkillManagementGloballyActivated;
1745 require_once
'Modules/TestQuestionPool/classes/class.ilObjQuestionPoolXMLParser.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
static getPoolQuestionChangeListeners(ilDBInterface $db, $poolObjId)
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.
static _hasUntrashedReference($a_obj_id)
checks wether an object has at least one reference that is not in trash
static _isWriteable($object_id, $user_id)
Returns true, if the question pool is writeable by a given user.
populateQuestionSkillAssignmentsXml(ilXmlWriter &$a_xml_writer, $questions)
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.
addQuestionChangeListeners(assQuestion $question)
static _isUsedInRandomTest($question_id="")
Checks whether the question is used in a random test or not.
static _getQuestionTypes($all_tags=FALSE, $fixOrder=false)
getQuestiontype($question_id)
Returns the question type of a question with a given id.
Skill management settings.
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...
objectToXmlWriter(ilXmlWriter &$a_xml_writer, $a_inst, $a_target_dir, &$expLog, $questions)
export pages of test to xml (see ilias_co.dtd)
static _getQuestionCount($questionpool_id, $complete_questions_only=FALSE)
Returns the number of questions in a question pool.
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.
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
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
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.
& getQuestionDetails($question_ids)
Returns an array containing the qpl_question and qpl_qst_type fields for an array of question ids...
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.
static _getAllReferences($a_id)
get all reference ids of object
xmlEndTag($tag)
Writes an endtag.
setOnline($a_online_status)
Sets the questionpool online status.
exportXMLSettings($xmlWriter)
setSkillServiceEnabled($skillServiceEnabled)
modifyExportIdentifier($a_tag, $a_param, $a_value)
duplicateQuestion($question_id)
Duplicates a question for a questionpool.
setShowTaxonomies($showTaxonomies)
questionsToXML($questions)
Returns a QTI xml representation of a list of questions.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
getQuestionTypes($all_tags=FALSE, $fixOrder=false)
static _updateQuestionCount($object_id)
Updates the number of available questions for a question pool in the database.
static _lookupOnline($a_obj_id, $is_reference=FALSE)
static _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)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
__construct($a_id=0, $a_call_by_reference=true)
Constructor public.
static collectFileItems($a_page, $a_domdoc)
Get all file items that are used within the page.
static _getForbiddenQuestionTypes()
Returns the forbidden questiontypes for ILIAS.
cleanupClipboard($deletedQuestionId)
static _setImportDirectory($a_import_dir=null)
set import directory
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)
checkQuestionParent($questionId)
copyToClipboard($question_id)
Copies a question to the clipboard.
read($a_force_db=false)
read object data from db into object
getType()
get object type public
Create styles array
The data for the language used.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
if(php_sapi_name() !='cli') $in
getTitle()
get title of glossary object
isPluginActive($questionType)
Checks wheather or not a question plugin with a given name is active.
& getAllQuestions()
Retrieve an array containing all question ids of the questionpool.
static $isSkillManagementGloballyActivated
static getDataDir()
get data directory (outside webspace)
static isSkillManagementGloballyActivated()
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.
cloneObject($a_target_id, $a_copy_id=0, $a_omit_tree=false)
Creates a 1:1 copy of the object and places the copy in a given repository.
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
static insertInstIntoID($a_value)
inserts installation id into ILIAS id
deleteMetaData()
delete meta data entry
static getQuestionTypeTranslations()
static _getImportDirectory()
get import directory of lm
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
addQuestionChangeListener(ilQuestionChangeListener $listener)
static subStr($a_str, $a_start, $a_length=NULL)
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
static _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.
setDescription($a_description)
set description of content object
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...