19 declare(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();
   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);
   179         $result = $this->db->queryF(
   180             'SELECT id_questionpool FROM qpl_questionpool WHERE obj_fi = %s',
   185         if ($result->numRows() == 1) {
   186             $result = $this->db->update(
   190                     'tstamp' => [
'integer', time()]
   193                     'obj_fi' => [
'integer', $this->
getId()]
   197             $next_id = $this->db->nextId(
'qpl_questionpool');
   199             $result = $this->db->insert(
'qpl_questionpool', [
   200                 'id_questionpool' => [
'integer', $next_id],
   202                 'tstamp' => [
'integer', time()],
   203                 'obj_fi' => [
'integer', $this->
getId()]
   210         if ($question_id < 1) {
   214         $result = $this->db->queryF(
   215             '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',
   220         if ($result->numRows() == 1) {
   221             $data = $this->db->fetchAssoc($result);
   222             return $data[
'type_tag'];
   227     public function isInUse(
int $question_id): bool
   229         $result = $this->db->queryF(
   230             'SELECT COUNT(solution_id) solution_count FROM tst_solutions WHERE question_fi = %s',
   234         $row = $this->db->fetchAssoc($result);
   235         return $row[
'solution_count'];
   240         if ($question_id > 0) {
   241             return assQuestion::instantiateQuestionGUI($question_id);
   243         $question_type_gui = $question_type . 
'GUI';
   244         $question_gui = 
new $question_type_gui();
   245         return $question_gui;
   252             $question->getObject()->getTitle()
   254         $new_id = $question->getObject()->duplicate(
false, $newtitle);
   262         if ($question_gui->getObject()->getObjId() == $questionpool_to) {
   268                 $question_gui->getObject()->getTitle()
   271             return $question_gui->getObject()->copyObject($this->
getId(), $newtitle);
   277         $result = $this->db->queryF(
   278             "SELECT COUNT(question_id) AS cnt FROM qpl_questions WHERE obj_fi = %s AND title like %s",
   280             [$this->
getId(), 
"{$title}%"]
   282         $counter_object = $this->db->fetchObject($result);
   283         if ($counter_object->cnt === 0) {
   286         return "{$title} ({$counter_object->cnt})";
   291         $query_result = $this->db->queryF(
   292             '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',
   298         if ($query_result->numRows()) {
   299             while ($row = $this->db->fetchAssoc($query_result)) {
   300                 $row[
'ttype'] = $types[$row[
'type_tag']];
   301                 if ($row[
'plugin']) {
   303                         array_push($rows, $row);
   306                     array_push($rows, $row);
   318         $xmlWriter->xmlStartTag(
'Settings');
   320         $xmlWriter->xmlEndTag(
'Settings');
   334         $this->file_ids = [];
   337         $attrs[
'Type'] = 
'Questionpool_Test';
   338         $a_xml_writer->
xmlStartTag(
'ContentObject', $attrs);
   347         $expLog->write(date(
'[y-m-d H:i:s] ') . 
'Start Export Page Objects');
   348         $ilBench->start(
'ContentObjectExport', 
'exportPageObjects');
   350         $ilBench->stop(
'ContentObjectExport', 
'exportPageObjects');
   351         $expLog->write(date(
'[y-m-d H:i:s] ') . 
'Finished Export Page Objects');
   354         $expLog->write(date(
'[y-m-d H:i:s] ') . 
'Start Export Media Objects');
   355         $ilBench->start(
'ContentObjectExport', 
'exportMediaObjects');
   357         $ilBench->stop(
'ContentObjectExport', 
'exportMediaObjects');
   358         $expLog->write(date(
'[y-m-d H:i:s] ') . 
'Finished Export Media Objects');
   361         $expLog->write(date(
'[y-m-d H:i:s] ') . 
'Start Export File Items');
   362         $ilBench->start(
'ContentObjectExport', 
'exportFileItems');
   364         $ilBench->stop(
'ContentObjectExport', 
'exportFileItems');
   365         $expLog->write(date(
'[y-m-d H:i:s] ') . 
'Finished Export File Items');
   370         $a_xml_writer->
xmlEndTag(
'ContentObject');
   380         $assignmentList->setParentObjId($this->
getId());
   381         $assignmentList->loadFromDb();
   382         $assignmentList->loadAdditionalSkillData();
   385         $skillQuestionAssignmentExporter->setXmlWriter($a_xml_writer);
   386         $skillQuestionAssignmentExporter->setQuestionIds($questions);
   387         $skillQuestionAssignmentExporter->setAssignmentList($assignmentList);
   388         $skillQuestionAssignmentExporter->export();
   399         if ($a_tag == 
'Identifier' && $a_param == 
'Entry') {
   416         foreach ($questions as $question_id) {
   417             $ilBench->
start(
'ContentObjectExport', 
'exportPageObject');
   418             $expLog->write(date(
'[y-m-d H:i:s] ') . 
'Page Object ' . $question_id);
   421             $a_xml_writer->xmlStartTag(
'PageObject', $attrs);
   424             $ilBench->start(
'ContentObjectExport', 
'exportPageObject_XML');
   426             $page_object->buildDom();
   427             $page_object->insertInstIntoIDs($a_inst);
   428             $mob_ids = $page_object->collectMediaObjects(
false);
   430             $xml = $page_object->getXMLFromDom(
false, 
false, 
false, 
'', 
true);
   431             $xml = str_replace(
'&', 
'&', $xml);
   432             $a_xml_writer->appendXML($xml);
   433             $page_object->freeDom();
   435             $ilBench->stop(
'ContentObjectExport', 
'exportPageObject_XML');
   437             $ilBench->start(
"ContentObjectExport", 
"exportPageObject_CollectMedia");
   438             foreach ($mob_ids as $mob_id) {
   439                 $this->mob_ids[$mob_id] = $mob_id;
   441             $ilBench->stop(
'ContentObjectExport', 
'exportPageObject_CollectMedia');
   444             $ilBench->start(
'ContentObjectExport', 
'exportPageObject_CollectFileItems');
   446             foreach ($file_ids as $file_id) {
   447                 $this->file_ids[$file_id] = $file_id;
   449             $ilBench->stop(
'ContentObjectExport', 
'exportPageObject_CollectFileItems');
   451             $a_xml_writer->xmlEndTag(
"PageObject");
   453             $ilBench->stop(
'ContentObjectExport', 
'exportPageObject');
   459         foreach ($this->mob_ids as $mob_id) {
   460             $expLog->write(date(
'[y-m-d H:i:s] ') . 
'Media Object ' . $mob_id);
   462                 $target_dir = $a_target_dir . DIRECTORY_SEPARATOR . 
'objects'   463                     . DIRECTORY_SEPARATOR . 
'il_' . 
IL_INST_ID . 
'_mob_' . $mob_id;
   466                 $media_obj->exportXML($a_xml_writer, (
int) $a_inst);
   467                 foreach ($media_obj->getMediaItems() as $item) {
   468                     $stream = $item->getLocationStream();
   469                     file_put_contents($target_dir . DIRECTORY_SEPARATOR . $item->getLocation(), $stream);
   483         foreach ($this->file_ids as $file_id) {
   484             $expLog->write(date(
"[y-m-d H:i:s] ") . 
"File Item " . $file_id);
   485             $file_dir = $target_dir . 
'/objects/il_' . 
IL_INST_ID . 
'_file_' . $file_id;
   487             $file_obj = 
new ilObjFile((
int) $file_id, 
false);
   488             $source_file = $file_obj->getFile($file_obj->getVersion());
   489             if (!is_file($source_file)) {
   490                 $source_file = $file_obj->getFile();
   492             if (is_file($source_file)) {
   493                 copy($source_file, $file_dir . 
'/' . $file_obj->getFileName());
   508         if (!is_writable($qpl_data_dir)) {
   509             $this->error->raiseError(
   510                 'Questionpool Data Directory (' . $qpl_data_dir
   511                 . 
') not writeable.',
   517         $qpl_dir = $qpl_data_dir . 
'/qpl_' . $this->
getId();
   519         if (!@is_dir($qpl_dir)) {
   520             $this->error->raiseError(
'Creation of Questionpool Directory failed.', $this->error->FATAL);
   525             $this->error->raiseError(
'Creation of Export Directory failed.', $this->error->FATAL);
   529             $this->error->raiseError(
'Creation of Export Directory failed.', $this->error->FATAL);
   560         $result = $this->db->queryF(
   561             'SELECT question_id FROM qpl_questions WHERE obj_fi = %s AND qpl_questions.tstamp > 0 AND original_id IS NULL',
   566         while ($row = $this->db->fetchAssoc($result)) {
   567             array_push($questions, $row[
'question_id']);
   574         $query_result = $this->db->queryF(
   575             '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',
   580         if ($query_result->numRows()) {
   581             while ($row = $this->db->fetchAssoc($query_result)) {
   582                 if ($row[
'plugin']) {
   584                         array_push($questions, $row[
'question_id']);
   587                     array_push($questions, $row[
'question_id']);
   596         $row = $this->db->fetchAssoc(
   598                 'SELECT COUNT(question_id) cnt FROM qpl_questions WHERE question_id = %s AND obj_fi = %s',
   599                 [
'integer', 
'integer'],
   600                 [$question_id, $this->getId()]
   604         return (
bool) $row[
'cnt'];
   627         if (count($questions) > 0) {
   628             foreach ($questions as $key => $value) {
   630                 $xml .= $question->getObject()->toXML();
   632             if (count($questions) > 1) {
   633                 $xml = preg_replace(
'/<\/questestinterop>\s*<.xml.*?>\s*<questestinterop>/', 
'', $xml);
   638             '\\1' . 
'<!DOCTYPE questestinterop SYSTEM "ims_qtiasiv1p2p1.dtd">',
   647         $ilDB = $DIC[
'ilDB'];
   648         $result = 
$ilDB->queryF(
   649             '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',
   653         $row = 
$ilDB->fetchAssoc($result);
   654         return $row[
'question_count'];
   666         $ilDB = $DIC[
'ilDB'];
   669             $result = 
$ilDB->queryF(
   670                 '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',
   675             $result = 
$ilDB->queryF(
   676                 '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',
   681         if ($result->numRows() == 1) {
   682             $row = 
$ilDB->fetchAssoc($result);
   683             if ($row[
'equal_points'] == 1) {
   703                 if (strcmp($question_object[
'action'], 
'move') == 0) {
   704                     $result = $this->db->queryF(
   705                         'SELECT obj_fi FROM qpl_questions WHERE question_id = %s',
   707                         [$question_object[
'question_id']]
   709                     if ($result->numRows() == 1) {
   710                         $row = $this->db->fetchAssoc($result);
   711                         $source_questionpool = $row[
'obj_fi'];
   712                         $affectedRows = $this->db->manipulateF(
   713                             'UPDATE qpl_questions SET obj_fi = %s WHERE question_id = %s',
   714                             [
'integer', 
'integer'],
   715                             [$this->
getId(), $question_object[
'question_id']]
   717                         if (!$affectedRows) {
   721                         $source_path = 
CLIENT_WEB_DIR . 
'/assessment/' . $source_questionpool . 
'/' . $question_object[
'question_id'] . 
'/';
   722                         if (@is_dir($source_path)) {
   724                             if (!@is_dir($target_path)) {
   727                             rename($source_path, $target_path . $question_object[
'question_id']);
   733                     $new_question_id = $this->
copyQuestion($question_object[
'question_id'], $this->
getId());
   734                     if (!$new_question_id) {
   759         $clip[$question_id] = [
'question_id' => $question_id, 
'action' => 
'copy'];
   775         $clip[$question_id] = [
'question_id' => $question_id, 
'action' => 
'move'];
   786         if (!isset($clip[$deleted_question_id])) {
   790         unset($clip[$deleted_question_id]);
   809         $rbacsystem = $DIC[
'rbacsystem'];
   832         $query_result = $this->db->query(
   833             'SELECT qpl_questions.*, qpl_qst_type.type_tag '   834             . 
'FROM qpl_questions, qpl_qst_type '   835             . 
'WHERE qpl_questions.question_type_fi = qpl_qst_type.question_type_id '   836             . 
'AND ' . $this->db->in(
   837                 'qpl_questions.question_id',
   841             ) . 
' ORDER BY qpl_questions.title'   843         if ($query_result->numRows()) {
   844             while ($row = $this->db->fetchAssoc($query_result)) {
   845                 array_push($result, $row);
   862         $query_result = $this->db->query(
   863             '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 '   864             . $this->db->in(
'qpl_questions.question_id', $question_ids, 
false, 
'integer')
   865             . 
' ORDER BY qpl_questions.title'   867         if ($query_result->numRows()) {
   868             while ($row = $this->db->fetchAssoc($query_result)) {
   869                 if (!$this->questionrepository->isUsedInRandomTest($row[
'question_id'])) {
   870                     array_push($result, $row);
   879                     $duplicate_id = $question->getObject()->duplicate(
true);
   880                     if ($duplicate_id > 0) {
   882                         $affectedRows = $this->db->manipulateF(
   883                             'UPDATE tst_solutions SET question_fi = %s WHERE question_fi = %s',
   884                             [
'integer', 
'integer'],
   885                             [$duplicate_id, $row[
'question_id']]
   889                         $affectedRows = $this->db->manipulateF(
   890                             'UPDATE tst_test_rnd_qst SET question_fi = %s WHERE question_fi = %s',
   891                             [
'integer', 
'integer'],
   892                             [$duplicate_id, $row[
'question_id']]
   896                         $affectedRows = $this->db->manipulateF(
   897                             'UPDATE tst_test_result SET question_fi = %s WHERE question_fi = %s',
   898                             [
'integer', 
'integer'],
   899                             [$duplicate_id, $row[
'question_id']]
   903                         $affectedRows = $this->db->manipulateF(
   904                             'UPDATE ass_log SET question_fi = %s WHERE question_fi = %s',
   905                             [
'integer', 
'integer'],
   906                             [$duplicate_id, $row[
'question_id']]
   910                         array_push($result, $row);
   925         bool $use_object_id = 
false,
   926         bool $equal_points = 
false,
   927         bool $could_be_offline = 
false,
   928         bool $showPath = 
false,
   929         bool $with_questioncount = 
false,
   930         string $permission = 
'read',
   934         $ilUser = $DIC[
'ilUser'];
   935         $ilDB = $DIC[
'ilDB'];
   946         if (count($obj_ids)) {
   947             $in = 
$ilDB->in(
'object_data.obj_id', $obj_ids, 
false, 
'integer');
   948             if ($could_be_offline) {
   949                 $result = 
$ilDB->query(
   950                     'SELECT qpl_questionpool.*, object_data.title FROM qpl_questionpool, object_data WHERE ' .
   951                     'qpl_questionpool.obj_fi = object_data.obj_id AND ' . $in . 
' ORDER BY object_data.title'   954                 $result = 
$ilDB->queryF(
   955                     'SELECT qpl_questionpool.*, object_data.title FROM qpl_questionpool, object_data WHERE ' .
   956                     'qpl_questionpool.obj_fi = object_data.obj_id AND ' . $in . 
' AND object_data.offline = %s ' .
   957                     'ORDER BY object_data.title',
   962             while ($row = 
$ilDB->fetchAssoc($result)) {
   964                 if ($equal_points !== 
false) {
   970                     $ref_id = array_search($row[
'obj_fi'], $obj_ids);
   971                     $title = (($showPath) ? $titles[$ref_id] : $row[
'title']);
   972                     if ($with_questioncount) {
   973                         $title .= 
' [' . $row[
'questioncount'] . 
' ' . ($row[
'questioncount'] == 1 ? 
$lng->
txt(
   975                         ) : 
$lng->
txt(
'assQuestions')) . 
']';
   978                     if ($use_object_id) {
   979                         $result_array[$row[
'obj_fi']] = [
   980                             'qpl_id' => $row[
'obj_fi'],
   981                             'qpl_title' => $row[
'title'],
   983                             'count' => $row[
'questioncount']
   987                             'qpl_id' => $row[
'obj_fi'],
   988                             'qpl_title' => $row[
'title'],
   990                             'count' => $row[
'questioncount']
   996         return $result_array;
  1002         $result = $this->db->queryF(
  1003             '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',
  1007         while ($row = $this->db->fetchAssoc($result)) {
  1008             array_push($questions, $row[
'question_id']);
  1020         $new_obj = parent::cloneObject($target_id, $copy_id, $omit_tree);
  1025         $new_obj->saveToDb();
  1029         $questionIdsMap = [];
  1030         foreach ($questions as $question_id) {
  1031             $newQuestionId = $new_obj->copyQuestion($question_id, $new_obj->getId());
  1032             $questionIdsMap[$question_id] = $newQuestionId;
  1036         $new_obj->updateMetaData();
  1039         $duplicator->setSourceObjId($this->
getId());
  1040         $duplicator->setSourceObjType($this->
getType());
  1041         $duplicator->setTargetObjId($new_obj->getId());
  1042         $duplicator->setTargetObjType($new_obj->getType());
  1043         $duplicator->setQuestionIdMapping($questionIdsMap);
  1044         $duplicator->duplicate($duplicator->getAllTaxonomiesForSourceObject());
  1046         $new_obj->saveToDb();
  1051     public function getQuestionTypes($all_tags = 
false, $fixOrder = 
false, $withDeprecatedTypes = 
true): array
  1053         return self::_getQuestionTypes($all_tags, $fixOrder, $withDeprecatedTypes);
  1056     public static function _getQuestionTypes($all_tags = 
false, $fixOrder = 
false, $withDeprecatedTypes = 
true): array
  1059         $ilDB = $DIC[
'ilDB'];
  1061         $component_factory = $DIC[
'component.factory'];
  1062         $disabled_question_types = QuestionPoolDIC::dic()[
'global_test_settings']->getDisabledQuestionTypes();
  1065         $result = 
$ilDB->query(
'SELECT * FROM qpl_qst_type');
  1067         while ($row = 
$ilDB->fetchAssoc($result)) {
  1068             if ($all_tags || (!in_array($row[
'question_type_id'], $disabled_question_types))) {
  1069                 if ($row[
'plugin'] == 0) {
  1070                     $types[
$lng->
txt($row[
'type_tag'])] = $row;
  1072                     foreach ($component_factory->getActivePluginsInSlot(
'qst') as $pl) {
  1073                         if (strcmp($pl->getQuestionType(), $row[
'type_tag']) == 0) {
  1074                             $types[$pl->getQuestionTypeTranslation()] = $row;
  1083         $types = $orderer->getOrderedTypes($withDeprecatedTypes);
  1091         $ilDB = $DIC[
'ilDB'];
  1093         $query = 
'SELECT type_tag FROM qpl_qst_type WHERE question_type_id = %s';
  1094         $types = [
'integer'];
  1095         $values = [$type_id];
  1096         $result = 
$ilDB->queryF($query, $types, $values);
  1098         if ($row = 
$ilDB->fetchAssoc($result)) {
  1099             return $row[
'type_tag'];
  1107         $ilDB = $DIC[
'ilDB'];
  1109         $component_factory = $DIC[
'component.factory'];
  1112         $result = 
$ilDB->query(
'SELECT * FROM qpl_qst_type');
  1114         while ($row = 
$ilDB->fetchAssoc($result)) {
  1115             if ($row[
'plugin'] == 0) {
  1116                 $types[$row[
'type_tag']] = 
$lng->
txt($row[
'type_tag']);
  1118                 foreach ($component_factory->getActivePluginsInSlot(
'qst') as $pl) {
  1119                     if (strcmp($pl->getQuestionType(), $row[
'type_tag']) == 0) {
  1120                         $types[$row[
'type_tag']] = $pl->getQuestionTypeTranslation();
  1135             'assSingleChoice' => 1,
  1136             'assMultipleChoice' => 2,
  1137             'assKprimChoice' => 3,
  1138             'assClozeTest' => 4,
  1139             'assMatchingQuestion' => 5,
  1140             'assOrderingQuestion' => 6,
  1141             'assOrderingHorizontal' => 7,
  1142             'assImagemapQuestion' => 8,
  1143             'assTextSubset' => 9,
  1144             'assErrorText' => 10,
  1149         foreach ($qtypes as $k => $t) {
  1150             if (isset($allowed_types[$t[
'type_tag']])) {
  1151                 $t[
'order'] = $allowed_types[$t[
'type_tag']];
  1161         $result = $this->db->queryF(
  1162             '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',
  1166         while ($row = $this->db->fetchAssoc($result)) {
  1167             array_push($questions, $row);
  1175         $ilDB = $DIC[
'ilDB'];
  1177             'UPDATE qpl_questionpool SET questioncount = %s, tstamp = %s WHERE obj_fi = %s',
  1178             [
'integer', 
'integer', 
'integer'],
  1191         if (!$this->component_repository->getComponentByTypeAndName(
  1194         )->getPluginSlotById(
'qst')->hasPluginName($questionType)) {
  1198         return $this->component_repository
  1199             ->getComponentByTypeAndName(
  1203             ->getPluginSlotById(
  1214         $incompleteQuestionPurger->setOwnerId($this->
user->getId());
  1215         $incompleteQuestionPurger->purge();
  1242         if (self::$isSkillManagementGloballyActivated === null) {
  1245             self::$isSkillManagementGloballyActivated = $skmgSet->isActivated();
  1248         return self::$isSkillManagementGloballyActivated;
  1254         $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)
 
Readable part of repository interface to ilComponentDataDB. 
 
exportXMLPageObjects(&$a_xml_writer, $a_inst, &$expLog, $questions)
export page objects to xml (see ilias_co.dtd) 
 
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 
 
exportXMLMediaObjects(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
 
moveToClipboard(int $question_id)
Moves a question to the clipboard. 
 
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...
 
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...
 
static _hasUntrashedReference(int $obj_id)
checks whether an object has at least one reference that is not in trash 
 
fromXML(?string $xml_file)
 
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)
 
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)
 
cloneMetaData(ilObject $target_obj)
Copy meta data. 
 
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. 
 
__construct(int $a_id=0, bool $a_call_by_reference=true)
 
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively 
 
static createDirectory(string $a_dir, int $a_mod=0755)
create directory 
 
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 
 
exportTitleAndDescription(ilXmlWriter &$a_xml_writer)
 
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()
 
appendCounterToQuestionTitleIfNecessary(string $title)
 
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins 
 
__construct(Container $dic, ilPlugin $plugin)
 
getTaxonomyIds()
get ids of all taxonomies corresponding to current pool 
 
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag. 
 
static getQuestionTypeTranslations()
 
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content) 
 
ilComponentRepository $component_repository
 
GeneralQuestionPropertiesRepository $questionrepository
 
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. 
 
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. 
 
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 ...
 
cleanupClipboard(int $deleted_question_id)
 
static _getQuestionTypes($all_tags=false, $fixOrder=false, $withDeprecatedTypes=true)