19 require_once
'./Modules/Test/classes/inc.AssessmentConstants.php';
59 $ilCtrl = $DIC[
'ilCtrl'];
60 $rbacsystem = $DIC[
'rbacsystem'];
63 $this->error = $DIC[
'ilErr'];
64 $this->
ctrl = &$ilCtrl;
66 $this->
ctrl->saveParameter($this, array(
67 "ref_id",
"test_ref_id",
"calling_test",
"test_express_mode",
"q_id",
'tax_node',
'calling_consumer',
'consumer_context' 69 $this->
ctrl->saveParameter($this,
"calling_consumer");
70 $this->
ctrl->saveParameterByClass(
'ilAssQuestionPageGUI',
'calling_consumer');
71 $this->
ctrl->saveParameterByClass(
'ilAssQuestionPageGUI',
'consumer_context');
72 $this->
ctrl->saveParameterByClass(
'ilobjquestionpoolgui',
'calling_consumer');
73 $this->
ctrl->saveParameterByClass(
'ilobjquestionpoolgui',
'consumer_context');
74 $this->qplrequest = $DIC->testQuestionPool()->internal()->request();
82 if (!$this->request_wrapper->has($param)) {
87 $this->
refinery->kindlyTo()->string()
89 return $this->request_wrapper->retrieve($param, $trafo);
94 if (!$this->request_wrapper->has($param)) {
101 return $this->request_wrapper->retrieve($param, $trafo);
120 $ilLocator = $DIC[
'ilLocator'];
121 $ilAccess = $DIC[
'ilAccess'];
122 $ilNavigationHistory = $DIC[
'ilNavigationHistory'];
124 $ilCtrl = $DIC[
'ilCtrl'];
126 $ilTabs = $DIC[
'ilTabs'];
128 $ilDB = $DIC[
'ilDB'];
129 $component_repository = $DIC[
'component.repository'];
131 $randomGroup = $DIC->refinery()->random();
133 $writeAccess = $ilAccess->checkAccess(
"write",
"", $this->qplrequest->getRefId());
135 if ((!$ilAccess->checkAccess(
"read",
"", $this->qplrequest->getRefId()))
136 && (!$ilAccess->checkAccess(
"visible",
"", $this->qplrequest->getRefId()))) {
144 $ilAccess->checkAccess(
"read",
"", $this->qplrequest->getRefId())) {
145 if (
'qpl' == $this->
object->getType()) {
146 $ilNavigationHistory->addItem(
147 $this->qplrequest->getRefId(),
148 "ilias.php?baseClass=ilObjQuestionPoolGUI&cmd=questions&ref_id=" . $this->qplrequest->getRefId(),
154 $cmd = $this->
ctrl->getCmd(
"questions");
155 $next_class = $this->
ctrl->getNextClass($this);
158 if (in_array($next_class, array(
'',
'ilobjquestionpoolgui')) && $cmd ==
'questions') {
167 if (!(in_array($next_class, array(
'',
'ilobjquestionpoolgui')) && $cmd ==
'questions') && $q_id < 1) {
168 $q_type = $this->qplrequest->raw(
"sel_question_types");
170 if ($cmd !=
"createQuestion" && $cmd !=
"createQuestionForTest" 171 && $next_class !=
"ilassquestionpagegui") {
172 if (($this->qplrequest->raw(
"test_ref_id") !=
"") or ($this->qplrequest->raw(
"calling_test"))) {
173 $ref_id = $this->qplrequest->raw(
"test_ref_id");
175 $ref_id = $this->qplrequest->raw(
"calling_test");
179 switch ($next_class) {
180 case "ilcommonactiondispatchergui":
182 $this->
ctrl->forwardCommand($gui);
185 case 'ilobjectmetadatagui':
186 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
187 $ilErr->raiseError($this->
lng->txt(
'permission_denied'),
$ilErr->WARNING);
190 $this->
ctrl->forwardCommand($md_gui);
193 case 'ilassquestionpreviewgui':
194 if (!$ilAccess->checkAccess(
'read',
'', $this->object->getRefId())) {
198 $this->
ctrl->saveParameter($this,
"q_id");
212 $gui->
initQuestion((
int) $this->qplrequest->raw(
'q_id'), $this->
object->getId());
213 $gui->initPreviewSettings($this->
object->getRefId());
215 $gui->initHintTracking();
218 $ilHelp = $DIC[
'ilHelp'];
219 $ilHelp->setScreenIdComponent(
"qpl");
221 $this->
ctrl->forwardCommand($gui);
224 case "ilassquestionpagegui":
225 if ($cmd ==
'finishEditing') {
226 $this->
ctrl->redirectByClass(
'ilassquestionpreviewgui',
'show');
229 if ($cmd ===
'edit' && !$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
232 $this->tpl->setCurrentBlock(
"ContentStyle");
234 $this->tpl->parseCurrentBlock();
237 $this->tpl->setCurrentBlock(
"SyntaxStyle");
239 $this->tpl->parseCurrentBlock();
242 $q_gui->setQuestionTabs();
243 $q_gui->outAdditionalOutput();
244 $q_gui->object->setObjId($this->
object->getId());
246 $q_gui->setTargetGuiClass(null);
247 $q_gui->setQuestionActionCmd(
'');
249 if ($this->
object->getType() ==
'qpl') {
250 $q_gui->addHeaderAction();
253 $question = $q_gui->object;
255 if ($question->isInActiveTest()) {
256 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"question_is_part_of_running_test"),
true);
260 $this->
ctrl->saveParameter($this,
"q_id");
261 $this->
lng->loadLanguageModule(
"content");
262 $this->
ctrl->setReturnByClass(
"ilAssQuestionPageGUI",
"view");
263 $this->
ctrl->setReturn($this,
"questions");
265 $page_gui->obj->addUpdateListener(
270 $page_gui->setEnabledTabs(
false);
271 if (strlen($this->
ctrl->getCmd()) == 0 && !isset($_POST[
"editImagemapForward_x"])) {
272 $this->
ctrl->setCmdClass(get_class($page_gui));
273 $this->
ctrl->setCmd(
"preview");
275 $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(
true)));
276 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
277 $page_gui->setOutputMode(
"edit");
278 $page_gui->setHeader($question->getTitleForHTMLOutput());
279 $page_gui->setPresentationTitle($question->getTitleForHTMLOutput());
280 $ret = $this->
ctrl->forwardCommand($page_gui);
286 case 'ilpermissiongui':
288 $this->
ctrl->forwardCommand($perm_gui);
291 case 'ilobjectcopygui':
294 $this->
ctrl->forwardCommand($cp);
297 case "ilquestionpoolexportgui":
299 $exp_gui->addFormat(
'xml', $this->
lng->txt(
'qpl_export_xml'));
300 $exp_gui->addFormat(
'xls', $this->
lng->txt(
'qpl_export_excel'), $this,
'createExportExcel');
301 $ret = $this->
ctrl->forwardCommand($exp_gui);
304 case "ilinfoscreengui":
308 case 'ilassquestionhintsgui':
309 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
313 $this->
ctrl->setReturn($this,
"questions");
315 $questionGUI->object->setObjId($this->
object->getId());
316 $questionGUI->setQuestionTabs();
318 if ($questionGUI->object->isInActiveTest()) {
319 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"question_is_part_of_running_test"),
true);
323 $ilHelp = $DIC[
'ilHelp'];
324 $ilHelp->setScreenIdComponent(
"qpl");
326 if ($this->
object->getType() ==
'qpl' && $writeAccess) {
327 $questionGUI->addHeaderAction();
331 $gui->setEditingEnabled(
332 $DIC->access()->checkAccess(
'write',
'', $this->
object->getRefId())
335 $ilCtrl->forwardCommand($gui);
339 case 'illocalunitconfigurationgui':
340 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
341 $ilErr->raiseError($this->
lng->txt(
'permission_denied'),
$ilErr->WARNING);
344 $questionGUI->object->setObjId($this->
object->getId());
345 $questionGUI->setQuestionTabs();
347 $this->
ctrl->setReturn($this,
'questions');
351 $ilCtrl->forwardCommand($gui);
354 case 'ilassquestionfeedbackeditinggui':
355 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
360 $this->
ctrl->setReturn($this,
"questions");
362 $questionGUI->object->setObjId($this->
object->getId());
363 $questionGUI->setQuestionTabs();
365 if ($questionGUI->object->isInActiveTest()) {
366 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"question_is_part_of_running_test"),
true);
370 $ilHelp = $DIC[
'ilHelp'];
371 $ilHelp->setScreenIdComponent(
"qpl");
373 if ($this->
object->getType() ==
'qpl' && $writeAccess) {
374 $questionGUI->addHeaderAction();
377 $ilCtrl->forwardCommand($gui);
381 case 'ilobjquestionpoolsettingsgeneralgui':
383 $this->
ctrl->forwardCommand($gui);
386 case "ilobjtaxonomygui":
387 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
396 $component_repository,
402 $forwarder->forward();
406 case 'ilquestionpoolskilladministrationgui':
419 $component_repository,
424 $this->
ctrl->forwardCommand($gui);
428 case 'ilquestionbrowsertablegui':
432 case "ilobjquestionpoolgui":
435 if ($cmd ==
'questions') {
436 $this->
ctrl->setParameter($this,
'q_id',
'');
440 $ret = $this->$cmd();
444 if (in_array($cmd, [
'editQuestion',
'save',
'suggestedsolution']) && !$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
448 if ($cmd ===
'assessment' &&
449 $this->
object->getType() ===
'tst' &&
450 !$ilAccess->checkAccess(
'write',
'', $this->
object->getRefId())) {
454 $this->
ctrl->setReturn($this,
"questions");
458 $questionGUI->object->setObjId($this->
object->getId());
460 if (in_array($cmd, [
'editQuestion',
'save',
'suggestedsolution']) && $questionGUI->object->isInActiveTest()) {
461 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"question_is_part_of_running_test"),
true);
465 if ($this->
object->getType() ==
'qpl') {
466 $questionGUI->setTaxonomyIds($this->
object->getTaxonomyIds());
469 $questionGUI->addHeaderAction();
472 $questionGUI->setQuestionTabs();
474 $ilHelp = $DIC[
'ilHelp'];
475 $ilHelp->setScreenIdComponent(
"qpl");
476 $ret = $this->
ctrl->forwardCommand($questionGUI);
480 if (!(strtolower($this->qplrequest->raw(
"baseClass")) ==
"iladministrationgui" 481 || strtolower($this->qplrequest->raw(
'baseClass')) ==
'ilrepositorygui')
483 $this->tpl->printToStdout();
490 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_permission"),
true);
491 $target_class = get_class($this->
object) .
"GUI";
492 $this->
ctrl->setParameterByClass($target_class,
'ref_id', $this->ref_id);
493 $this->
ctrl->redirectByClass($target_class);
503 $DIC->ctrl()->redirectByClass(
'ilQuestionPoolExportGUI');
511 $file = explode(
"_", $this->qplrequest->raw(
"file_id"));
512 $fileObj =
new ilObjFile($file[count($file) - 1],
false);
513 $fileObj->sendFile();
540 $_POST[
"filter_text"] =
"";
541 $_POST[
"sel_filter_type"] =
"";
551 $pg_obj->
send_paragraph($this->qplrequest->raw(
"par_id"), $this->qplrequest->raw(
"downloadtitle"));
561 $this->
ctrl->setParameter($this,
'new_type', $this->qplrequest->raw(
'new_type'));
562 if (!isset($_FILES[
'xmldoc']) || !isset($_FILES[
'xmldoc'][
'error']) || $_FILES[
'xmldoc'][
'error'] > UPLOAD_ERR_OK) {
563 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"error_upload"),
true);
564 if (!$questions_only) {
565 $this->
ctrl->redirect($this,
'create');
577 $file = pathinfo($_FILES[
"xmldoc"][
"name"]);
578 $full_path = $basedir .
"/" . $_FILES[
"xmldoc"][
"name"];
580 if (strpos($file[
'filename'],
'qpl') ===
false 581 && strpos($file[
'filename'],
'qti') ===
false) {
582 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'import_file_not_valid'),
true);
583 $cmd = $this->
ctrl->getCmd() ===
'upload' ?
'importQuestions' :
'create';
584 $this->
ctrl->redirect($this, $cmd);
589 $DIC[
'ilLog']->write(__METHOD__ .
": full path " . $full_path);
593 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'import_file_not_valid'),
true);
594 $cmd = $this->
ctrl->getCmd() ===
'upload' ?
'importQuestions' :
'create';
595 $this->
ctrl->redirect($this, $cmd);
598 $DIC[
'ilLog']->write(__METHOD__ .
": full path " . $full_path);
599 if (strcmp($_FILES[
"xmldoc"][
"type"],
"text/xml") == 0) {
600 $qti_file = $full_path;
607 $subdir = basename($file[
"basename"],
"." . $file[
"extension"]);
612 if (!file_exists($qti_file)) {
614 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'cannot_find_xml'),
true);
615 $cmd = $this->
ctrl->getCmd() ===
'upload' ?
'importQuestions' :
'create';
616 $this->
ctrl->redirect($this, $cmd);
620 $qtiParser->startParsing();
621 $founditems = &$qtiParser->getFoundItems();
622 if (count($founditems) == 0) {
628 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"qpl_import_no_items"),
true);
629 if (!$questions_only) {
630 $this->
ctrl->redirect($this,
'create');
637 foreach ($founditems as $item) {
638 if (strlen($item[
"type"])) {
645 if ($complete == 0) {
649 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"qpl_import_non_ilias_files"),
true);
650 if (!$questions_only) {
651 $this->
ctrl->redirect($this,
'create');
660 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.qpl_import_verification.html",
"Modules/TestQuestionPool");
664 foreach ($founditems as $item) {
666 'title' => $item[
'title'],
667 'ident' => $item[
'ident'],
669 switch ($item[
"type"]) {
671 $type = $this->
lng->txt(
"assClozeTest");
674 $type = $this->
lng->txt(
"assImagemapQuestion");
677 $type = $this->
lng->txt(
"assMatchingQuestion");
680 $type = $this->
lng->txt(
"assMultipleChoice");
683 $type = $this->
lng->txt(
"assKprimChoice");
686 $type = $this->
lng->txt(
"assLongMenu");
689 $type = $this->
lng->txt(
"assSingleChoice");
692 $type = $this->
lng->txt(
"assOrderingQuestion");
695 $type = $this->
lng->txt(
"assTextQuestion");
698 $type = $this->
lng->txt(
"assNumeric");
701 $type = $this->
lng->txt(
"assTextSubset");
704 $type = $this->
lng->txt($item[
"type"]);
708 if (strcmp(
$type,
"-" . $item[
"type"] .
"-") == 0) {
710 $component_factory = $DIC[
'component.factory'];
711 $component_repository = $DIC[
"component.repository"];
712 $plugins = $component_repository->getPluginSlotById(
"qst")->getActivePlugins();
713 foreach ($component_factory->getActivePluginsInSlot(
"qst") as $pl) {
714 if (strcmp($pl->getQuestionType(), $item[
"type"]) == 0) {
715 $type = $pl->getQuestionTypeTranslation();
720 $row[
'type'] =
$type;
724 $table->setData(
$rows);
726 if (is_file($xml_file)
727 && !$questions_only) {
728 $this->tpl->setCurrentBlock(
"import_qpl");
730 $fh = @fopen($xml_file,
"r");
731 $xml = @fread($fh, filesize($xml_file));
733 if (preg_match(
"/<ContentObject.*?MetaData.*?General.*?Title[^>]*?>([^<]*?)</",
$xml, $matches)) {
734 $this->tpl->setVariable(
"VALUE_NEW_QUESTIONPOOL", $matches[1]);
737 $this->tpl->setVariable(
"TEXT_CREATE_NEW_QUESTIONPOOL", $this->
lng->txt(
"qpl_import_create_new_qpl"));
738 $this->tpl->parseCurrentBlock();
741 $this->tpl->setCurrentBlock(
"adm_content");
742 $this->tpl->setVariable(
"FOUND_QUESTIONS_INTRODUCTION", $this->
lng->txt(
"qpl_import_verify_found_questions"));
743 if ($questions_only) {
744 $this->tpl->setVariable(
"VERIFICATION_HEADING", $this->
lng->txt(
"import_questions_into_qpl"));
745 $this->tpl->setVariable(
"FORMACTION", $this->
ctrl->getFormAction($this));
747 $this->tpl->setVariable(
"VERIFICATION_HEADING", $this->
lng->txt(
"import_qpl"));
749 $this->
ctrl->setParameter($this,
"new_type", $this->type);
750 $this->tpl->setVariable(
"FORMACTION", $this->
ctrl->getFormAction($this));
753 $value_questions_only = 0;
754 if ($questions_only) {
755 $value_questions_only = 1;
757 $this->tpl->setVariable(
"VALUE_QUESTIONS_ONLY", $value_questions_only);
758 $this->tpl->setVariable(
"VERIFICATION_TABLE", $table->getHtml());
759 $this->tpl->setVariable(
"VERIFICATION_FORM_NAME", $table->getFormName());
761 $this->tpl->parseCurrentBlock();
772 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
773 $this->
ctrl->redirect($this,
'create');
778 if ($this->qplrequest->int(
'questions_only') === 1) {
781 $description = $this->
object->getDescription();
784 $newObj->setType($this->qplrequest->raw(
"new_type"));
785 $newObj->setTitle(
"dummy");
786 $newObj->setDescription(
"questionpool import");
787 $newObj->create(
true);
788 $newObj->createReference();
789 $newObj->putInTree($this->qplrequest->getRefId());
790 $newObj->setPermissions($this->qplrequest->getRefId());
792 $title = $this->qplrequest->raw(
'qpl_new');
798 ilSession::set(
"qpl_import_idents", $this->qplrequest->raw(
"ident"));
802 $imp =
new ilImport($this->qplrequest->getRefId());
804 $map->addMapping(
"Modules/TestQuestionPool",
"qpl",
"new_id", $newObj->getId());
805 $imp->
importObject($newObj, $fullPath, $fileName,
"qpl",
"Modules/TestQuestionPool",
true);
812 $contParser->setQuestionMapping($qtiParser->getImportMapping());
813 $contParser->startParsing();
820 $newObj->setTitle($title);
823 if ($description !== null) {
824 $newObj->setDescription($description);
832 if ($_POST[
"questions_only"] == 1) {
833 $this->
ctrl->redirect($this,
"questions");
835 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_imported"),
true);
837 "&baseClass=ilObjQuestionPoolGUI");
843 if ($_POST[
"questions_only"] == 1) {
844 $this->
ctrl->redirect($this,
"questions");
846 $this->
ctrl->redirect($this,
"cancel");
855 $upload_valid =
true;
857 if ($form->checkInput()) {
859 $form->setValuesByPost();
863 $form->setValuesByPost();
877 $this->tpl->setContent($form->getHtml());
886 $form->setTitle($this->
lng->txt(
'import_question'));
887 $form->setFormAction($this->
ctrl->getFormAction($this,
'upload'));
891 $form->addItem($file);
893 $form->addCommandButton(
'upload', $this->
lng->txt(
'upload'));
894 $form->addCommandButton(
'questions', $this->
lng->txt(
'cancel'));
905 $addContEditMode = $_POST[
'add_quest_cont_edit_mode'];
910 $q_gui->object->setObjId($this->
object->getId());
911 $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
912 $q_gui->object->createNewQuestion();
913 $this->
ctrl->setParameterByClass(get_class($q_gui),
"q_id", $q_gui->object->getId());
914 $this->
ctrl->setParameterByClass(get_class($q_gui),
"sel_question_types", $_POST[
"sel_question_types"]);
915 $this->
ctrl->redirectByClass(get_class($q_gui),
"editQuestion");
923 if (!$this->qplrequest->raw(
'q_id')) {
925 $addContEditMode = $this->qplrequest->raw(
'add_quest_cont_edit_mode');
930 $q_gui->object->setObjId($this->
object->getId());
931 $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
932 $q_gui->object->createNewQuestion();
934 $class = get_class($q_gui);
935 $qId = $q_gui->object->getId();
937 $class = $this->qplrequest->raw(
"sel_question_types") .
'gui';
938 $qId = $this->qplrequest->raw(
'q_id');
941 $this->
ctrl->setParameterByClass($class,
"q_id", $qId);
942 $this->
ctrl->setParameterByClass($class,
"sel_question_types", $this->qplrequest->raw(
"sel_question_types"));
943 $this->
ctrl->setParameterByClass($class,
"prev_qid", $this->qplrequest->raw(
"prev_qid"));
945 $this->
ctrl->redirectByClass($class,
"editQuestion");
955 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
958 "&baseClass=ilObjQuestionPoolGUI");
967 $type = $this->qplrequest->raw(
"sel_question_types");
968 $this->editQuestionForm(
$type);
977 $rbacsystem = $DIC[
'rbacsystem'];
979 $questionIdsToDelete = $this->qplrequest->isset(
'q_id') ? (array) $this->qplrequest->raw(
'q_id') : array();
980 if (0 === count($questionIdsToDelete) && $this->qplrequest->isset(
'q_id')) {
981 $questionIdsToDelete = array($this->qplrequest->getQuestionId());
984 $questionIdsToDelete = array_filter(array_map(
'intval', $questionIdsToDelete));
985 if (0 === count($questionIdsToDelete)) {
986 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"qpl_delete_select_none"),
true);
987 $this->
ctrl->redirect($this,
"questions");
990 $this->tpl->setOnScreenMessage(
'question', $this->
lng->txt(
"qpl_confirm_delete_questions"));
991 $deleteable_questions = &$this->
object->getDeleteableQuestionDetails($questionIdsToDelete);
992 $table_gui =
new ilQuestionBrowserTableGUI($this,
'questions', (($rbacsystem->checkAccess(
'write', $this->qplrequest->getRefId()) ?
true :
false)),
true);
993 $table_gui->setShowRowsSelector(
false);
994 $table_gui->setLimit(PHP_INT_MAX);
995 $table_gui->setEditable($rbacsystem->checkAccess(
'write', $this->qplrequest->getRefId()));
996 $table_gui->setData($deleteable_questions);
997 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
1007 foreach ($_POST[
"q_id"] as
$key => $value) {
1008 $this->
object->deleteQuestion($value);
1009 $this->
object->cleanupClipboard($value);
1011 if (count($_POST[
"q_id"])) {
1012 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"qpl_questions_deleted"),
true);
1015 $this->
ctrl->setParameter($this,
'q_id',
'');
1017 $this->
ctrl->redirect($this,
"questions");
1025 $this->
ctrl->redirect($this,
"questions");
1034 $post = $this->qplrequest->getParsedBody();
1035 if (array_key_exists(
'q_id',
$post) && is_array(
$post[
'q_id']) && count(
$post[
'q_id']) > 0) {
1039 $export_file = $qpl_exp->buildExportFile();
1042 if ($export_file ===
'') {
1043 $export_file =
"StandIn";
1048 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"qpl_export_select_none"),
true);
1050 $this->
ctrl->redirect($this,
"questions");
1056 $enableComments = $DIC->rbac()->system()->checkAccess(
'write', $this->qplrequest->getRefId());
1059 $table_gui->resetOffset();
1060 $table_gui->writeFilterToSession();
1076 $table_gui->resetOffset();
1077 $table_gui->resetFilter();
1086 $this->
ctrl->redirect($this,
'infoScreen');
1094 if (!$this->
access->checkAccess(
"read",
"", $this->qplrequest->getRefId())) {
1099 if (get_class($this->
object) ==
"ilObjTest") {
1100 if ($this->qplrequest->raw(
"calling_test") > 0) {
1101 $ref_id = $this->qplrequest->raw(
"calling_test");
1102 $q_id = $this->qplrequest->raw(
"q_id");
1104 if ($this->qplrequest->raw(
'test_express_mode')) {
1106 ilUtil::redirect(
"ilias.php?ref_id=" .
$ref_id .
"&q_id=" . $q_id .
"&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
1108 ilUtil::redirect(
"ilias.php?ref_id=" .
$ref_id .
"&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
1114 } elseif ($this->qplrequest->isset(
'calling_consumer') && (
int) $this->qplrequest->raw(
'calling_consumer')) {
1115 $ref_id = (
int) $this->qplrequest->raw(
'calling_consumer');
1118 ilUtil::redirect($consumer->getQuestionEditingFormBackTarget($this->qplrequest->raw(
'consumer_context')));
1123 $this->
object->purgeQuestions();
1127 if ($qsaImportFails->failedImportsRegistered()) {
1129 $button->setUrl($this->
ctrl->getLinkTarget($this,
'renoveImportFails'));
1130 $button->setCaption(
'ass_skl_import_fails_remove_btn');
1132 $this->tpl->setOnScreenMessage(
'failure', $qsaImportFails->getFailedImportsMessage($this->lng) .
'<br />' . $button->render());
1137 $table_gui->setPreventDoubleSubmission(
false);
1139 if ($this->rbac_system->checkAccess(
'write', $this->qplrequest->getRefId())) {
1141 $btn->setCaption(
'ass_create_question');
1142 $btn->setUrl($this->
ctrl->getLinkTarget($this,
'createQuestionForm'));
1143 $btn->setPrimary(
true);
1144 $this->
toolbar->addButtonInstance($btn);
1148 $btnImport->setCaption(
'import');
1149 $btnImport->setUrl($this->
ctrl->getLinkTarget($this,
'importQuestions'));
1150 $this->
toolbar->addButtonInstance($btnImport);
1154 $btnPaste->setCaption(
'paste');
1155 $btnPaste->setUrl($this->
ctrl->getLinkTarget($this,
'paste'));
1156 $this->
toolbar->addButtonInstance($btnPaste);
1160 $this->tpl->setContent($this->
ctrl->getHTML($table_gui));
1162 if ($this->
object->getShowTaxonomies()) {
1163 $this->
lng->loadLanguageModule(
'tax');
1165 foreach ($taxIds as $taxId) {
1166 if ($taxId != $this->
object->getNavTaxonomyId()) {
1174 'ilobjquestionpoolgui',
1178 if (!$taxExp->handleCommand()) {
1179 $this->tpl->setLeftContent($taxExp->getHTML() .
" ");
1186 $this->tpl->setPermanentLink($this->
object->getType(), $this->
object->getRefId());
1194 $qId = $this->qplrequest->getQuestionId();
1196 if ($this->
object->checkQuestionParent($qId)) {
1206 $ilHelp = $DIC[
'ilHelp'];
1208 $ilHelp->setScreenId(
'assQuestions');
1211 $ilHelp->setSubScreenId(
'createQuestion_editMode');
1213 $ilHelp->setSubScreenId(
'createQuestion');
1218 $this->tpl->setContent($this->
ctrl->getHTML($form));
1226 $form->setTitle($this->
lng->txt(
'ass_create_question'));
1227 $form->setFormAction($this->
ctrl->getFormAction($this));
1232 foreach ($this->
object->getQuestionTypes(
false,
true,
false) as $translation =>
$data) {
1233 $options[
$data[
'type_tag']] = $translation;
1236 $si->setOptions($options);
1239 $form->addItem($si);
1247 $this->
lng->txt(
'tst_add_quest_cont_edit_mode_IPE'),
1250 $option_ipe->
setInfo($this->
lng->txt(
'tst_add_quest_cont_edit_mode_IPE_info'));
1251 $ri->addOption($option_ipe);
1254 $this->
lng->txt(
'tst_add_quest_cont_edit_mode_RTE'),
1257 $option_rte->
setInfo($this->
lng->txt(
'tst_add_quest_cont_edit_mode_RTE_info'));
1258 $ri->addOption($option_rte);
1262 $form->addItem($ri,
true);
1266 $form->addItem($hi,
true);
1271 $form->addCommandButton(
'createQuestion', $this->
lng->txt(
'create'));
1272 $form->addCommandButton(
'questions', $this->
lng->txt(
'cancel'));
1282 $this->
toolbar->setFormAction($this->
ctrl->getFormAction($this,
'print'));
1285 $mode->setOptions(array(
1286 'overview' => $this->
lng->txt(
'overview'),
1287 'detailed' => $this->
lng->txt(
'detailed_output_solutions'),
1288 'detailed_printview' => $this->
lng->txt(
'detailed_output_printview')
1291 $output = $this->qplrequest->raw(
'output') ??
'';
1295 $this->
toolbar->setFormName(
'printviewOptions');
1296 $this->
toolbar->addInputItem($mode,
true);
1297 $this->
toolbar->addFormButton($this->
lng->txt(
'submit'),
'print');
1299 $data = $this->
object->getPrintviewQuestions();
1302 $totalPoints += $d[
'points'];
1304 $table_gui->setTotalPoints($totalPoints);
1305 $table_gui->initColumns();
1306 $table_gui->setData(
$data);
1307 $this->tpl->setContent($table_gui->getHTML());
1312 $this->
object->update();
1313 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
1322 if ($this->
object->pasteFromClipboard()) {
1323 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"qpl_paste_success"),
true);
1325 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"qpl_paste_error"),
true);
1328 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"qpl_paste_no_objects"),
true);
1330 $this->
ctrl->redirect($this,
"questions");
1338 if (isset($_POST[
"q_id"]) && is_array($_POST[
"q_id"]) && count($_POST[
"q_id"]) > 0) {
1339 foreach ($_POST[
"q_id"] as
$key => $value) {
1340 $this->
object->copyToClipboard($value);
1342 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"qpl_copy_insert_clipboard"),
true);
1343 } elseif ($this->qplrequest->isset(
'q_id') && $this->qplrequest->getQuestionId() > 0) {
1344 $this->
object->copyToClipboard($this->qplrequest->getQuestionId());
1345 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"qpl_copy_insert_clipboard"),
true);
1347 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"qpl_copy_select_none"),
true);
1349 $this->
ctrl->redirect($this,
"questions");
1357 if (isset($_POST[
"q_id"]) && is_array($_POST[
"q_id"]) && count($_POST[
"q_id"]) > 0) {
1358 foreach ($_POST[
"q_id"] as
$key => $value) {
1359 $this->
object->moveToClipboard($value);
1361 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"qpl_move_insert_clipboard"),
true);
1362 } elseif ($this->qplrequest->isset(
'q_id') && $this->qplrequest->getQuestionId() > 0) {
1363 $this->
object->moveToClipboard($this->qplrequest->getQuestionId());
1364 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"qpl_copy_insert_clipboard"),
true);
1366 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"qpl_move_select_none"),
true);
1368 $this->
ctrl->redirect($this,
"questions");
1374 $rbacsystem = $DIC[
'rbacsystem'];
1375 if ($rbacsystem->checkAccess(
"write", $this->qplrequest->getRefId())) {
1376 $question_ids = &$this->
object->getAllQuestionIds();
1378 $qpl_exp->buildExportFile();
1379 $this->
ctrl->redirectByClass(
"ilquestionpoolexportgui",
"");
1402 $this->
ctrl->redirectByClass(get_class($p_gui),
"show");
1408 $form->setTarget(
"_top");
1409 $form->setFormAction($this->
ctrl->getFormAction($this));
1410 $form->setTitle($this->
lng->txt(
"import_qpl"));
1414 $fi->setRequired(
true);
1415 $form->addItem($fi);
1417 $form->addCommandButton(
"importFile", $this->
lng->txt(
"import"));
1418 $form->addCommandButton(
"cancel", $this->
lng->txt(
"cancel"));
1428 if ($_REQUEST[
'new_type'] === null) {
1429 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'import_file_not_valid'),
true);
1430 $this->
ctrl->redirect($this,
'create');
1434 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"),
true);
1435 $this->
ctrl->redirect($this,
'create');
1439 $form = $this->
initImportForm($this->qplrequest->raw(
"new_type"));
1440 if ($form->checkInput()) {
1445 $this->tpl->setContent($form->getHTML());
1451 $ilLocator = $DIC[
'ilLocator'];
1453 switch ($this->
ctrl->getCmd()) {
1459 $this->
ctrl->clearParameterByClass(self::class,
'q_id');
1460 $ilLocator->addItem($this->
object->getTitle(), $this->
ctrl->getLinkTarget($this,
""),
"", $this->qplrequest->getRefId());
1461 $this->
ctrl->setParameter($this,
'q_id', $this->qplrequest->getQuestionId());
1465 if (!is_array($this->qplrequest->raw(
"q_id")) && $this->qplrequest->raw(
"q_id") > 0 && $this->qplrequest->raw(
'cmd') !==
'questions') {
1467 if ($q_gui !== null && $q_gui->object instanceof
assQuestion) {
1468 $q_gui->object->setObjId($this->
object->getId());
1469 $title = $q_gui->object->getTitle();
1473 $ilLocator->addItem($title, $this->
ctrl->getLinkTargetByClass(get_class($q_gui),
"editQuestion"));
1476 $this->
ctrl->setParameter($this,
'q_id',
'');
1477 $this->
ctrl->redirect($this);
1487 parent::setTitleAndDescription();
1489 if (!is_array($this->qplrequest->raw(
"q_id")) && $this->qplrequest->raw(
"q_id") > 0 && $this->qplrequest->raw(
'cmd') !==
'questions') {
1492 $q_gui->object->setObjId($this->
object->getId());
1493 $title = $this->
object->getTitle() .
': ' . $q_gui->object->getTitle();
1497 $this->tpl->setTitle(
1500 self::ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
1503 $this->tpl->setDescription(
1504 $q_gui->object->getDescriptionForHTMLOutput()
1509 $this->
ctrl->setParameter($this,
'q_id',
'');
1510 $this->
ctrl->redirect($this);
1513 $this->tpl->setTitle(
1515 $this->
object->getTitle(),
1516 self::ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
1519 $this->tpl->setDescription(
1521 $this->
object->getLongDescription(),
1522 self::ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
1537 $ilHelp = $DIC[
'ilHelp'];
1539 $currentUserHasWriteAccess = $this->
access->checkAccess(
"write",
"", $this->
object->getRefId());
1540 $currentUserHasReadAccess = $this->
access->checkAccess(
"read",
"", $this->
object->getRefId());
1542 $ilHelp->setScreenIdComponent(
"qpl");
1544 $next_class = strtolower($this->
ctrl->getNextClass());
1545 switch ($next_class) {
1547 case "ilpermissiongui":
1548 case "ilobjectmetadatagui":
1549 case "ilquestionpoolexportgui":
1550 case "ilquestionpoolskilladministrationgui":
1553 case 'ilobjtaxonomygui':
1554 case 'ilobjquestionpoolsettingsgeneralgui':
1556 if ($currentUserHasWriteAccess) {
1567 $force_active =
false;
1570 if (is_array($commands)) {
1571 foreach ($commands as
$key => $value) {
1572 if (preg_match(
"/^delete_.*/",
$key, $matches) ||
1573 preg_match(
"/^addSelectGap_.*/",
$key, $matches) ||
1574 preg_match(
"/^addTextGap_.*/",
$key, $matches) ||
1575 preg_match(
"/^deleteImage_.*/",
$key, $matches) ||
1576 preg_match(
"/^upload_.*/",
$key, $matches) ||
1577 preg_match(
"/^addSuggestedSolution_.*/",
$key, $matches)
1579 $force_active =
true;
1583 if (isset($_POST[
'imagemap_x'])) {
1584 $force_active =
true;
1586 if (!$force_active) {
1587 $force_active = ((strtolower($this->
ctrl->getCmdClass()) == strtolower(get_class($this)) || strlen($this->
ctrl->getCmdClass()) == 0) &&
1588 $this->
ctrl->getCmd() ==
"")
1592 if ($currentUserHasReadAccess) {
1593 $this->tabs_gui->addTarget(
1595 $this->
ctrl->getLinkTarget($this,
"questions"),
1596 array(
"questions",
"filter",
"resetFilter",
"createQuestion",
1597 "importQuestions",
"deleteQuestions",
"filterQuestionBrowser",
1598 "view",
"preview",
"editQuestion",
"exec_pg",
1599 "addItem",
"upload",
"save",
"cancel",
"addSuggestedSolution",
1600 "cancelExplorer",
"linkChilds",
"removeSuggestedSolution",
1601 "add",
"addYesNo",
"addTrueFalse",
"createGaps",
"saveEdit",
1602 "setMediaMode",
"uploadingImage",
"uploadingImagemap",
"addArea",
1603 "deletearea",
"saveShape",
"back",
"addPair",
"uploadingJavaapplet",
1604 "addParameter",
"assessment",
"addGIT",
"addST",
"addPG",
"delete",
1605 "toggleGraphicalAnswers",
"deleteAnswer",
"deleteImage",
"removeJavaapplet"),
1611 if ($currentUserHasReadAccess) {
1612 $this->tabs_gui->addTarget(
1614 $this->
ctrl->getLinkTarget($this,
"infoScreen"),
1615 array(
"infoScreen",
"showSummary")
1619 if ($currentUserHasWriteAccess) {
1621 $this->tabs_gui->addTarget(
1623 $this->
ctrl->getLinkTargetByClass(
'ilObjQuestionPoolSettingsGeneralGUI'),
1625 array(
'ilObjQuestionPoolSettingsGeneralGUI',
'ilObjTaxonomyGUI')
1630 $link = $this->
ctrl->getLinkTargetByClass(
1631 array(
'ilQuestionPoolSkillAdministrationGUI',
'ilAssQuestionSkillAssignmentsGUI'),
1635 $this->tabs_gui->addTarget(
'qpl_tab_competences', $link, array(), array());
1639 if ($currentUserHasReadAccess) {
1641 $this->tabs_gui->addTarget(
1643 $this->
ctrl->getLinkTarget($this,
'print'),
1650 if ($currentUserHasWriteAccess) {
1652 $mdtab = $mdgui->getTab();
1654 $this->tabs_gui->addTarget(
1663 if ($currentUserHasWriteAccess) {
1664 $this->tabs_gui->addTarget(
1666 $this->
ctrl->getLinkTargetByClass(
"ilquestionpoolexportgui",
""),
1668 "ilquestionpoolexportgui" 1672 if ($this->
access->checkAccess(
"edit_permission",
"", $this->object->getRefId())) {
1673 $this->tabs_gui->addTarget(
1675 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
1676 array(
"perm",
"info",
"owner"),
1688 if (!$this->
object->isSkillServiceEnabled()) {
1702 'qpl_settings_subtab_general',
1703 $this->
ctrl->getLinkTargetByClass(
'ilObjQuestionPoolSettingsGeneralGUI'),
1705 'ilObjQuestionPoolSettingsGeneralGUI' 1709 'qpl_settings_subtab_taxonomies',
1710 $this->
ctrl->getLinkTargetByClass(
'ilObjTaxonomyGUI',
'editAOTaxonomySettings'),
1723 $this->
ctrl->setCmd(
"showSummary");
1724 $this->
ctrl->setCmdClass(
"ilinfoscreengui");
1733 if (!$this->
access->checkAccess(
"visible",
"", $this->ref_id)) {
1734 $this->error->raiseError($this->
lng->txt(
"msg_no_perm_read"));
1737 $info->enablePrivateNotes();
1740 $info->addMetaDataSections($this->
object->getId(), 0, $this->
object->getType());
1742 $this->
ctrl->forwardCommand($info);
1753 public static function _goto($a_target): void
1756 $main_tpl = $DIC->ui()->mainTemplate();
1757 $ilAccess = $DIC[
'ilAccess'];
1760 $ctrl = $DIC[
'ilCtrl'];
1762 if ($ilAccess->checkAccess(
"write",
"", (
int) $a_target)
1763 || $ilAccess->checkAccess(
'read',
'', (
int) $a_target)
1765 $target_class = ilObjQuestionPoolGUI::class;
1766 $target_cmd =
'questions';
1771 if ($ilAccess->checkAccess(
'visible',
"", $a_target)) {
1776 $main_tpl->setOnScreenMessage(
1779 $lng->
txt(
"msg_no_perm_read_item"),
1800 $rbacsystem = $DIC[
'rbacsystem'];
1801 $ilDB = $DIC[
'ilDB'];
1804 $component_repository = $DIC[
'component.repository'];
1806 $writeAccess = (bool) $rbacsystem->checkAccess(
'write', $this->qplrequest->getRefId());
1807 $enableCommenting = $writeAccess;
1818 $table_gui->setEditable($writeAccess);
1823 $component_repository
1825 $questionList->setParentObjId($this->
object->getId());
1827 foreach ($table_gui->getFilterItems() as $item) {
1828 if (substr($item->getPostVar(), 0, strlen(
'tax_')) ==
'tax_') {
1829 $v = $item->getValue();
1831 if (is_array($v) && count($v) && !(
int) $v[0]) {
1835 $taxId = substr($item->getPostVar(), strlen(
'tax_'));
1837 $questionList->addTaxonomyFilter(
1840 $this->
object->getId(),
1841 $this->
object->getType()
1843 } elseif ($item->getValue() !=
false) {
1844 $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
1848 if ($this->
object->isNavTaxonomyActive() && (
int) $this->qplrequest->raw(
'tax_node')) {
1852 if ((
int) $this->qplrequest->raw(
'tax_node') != $rootNodeId) {
1853 $questionList->addTaxonomyFilter(
1854 $this->
object->getNavTaxonomyId(),
1855 array((
int) $this->qplrequest->raw(
'tax_node')),
1857 $this->
object->getType()
1862 $questionList->load();
1863 $data = $questionList->getQuestionDataArray();
1865 $table_gui->setQuestionData(
$data);
const MATCHING_QUESTION_IDENTIFIER
const MULTIPLE_CHOICE_QUESTION_IDENTIFIER
const ADDITIONAL_CONTENT_EDITING_MODE_IPE
static _goto($a_target)
Redirect script to call a test with the question pool reference id.
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)
& createQuestionForTestObject()
create new question
afterSave(ilObject $new_object)
save object public
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
createQuestionFormObject()
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...
copyObject()
copy one or more question objects to the clipboard
confirmDeleteQuestionsObject()
delete questions
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...
filterObject()
set question list filter
Abstract basic class which is to be extended by the concrete assessment question type classes...
prepareOutput(bool $show_sub_objects=true)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS TestQuestionPool InternalRequestService $qplrequest
const KPRIM_CHOICE_QUESTION_IDENTIFIER
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getQuestionTypeName($type_tag)
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
__construct()
Constructor public.
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...
setParameterByClass(string $a_class, string $a_parameter, $a_value)
static getUsageOfObject(int $a_obj_id, bool $a_include_titles=false)
loadLanguageModule(string $a_module)
Load language module.
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
filterQuestionBrowserObject()
exportObject()
Gateway for exports initiated from workspace, as there is a generic forward to {objTypeMainGUI}::expo...
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.
importObject(?object $a_new_obj, string $a_tmp_file, string $a_filename, string $a_type, string $a_comp="", bool $a_copy_file=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static unzip(string $path_to_zip_file, bool $overwrite_existing=false, bool $unpack_flat=false)
addSubTabTarget(string $a_text, string $a_link, $a_cmd="", $a_cmdClass="", string $a_frame="", bool $a_activate=false, bool $a_dir_text=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.
resetQuestionBrowserObject()
& editQuestionForTestObject()
edit question
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...
ilGlobalTemplateInterface $tpl
deleteQuestionsObject()
delete questions confirmation screen
deleteRegisteredImportFails()
getQueryParamString(string $param)
static _lookupTitle(int $obj_id)
const NUMERIC_QUESTION_IDENTIFIER
setContent(string $a_html)
Sets content for standard template.
initImportForm(string $new_type)
setTitleAndDescription()
called by prepare output
buildQuestionBrowserTableGUI($taxIds)
questionsObject()
list questions of question pool
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
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
createQuestionObject()
create new question
downloadFileObject()
download file
cancelDeleteQuestionsObject()
Cancel question deletion.
Legacy Content Object Parser.
static _setImportDirectory($a_import_dir=null)
set import directory
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 _getLink(?int $a_ref_id, string $a_type='', array $a_params=array(), string $append="")
static getSyntaxStylePath()
importVerifiedFileObject()
imports question(s) into the questionpool (after verification)
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)
const EDIT_CONTEXT_AUTHORING
moveObject()
mark one or more question objects for moving
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...
fullscreenObject()
show fullscreen view
printObject()
Creates a print view for a question pool.
fetchAuthoringQuestionIdParamater()
static isSkillManagementGloballyActivated()
__construct(Container $dic, ilPlugin $plugin)
const ADDITIONAL_CONTENT_EDITING_MODE_RTE
getQueryParamInt(string $param)
pasteObject()
paste questios from the clipboard into the question pool
initQuestion($questionId, $parentObjId)
static isAdditionalQuestionContentEditingModePageObjectEnabled()
Returns the fact wether content editing with ilias page editor is enabled for questions or not...
resetFilterObject()
resets filter
exportQuestionObject()
export question
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
infoScreenForward()
show information screen
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()
static _createImportDirectory()
creates data directory for import files (data_dir/qpl_data/qpl_<id>/import, depending on data directo...
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)
send_paragraph(string $par_id, string $filename)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
const IMAGEMAP_QUESTION_IDENTIFIER