19declare(strict_types=1);
43 public function __construct(
int $a_id = 0,
bool $a_call_by_reference =
true)
46 $this->component_repository =
$DIC[
'component.repository'];
47 $this->benchmark =
$DIC[
'ilBench'];
49 $local_dic = QuestionPoolDIC::dic();
50 $this->questionrepository = $local_dic[
'question.general_properties.repository'];
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();
148 if (is_dir($directory)) {
156 $question->delete($question_id);
161 $result = $this->db->queryF(
162 'SELECT * FROM qpl_questionpool WHERE obj_fi = %s',
166 if ($result->numRows() == 1) {
167 $row = $this->db->fetchAssoc($result);
174 $result = $this->db->queryF(
175 'SELECT id_questionpool FROM qpl_questionpool WHERE obj_fi = %s',
180 if ($result->numRows() == 1) {
181 $result = $this->db->update(
185 'tstamp' => [
'integer', time()]
188 'obj_fi' => [
'integer', $this->
getId()]
192 $next_id = $this->db->nextId(
'qpl_questionpool');
194 $result = $this->db->insert(
'qpl_questionpool', [
195 'id_questionpool' => [
'integer', $next_id],
197 'tstamp' => [
'integer', time()],
198 'obj_fi' => [
'integer', $this->
getId()]
205 if ($question_id < 1) {
209 $result = $this->db->queryF(
210 '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',
215 if ($result->numRows() == 1) {
216 $data = $this->db->fetchAssoc($result);
217 return $data[
'type_tag'];
222 public function isInUse(
int $question_id): bool
224 $result = $this->db->queryF(
225 'SELECT COUNT(solution_id) solution_count FROM tst_solutions WHERE question_fi = %s',
229 $row = $this->db->fetchAssoc($result);
230 return $row[
'solution_count'];
235 if ($question_id > 0) {
236 return assQuestion::instantiateQuestionGUI($question_id);
238 $question_type_gui = $question_type .
'GUI';
239 $question_gui =
new $question_type_gui();
240 return $question_gui;
247 $question->getObject()->getTitle()
249 $new_id = $question->getObject()->duplicate(
false, $newtitle);
257 if ($question_gui->getObject()->getObjId() == $questionpool_to) {
263 $question_gui->getObject()->getTitle()
266 return $question_gui->getObject()->copyObject($this->
getId(), $newtitle);
272 $result = $this->db->queryF(
273 "SELECT COUNT(question_id) AS cnt FROM qpl_questions WHERE obj_fi = %s AND title like %s",
275 [$this->
getId(),
"{$title}%"]
277 $counter_object = $this->db->fetchObject($result);
278 if ($counter_object->cnt === 0) {
281 return "{$title} ({$counter_object->cnt})";
286 $query_result = $this->db->queryF(
287 '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',
293 if ($query_result->numRows()) {
294 while ($row = $this->db->fetchAssoc($query_result)) {
295 $row[
'ttype'] = $types[$row[
'type_tag']];
296 if ($row[
'plugin']) {
298 array_push($rows, $row);
301 array_push($rows, $row);
313 $xmlWriter->xmlStartTag(
'Settings');
315 $xmlWriter->xmlEndTag(
'Settings');
329 $this->file_ids = [];
332 $attrs[
'Type'] =
'Questionpool_Test';
333 $a_xml_writer->
xmlStartTag(
'ContentObject', $attrs);
342 $expLog->write(date(
'[y-m-d H:i:s] ') .
'Start Export Page Objects');
343 $ilBench->start(
'ContentObjectExport',
'exportPageObjects');
345 $ilBench->stop(
'ContentObjectExport',
'exportPageObjects');
346 $expLog->write(date(
'[y-m-d H:i:s] ') .
'Finished Export Page Objects');
349 $expLog->write(date(
'[y-m-d H:i:s] ') .
'Start Export Media Objects');
350 $ilBench->start(
'ContentObjectExport',
'exportMediaObjects');
352 $ilBench->stop(
'ContentObjectExport',
'exportMediaObjects');
353 $expLog->write(date(
'[y-m-d H:i:s] ') .
'Finished Export Media Objects');
356 $expLog->write(date(
'[y-m-d H:i:s] ') .
'Start Export File Items');
357 $ilBench->start(
'ContentObjectExport',
'exportFileItems');
359 $ilBench->stop(
'ContentObjectExport',
'exportFileItems');
360 $expLog->write(date(
'[y-m-d H:i:s] ') .
'Finished Export File Items');
365 $a_xml_writer->
xmlEndTag(
'ContentObject');
375 $assignmentList->setParentObjId($this->
getId());
376 $assignmentList->loadFromDb();
377 $assignmentList->loadAdditionalSkillData();
380 $skillQuestionAssignmentExporter->setXmlWriter($a_xml_writer);
381 $skillQuestionAssignmentExporter->setQuestionIds($questions);
382 $skillQuestionAssignmentExporter->setAssignmentList($assignmentList);
383 $skillQuestionAssignmentExporter->export();
394 if ($a_tag ==
'Identifier' && $a_param ==
'Entry') {
411 foreach ($questions as $question_id) {
412 $ilBench->
start(
'ContentObjectExport',
'exportPageObject');
413 $expLog->write(date(
'[y-m-d H:i:s] ') .
'Page Object ' . $question_id);
416 $a_xml_writer->xmlStartTag(
'PageObject', $attrs);
419 $ilBench->start(
'ContentObjectExport',
'exportPageObject_XML');
421 $page_object->buildDom();
422 $page_object->insertInstIntoIDs($a_inst);
423 $mob_ids = $page_object->collectMediaObjects(
false);
425 $xml = $page_object->getXMLFromDom(
false,
false,
false,
'',
true);
426 $xml = str_replace(
'&',
'&', $xml);
427 $a_xml_writer->appendXML($xml);
428 $page_object->freeDom();
430 $ilBench->stop(
'ContentObjectExport',
'exportPageObject_XML');
432 $ilBench->start(
"ContentObjectExport",
"exportPageObject_CollectMedia");
434 $this->mob_ids[$mob_id] = $mob_id;
436 $ilBench->stop(
'ContentObjectExport',
'exportPageObject_CollectMedia');
439 $ilBench->start(
'ContentObjectExport',
'exportPageObject_CollectFileItems');
442 $this->file_ids[$file_id] = $file_id;
444 $ilBench->stop(
'ContentObjectExport',
'exportPageObject_CollectFileItems');
446 $a_xml_writer->xmlEndTag(
"PageObject");
448 $ilBench->stop(
'ContentObjectExport',
'exportPageObject');
454 foreach ($this->mob_ids as $mob_id) {
455 $expLog->write(date(
'[y-m-d H:i:s] ') .
'Media Object ' . $mob_id);
457 $target_dir = $a_target_dir . DIRECTORY_SEPARATOR .
'objects'
458 . DIRECTORY_SEPARATOR .
'il_' .
IL_INST_ID .
'_mob_' . $mob_id;
461 $media_obj->exportXML($a_xml_writer, (
int) $a_inst);
462 foreach ($media_obj->getMediaItems() as $item) {
463 $stream = $item->getLocationStream();
464 file_put_contents($target_dir . DIRECTORY_SEPARATOR . $item->getLocation(), $stream);
478 foreach ($this->file_ids as $file_id) {
479 $expLog->write(date(
"[y-m-d H:i:s] ") .
"File Item " . $file_id);
480 $file_dir = $target_dir .
'/objects/il_' .
IL_INST_ID .
'_file_' . $file_id;
482 $file_obj =
new ilObjFile((
int) $file_id,
false);
483 $source_file = $file_obj->getFile($file_obj->getVersion());
484 if (!is_file($source_file)) {
485 $source_file = $file_obj->getFile();
487 if (is_file($source_file)) {
488 copy($source_file, $file_dir .
'/' . $file_obj->getFileName());
503 if (!is_writable($qpl_data_dir)) {
504 $this->
error->raiseError(
505 'Questionpool Data Directory (' . $qpl_data_dir
506 .
') not writeable.',
512 $qpl_dir = $qpl_data_dir .
'/qpl_' . $this->
getId();
514 if (!@is_dir($qpl_dir)) {
515 $this->
error->raiseError(
'Creation of Questionpool Directory failed.', $this->
error->FATAL);
520 $this->
error->raiseError(
'Creation of Export Directory failed.', $this->
error->FATAL);
524 $this->
error->raiseError(
'Creation of Export Directory failed.', $this->
error->FATAL);
555 $result = $this->db->queryF(
556 'SELECT question_id FROM qpl_questions WHERE obj_fi = %s AND qpl_questions.tstamp > 0 AND original_id IS NULL',
561 while ($row = $this->db->fetchAssoc($result)) {
562 array_push($questions, $row[
'question_id']);
569 $query_result = $this->db->queryF(
570 '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',
575 if ($query_result->numRows()) {
576 while ($row = $this->db->fetchAssoc($query_result)) {
577 if ($row[
'plugin']) {
579 array_push($questions, $row[
'question_id']);
582 array_push($questions, $row[
'question_id']);
591 $row = $this->db->fetchAssoc(
593 'SELECT COUNT(question_id) cnt FROM qpl_questions WHERE question_id = %s AND obj_fi = %s',
594 [
'integer',
'integer'],
595 [$question_id, $this->getId()]
599 return (
bool) $row[
'cnt'];
622 if (count($questions) > 0) {
623 foreach ($questions as $key => $value) {
625 $xml .= $question->getObject()->toXML();
627 if (count($questions) > 1) {
628 $xml = preg_replace(
'/<\/questestinterop>\s*<.xml.*?>\s*<questestinterop>/',
'', $xml);
633 '\\1' .
'<!DOCTYPE questestinterop SYSTEM "ims_qtiasiv1p2p1.dtd">',
643 $result =
$ilDB->queryF(
644 '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',
648 $row =
$ilDB->fetchAssoc($result);
649 return $row[
'question_count'];
664 $result =
$ilDB->queryF(
665 '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',
670 $result =
$ilDB->queryF(
671 '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',
676 if ($result->numRows() == 1) {
677 $row =
$ilDB->fetchAssoc($result);
678 if ($row[
'equal_points'] == 1) {
698 if (strcmp($question_object[
'action'],
'move') == 0) {
699 $result = $this->db->queryF(
700 'SELECT obj_fi FROM qpl_questions WHERE question_id = %s',
702 [$question_object[
'question_id']]
704 if ($result->numRows() == 1) {
705 $row = $this->db->fetchAssoc($result);
706 $source_questionpool = $row[
'obj_fi'];
707 $affectedRows = $this->db->manipulateF(
708 'UPDATE qpl_questions SET obj_fi = %s WHERE question_id = %s',
709 [
'integer',
'integer'],
710 [$this->
getId(), $question_object[
'question_id']]
712 if (!$affectedRows) {
716 $source_path =
CLIENT_WEB_DIR .
'/assessment/' . $source_questionpool .
'/' . $question_object[
'question_id'] .
'/';
717 if (@is_dir($source_path)) {
719 if (!@is_dir($target_path)) {
722 rename($source_path, $target_path . $question_object[
'question_id']);
728 $new_question_id = $this->
copyQuestion($question_object[
'question_id'], $this->
getId());
729 if (!$new_question_id) {
754 $clip[$question_id] = [
'question_id' => $question_id,
'action' =>
'copy'];
770 $clip[$question_id] = [
'question_id' => $question_id,
'action' =>
'move'];
781 if (!isset($clip[$deleted_question_id])) {
785 unset($clip[$deleted_question_id]);
804 $rbacsystem =
$DIC[
'rbacsystem'];
827 $query_result = $this->db->query(
828 'SELECT qpl_questions.*, qpl_qst_type.type_tag '
829 .
'FROM qpl_questions, qpl_qst_type '
830 .
'WHERE qpl_questions.question_type_fi = qpl_qst_type.question_type_id '
831 .
'AND ' . $this->db->in(
832 'qpl_questions.question_id',
836 ) .
' ORDER BY qpl_questions.title'
838 if ($query_result->numRows()) {
839 while ($row = $this->db->fetchAssoc($query_result)) {
840 array_push($result, $row);
857 $query_result = $this->db->query(
858 '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 '
859 . $this->db->in(
'qpl_questions.question_id', $question_ids,
false,
'integer')
860 .
' ORDER BY qpl_questions.title'
862 if ($query_result->numRows()) {
863 while ($row = $this->db->fetchAssoc($query_result)) {
864 if (!$this->questionrepository->isUsedInRandomTest($row[
'question_id'])) {
865 array_push($result, $row);
874 $duplicate_id = $question->getObject()->duplicate(
true);
875 if ($duplicate_id > 0) {
877 $affectedRows = $this->db->manipulateF(
878 'UPDATE tst_solutions SET question_fi = %s WHERE question_fi = %s',
879 [
'integer',
'integer'],
880 [$duplicate_id, $row[
'question_id']]
884 $affectedRows = $this->db->manipulateF(
885 'UPDATE tst_test_rnd_qst SET question_fi = %s WHERE question_fi = %s',
886 [
'integer',
'integer'],
887 [$duplicate_id, $row[
'question_id']]
891 $affectedRows = $this->db->manipulateF(
892 'UPDATE tst_test_result SET question_fi = %s WHERE question_fi = %s',
893 [
'integer',
'integer'],
894 [$duplicate_id, $row[
'question_id']]
898 $affectedRows = $this->db->manipulateF(
899 'UPDATE ass_log SET question_fi = %s WHERE question_fi = %s',
900 [
'integer',
'integer'],
901 [$duplicate_id, $row[
'question_id']]
905 array_push($result, $row);
920 bool $use_object_id =
false,
921 bool $equal_points =
false,
922 bool $could_be_offline =
false,
923 bool $showPath =
false,
924 bool $with_questioncount =
false,
925 string $permission =
'read',
929 $ilUser =
$DIC[
'ilUser'];
941 if (count($obj_ids)) {
942 $in =
$ilDB->in(
'object_data.obj_id', $obj_ids,
false,
'integer');
943 if ($could_be_offline) {
944 $result =
$ilDB->query(
945 'SELECT qpl_questionpool.*, object_data.title FROM qpl_questionpool, object_data WHERE ' .
946 'qpl_questionpool.obj_fi = object_data.obj_id AND ' . $in .
' ORDER BY object_data.title'
949 $result =
$ilDB->queryF(
950 'SELECT qpl_questionpool.*, object_data.title FROM qpl_questionpool, object_data WHERE ' .
951 'qpl_questionpool.obj_fi = object_data.obj_id AND ' . $in .
' AND object_data.offline = %s ' .
952 'ORDER BY object_data.title',
957 while ($row =
$ilDB->fetchAssoc($result)) {
959 if ($equal_points !==
false) {
965 $ref_id = array_search($row[
'obj_fi'], $obj_ids);
967 if ($with_questioncount) {
968 $title .=
' [' . $row[
'questioncount'] .
' ' . ($row[
'questioncount'] == 1 ?
$lng->
txt(
970 ) :
$lng->
txt(
'assQuestions')) .
']';
973 if ($use_object_id) {
974 $result_array[$row[
'obj_fi']] = [
975 'qpl_id' => $row[
'obj_fi'],
976 'qpl_title' => $row[
'title'],
978 'count' => $row[
'questioncount']
982 'qpl_id' => $row[
'obj_fi'],
983 'qpl_title' => $row[
'title'],
985 'count' => $row[
'questioncount']
991 return $result_array;
997 $result = $this->db->queryF(
998 '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',
1002 while ($row = $this->db->fetchAssoc($result)) {
1003 $questions[] = $row[
'question_id'];
1015 $new_obj = parent::cloneObject($target_id, $copy_id, $omit_tree);
1019 $new_obj->setSkillServiceEnabled($this->isSkillServiceEnabled());
1020 $new_obj->saveToDb();
1023 $questions = $this->getQplQuestions();
1024 $questionIdsMap = [];
1025 foreach ($questions as $question_id) {
1026 $newQuestionId = $new_obj->copyQuestion($question_id, $new_obj->getId());
1027 $questionIdsMap[$question_id] = $newQuestionId;
1030 $this->cloneMetaData($new_obj);
1031 $new_obj->updateMetaData();
1034 $duplicator->setSourceObjId($this->
getId());
1035 $duplicator->setSourceObjType($this->getType());
1036 $duplicator->setTargetObjId($new_obj->getId());
1037 $duplicator->setTargetObjType($new_obj->getType());
1038 $duplicator->setQuestionIdMapping($questionIdsMap);
1039 $duplicator->duplicate($duplicator->getAllTaxonomiesForSourceObject());
1041 $new_obj->saveToDb();
1046 public function getQuestionTypes($all_tags =
false, $fixOrder =
false, $withDeprecatedTypes =
true): array
1048 return self::_getQuestionTypes($all_tags, $fixOrder, $withDeprecatedTypes);
1051 public static function _getQuestionTypes($all_tags =
false, $fixOrder =
false, $withDeprecatedTypes =
true): array
1056 $component_factory =
$DIC[
'component.factory'];
1057 $disabled_question_types = QuestionPoolDIC::dic()[
'global_test_settings']->getDisabledQuestionTypes();
1059 $lng->loadLanguageModule(
'assessment');
1060 $result =
$ilDB->query(
'SELECT * FROM qpl_qst_type');
1062 while ($row =
$ilDB->fetchAssoc($result)) {
1063 if ($all_tags || (!in_array($row[
'question_type_id'], $disabled_question_types))) {
1064 if ($row[
'plugin'] == 0) {
1065 $types[
$lng->txt($row[
'type_tag'])] = $row;
1067 foreach ($component_factory->getActivePluginsInSlot(
'qst') as $pl) {
1068 if (strcmp($pl->getQuestionType(), $row[
'type_tag']) == 0) {
1069 $types[$pl->getQuestionTypeTranslation()] = $row;
1078 $types = $orderer->getOrderedTypes($withDeprecatedTypes);
1088 $query =
'SELECT type_tag FROM qpl_qst_type WHERE question_type_id = %s';
1089 $types = [
'integer'];
1090 $values = [$type_id];
1091 $result =
$ilDB->queryF($query, $types, $values);
1093 if ($row =
$ilDB->fetchAssoc($result)) {
1094 return $row[
'type_tag'];
1104 $component_factory =
$DIC[
'component.factory'];
1106 $lng->loadLanguageModule(
'assessment');
1107 $result =
$ilDB->query(
'SELECT * FROM qpl_qst_type');
1109 while ($row =
$ilDB->fetchAssoc($result)) {
1110 if ($row[
'plugin'] == 0) {
1111 $types[$row[
'type_tag']] =
$lng->txt($row[
'type_tag']);
1113 foreach ($component_factory->getActivePluginsInSlot(
'qst') as $pl) {
1114 if (strcmp($pl->getQuestionType(), $row[
'type_tag']) == 0) {
1115 $types[$row[
'type_tag']] = $pl->getQuestionTypeTranslation();
1130 'assSingleChoice' => 1,
1131 'assMultipleChoice' => 2,
1132 'assKprimChoice' => 3,
1133 'assClozeTest' => 4,
1134 'assMatchingQuestion' => 5,
1135 'assOrderingQuestion' => 6,
1136 'assOrderingHorizontal' => 7,
1137 'assImagemapQuestion' => 8,
1138 'assTextSubset' => 9,
1139 'assErrorText' => 10,
1144 foreach ($qtypes as $k => $t) {
1145 if (isset($allowed_types[$t[
'type_tag']])) {
1146 $t[
'order'] = $allowed_types[$t[
'type_tag']];
1156 $result = $this->db->queryF(
1157 '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',
1161 while ($row = $this->db->fetchAssoc($result)) {
1162 array_push($questions, $row);
1172 'UPDATE qpl_questionpool SET questioncount = %s, tstamp = %s WHERE obj_fi = %s',
1173 [
'integer',
'integer',
'integer'],
1186 if (!$this->component_repository->getComponentByTypeAndName(
1189 )->getPluginSlotById(
'qst')->hasPluginName($questionType)) {
1193 return $this->component_repository
1194 ->getComponentByTypeAndName(
1198 ->getPluginSlotById(
1209 $incompleteQuestionPurger->setOwnerId($this->
user->getId());
1210 $incompleteQuestionPurger->purge();
1225 return $this->skill_service_enabled;
1230 $this->skill_service_enabled = $skill_service_enabled;
1233 private static $isSkillManagementGloballyActivated =
null;
1237 if (self::$isSkillManagementGloballyActivated ===
null) {
1240 self::$isSkillManagementGloballyActivated = $skmgSet->isActivated();
1243 return self::$isSkillManagementGloballyActivated;
1249 $parser->startParsing();
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static instantiateQuestion(int $question_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const ORDER_MODE_FIX
order mode with fixed priority for ordering
const ORDER_MODE_ALPHA
order mode that orders by alphanumerical priority
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="")
@depricated Get export directory for an repository object
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static getDataDir()
get data directory (outside webspace)
static createDirectory(string $a_dir, int $a_mod=0755)
create directory
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...
static _getQuestionTypes($all_tags=false, $fixOrder=false, $withDeprecatedTypes=true)
getImportMapping()
get array of (two) new created questions for import id
cleanupClipboard(int $deleted_question_id)
getQuestiontype($question_id)
__construct(int $a_id=0, bool $a_call_by_reference=true)
static _isWriteable($object_id, $user_id)
Returns true, if the question pool is writeable by a given user.
static _getAvailableQuestionpools(bool $use_object_id=false, bool $equal_points=false, bool $could_be_offline=false, bool $showPath=false, bool $with_questioncount=false, string $permission='read', int $usr_id=0)
Returns the available question pools for the active user.
ilComponentRepository $component_repository
checkQuestionParent(int $question_id)
getExportDirectory($type='')
get export directory of questionpool
getTaxonomyIds()
get ids of all taxonomies corresponding to current pool
exportFileItems($target_dir, &$expLog)
export files of file itmes
isInUse(int $question_id)
GeneralQuestionPropertiesRepository $questionrepository
copyQuestion(int $question_id, int $questionpool_to)
setSkillServiceEnabled(bool $skill_service_enabled)
static isSkillManagementGloballyActivated()
modifyExportIdentifier($a_tag, $a_param, $a_value)
duplicateQuestion(int $question_id)
static _getQuestionCount(int $pool_id)
read($a_force_db=false)
read object data from db into object
createReference()
Creates a database reference id for the object (saves the object to the database and creates a refere...
questionsToXML($questions)
Returns a QTI xml representation of a list of questions.
fromXML(?string $xml_file)
static & _getSelfAssessmentQuestionTypes($all_tags=false)
create($a_upload=false)
create questionpool object
objectToXmlWriter(ilXmlWriter &$a_xml_writer, $a_inst, $a_target_dir, &$expLog, $questions)
export pages of test to xml (see ilias_co.dtd)
exportXMLMediaObjects(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
createExportDirectory()
creates data directory for export files (data_dir/qpl_data/qpl_<id>/export, depending on data directo...
isPluginActive($questionType)
Checks wheather or not a question plugin with a given name is active.
exportXMLPageObjects(&$a_xml_writer, $a_inst, &$expLog, $questions)
export page objects to xml (see ilias_co.dtd)
static _hasEqualPoints($a_obj_id, $is_reference=false)
Checks a question pool for questions with the same maximum points.
getQuestionDetails($question_ids)
Returns an array containing the qpl_question and qpl_qst_type fields for an array of question ids.
bool $skill_service_enabled
static getQuestionTypeByTypeId($type_id)
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.
static getQuestionTypeTranslations()
update()
update object data
createQuestion(string $question_type, int $question_id=-1)
copyToClipboard($question_id)
Copies a question to the clipboard.
exportXMLSettings($xmlWriter)
deleteQuestion(int $question_id)
getDeleteableQuestionDetails($question_ids)
Returns an array containing the qpl_question and qpl_qst_type fields of deleteable questions for an a...
moveToClipboard(int $question_id)
Moves a question to the clipboard.
static _updateQuestionCount(int $object_id)
pasteFromClipboard()
Copies/Moves a question from the clipboard.
& getAllQuestions()
Retrieve an array containing all question ids of the questionpool.
appendCounterToQuestionTitleIfNecessary(string $title)
populateQuestionSkillAssignmentsXml(ilXmlWriter &$a_xml_writer, $questions)
exportTitleAndDescription(ilXmlWriter &$a_xml_writer)
getQuestionTypes($all_tags=false, $fixOrder=false, $withDeprecatedTypes=true)
static getUsageOfObject(int $a_obj_id, bool $a_include_titles=false)
Class ilObject Basic functions for all objects.
static _hasUntrashedReference(int $obj_id)
checks whether an object has at least one reference that is not in trash
static _getAllReferences(int $id)
get all reference ids for object ID
static _prepareCloneSelection(array $ref_ids, string $new_type, bool $show_path=true)
Prepare copy wizard object selection.
static _lookupObjId(int $ref_id)
static collectFileItems(ilPageObject $a_page, DOMDocument $a_domdoc)
Get all file items that are used within the page.
static get(string $a_var)
static clear(string $a_var)
static set(string $a_var, $a_val)
Set a value.
Skill management settings.
static insertInstIntoID(string $a_value)
inserts installation id into ILIAS id
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,...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
xmlEndTag(string $tag)
Writes an endtag.
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
Readable part of repository interface to ilComponentDataDB.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc