19 require_once
'./Modules/Test/classes/inc.AssessmentConstants.php';
59 private \ILIAS\Filesystem\Util\Archive\LegacyArchives
$archives;
83 $this->db = $DIC[
'ilDB'];
84 $this->
rbac = $DIC->rbac();
85 $this->log = $DIC[
'ilLog'];
86 $this->
help = $DIC[
'ilHelp'];
87 $this->global_screen = $DIC[
'global_screen'];
88 $this->component_factory = $DIC[
'component.factory'];
89 $this->component_repository = $DIC[
'component.repository'];
90 $this->navigation_history = $DIC[
'ilNavigationHistory'];
91 $this->ui_service = $DIC->uiService();
92 $this->questioninfo = $DIC->testQuestionPool()->questionInfo();
93 $this->qplrequest = $DIC->testQuestionPool()->internal()->request();
94 $this->taxonomy = $DIC->taxonomy();
95 $this->
http = $DIC->http();
96 $this->http_request = $this->
http->request();
98 $this->archives = $DIC->legacyArchives();
101 $this->
ctrl->saveParameter($this, [
110 $this->
ctrl->saveParameterByClass(
'ilAssQuestionPageGUI',
'consumer_context');
111 $this->
ctrl->saveParameterByClass(
'ilobjquestionpoolgui',
'consumer_context');
113 $this->
lng->loadLanguageModule(
'assessment');
115 $here_uri = $this->data_factory->uri($this->request->getUri()->__toString());
117 $query_params_namespace = [
'qpool',
'table'];
118 list($url_builder, $action_parameter_token, $row_id_token) = $url_builder->
acquireParameters(
119 $query_params_namespace,
127 $this->notes_service->gui()->initJavascript();
132 if (!$this->request_wrapper->has($param)) {
135 $trafo = $this->
refinery->byTrying([
136 $this->
refinery->kindlyTo()->null(),
137 $this->
refinery->kindlyTo()->string()
139 return $this->request_wrapper->retrieve($param, $trafo);
144 if (!$this->request_wrapper->has($param)) {
147 $trafo = $this->
refinery->byTrying([
148 $this->
refinery->kindlyTo()->null(),
151 return $this->request_wrapper->retrieve($param, $trafo);
167 $randomGroup = $this->
refinery->random();
169 $writeAccess = $ilAccess->checkAccess(
'write',
'', $this->qplrequest->getRefId());
171 if ((!$ilAccess->checkAccess(
'read',
'', $this->qplrequest->getRefId()))
172 && (!$ilAccess->checkAccess(
'visible',
'', $this->qplrequest->getRefId()))) {
177 $ilAccess->checkAccess(
'read',
'', $this->qplrequest->getRefId())) {
178 if (
'qpl' === $this->
object->getType()) {
179 $ilNavigationHistory->addItem(
180 $this->qplrequest->getRefId(),
181 ilLink::_getLink($this->qplrequest->getRefId(),
"qpl"),
187 $cmd = $this->
ctrl->getCmd(
'questions');
188 $next_class = $this->
ctrl->getNextClass($this);
191 if (in_array($next_class, [
'',
'ilobjquestionpoolgui']) && $cmd ==
'questions') {
200 if (!(in_array($next_class, [
'',
'ilobjquestionpoolgui']) && $cmd ==
'questions') && $q_id < 1) {
201 $q_type = $this->qplrequest->raw(
'sel_question_types');
203 if ($cmd !==
'createQuestion' && $cmd !==
'createQuestionForTest' 204 && $next_class !=
'ilassquestionpagegui') {
205 if (($this->qplrequest->raw(
'test_ref_id') !=
'') || ($this->qplrequest->raw(
'calling_test'))) {
206 $ref_id = $this->qplrequest->raw(
'test_ref_id');
208 $ref_id = $this->qplrequest->raw(
'calling_test');
212 switch ($next_class) {
213 case 'ilcommonactiondispatchergui':
215 $this->
ctrl->forwardCommand($gui);
218 case 'ilobjectmetadatagui':
219 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
220 $ilErr->raiseError($this->
lng->txt(
'permission_denied'),
$ilErr->WARNING);
223 $this->
ctrl->forwardCommand($md_gui);
226 case 'ilassquestionpreviewgui':
227 if (!$ilAccess->checkAccess(
'read',
'', $this->object->getRefId())) {
231 $this->
ctrl->saveParameter($this,
'q_id');
241 $this->global_screen,
246 $gui->initQuestion((
int) $this->qplrequest->raw(
'q_id'), $this->
object->getId());
247 $gui->initPreviewSettings($this->
object->getRefId());
249 $gui->initHintTracking();
254 $this->
ctrl->forwardCommand($gui);
257 case 'ilassquestionpagegui':
258 if ($cmd ==
'finishEditing') {
259 $this->
ctrl->redirectByClass(
'ilassquestionpreviewgui',
'show');
262 if ($cmd ===
'edit' && !$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
265 $this->tpl->setCurrentBlock(
'ContentStyle');
267 $this->tpl->parseCurrentBlock();
269 $this->tpl->setCurrentBlock(
'SyntaxStyle');
271 $this->tpl->parseCurrentBlock();
274 $q_gui->setQuestionTabs();
275 $q_gui->outAdditionalOutput();
276 $q_gui->object->setObjId($this->
object->getId());
278 $q_gui->setTargetGuiClass(null);
279 $q_gui->setQuestionActionCmd(
'');
281 if ($this->
object->getType() ==
'qpl') {
282 $q_gui->addHeaderAction();
285 $question = $q_gui->object;
287 if ($this->questioninfo->isInActiveTest($question->getObjId())) {
288 $this->tpl->setOnScreenMessage(
290 $this->
lng->txt(
'question_is_part_of_running_test'),
296 $this->
ctrl->saveParameter($this,
'q_id');
297 $this->
lng->loadLanguageModule(
'content');
298 $this->
ctrl->setReturnByClass(
'ilAssQuestionPageGUI',
'view');
299 $this->
ctrl->setReturn($this,
'questions');
301 $page_gui->obj->addUpdateListener(
306 $page_gui->setEnabledTabs(
false);
308 $this->
ctrl->getCmd()
309 ) == 0 && !isset($_POST[
'editImagemapForward_x'])) {
310 $this->
ctrl->setCmdClass(get_class($page_gui));
311 $this->
ctrl->setCmd(
'preview');
313 $page_gui->setQuestionHTML([$q_gui->object->getId() => $q_gui->getPreview(
true)]);
314 $page_gui->setTemplateTargetVar(
'ADM_CONTENT');
315 $page_gui->setOutputMode(
'edit');
316 $page_gui->setHeader($question->getTitleForHTMLOutput());
317 $page_gui->setPresentationTitle($question->getTitleForHTMLOutput());
318 $ret = $this->
ctrl->forwardCommand($page_gui);
324 case 'ilpermissiongui':
326 $this->
ctrl->forwardCommand($perm_gui);
329 case 'ilobjectcopygui':
332 $this->
ctrl->forwardCommand($cp);
335 case 'ilquestionpoolexportgui':
337 $exp_gui->addFormat(
'xml', $this->
lng->txt(
'qpl_export_xml'));
338 $exp_gui->addFormat(
'xlsx', $this->
lng->txt(
'qpl_export_excel'), $this,
'createExportExcel');
339 $ret = $this->
ctrl->forwardCommand($exp_gui);
342 case 'ilinfoscreengui':
346 case 'ilassquestionhintsgui':
347 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
351 $this->
ctrl->setReturn($this,
'questions');
356 $questionGUI->object->setObjId($this->
object->getId());
357 $questionGUI->setQuestionTabs();
359 if ($this->questioninfo->isInActiveTest($questionGUI->object->getObjId())) {
360 $this->tpl->setOnScreenMessage(
362 $this->
lng->txt(
'question_is_part_of_running_test'),
371 if ($this->
object->getType() ==
'qpl' && $writeAccess) {
372 $questionGUI->addHeaderAction();
376 $gui->setEditingEnabled(
377 $this->
access->checkAccess(
'write',
'', $this->object->getRefId())
380 $ilCtrl->forwardCommand($gui);
384 case 'illocalunitconfigurationgui':
385 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
386 $ilErr->raiseError($this->
lng->txt(
'permission_denied'),
$ilErr->WARNING);
389 $questionGUI->object->setObjId($this->
object->getId());
390 $questionGUI->setQuestionTabs();
392 $this->
ctrl->setReturn($this,
'questions');
396 $ilCtrl->forwardCommand($gui);
399 case 'ilassquestionfeedbackeditinggui':
400 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
404 $this->
ctrl->setReturn($this,
'questions');
406 $questionGUI->object->setObjId($this->
object->getId());
407 $questionGUI->setQuestionTabs();
409 if ($this->questioninfo->isInActiveTest($questionGUI->object->getObjId())) {
410 $this->tpl->setOnScreenMessage(
412 $this->
lng->txt(
'question_is_part_of_running_test'),
421 if ($this->
object->getType() ==
'qpl' && $writeAccess) {
422 $questionGUI->addHeaderAction();
425 $ilCtrl->forwardCommand($gui);
429 case 'ilobjquestionpoolsettingsgeneralgui':
442 $this->
ctrl->forwardCommand($gui);
445 case strtolower(ilTaxonomySettingsGUI::class):
446 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
456 $component_repository,
463 $forwarder->forward();
467 case 'ilquestionpoolskilladministrationgui':
478 $component_repository,
483 $this->
ctrl->forwardCommand($gui);
488 case 'ilobjquestionpoolgui':
493 $ids = $this->request_wrapper->retrieve(
494 $this->row_id_token->getName(),
495 $this->
refinery->custom()->transformation(fn($v) => $v)
499 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_questions_selected'),
true);
500 $this->
ctrl->redirect($this,
'questions');
502 if ($ids[0] ===
'ALL_OBJECTS') {
503 $ids = $this->
object->getAllQuestionIds();
505 if (!is_array($ids)) {
506 $ids = explode(
',', $ids);
508 $ids = array_map(
'intval', $ids);
511 $this->
ctrl->setParameterByClass(
"ilAssQuestionPageGUI",
"q_id", current($ids));
512 $this->
ctrl->setParameterByClass(
"ilAssQuestionPreviewGUI",
"q_id", current($ids));
513 $this->
ctrl->setParameterByClass(
'ilAssQuestionFeedbackEditingGUI',
'q_id', current($ids));
514 $this->
ctrl->setParameterByClass(
'ilAssQuestionHintsGUI',
'q_id', current($ids));
515 $this->
ctrl->setParameterByClass($class,
"q_id", current($ids));
526 case 'edit_question':
527 $url = $this->
ctrl->getLinkTargetByClass($class,
'editQuestion');
531 $url = $this->
ctrl->getLinkTargetByClass(
'ilAssQuestionPageGUI',
'edit');
544 $this->
ctrl->redirect($this,
'questions');
548 $this->
ctrl->redirect($this,
'questions');
555 $this->
ctrl->redirect($this,
'questions');
560 $this->
object->getRefId(),
562 $this->
object->getId(),
568 .
' event = new Event("click");' 575 throw new \Exception(
"'$action'" .
" not implemented");
581 if ($cmd ==
'questions') {
582 $this->
ctrl->setParameter($this,
'q_id',
'');
585 $ret = $this->$cmd();
589 if (in_array($cmd, [
'editQuestion',
'save',
'suggestedsolution']) && !$ilAccess->checkAccess(
592 $this->object->getRefId()
597 if ($cmd ===
'assessment' &&
598 $this->
object->getType() ===
'tst' &&
599 !$ilAccess->checkAccess(
'write',
'', $this->
object->getRefId())) {
603 $this->
ctrl->setReturn($this,
'questions');
607 $questionGUI->object->setObjId($this->
object->getId());
611 [
'editQuestion',
'save',
'suggestedsolution']
612 ) && $this->questioninfo->isInActiveTest($questionGUI->object->getObjId())
614 $this->tpl->setOnScreenMessage(
616 $this->
lng->txt(
'question_is_part_of_running_test'),
622 if ($this->
object->getType() ==
'qpl') {
623 $questionGUI->setTaxonomyIds($this->
object->getTaxonomyIds());
626 $questionGUI->addHeaderAction();
629 $questionGUI->setQuestionTabs();
633 $ret = $this->
ctrl->forwardCommand($questionGUI);
637 if (!(strtolower($this->qplrequest->raw(
'baseClass')) ==
'iladministrationgui' 638 || strtolower($this->qplrequest->raw(
'baseClass')) ==
'ilrepositorygui')
640 $this->tpl->printToStdout();
646 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_permission'),
true);
647 $target_class = get_class($this->
object) .
'GUI';
648 $this->
ctrl->setParameterByClass($target_class,
'ref_id', $this->ref_id);
649 $this->
ctrl->redirectByClass($target_class);
658 $this->
ctrl->redirectByClass(
'ilQuestionPoolExportGUI');
663 $file = explode(
'_', $this->qplrequest->raw(
'file_id'));
664 $fileObj =
new ilObjFile($file[count($file) - 1],
false);
665 $fileObj->sendFile();
684 $pg_obj->
sendParagraph($this->qplrequest->raw(
'par_id'), $this->qplrequest->raw(
'downloadtitle'));
693 $this->
ctrl->setParameter($this,
'new_type', $this->qplrequest->raw(
'new_type'));
694 if (!isset($_FILES[
'xmldoc']) || !isset($_FILES[
'xmldoc'][
'error']) || $_FILES[
'xmldoc'][
'error'] > UPLOAD_ERR_OK) {
695 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'error_upload'),
true);
696 if (!$questions_only) {
697 $this->
ctrl->redirect($this,
'create');
708 $file = pathinfo($_FILES[
'xmldoc'][
'name']);
709 $full_path = $basedir .
'/' . $_FILES[
'xmldoc'][
'name'];
711 if (strpos($file[
'filename'],
'qpl') ===
false 712 && strpos($file[
'filename'],
'qti') ===
false) {
713 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'import_file_not_valid'),
true);
714 $cmd = $this->
ctrl->getCmd() ===
'upload' ?
'importQuestions' :
'create';
715 $this->
ctrl->redirect($this, $cmd);
719 $this->log->write(__METHOD__ .
': full path ' . $full_path);
723 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'import_file_not_valid'),
true);
724 $cmd = $this->
ctrl->getCmd() ===
'upload' ?
'importQuestions' :
'create';
725 $this->
ctrl->redirect($this, $cmd);
728 $this->log->write(__METHOD__ .
': full path ' . $full_path);
729 if (strcmp($_FILES[
'xmldoc'][
'type'],
'text/xml') == 0) {
730 $qti_file = $full_path;
733 $this->archives->unzip($full_path);
735 $subdir = basename($file[
'basename'],
'.' . $file[
'extension']);
744 if (!file_exists($qti_file)) {
746 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'cannot_find_xml'),
true);
747 $cmd = $this->
ctrl->getCmd() ===
'upload' ?
'importQuestions' :
'create';
748 $this->
ctrl->redirect($this, $cmd);
752 $qtiParser->startParsing();
753 $founditems = &$qtiParser->getFoundItems();
754 if (count($founditems) == 0) {
757 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'qpl_import_no_items'),
true);
758 if (!$questions_only) {
759 $this->
ctrl->redirect($this,
'create');
766 foreach ($founditems as $item) {
767 if (strlen($item[
'type'])) {
774 if ($complete == 0) {
777 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'qpl_import_non_ilias_files'),
true);
778 if (!$questions_only) {
779 $this->
ctrl->redirect($this,
'create');
788 $this->tpl->addBlockFile(
791 'tpl.qpl_import_verification.html',
792 'Modules/TestQuestionPool' 797 foreach ($founditems as $item) {
799 'title' => $item[
'title'],
800 'ident' => $item[
'ident'],
802 switch ($item[
'type']) {
804 $type = $this->
lng->txt(
'assClozeTest');
807 $type = $this->
lng->txt(
'assImagemapQuestion');
810 $type = $this->
lng->txt(
'assMatchingQuestion');
813 $type = $this->
lng->txt(
'assMultipleChoice');
816 $type = $this->
lng->txt(
'assKprimChoice');
819 $type = $this->
lng->txt(
'assLongMenu');
822 $type = $this->
lng->txt(
'assSingleChoice');
825 $type = $this->
lng->txt(
'assOrderingQuestion');
828 $type = $this->
lng->txt(
'assTextQuestion');
831 $type = $this->
lng->txt(
'assNumeric');
834 $type = $this->
lng->txt(
'assTextSubset');
837 $type = $this->
lng->txt($item[
'type']);
841 if (strcmp(
$type,
'-' . $item[
'type'] .
'-') == 0) {
845 if (strcmp($pl->getQuestionType(), $item[
'type']) == 0) {
846 $type = $pl->getQuestionTypeTranslation();
851 $row[
'type'] =
$type;
855 $table->setData($rows);
857 if (is_file($xml_file)
858 && !$questions_only) {
859 $this->tpl->setCurrentBlock(
"import_qpl");
861 $fh = fopen($xml_file,
'r');
862 $xml = fread($fh, filesize($xml_file));
867 if (preg_match(
'/<ContentObject.*?MetaData.*?General.*?Title[^>]*?>([^<]*?)</', $xml, $matches)) {
868 $this->tpl->setVariable(
'VALUE_NEW_QUESTIONPOOL', $matches[1]);
871 $this->tpl->setVariable(
"TEXT_CREATE_NEW_QUESTIONPOOL", $this->
lng->txt(
"qpl_import_create_new_qpl"));
872 $this->tpl->parseCurrentBlock();
875 $this->tpl->setCurrentBlock(
'adm_content');
876 $this->tpl->setVariable(
'FOUND_QUESTIONS_INTRODUCTION', $this->
lng->txt(
'qpl_import_verify_found_questions'));
877 if ($questions_only) {
878 $this->tpl->setVariable(
'VERIFICATION_HEADING', $this->
lng->txt(
'import_questions_into_qpl'));
879 $this->tpl->setVariable(
'FORMACTION', $this->
ctrl->getFormAction($this));
881 $this->tpl->setVariable(
'VERIFICATION_HEADING', $this->
lng->txt(
'import_qpl'));
883 $this->
ctrl->setParameter($this,
'new_type', $this->type);
884 $this->tpl->setVariable(
'FORMACTION', $this->
ctrl->getFormAction($this));
887 $value_questions_only = 0;
888 if ($questions_only) {
889 $value_questions_only = 1;
891 $this->tpl->setVariable(
'VALUE_QUESTIONS_ONLY', $value_questions_only);
892 $this->tpl->setVariable(
'VERIFICATION_TABLE', $table->getHtml());
893 $this->tpl->setVariable(
'VERIFICATION_FORM_NAME', $table->getFormName());
895 $this->tpl->parseCurrentBlock();
905 if (!is_writable($qpl_data_dir)) {
906 $this->error->raiseError(
907 'Questionpool Data Directory (' . $qpl_data_dir
908 .
') not writeable.',
913 $qpl_dir = $qpl_data_dir .
'/qpl_import';
915 if (!@is_dir($qpl_dir)) {
916 $this->error->raiseError(
'Creation of Questionpool Directory failed.', $this->error->FATAL);
924 if ($this->creation_mode
926 || !$this->creation_mode
928 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
929 $this->
ctrl->redirect($this,
'create');
934 if ($this->qplrequest->int(
'questions_only') === 1) {
937 $description = $this->
object->getDescription();
940 $newObj->setType($this->qplrequest->raw(
'new_type'));
941 $newObj->setTitle(
'dummy');
942 $newObj->setDescription(
'questionpool import');
943 $newObj->create(
true);
944 $newObj->createReference();
945 $newObj->putInTree($this->qplrequest->getRefId());
946 $newObj->setPermissions($this->qplrequest->getRefId());
948 $title = $this->qplrequest->raw(
'qpl_new');
954 ilSession::set(
"qpl_import_idents", $this->qplrequest->raw(
"ident"));
958 $imp =
new ilImport($this->qplrequest->getRefId());
960 $map->addMapping(
'Modules/TestQuestionPool',
'qpl',
'new_id', $newObj->getId());
961 $imp->
importObject($newObj, $fullPath, $fileName,
'qpl',
'Modules/TestQuestionPool',
true);
967 $this->qplrequest->raw(
'ident')
977 $contParser->setQuestionMapping($qtiParser->getImportMapping());
978 $contParser->startParsing();
984 $newObj->setTitle($title);
987 if ($description !== null) {
988 $newObj->setDescription($description);
996 if ($_POST[
'questions_only'] == 1) {
997 $this->
ctrl->redirect($this,
'questions');
999 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'object_imported'),
true);
1001 'ilias.php?ref_id=' . $newObj->getRefId() .
1002 '&baseClass=ilObjQuestionPoolGUI' 1009 if ($_POST[
'questions_only'] == 1) {
1010 $this->
ctrl->redirect($this,
'questions');
1012 $this->
ctrl->redirect($this,
'cancel');
1021 $upload_valid =
true;
1023 if ($form->checkInput()) {
1025 $form->setValuesByPost();
1029 $form->setValuesByPost();
1043 $this->tpl->setContent($form->getHtml());
1049 $form->setTitle($this->
lng->txt(
'import_question'));
1050 $form->setFormAction($this->
ctrl->getFormAction($this,
'upload'));
1054 $form->addItem($file);
1056 $form->addCommandButton(
'upload', $this->
lng->txt(
'upload'));
1057 $form->addCommandButton(
'questions', $this->
lng->txt(
'cancel'));
1065 $addContEditMode = $_POST[
'add_quest_cont_edit_mode'];
1070 $q_gui->object->setObjId($this->
object->getId());
1071 $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
1072 $q_gui->object->createNewQuestion();
1073 $this->
ctrl->setParameterByClass(get_class($q_gui),
'q_id', $q_gui->object->getId());
1074 $this->
ctrl->setParameterByClass(get_class($q_gui),
'sel_question_types', $_POST[
'sel_question_types']);
1075 $this->
ctrl->redirectByClass(get_class($q_gui),
'editQuestion');
1080 if (!$this->qplrequest->raw(
'q_id')) {
1082 $add_cont_edit_mode = $this->qplrequest->raw(
'add_quest_cont_edit_mode');
1087 $q_gui->object->setObjId($this->
object->getId());
1088 $q_gui->object->setAdditionalContentEditingMode($add_cont_edit_mode);
1089 $q_gui->object->createNewQuestion();
1091 $class = get_class($q_gui);
1092 $q_id = $q_gui->object->getId();
1094 $class = $this->qplrequest->raw(
'sel_question_types') .
'gui';
1095 $q_id = $this->qplrequest->raw(
'q_id');
1098 $this->
ctrl->setParameterByClass($class,
'q_id', $q_id);
1099 $this->
ctrl->setParameterByClass($class,
'sel_question_types', $this->qplrequest->raw(
'sel_question_types'));
1100 $this->
ctrl->setParameterByClass($class,
'prev_qid', $this->qplrequest->raw(
'prev_qid'));
1102 $this->
ctrl->redirectByClass($class,
'editQuestion');
1108 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'object_added'),
true);
1111 'ilias.php?ref_id=' . $new_object->
getRefId() .
1112 '&baseClass=ilObjQuestionPoolGUI' 1121 $type = $this->qplrequest->raw(
'sel_question_types');
1122 $this->editQuestionForm(
$type);
1129 $questionIdsToDelete = array_filter(array_map(
'intval', $ids));
1130 if (0 === count($questionIdsToDelete)) {
1131 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'qpl_delete_select_none'),
true);
1132 $this->
ctrl->redirect($this,
'questions');
1135 $this->tpl->setOnScreenMessage(
'question', $this->
lng->txt(
'qpl_confirm_delete_questions'));
1136 $deleteable_questions = $this->
object->getDeleteableQuestionDetails($questionIdsToDelete);
1137 $table_gui =
new ilQuestionBrowserTableGUI($this,
'questions', (($rbacsystem->checkAccess(
'write', $this->qplrequest->getRefId()) ?
true :
false)),
true);
1138 $table_gui->setShowRowsSelector(
false);
1139 $table_gui->setLimit(PHP_INT_MAX);
1140 $table_gui->setEditable($rbacsystem->checkAccess(
'write', $this->qplrequest->getRefId()));
1141 $table_gui->setData($deleteable_questions);
1142 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
1152 $questionIdsToDelete = $this->qplrequest->isset(
'q_id') ? (array) $this->qplrequest->raw(
'q_id') : [];
1153 if (0 === count($questionIdsToDelete) && $this->qplrequest->isset(
'q_id')) {
1154 $questionIdsToDelete = [$this->qplrequest->getQuestionId()];
1157 $questionIdsToDelete = array_filter(array_map(
'intval', $questionIdsToDelete));
1158 if (0 === count($questionIdsToDelete)) {
1159 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'qpl_delete_select_none'),
true);
1160 $this->
ctrl->redirect($this,
'questions');
1163 $this->tpl->setOnScreenMessage(
'question', $this->
lng->txt(
'qpl_confirm_delete_questions'));
1164 $deleteable_questions = &$this->
object->getDeleteableQuestionDetails($questionIdsToDelete);
1168 (($rbacsystem->checkAccess(
'write', $this->qplrequest->getRefId()) ?
true :
false)),
1171 $table_gui->setShowRowsSelector(
false);
1172 $table_gui->setLimit(PHP_INT_MAX);
1173 $table_gui->setEditable($rbacsystem->checkAccess(
'write', $this->qplrequest->getRefId()));
1174 $table_gui->setData($deleteable_questions);
1175 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
1183 foreach ($_POST[
'q_id'] as
$key => $value) {
1184 $this->
object->deleteQuestion($value);
1185 $this->
object->cleanupClipboard($value);
1187 if (count($_POST[
'q_id'])) {
1188 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'qpl_questions_deleted'),
true);
1191 $this->
ctrl->setParameter($this,
'q_id',
'');
1192 $this->
ctrl->redirect($this,
'questions');
1197 $this->
ctrl->redirect($this,
'questions');
1206 $export_file = $qpl_exp->buildExportFile();
1209 if ($export_file ===
'') {
1210 $export_file =
'StandIn';
1215 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'qpl_export_select_none'),
true);
1224 $this->
ctrl->redirect($this,
'infoScreen');
1232 if (!$this->
access->checkAccess(
"read",
"", $this->qplrequest->getRefId())) {
1237 if (get_class($this->
object) ==
'ilObjTest') {
1238 if ($this->qplrequest->raw(
'calling_test') > 0) {
1239 $ref_id = $this->qplrequest->raw(
'calling_test');
1240 $q_id = $this->qplrequest->raw(
'q_id');
1242 if ($this->qplrequest->raw(
'test_express_mode')) {
1245 'ilias.php?ref_id=' .
$ref_id .
'&q_id=' . $q_id .
'&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI' 1249 'ilias.php?ref_id=' .
$ref_id .
'&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI' 1258 $this->
object->purgeQuestions();
1262 if ($qsa_import_fails->failedImportsRegistered()) {
1263 $button = $this->ui_factory->button()->standard(
1264 $this->
lng->txt(
'ass_skl_import_fails_remove_btn'),
1265 $this->
ctrl->getLinkTarget($this,
'renoveImportFails')
1267 $this->tpl->setOnScreenMessage(
1269 $qsa_import_fails->getFailedImportsMessage($this->lng) .
'<br />' . $this->ui_renderer->render(
1275 if ($this->rbac_system->checkAccess(
'write', $this->qplrequest->getRefId())) {
1276 $btn = $this->ui_factory->button()->primary(
1277 $this->
lng->txt(
'ass_create_question'),
1278 $this->
ctrl->getLinkTarget($this,
'createQuestionForm')
1280 $this->
toolbar->addComponent($btn);
1282 $btn_import = $this->ui_factory->button()->standard(
1283 $this->
lng->txt(
'import'),
1284 $this->
ctrl->getLinkTarget($this,
'importQuestions')
1286 $this->
toolbar->addComponent($btn_import);
1289 $btn_paste = $this->ui_factory->button()->standard(
1290 $this->
lng->txt(
'paste'),
1291 $this->
ctrl->getLinkTarget($this,
'paste')
1293 $this->
toolbar->addComponent($btn_paste);
1297 $this->tpl->setPermanentLink($this->
object->getType(), $this->
object->getRefId());
1298 $this->tpl->setContent($this->
getTable());
1303 $q_id = $this->qplrequest->getQuestionId();
1305 if ($this->
object->checkQuestionParent($q_id)) {
1319 $ilHelp->setSubScreenId(
'createQuestion_editMode');
1321 $ilHelp->setSubScreenId(
'createQuestion');
1326 $this->tpl->setContent($this->
ctrl->getHTML($form));
1332 $form->setTitle($this->
lng->txt(
'ass_create_question'));
1333 $form->setFormAction($this->
ctrl->getFormAction($this));
1336 foreach ($this->
object->getQuestionTypes(
false,
true,
false) as $translation =>
$data) {
1337 $options[
$data[
'type_tag']] = $translation;
1342 $form->addItem($si);
1348 $this->
lng->txt(
'tst_add_quest_cont_edit_mode_IPE'),
1351 $option_ipe->
setInfo($this->
lng->txt(
'tst_add_quest_cont_edit_mode_IPE_info'));
1352 $ri->addOption($option_ipe);
1355 $this->
lng->txt(
'tst_add_quest_cont_edit_mode_RTE'),
1358 $option_rte->
setInfo($this->
lng->txt(
'tst_add_quest_cont_edit_mode_RTE_info'));
1359 $ri->addOption($option_rte);
1363 $form->addItem($ri,
true);
1367 $form->addItem($hi,
true);
1372 $form->addCommandButton(
'createQuestion', $this->
lng->txt(
'create'));
1373 $form->addCommandButton(
'questions', $this->
lng->txt(
'cancel'));
1380 $this->
ctrl->setParameter($this,
'output',
'overview');
1381 $output_link = $this->
ctrl->getLinkTarget($this,
'print');
1382 $this->
ctrl->setParameter($this,
'output',
'detailed_output_solutions');
1383 $output_link_detailed = $this->
ctrl->getLinkTarget($this,
'print');
1384 $this->
ctrl->setParameter($this,
'output',
'detailed_output_printview');
1385 $output_link_printview = $this->
ctrl->getLinkTarget($this,
'print');
1387 $mode = $this->ui_factory->dropdown()->standard([
1388 $this->ui_factory->button()->shy($this->
lng->txt(
'overview'), $output_link),
1389 $this->ui_factory->button()->shy($this->
lng->txt(
'detailed_output_solutions'), $output_link_detailed),
1390 $this->ui_factory->button()->shy($this->
lng->txt(
'detailed_output_printview'), $output_link_printview)
1391 ])->withLabel($this->
lng->txt(
'output_mode'));
1393 $output = $this->qplrequest->raw(
'output') ??
'';
1396 $data = $this->
object->getPrintviewQuestions();
1399 $totalPoints += $d[
'points'];
1401 $table_gui->setTotalPoints($totalPoints);
1402 $table_gui->initColumns();
1403 $table_gui->setData(
$data);
1404 $this->tpl->setContent($this->ui_renderer->render($mode) . $table_gui->getHTML());
1409 $this->
object->update();
1410 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_obj_modified'),
true);
1416 if ($this->
object->pasteFromClipboard()) {
1417 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'qpl_paste_success'),
true);
1419 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'qpl_paste_error'),
true);
1422 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'qpl_paste_no_objects'),
true);
1424 $this->
ctrl->redirect($this,
'questions');
1430 foreach ($ids as
$id) {
1431 $this->
object->copyToClipboard($id);
1433 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'qpl_copy_insert_clipboard'),
true);
1435 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'qpl_copy_select_none'),
true);
1442 foreach ($ids as
$id) {
1443 $this->
object->moveToClipboard($id);
1445 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'qpl_move_insert_clipboard'),
true);
1447 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'qpl_move_select_none'),
true);
1454 if ($rbacsystem->checkAccess(
'write', $this->qplrequest->getRefId())) {
1455 $question_ids = &$this->
object->getAllQuestionIds();
1457 $qpl_exp->buildExportFile();
1458 $this->
ctrl->redirectByClass(
'ilquestionpoolexportgui',
'');
1464 $this->
ctrl->redirectByClass(ilAssQuestionPreviewGUI::class,
'show');
1470 $form->setTarget(
'_top');
1471 $form->setFormAction($this->
ctrl->getFormAction($this));
1472 $form->setTitle($this->
lng->txt(
'import_qpl'));
1476 $fi->setRequired(
true);
1477 $form->addItem($fi);
1479 $form->addCommandButton(
'importFile', $this->
lng->txt(
'import'));
1480 $form->addCommandButton(
'cancel', $this->
lng->txt(
'cancel'));
1490 if ($_REQUEST[
'new_type'] === null) {
1491 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'import_file_not_valid'),
true);
1492 $this->
ctrl->redirect($this,
'create');
1496 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
1497 $this->
ctrl->redirect($this,
'create');
1501 $form = $this->
initImportForm($this->qplrequest->raw(
'new_type'));
1502 if ($form->checkInput()) {
1507 $this->tpl->setContent($form->getHTML());
1514 switch ($this->
ctrl->getCmd()) {
1520 $this->
ctrl->clearParameterByClass(self::class,
'q_id');
1521 $ilLocator->addItem(
1522 $this->
object->getTitle(),
1523 $this->
ctrl->getLinkTarget($this,
''),
1525 $this->qplrequest->getRefId()
1527 $this->
ctrl->setParameter($this,
'q_id', $this->qplrequest->getQuestionId());
1531 if (!is_array($this->qplrequest->raw(
'q_id')) && $this->qplrequest->raw(
'q_id') > 0 && $this->qplrequest->raw(
1533 ) !==
'questions') {
1535 if ($q_gui !== null && $q_gui->object instanceof
assQuestion) {
1536 $q_gui->object->setObjId($this->
object->getId());
1537 $title = $q_gui->object->getTitleForHTMLOutput();
1539 $title = $this->
lng->txt(
'new') .
': ' . $this->questioninfo->getQuestionTypeName(
1540 $q_gui->object->getId()
1543 $ilLocator->addItem($title, $this->
ctrl->getLinkTargetByClass(get_class($q_gui),
'editQuestion'));
1546 $this->
ctrl->setParameter($this,
'q_id',
'');
1547 $this->
ctrl->redirect($this);
1557 parent::setTitleAndDescription();
1559 if (!is_array($this->qplrequest->raw(
'q_id')) && $this->qplrequest->raw(
'q_id') > 0 && $this->qplrequest->raw(
1561 ) !==
'questions') {
1564 $q_gui->object->setObjId($this->
object->getId());
1565 $title = $this->
object->getTitle() .
': ' . $q_gui->object->getTitle();
1567 $title = $this->
lng->txt(
'new') .
': ' . $this->questioninfo->getQuestionTypeName(
1568 $q_gui->object->getId()
1571 $this->tpl->setTitle(
1574 self::ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
1577 $this->tpl->setDescription(
1578 $q_gui->object->getDescriptionForHTMLOutput()
1583 $this->
ctrl->setParameter($this,
'q_id',
'');
1584 $this->
ctrl->redirect($this);
1587 $this->tpl->setTitle(
1589 $this->
object->getTitle(),
1590 self::ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
1593 $this->tpl->setDescription(
1595 $this->
object->getLongDescription(),
1596 self::ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
1612 $currentUserHasWriteAccess = $this->
access->checkAccess(
'write',
'', $this->
object->getRefId());
1613 $currentUserHasReadAccess = $this->
access->checkAccess(
'read',
'', $this->
object->getRefId());
1615 $ilHelp->setScreenIdComponent(
'qpl');
1617 $next_class = strtolower($this->
ctrl->getNextClass());
1618 switch ($next_class) {
1620 case 'ilpermissiongui':
1621 case 'ilobjectmetadatagui':
1622 case 'ilquestionpoolexportgui':
1623 case 'ilquestionpoolskilladministrationgui':
1626 case strtolower(ilTaxonomySettingsGUI::class):
1627 case 'ilobjquestionpoolsettingsgeneralgui':
1629 if ($currentUserHasWriteAccess) {
1640 $force_active =
false;
1642 if (is_array($commands)) {
1643 foreach ($commands as
$key => $value) {
1644 if (preg_match(
'/^delete_.*/',
$key, $matches) ||
1645 preg_match(
'/^addSelectGap_.*/',
$key, $matches) ||
1646 preg_match(
'/^addTextGap_.*/',
$key, $matches) ||
1647 preg_match(
'/^deleteImage_.*/',
$key, $matches) ||
1648 preg_match(
'/^upload_.*/',
$key, $matches) ||
1649 preg_match(
'/^addSuggestedSolution_.*/',
$key, $matches)
1651 $force_active =
true;
1655 if (isset($_POST[
'imagemap_x'])) {
1656 $force_active =
true;
1658 if (!$force_active) {
1659 $force_active = ((strtolower($this->
ctrl->getCmdClass()) == strtolower(get_class($this)) || strlen(
1660 $this->
ctrl->getCmdClass()
1662 $this->
ctrl->getCmd() ==
'')
1666 if ($currentUserHasReadAccess) {
1667 $this->tabs_gui->addTarget(
1669 $this->
ctrl->getLinkTarget($this,
'questions'),
1677 'filterQuestionBrowser',
1686 'addSuggestedSolution',
1689 'removeSuggestedSolution',
1697 'uploadingImagemap',
1703 'uploadingJavaapplet',
1710 'toggleGraphicalAnswers',
1720 if ($currentUserHasReadAccess) {
1721 $this->tabs_gui->addTarget(
1723 $this->
ctrl->getLinkTarget($this,
'infoScreen'),
1724 [
'infoScreen',
'showSummary']
1728 if ($currentUserHasWriteAccess) {
1730 $this->tabs_gui->addTarget(
1732 $this->
ctrl->getLinkTargetByClass(
'ilObjQuestionPoolSettingsGeneralGUI'),
1734 [
'ilObjQuestionPoolSettingsGeneralGUI',
'ilObjTaxonomyGUI']
1739 $link = $this->
ctrl->getLinkTargetByClass(
1740 [
'ilQuestionPoolSkillAdministrationGUI',
'ilAssQuestionSkillAssignmentsGUI'],
1744 $this->tabs_gui->addTarget(
'qpl_tab_competences', $link, [], []);
1748 if ($currentUserHasReadAccess) {
1750 $this->tabs_gui->addTarget(
1752 $this->
ctrl->getLinkTarget($this,
'print'),
1759 if ($currentUserHasWriteAccess) {
1761 $mdtab = $mdgui->getTab();
1763 $this->tabs_gui->addTarget(
1772 if ($currentUserHasWriteAccess) {
1773 $this->tabs_gui->addTarget(
1775 $this->
ctrl->getLinkTargetByClass(
'ilquestionpoolexportgui',
''),
1777 'ilquestionpoolexportgui' 1781 if ($this->
access->checkAccess(
'edit_permission',
'', $this->object->getRefId())) {
1782 $this->tabs_gui->addTarget(
1784 $this->
ctrl->getLinkTargetByClass([get_class($this),
'ilpermissiongui'],
'perm'),
1785 [
'perm',
'info',
'owner'],
1797 if (!$this->
object->isSkillServiceEnabled()) {
1812 $this->
lng->txt(
'qpl_settings_subtab_general'),
1813 $this->
ctrl->getLinkTargetByClass(
'ilObjQuestionPoolSettingsGeneralGUI'),
1815 if ($this->
object->getShowTaxonomies()) {
1818 $this->
lng->txt(
'qpl_settings_subtab_taxonomies'),
1819 $this->
ctrl->getLinkTargetByClass(
'ilTaxonomySettingsGUI',
''),
1831 $this->
ctrl->setCmd(
'showSummary');
1832 $this->
ctrl->setCmdClass(
'ilinfoscreengui');
1838 if (!$this->
access->checkAccess(
'visible',
'', $this->ref_id)) {
1839 $this->error->raiseError($this->
lng->txt(
'msg_no_perm_read'));
1842 $info->enablePrivateNotes();
1845 $info->addMetaDataSections($this->
object->getId(), 0, $this->
object->getType());
1847 $this->
ctrl->forwardCommand($info);
1850 public static function _goto($a_target): void
1853 $main_tpl = $DIC->ui()->mainTemplate();
1854 $ilAccess = $DIC[
'ilAccess'];
1857 $ctrl = $DIC[
'ilCtrl'];
1859 if ($ilAccess->checkAccess(
'write',
'', (
int) $a_target)
1860 || $ilAccess->checkAccess(
'read',
'', (
int) $a_target)
1862 $target_class = ilObjQuestionPoolGUI::class;
1863 $target_cmd =
'questions';
1868 if ($ilAccess->checkAccess(
'visible',
"", $a_target)) {
1873 $main_tpl->setOnScreenMessage(
1876 $lng->
txt(
"msg_no_perm_read_item"),
1895 $this->data_factory,
1898 $this->action_parameter_token,
1899 $this->row_id_token,
1902 $this->component_repository,
1904 $this->
object->getShowTaxonomies() ? $this->taxonomy->domain() : null,
1906 $this->
object->getId(),
1907 (
int) $this->qplrequest->getRefId()
1914 $filter_action = $this->
ctrl->getLinkTarget($this,
'questions');
1915 $filter = $table->getFilter($this->ui_service, $filter_action);
1917 $filter_params = $this->ui_service->filter()->getData($filter);
1919 if ($filter_params) {
1920 foreach (array_filter($filter_params) as $item => $value) {
1924 foreach ($value as $tax_value) {
1925 if ($tax_value ===
'null') {
1926 $table->addTaxonomyFilterNoTaxonomySet(
true);
1928 $tax_nodes = explode(
'-', $tax_value);
1929 $tax_id = array_shift($tax_nodes);
1930 $table->addTaxonomyFilter(
1934 $this->
object->getType()
1940 $table->setCommentFilter($value);
1943 $table->addFieldFilter($item, $value);
1951 ->withRequest($this->request)
const MATCHING_QUESTION_IDENTIFIER
const MULTIPLE_CHOICE_QUESTION_IDENTIFIER
const ADDITIONAL_CONTENT_EDITING_MODE_IPE
ilNavigationHistory $navigation_history
HttpRequest $http_request
setEditPreview(bool $a_editpreview)
Set Display first Edit tab, then Preview tab, instead of Page and Edit.
raiseError(string $a_msg, int $a_err_obj)
wrapper for downward compability
static get(string $a_var)
afterSave(ilObject $new_object)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Readable part of repository interface to ilComponentDataDB.
ilRbacSystem $rbac_system
URLBuilderToken $action_parameter_token
createQuestionFormObject()
DataFactory $data_factory
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
renoveImportFailsObject()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
confirmDeleteQuestions(array $ids)
static _getGUIClassNameForId($a_q_id)
confirmDeleteQuestionsObject()
delete questions after confirmation
GUI class for the workflow of copying objects.
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually...
__construct($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
Abstract basic class which is to be extended by the concrete assessment question type classes...
prepareOutput(bool $show_sub_objects=true)
copyQuestions(array $ids)
ILIAS TestQuestionPool InternalRequestService $qplrequest
const KPRIM_CHOICE_QUESTION_IDENTIFIER
acquireParameters(array $namespace, string ... $names)
static _gotoRepositoryNode(int $ref_id, string $cmd="")
const LONG_MENU_QUESTION_IDENTIFIER
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const TEXTSUBSET_QUESTION_IDENTIFIER
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setParameterByClass(string $a_class, string $a_parameter, $a_value)
const TAB_COMMON_SETTINGS
Component logger with individual log levels by component id.
getTabs()
adds tabs to tab gui object
download_paragraphObject()
download source code paragraph
static getStyleSheetLocation(string $mode="output", string $a_css_name="", string $a_css_location="")
get full style sheet file name (path inclusive) of current user
exportObject()
Gateway for exports initiated from workspace, as there is a generic forward to {objTypeMainGUI}::expo...
GlobalScreen $global_screen
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getQuestionGUI(string $question_type='', int $question_id=-1)
Creates a question gui representation and returns the alias to the question gui.
const CMD_SHOW_LIST
command constants
const CMD_SHOW
command constants
importObject(?object $a_new_obj, string $a_tmp_file, string $a_filename, string $a_type, string $a_comp="", bool $a_copy_file=false)
static _lookupObjId(int $ref_id)
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
Interface ilCtrlBaseClassInterface describes ilCtrl base classes.
editQuestionForTestObject()
URLBuilderToken $row_id_token
moveQuestions(array $ids)
ilComponentRepository $component_repository
getActivePluginsInSlot(string $slot_id)
Get the active plugins for the given slot.
addSubTab(string $a_id, string $a_text, string $a_link, string $a_frame="")
importQuestionsObject(ilPropertyFormGUI $form=null)
display the import form to import questions into the questionpool
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
ilGlobalTemplateInterface $tpl
deleteQuestionsObject()
delete questions confirmation screen
deleteRegisteredImportFails()
ilComponentFactory $component_factory
getQueryParamString(string $param)
static _lookupTitle(int $obj_id)
const NUMERIC_QUESTION_IDENTIFIER
setScreenId(string $a_id)
setContent(string $a_html)
Sets content for standard template.
initImportForm(string $new_type)
ILIAS Notes Service $notes_service
ILIAS Filesystem Util Archive LegacyArchives $archives
setTitleAndDescription()
called by prepare output
questionsObject()
list questions of question pool
createQuestionForTestObject()
setScreenIdComponent(string $a_comp)
Class ilObjectGUI Basic methods of all Output classes.
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
const ORDERING_QUESTION_IDENTIFIER
uploadQplObject($questions_only=false)
imports question(s) into the questionpool
QuestionInfoService $questioninfo
cancelDeleteQuestionsObject()
Provides fluid interface to RBAC services.
Legacy Content Object Parser.
static _setImportDirectory($a_import_dir=null)
header include for all ilias files.
addSettingsSubTabs(ilTabsGUI $tabs)
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
static getSyntaxStylePath()
importVerifiedFileObject()
static getDataDir()
get data directory (outside webspace)
const TEXT_QUESTION_IDENTIFIER
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
Last visited history for repository items.
const EDIT_CONTEXT_AUTHORING
buildCreateQuestionForm()
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static redirect(string $a_script)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static buildAjaxHash(int $node_type, ?int $node_id, string $obj_type, int $obj_id, string $sub_type=null, int $sub_id=null, int $news_id=0)
Build ajax hash.
fullscreenObject()
show fullscreen view
fetchAuthoringQuestionIdParamater()
static isSkillManagementGloballyActivated()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
sendParagraph(string $par_id, string $filename)
const ADDITIONAL_CONTENT_EDITING_MODE_RTE
getQueryParamInt(string $param)
static isAdditionalQuestionContentEditingModePageObjectEnabled()
Returns the fact wether content editing with ilias page editor is enabled for questions or not...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getImportDirectory()
get import directory of lm
redirectAfterMissingWrite()
exportQuestions(array $ids)
static getListCommentsJSCall(string $a_hash, string $a_update_code=null)
Get list comments js call.
const SINGLE_CHOICE_QUESTION_IDENTIFIER
importFileObject(int $parent_id=null)
form for new questionpool object import
const RENDER_PURPOSE_PREVIEW
static set(string $a_var, $a_val)
Set a value.
const CMD_SHOW_SKILL_QUEST_ASSIGNS
showMediaFullscreen(int $a_style_id=0)
show fullscreen view of media object
const CLOZE_TEST_IDENTIFIER
Question identifier constants.
uploadObject()
imports question(s) into the questionpool
static _setImportDirectory($a_import_dir=null)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
const IMAGEMAP_QUESTION_IDENTIFIER