19 require_once
'./Modules/Test/classes/inc.AssessmentConstants.php';
47 public function __construct($a_id = 0, $a_call_by_reference =
true)
50 $this->component_repository = $DIC[
'component.repository'];
51 $this->benchmark = $DIC[
'ilBench'];
52 $this->questioninfo = $DIC->testQuestionPool()->questionInfo();
56 $this->skill_service_enabled =
false;
64 $id = parent::create();
82 $result = parent::createReference();
96 if (!parent::update()) {
110 public function read($a_force_db =
false): void
112 parent::read($a_force_db);
122 public function delete():
bool 125 if (!parent::delete()) {
136 $qsaImportFails->deleteRegisteredImportFails();
145 if (count($questions)) {
146 foreach ($questions as $question_id) {
152 $directory = $qpl_data_dir .
'/qpl_' . $this->
getId();
153 if (is_dir($directory)) {
161 $question->delete($question_id);
166 $result = $this->db->queryF(
167 'SELECT * FROM qpl_questionpool WHERE obj_fi = %s',
171 if ($result->numRows() == 1) {
172 $row = $this->db->fetchAssoc($result);
180 $result = $this->db->queryF(
181 'SELECT id_questionpool FROM qpl_questionpool WHERE obj_fi = %s',
186 if ($result->numRows() == 1) {
187 $result = $this->db->update(
192 'tstamp' => [
'integer', time()]
195 'obj_fi' => [
'integer', $this->
getId()]
199 $next_id = $this->db->nextId(
'qpl_questionpool');
201 $result = $this->db->insert(
'qpl_questionpool', [
202 'id_questionpool' => [
'integer', $next_id],
205 'tstamp' => [
'integer', time()],
206 'obj_fi' => [
'integer', $this->
getId()]
213 if ($question_id < 1) {
217 $result = $this->db->queryF(
218 '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',
223 if ($result->numRows() == 1) {
224 $data = $this->db->fetchAssoc($result);
225 return $data[
'type_tag'];
230 public function isInUse(
int $question_id): bool
232 $result = $this->db->queryF(
233 'SELECT COUNT(solution_id) solution_count FROM tst_solutions WHERE question_fi = %s',
237 $row = $this->db->fetchAssoc($result);
238 return $row[
'solution_count'];
243 if ($question_id > 0) {
246 $question_type_gui = $question_type .
'GUI';
247 $question_gui =
new $question_type_gui();
248 return $question_gui;
254 $newtitle = $question->object->getTitle();
255 if ($this->questioninfo->questionTitleExistsInPool($this->getId(), $question->object->getTitle())) {
257 while ($this->questioninfo->questionTitleExistsInPool(
259 $question->object->getTitle() .
' (' . $counter .
')' 263 $newtitle = $question->object->getTitle() .
' (' . $counter .
')';
265 $new_id = $question->object->duplicate(
false, $newtitle);
273 if ($question_gui->object->getObjId() == $questionpool_to) {
278 $newtitle = $question_gui->object->getTitle();
279 if ($this->questioninfo->questionTitleExistsInPool($this->getId(), $question_gui->object->getTitle())) {
281 while ($this->questioninfo->questionTitleExistsInPool(
283 $question_gui->object->getTitle() .
' (' . $counter .
')' 287 $newtitle = $question_gui->object->getTitle() .
' (' . $counter .
')';
289 return $question_gui->object->copyObject($this->
getId(), $newtitle);
295 $query_result = $this->db->queryF(
296 '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',
302 if ($query_result->numRows()) {
303 while ($row = $this->db->fetchAssoc($query_result)) {
304 $row[
'ttype'] = $types[$row[
'type_tag']];
305 if ($row[
'plugin']) {
307 array_push($rows, $row);
310 array_push($rows, $row);
322 $xmlWriter->xmlStartTag(
'Settings');
324 $xmlWriter->xmlElement(
'ShowTaxonomies', null, (
int) $this->
getShowTaxonomies());
327 $xmlWriter->xmlEndTag(
'Settings');
341 $this->file_ids = [];
344 $attrs[
'Type'] =
'Questionpool_Test';
345 $a_xml_writer->
xmlStartTag(
'ContentObject', $attrs);
354 $expLog->write(date(
'[y-m-d H:i:s] ') .
'Start Export Page Objects');
355 $ilBench->start(
'ContentObjectExport',
'exportPageObjects');
357 $ilBench->stop(
'ContentObjectExport',
'exportPageObjects');
358 $expLog->write(date(
'[y-m-d H:i:s] ') .
'Finished Export Page Objects');
361 $expLog->write(date(
'[y-m-d H:i:s] ') .
'Start Export Media Objects');
362 $ilBench->start(
'ContentObjectExport',
'exportMediaObjects');
364 $ilBench->stop(
'ContentObjectExport',
'exportMediaObjects');
365 $expLog->write(date(
'[y-m-d H:i:s] ') .
'Finished Export Media Objects');
368 $expLog->write(date(
'[y-m-d H:i:s] ') .
'Start Export File Items');
369 $ilBench->start(
'ContentObjectExport',
'exportFileItems');
371 $ilBench->stop(
'ContentObjectExport',
'exportFileItems');
372 $expLog->write(date(
'[y-m-d H:i:s] ') .
'Finished Export File Items');
377 $a_xml_writer->
xmlEndTag(
'ContentObject');
387 $assignmentList->setParentObjId($this->
getId());
388 $assignmentList->loadFromDb();
389 $assignmentList->loadAdditionalSkillData();
392 $skillQuestionAssignmentExporter->setXmlWriter($a_xml_writer);
393 $skillQuestionAssignmentExporter->setQuestionIds($questions);
394 $skillQuestionAssignmentExporter->setAssignmentList($assignmentList);
395 $skillQuestionAssignmentExporter->export();
407 $md2xml->setExportMode(
true);
408 $md2xml->startExport();
409 $a_xml_writer->appendXML($md2xml->getXML());
414 if ($a_tag ==
'Identifier' && $a_param ==
'Entry') {
431 foreach ($questions as $question_id) {
432 $ilBench->
start(
'ContentObjectExport',
'exportPageObject');
433 $expLog->write(date(
'[y-m-d H:i:s] ') .
'Page Object ' . $question_id);
436 $a_xml_writer->xmlStartTag(
'PageObject', $attrs);
439 $ilBench->start(
'ContentObjectExport',
'exportPageObject_XML');
441 $page_object->buildDom();
442 $page_object->insertInstIntoIDs($a_inst);
443 $mob_ids = $page_object->collectMediaObjects(
false);
445 $xml = $page_object->getXMLFromDom(
false,
false,
false,
'',
true);
446 $xml = str_replace(
'&',
'&', $xml);
447 $a_xml_writer->appendXML($xml);
448 $page_object->freeDom();
450 $ilBench->stop(
'ContentObjectExport',
'exportPageObject_XML');
452 $ilBench->start(
"ContentObjectExport",
"exportPageObject_CollectMedia");
453 foreach ($mob_ids as $mob_id) {
454 $this->mob_ids[$mob_id] = $mob_id;
456 $ilBench->stop(
'ContentObjectExport',
'exportPageObject_CollectMedia');
459 $ilBench->start(
'ContentObjectExport',
'exportPageObject_CollectFileItems');
461 foreach ($file_ids as $file_id) {
462 $this->file_ids[$file_id] = $file_id;
464 $ilBench->stop(
'ContentObjectExport',
'exportPageObject_CollectFileItems');
466 $a_xml_writer->xmlEndTag(
"PageObject");
468 $ilBench->stop(
'ContentObjectExport',
'exportPageObject');
474 foreach ($this->mob_ids as $mob_id) {
475 $expLog->write(date(
'[y-m-d H:i:s] ') .
'Media Object ' . $mob_id);
478 $media_obj->exportXML($a_xml_writer, $a_inst);
479 $media_obj->exportFiles($a_target_dir);
491 foreach ($this->file_ids as $file_id) {
492 $expLog->write(date(
"[y-m-d H:i:s] ") .
"File Item " . $file_id);
493 $file_dir = $target_dir .
'/objects/il_' .
IL_INST_ID .
'_file_' . $file_id;
495 $file_obj =
new ilObjFile($file_id,
false);
496 $source_file = $file_obj->getFile($file_obj->getVersion());
497 if (!is_file($source_file)) {
498 $source_file = $file_obj->getFile();
500 if (is_file($source_file)) {
501 copy($source_file, $file_dir .
'/' . $file_obj->getFileName());
516 if (!is_writable($qpl_data_dir)) {
517 $this->error->raiseError(
518 'Questionpool Data Directory (' . $qpl_data_dir
519 .
') not writeable.',
525 $qpl_dir = $qpl_data_dir .
'/qpl_' . $this->
getId();
527 if (!@is_dir($qpl_dir)) {
528 $this->error->raiseError(
'Creation of Questionpool Directory failed.', $this->error->FATAL);
533 $this->error->raiseError(
'Creation of Export Directory failed.', $this->error->FATAL);
537 $this->error->raiseError(
'Creation of Export Directory failed.', $this->error->FATAL);
563 if ($a_import_dir !== null) {
591 $result = $this->db->queryF(
592 'SELECT question_id FROM qpl_questions WHERE obj_fi = %s AND qpl_questions.tstamp > 0 AND original_id IS NULL',
597 while ($row = $this->db->fetchAssoc($result)) {
598 array_push($questions, $row[
'question_id']);
605 $query_result = $this->db->queryF(
606 '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',
611 if ($query_result->numRows()) {
612 while ($row = $this->db->fetchAssoc($query_result)) {
613 if ($row[
'plugin']) {
615 array_push($questions, $row[
'question_id']);
618 array_push($questions, $row[
'question_id']);
627 $row = $this->db->fetchAssoc(
629 'SELECT COUNT(question_id) cnt FROM qpl_questions WHERE question_id = %s AND obj_fi = %s',
630 [
'integer',
'integer'],
631 [$question_id, $this->getId()]
635 return (
bool) $row[
'cnt'];
658 if (count($questions) > 0) {
659 foreach ($questions as
$key => $value) {
661 $xml .= $question->object->toXML();
663 if (count($questions) > 1) {
664 $xml = preg_replace(
'/<\/questestinterop>\s*<.xml.*?>\s*<questestinterop>/',
'', $xml);
669 '\\1' .
'<!DOCTYPE questestinterop SYSTEM "ims_qtiasiv1p2p1.dtd">',
678 $ilDB = $DIC[
'ilDB'];
679 $result =
$ilDB->queryF(
680 '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',
684 $row =
$ilDB->fetchAssoc($result);
685 return $row[
'question_count'];
707 $ilDB = $DIC[
'ilDB'];
710 $result =
$ilDB->queryF(
711 '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',
716 $result =
$ilDB->queryF(
717 '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',
722 if ($result->numRows() == 1) {
723 $row =
$ilDB->fetchAssoc($result);
724 if ($row[
'equal_points'] == 1) {
744 if (strcmp($question_object[
'action'],
'move') == 0) {
745 $result = $this->db->queryF(
746 'SELECT obj_fi FROM qpl_questions WHERE question_id = %s',
748 [$question_object[
'question_id']]
750 if ($result->numRows() == 1) {
751 $row = $this->db->fetchAssoc($result);
752 $source_questionpool = $row[
'obj_fi'];
753 $affectedRows = $this->db->manipulateF(
754 'UPDATE qpl_questions SET obj_fi = %s WHERE question_id = %s',
755 [
'integer',
'integer'],
756 [$this->
getId(), $question_object[
'question_id']]
758 if (!$affectedRows) {
762 $source_path =
CLIENT_WEB_DIR .
'/assessment/' . $source_questionpool .
'/' . $question_object[
'question_id'] .
'/';
763 if (@is_dir($source_path)) {
765 if (!@is_dir($target_path)) {
768 rename($source_path, $target_path . $question_object[
'question_id']);
774 $new_question_id = $this->
copyQuestion($question_object[
'question_id'], $this->
getId());
775 if (!$new_question_id) {
800 $clip[$question_id] = [
'question_id' => $question_id,
'action' =>
'copy'];
816 $clip[$question_id] = [
'question_id' => $question_id,
'action' =>
'move'];
827 if (!isset($clip[$deletedQuestionId])) {
831 unset($clip[$deletedQuestionId]);
850 $rbacsystem = $DIC[
'rbacsystem'];
873 $query_result = $this->db->query(
874 '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(
875 'qpl_questions.question_id',
879 ) .
' ORDER BY qpl_questions.title' 881 if ($query_result->numRows()) {
882 while ($row = $this->db->fetchAssoc($query_result)) {
883 array_push($result, $row);
900 $query_result = $this->db->query(
901 '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 ' 902 . $this->db->in(
'qpl_questions.question_id', $question_ids,
false,
'integer')
903 .
' ORDER BY qpl_questions.title' 905 if ($query_result->numRows()) {
906 while ($row = $this->db->fetchAssoc($query_result)) {
907 if (!$this->questioninfo->isUsedInRandomTest($row[
'question_id'])) {
908 array_push($result, $row);
917 $duplicate_id = $question->object->duplicate(
true);
918 if ($duplicate_id > 0) {
920 $affectedRows = $this->db->manipulateF(
921 'UPDATE tst_solutions SET question_fi = %s WHERE question_fi = %s',
922 [
'integer',
'integer'],
923 [$duplicate_id, $row[
'question_id']]
927 $affectedRows = $this->db->manipulateF(
928 'UPDATE tst_test_rnd_qst SET question_fi = %s WHERE question_fi = %s',
929 [
'integer',
'integer'],
930 [$duplicate_id, $row[
'question_id']]
934 $affectedRows = $this->db->manipulateF(
935 'UPDATE tst_test_result SET question_fi = %s WHERE question_fi = %s',
936 [
'integer',
'integer'],
937 [$duplicate_id, $row[
'question_id']]
941 $affectedRows = $this->db->manipulateF(
942 'UPDATE ass_log SET question_fi = %s WHERE question_fi = %s',
943 [
'integer',
'integer'],
944 [$duplicate_id, $row[
'question_id']]
948 array_push($result, $row);
963 $use_object_id =
false,
964 $equal_points =
false,
965 $could_be_offline =
false,
967 $with_questioncount =
false,
968 $permission =
'read',
972 $ilUser = $DIC[
'ilUser'];
973 $ilDB = $DIC[
'ilDB'];
977 $permission = (strlen($permission) == 0) ?
'read' : $permission;
985 if (count($obj_ids)) {
986 $in =
$ilDB->in(
'object_data.obj_id', $obj_ids,
false,
'integer');
987 if ($could_be_offline) {
988 $result =
$ilDB->query(
989 'SELECT qpl_questionpool.*, object_data.title FROM qpl_questionpool, object_data WHERE ' .
990 'qpl_questionpool.obj_fi = object_data.obj_id AND ' . $in .
' ORDER BY object_data.title' 993 $result =
$ilDB->queryF(
994 'SELECT qpl_questionpool.*, object_data.title FROM qpl_questionpool, object_data WHERE ' .
995 'qpl_questionpool.obj_fi = object_data.obj_id AND ' . $in .
' AND object_data.offline = %s ' .
996 'ORDER BY object_data.title',
1001 while ($row =
$ilDB->fetchAssoc($result)) {
1003 if ($equal_points) {
1009 $ref_id = array_search($row[
'obj_fi'], $obj_ids);
1010 $title = (($showPath) ? $titles[$ref_id] : $row[
'title']);
1011 if ($with_questioncount) {
1012 $title .=
' [' . $row[
'questioncount'] .
' ' . ($row[
'questioncount'] == 1 ?
$lng->
txt(
1014 ) :
$lng->
txt(
'assQuestions')) .
']';
1017 if ($use_object_id) {
1018 $result_array[$row[
'obj_fi']] = [
1019 'qpl_id' => $row[
'obj_fi'],
1020 'qpl_title' => $row[
'title'],
1022 'count' => $row[
'questioncount']
1026 'qpl_id' => $row[
'obj_fi'],
1027 'qpl_title' => $row[
'title'],
1029 'count' => $row[
'questioncount']
1035 return $result_array;
1041 $result = $this->db->queryF(
1042 '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',
1046 while ($row = $this->db->fetchAssoc($result)) {
1047 array_push($questions, $row[
'question_id']);
1059 $new_obj = parent::cloneObject($target_id, $copy_id, $omit_tree);
1065 $new_obj->saveToDb();
1069 $questionIdsMap = [];
1070 foreach ($questions as $question_id) {
1071 $newQuestionId = $new_obj->copyQuestion($question_id, $new_obj->getId());
1072 $questionIdsMap[$question_id] = $newQuestionId;
1076 $md->cloneMD($new_obj->getId(), 0, $new_obj->getType());
1077 $new_obj->updateMetaData();
1080 $duplicator->setSourceObjId($this->
getId());
1081 $duplicator->setSourceObjType($this->
getType());
1082 $duplicator->setTargetObjId($new_obj->getId());
1083 $duplicator->setTargetObjType($new_obj->getType());
1084 $duplicator->setQuestionIdMapping($questionIdsMap);
1085 $duplicator->duplicate($duplicator->getAllTaxonomiesForSourceObject());
1087 $new_obj->saveToDb();
1092 public function getQuestionTypes($all_tags =
false, $fixOrder =
false, $withDeprecatedTypes =
true): array
1094 return self::_getQuestionTypes($all_tags, $fixOrder, $withDeprecatedTypes);
1097 public static function _getQuestionTypes($all_tags =
false, $fixOrder =
false, $withDeprecatedTypes =
true): array
1100 $ilDB = $DIC[
'ilDB'];
1102 $component_factory = $DIC[
'component.factory'];
1106 $result =
$ilDB->query(
'SELECT * FROM qpl_qst_type');
1108 while ($row =
$ilDB->fetchAssoc($result)) {
1109 if ($all_tags || (!in_array($row[
'question_type_id'], $forbidden_types))) {
1110 if ($row[
'plugin'] == 0) {
1111 $types[
$lng->
txt($row[
'type_tag'])] = $row;
1113 foreach ($component_factory->getActivePluginsInSlot(
'qst') as $pl) {
1114 if (strcmp($pl->getQuestionType(), $row[
'type_tag']) == 0) {
1115 $types[$pl->getQuestionTypeTranslation()] = $row;
1124 $types = $orderer->getOrderedTypes($withDeprecatedTypes);
1132 $ilDB = $DIC[
'ilDB'];
1134 $query =
'SELECT type_tag FROM qpl_qst_type WHERE question_type_id = %s';
1135 $types = [
'integer'];
1136 $values = [$type_id];
1137 $result =
$ilDB->queryF($query, $types, $values);
1139 if ($row =
$ilDB->fetchAssoc($result)) {
1140 return $row[
'type_tag'];
1148 $ilDB = $DIC[
'ilDB'];
1150 $ilLog = $DIC[
'ilLog'];
1151 $component_factory = $DIC[
'component.factory'];
1154 $result =
$ilDB->query(
'SELECT * FROM qpl_qst_type');
1156 while ($row =
$ilDB->fetchAssoc($result)) {
1157 if ($row[
'plugin'] == 0) {
1158 $types[$row[
'type_tag']] =
$lng->
txt($row[
'type_tag']);
1160 foreach ($component_factory->getActivePluginsInSlot(
'qst') as $pl) {
1161 if (strcmp($pl->getQuestionType(), $row[
'type_tag']) == 0) {
1162 $types[$row[
'type_tag']] = $pl->getQuestionTypeTranslation();
1177 'assSingleChoice' => 1,
1178 'assMultipleChoice' => 2,
1179 'assKprimChoice' => 3,
1180 'assClozeTest' => 4,
1181 'assMatchingQuestion' => 5,
1182 'assOrderingQuestion' => 6,
1183 'assOrderingHorizontal' => 7,
1184 'assImagemapQuestion' => 8,
1185 'assTextSubset' => 9,
1186 'assErrorText' => 10,
1191 foreach ($qtypes as $k => $t) {
1192 if (isset($allowed_types[$t[
'type_tag']])) {
1193 $t[
'order'] = $allowed_types[$t[
'type_tag']];
1203 $result = $this->db->queryF(
1204 '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',
1208 while ($row = $this->db->fetchAssoc($result)) {
1209 array_push($questions, $row);
1217 $ilDB = $DIC[
'ilDB'];
1219 'UPDATE qpl_questionpool SET questioncount = %s, tstamp = %s WHERE obj_fi = %s',
1220 [
'integer',
'integer',
'integer'],
1233 if (!$this->component_repository->getComponentByTypeAndName(
1236 )->getPluginSlotById(
'qst')->hasPluginName($questionType)) {
1240 return $this->component_repository
1241 ->getComponentByTypeAndName(
1245 ->getPluginSlotById(
1256 $incompleteQuestionPurger->setOwnerId($this->
user->getId());
1257 $incompleteQuestionPurger->purge();
1284 if (self::$isSkillManagementGloballyActivated === null) {
1287 self::$isSkillManagementGloballyActivated = $skmgSet->isActivated();
1290 return self::$isSkillManagementGloballyActivated;
1296 $parser->startParsing();
static get(string $a_var)
bool $skill_service_enabled
const ORDER_MODE_FIX
order mode with fixed priority for ordering
getDeleteableQuestionDetails($question_ids)
Returns an array containing the qpl_question and qpl_qst_type fields of deleteable questions for an a...
checkQuestionParent(int $question_id)
exportXMLMetaData(&$a_xml_writer)
export content objects meta data to xml (see ilias_co.dtd)
Readable part of repository interface to ilComponentDataDB.
exportXMLPageObjects(&$a_xml_writer, $a_inst, &$expLog, $questions)
export page objects to xml (see ilias_co.dtd)
ILIAS TestQuestionPool QuestionInfoService $questioninfo
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
moveToClipboard($question_id)
Moves a question to the clipboard.
exportXMLMediaObjects(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
exportFileItems($target_dir, &$expLog)
export files of file itmes
getQuestiontype($question_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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.
pasteFromClipboard()
Copies/Moves a question from the clipboard.
objectToXmlWriter(ilXmlWriter &$a_xml_writer, $a_inst, $a_target_dir, &$expLog, $questions)
export pages of test to xml (see ilias_co.dtd)
static getQuestionTypeByTypeId($type_id)
static _getAllReferences(int $id)
get all reference ids for object ID
createReference()
Creates a database reference id for the object (saves the object to the database and creates a refere...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _hasUntrashedReference(int $obj_id)
checks whether an object has at least one reference that is not in trash
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getUsageOfObject(int $a_obj_id, bool $a_include_titles=false)
setSkillServiceEnabled(bool $skill_service_enabled)
loadLanguageModule(string $a_module)
Load language module.
getImportMapping()
get array of (two) new created questions for import id
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
start(string $a_module, string $a_bench)
start measurement
static _getExportDirectory(int $a_obj_id, string $a_type="xml", string $a_obj_type="", string $a_entity="")
Get export directory for an repository object.
deleteQuestion(int $question_id)
getExportDirectory($type='')
get export directory of questionpool
cloneObject(int $target_id, int $copy_id=0, bool $omit_tree=false)
Creates a 1:1 copy of the object and places the copy in a given repository.
exportXMLSettings($xmlWriter)
static _lookupObjId(int $ref_id)
static instantiateQuestionGUI(int $a_question_id)
xmlEndTag(string $tag)
Writes an endtag.
modifyExportIdentifier($a_tag, $a_param, $a_value)
static _hasEqualPoints($a_obj_id, $is_reference=false)
Checks a question pool for questions with the same maximum points.
isInUse(int $question_id)
getQuestionTypes($all_tags=false, $fixOrder=false, $withDeprecatedTypes=true)
static collectFileItems(ilPageObject $a_page, DOMDocument $a_domdoc)
Get all file items that are used within the page.
static instantiateQuestion(int $question_id)
static & _getSelfAssessmentQuestionTypes($all_tags=false)
setShowTaxonomies($show_taxonomies)
questionsToXML($questions)
Returns a QTI xml representation of a list of questions.
createQuestion(string $question_type, int $question_id=-1)
copyQuestion(int $question_id, int $questionpool_to)
static _prepareCloneSelection(array $ref_ids, string $new_type, bool $show_path=true)
Prepare copy wizard object selection.
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
__construct($a_id=0, $a_call_by_reference=true)
Constructor public.
static _getForbiddenQuestionTypes()
Returns the forbidden questiontypes for ILIAS.
cleanupClipboard($deletedQuestionId)
static _setImportDirectory($a_import_dir=null)
update()
update object data
createExportDirectory()
creates data directory for export files (data_dir/qpl_data/qpl_<id>/export, depending on data directo...
static _getObjectsByOperations( $a_obj_type, string $a_operation, int $a_usr_id=0, int $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.
copyToClipboard($question_id)
Copies a question to the clipboard.
static getDataDir()
get data directory (outside webspace)
read($a_force_db=false)
read object data from db into object
static _updateQuestionCount(int $object_id)
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 _getQuestionCount(int $pool_id)
static $isSkillManagementGloballyActivated
getQuestionDetails($question_ids)
Returns an array containing the qpl_question and qpl_qst_type fields for an array of question ids...
static isSkillManagementGloballyActivated()
getTaxonomyIds()
get ids of all taxonomies corresponding to current pool
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
static getQuestionTypeTranslations()
static _getImportDirectory()
get import directory of lm
ilComponentRepository $component_repository
static insertInstIntoID(string $a_value)
inserts installation id into ILIAS id
duplicateQuestion(int $question_id)
static clear(string $a_var)
static set(string $a_var, $a_val)
Set a value.
create($a_upload=false)
create questionpool object
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static _getQuestionTypes($all_tags=false, $fixOrder=false, $withDeprecatedTypes=true)