ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilObjQuestionPoolGUI.php
Go to the documentation of this file.
1<?php
18require_once './Services/Object/classes/class.ilObjectGUI.php';
19require_once './Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
20require_once './Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
21require_once './Modules/TestQuestionPool/exceptions/class.ilTestQuestionPoolException.php';
22require_once './Modules/Test/classes/inc.AssessmentConstants.php';
23require_once './Modules/Test/classes/class.ilObjAssessmentFolder.php';
24require_once './Modules/Test/classes/class.ilObjTest.php';
25
50{
54 public $object;
55
57 private $error;
58
62 protected $refinery;
63
68 public function __construct()
69 {
70 global $DIC;
71 $lng = $DIC['lng'];
72 $ilCtrl = $DIC['ilCtrl'];
73 $rbacsystem = $DIC['rbacsystem'];
74 $lng->loadLanguageModule("assessment");
75 $this->type = "qpl";
76 $this->error = $DIC['ilErr'];
77 $this->ctrl = &$ilCtrl;
78 $this->refinery = $DIC['refinery'];
79
80 $this->ctrl->saveParameter($this, array(
81 "ref_id", "test_ref_id", "calling_test", "test_express_mode", "q_id", 'tax_node', 'calling_consumer', 'consumer_context'
82 ));
83 $this->ctrl->saveParameter($this, "calling_consumer");
84 $this->ctrl->saveParameterByClass('ilAssQuestionPageGUI', 'calling_consumer');
85 $this->ctrl->saveParameterByClass('ilAssQuestionPageGUI', 'consumer_context');
86 $this->ctrl->saveParameterByClass('ilobjquestionpoolgui', 'calling_consumer');
87 $this->ctrl->saveParameterByClass('ilobjquestionpoolgui', 'consumer_context');
88
89 parent::__construct("", $_GET["ref_id"], true, false);
90 }
91
104 public function executeCommand()
105 {
106 global $DIC;
107 $ilUser = $DIC['ilUser'];
108 $ilLocator = $DIC['ilLocator'];
109 $ilAccess = $DIC['ilAccess'];
110 $ilNavigationHistory = $DIC['ilNavigationHistory'];
111 $tpl = $DIC['tpl'];
112 $ilCtrl = $DIC['ilCtrl'];
113 $ilErr = $DIC['ilErr'];
114 $ilTabs = $DIC['ilTabs'];
115 $lng = $DIC['lng'];
116 $ilDB = $DIC['ilDB'];
117 $ilPluginAdmin = $DIC['ilPluginAdmin'];
118 $ilias = $DIC['ilias'];
119
120 $writeAccess = $ilAccess->checkAccess("write", "", $_GET["ref_id"]);
121
122 if ((!$ilAccess->checkAccess("read", "", $_GET["ref_id"])) && (!$ilAccess->checkAccess("visible", "", $_GET["ref_id"]))) {
123 global $DIC;
124 $ilias = $DIC['ilias'];
125 $ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE);
126 }
127
128 // add entry to navigation history
129 if (!$this->getCreationMode() &&
130 $ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
131 if ('qpl' == $this->object->getType()) {
132 $ilNavigationHistory->addItem(
133 $_GET["ref_id"],
134 "ilias.php?baseClass=ilObjQuestionPoolGUI&cmd=questions&ref_id=" . $_GET["ref_id"],
135 "qpl"
136 );
137 }
138 }
139
140 $cmd = $this->ctrl->getCmd("questions");
141 $next_class = $this->ctrl->getNextClass($this);
142
143 if (in_array($next_class, array('', 'ilobjquestionpoolgui')) && $cmd == 'questions') {
144 $_GET['q_id'] = '';
145 }
146
147 $this->prepareOutput();
148
149 $this->ctrl->setReturn($this, "questions");
150
151 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
152
153 if ($_GET["q_id"] < 1) {
154 $q_type = ($_POST["sel_question_types"] != "")
155 ? $_POST["sel_question_types"]
156 : $_GET["sel_question_types"];
157 }
158 if ($cmd != "createQuestion" && $cmd != "createQuestionForTest"
159 && $next_class != "ilassquestionpagegui") {
160 if (($_GET["test_ref_id"] != "") or ($_GET["calling_test"])) {
161 $ref_id = $_GET["test_ref_id"];
162 if (!$ref_id) {
163 $ref_id = $_GET["calling_test"];
164 }
165 }
166 }
167 switch ($next_class) {
168 case "ilcommonactiondispatchergui":
169 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
171 $this->ctrl->forwardCommand($gui);
172 break;
173
174 case 'ilobjectmetadatagui':
175 if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
176 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
177 }
178 include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
179 $md_gui = new ilObjectMetaDataGUI($this->object);
180 $this->ctrl->forwardCommand($md_gui);
181 break;
182
183 case 'ilassquestionpreviewgui':
184 if (!$ilAccess->checkAccess('read', '', $this->object->getRefId())) {
186 }
187
188 $this->ctrl->saveParameter($this, "q_id");
189
190 $gui = new ilAssQuestionPreviewGUI(
191 $this->ctrl,
192 $this->tabs_gui,
193 $this->tpl,
194 $this->lng,
195 $ilDB,
196 $ilUser,
197 $DIC->rbac()
198 );
199
200 $gui->initQuestion((int) $_GET['q_id'], $this->object->getId());
201 $gui->initPreviewSettings($this->object->getRefId());
202 $gui->initPreviewSession($ilUser->getId(), $this->fetchAuthoringQuestionIdParamater());
203 $gui->initHintTracking();
204
205 global $DIC;
206 $ilHelp = $DIC['ilHelp'];
207 $ilHelp->setScreenIdComponent("qpl");
208
209 $this->ctrl->forwardCommand($gui);
210 break;
211
212 case "ilassquestionpagegui":
213 if ($cmd == 'finishEditing') {
214 $this->ctrl->redirectByClass('ilassquestionpreviewgui', 'show');
215 break;
216 }
217 if ($cmd === 'edit' && !$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
219 }
220
221 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
222 $this->tpl->setCurrentBlock("ContentStyle");
223 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
224 $this->tpl->parseCurrentBlock();
225
226 // syntax style
227 $this->tpl->setCurrentBlock("SyntaxStyle");
228 $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
229 $this->tpl->parseCurrentBlock();
230
231 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
233 $q_gui->setRenderPurpose(assQuestionGUI::RENDER_PURPOSE_PREVIEW);
234 $q_gui->setQuestionTabs();
235 $q_gui->outAdditionalOutput();
236 $q_gui->object->setObjId($this->object->getId());
237
238 $q_gui->setTargetGuiClass(null);
239 $q_gui->setQuestionActionCmd(null);
240
241 if ($this->object->getType() == 'qpl') {
242 $q_gui->addHeaderAction();
243 }
244
245 $question = $q_gui->object;
246
247 if ($question->isInActiveTest()) {
248 ilUtil::sendFailure($this->lng->txt("question_is_part_of_running_test"), true);
249 $this->ctrl->redirectByClass('ilAssQuestionPreviewGUI', ilAssQuestionPreviewGUI::CMD_SHOW);
250 }
251
252 $this->ctrl->saveParameter($this, "q_id");
253 include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
254 $this->lng->loadLanguageModule("content");
255 $this->ctrl->setReturnByClass("ilAssQuestionPageGUI", "view");
256 $this->ctrl->setReturn($this, "questions");
257 $page_gui = new ilAssQuestionPageGUI($_GET["q_id"]);
258 $page_gui->obj->addUpdateListener(
259 $question,
260 'updateTimestamp'
261 );
262 $page_gui->setEditPreview(true);
263 $page_gui->setEnabledTabs(false);
264 if (strlen($this->ctrl->getCmd()) == 0 && !isset($_POST["editImagemapForward_x"])) { // workaround for page edit imagemaps, keep in mind
265 $this->ctrl->setCmdClass(get_class($page_gui));
266 $this->ctrl->setCmd("preview");
267 }
268 $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(true)));
269 $page_gui->setTemplateTargetVar("ADM_CONTENT");
270 $page_gui->setOutputMode("edit");
271 $page_gui->setHeader($question->getTitle());
272 $page_gui->setPresentationTitle($question->getTitle());
273 $ret = $this->ctrl->forwardCommand($page_gui);
274 if ($ret != "") {
275 $tpl->setContent($ret);
276 }
277 break;
278
279 case 'ilpermissiongui':
280 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
281 $perm_gui = new ilPermissionGUI($this);
282 $ret = $this->ctrl->forwardCommand($perm_gui);
283 break;
284
285 case 'ilobjectcopygui':
286 include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
287 $cp = new ilObjectCopyGUI($this);
288 $cp->setType('qpl');
289 $this->ctrl->forwardCommand($cp);
290 break;
291
292 case "ilquestionpoolexportgui":
293 require_once 'Modules/TestQuestionPool/classes/class.ilQuestionPoolExportGUI.php';
294 $exp_gui = new ilQuestionPoolExportGUI($this);
295 $exp_gui->addFormat('xml', $this->lng->txt('qpl_export_xml'));
296 $exp_gui->addFormat('xls', $this->lng->txt('qpl_export_excel'), $this, 'createExportExcel');
297 $ret = $this->ctrl->forwardCommand($exp_gui);
298 break;
299
300 case "ilinfoscreengui":
301 $this->infoScreenForward();
302 break;
303
304 case 'ilassquestionhintsgui':
305 if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
307 }
308 // set return target
309 $this->ctrl->setReturn($this, "questions");
310
311 // set context tabs
312 require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
314 $questionGUI->object->setObjId($this->object->getId());
315 $questionGUI->setQuestionTabs();
316
317 if ($questionGUI->object->isInActiveTest()) {
318 ilUtil::sendFailure($this->lng->txt("question_is_part_of_running_test"), true);
319 $this->ctrl->redirectByClass('ilAssQuestionPreviewGUI', ilAssQuestionPreviewGUI::CMD_SHOW);
320 }
321
322 $ilHelp = $DIC['ilHelp'];
323 $ilHelp->setScreenIdComponent("qpl");
324
325 if ($this->object->getType() == 'qpl' && $writeAccess) {
326 $questionGUI->addHeaderAction();
327 }
328
329 // forward to ilAssQuestionHintsGUI
330 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
331 $gui = new ilAssQuestionHintsGUI($questionGUI);
332
333 $gui->setEditingEnabled(
334 $DIC->access()->checkAccess('write', '', $this->object->getRefId())
335 );
336
337 $ilCtrl->forwardCommand($gui);
338
339 break;
340
341 case 'illocalunitconfigurationgui':
342 if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
343 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
344 }
345
346 require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
348 $questionGUI->object->setObjId($this->object->getId());
349 $questionGUI->setQuestionTabs();
350
351 $this->ctrl->setReturn($this, 'questions');
352
353 require_once 'Modules/TestQuestionPool/classes/class.ilLocalUnitConfigurationGUI.php';
354 require_once 'Modules/TestQuestionPool/classes/class.ilUnitConfigurationRepository.php';
356 new ilUnitConfigurationRepository((int) $_GET['q_id'])
357 );
358 $ilCtrl->forwardCommand($gui);
359 break;
360
361 case 'ilassquestionfeedbackeditinggui':
362 if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
364 }
365
366 // set return target
367 $this->ctrl->setReturn($this, "questions");
368
369 // set context tabs
370 require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
372 $questionGUI->object->setObjId($this->object->getId());
373 $questionGUI->setQuestionTabs();
374
375 if ($questionGUI->object->isInActiveTest()) {
376 ilUtil::sendFailure($this->lng->txt("question_is_part_of_running_test"), true);
377 $this->ctrl->redirectByClass('ilAssQuestionPreviewGUI', ilAssQuestionPreviewGUI::CMD_SHOW);
378 }
379
380 $ilHelp = $DIC['ilHelp'];
381 $ilHelp->setScreenIdComponent("qpl");
382
383 if ($this->object->getType() == 'qpl' && $writeAccess) {
384 $questionGUI->addHeaderAction();
385 }
386
387 // forward to ilAssQuestionFeedbackGUI
388 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
389 $gui = new ilAssQuestionFeedbackEditingGUI($questionGUI, $ilCtrl, $ilAccess, $tpl, $ilTabs, $lng);
390 $ilCtrl->forwardCommand($gui);
391
392 break;
393
394 case 'ilobjquestionpoolsettingsgeneralgui':
395 require_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPoolSettingsGeneralGUI.php';
396 $gui = new ilObjQuestionPoolSettingsGeneralGUI($ilCtrl, $ilAccess, $lng, $tpl, $ilTabs, $this);
397 $this->ctrl->forwardCommand($gui);
398 break;
399
400 case "ilobjtaxonomygui":
401 if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
403 }
405 $this->object,
406 $ilDB,
407 $this->refinery,
408 $ilPluginAdmin,
409 $ilCtrl,
410 $ilTabs,
411 $lng
412 );
413
414 $forwarder->forward();
415
416 break;
417
418 case 'ilquestionpoolskilladministrationgui':
419
420 require_once 'Modules/TestQuestionPool/classes/class.ilQuestionPoolSkillAdministrationGUI.php';
422 $ilias,
423 $ilCtrl,
424 $ilAccess,
425 $ilTabs,
426 $tpl,
427 $lng,
428 $ilDB,
429 $ilPluginAdmin,
430 $this->object,
431 $this->ref_id
432 );
433
434 $this->ctrl->forwardCommand($gui);
435
436 break;
437
438 case 'ilquestionbrowsertablegui':
439 $this->ctrl->forwardCommand($this->buildQuestionBrowserTableGUI($taxIds = array())); // no tax ids required
440 break;
441
442 case "ilobjquestionpoolgui":
443 case "":
444
445 if ($cmd == 'questions') {
446 $this->ctrl->setParameter($this, 'q_id', '');
447 }
448
449 $cmd .= "Object";
450 $ret = $this->$cmd();
451 break;
452
453 default:
454 if (in_array($cmd, ['editQuestion', 'save', 'suggestedsolution']) && !$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
456 }
457
458 if ($cmd === 'assessment' &&
459 $this->object->getType() === 'tst' &&
460 !$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
462 }
463
464 $this->ctrl->setReturn($this, "questions");
465 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
467 $questionGUI->setEditContext(assQuestionGUI::EDIT_CONTEXT_AUTHORING);
468 $questionGUI->object->setObjId($this->object->getId());
469
470 if (in_array($cmd, ['editQuestion', 'save', 'suggestedsolution']) && $questionGUI->object->isInActiveTest()) {
471 ilUtil::sendFailure($this->lng->txt("question_is_part_of_running_test"), true);
472 $this->ctrl->redirectByClass('ilAssQuestionPreviewGUI', ilAssQuestionPreviewGUI::CMD_SHOW);
473 }
474
475 if ($this->object->getType() == 'qpl') {
476 $questionGUI->setTaxonomyIds($this->object->getTaxonomyIds());
477 $this->object->addQuestionChangeListeners($questionGUI->object);
478 if ($writeAccess) {
479 $questionGUI->addHeaderAction();
480 }
481 }
482 $questionGUI->setQuestionTabs();
483
484 $ilHelp = $DIC['ilHelp'];
485 $ilHelp->setScreenIdComponent("qpl");
486 $ret = $this->ctrl->forwardCommand($questionGUI);
487 break;
488 }
489
490 if (!(strtolower($_GET["baseClass"]) == "iladministrationgui"
491 || strtolower($_GET['baseClass']) == 'ilrepositorygui')
492 && $this->getCreationMode() != true) {
493 $this->tpl->printToStdout();
494 }
495 }
496
497
498 protected function redirectAfterMissingWrite()
499 {
500 ilUtil::sendFailure($this->lng->txt("no_permission"), true);
501 $target_class = get_class($this->object) . "GUI";
502 $this->ctrl->setParameterByClass($target_class, 'ref_id', $this->ref_id);
503 $this->ctrl->redirectByClass($target_class);
504 }
505
510 protected function exportObject()
511 {
512 global $DIC; /* @var ILIAS\DI\Container $DIC */
513 $DIC->ctrl()->redirectByClass('ilQuestionPoolExportGUI');
514 }
515
519 public function downloadFileObject()
520 {
521 $file = explode("_", $_GET["file_id"]);
522 include_once("./Modules/File/classes/class.ilObjFile.php");
523 $fileObj = new ilObjFile($file[count($file) - 1], false);
524 $fileObj->sendFile();
525 exit;
526 }
527
531 public function fullscreenObject()
532 {
533 include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
534 $page_gui = new ilAssQuestionPageGUI($_GET["pg_id"]);
535 $page_gui->showMediaFullscreen();
536 }
537
538
542 public function filterObject()
543 {
544 $this->questionsObject();
545 }
546
550 public function resetFilterObject()
551 {
552 $_POST["filter_text"] = "";
553 $_POST["sel_filter_type"] = "";
554 $this->questionsObject();
555 }
556
560 public function download_paragraphObject()
561 {
562 include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php");
563 $pg_obj = new ilAssQuestionPage($_GET["pg_id"]);
564 $pg_obj->send_paragraph($_GET["par_id"], $_GET["downloadtitle"]);
565 exit;
566 }
567
571 public function uploadQplObject($questions_only = false)
572 {
573 $this->ctrl->setParameter($this, 'new_type', $_REQUEST['new_type']);
574 if ($_FILES["xmldoc"]["error"] > UPLOAD_ERR_OK) {
575 ilUtil::sendFailure($this->lng->txt("error_upload"), true);
576 if (!$questions_only) {
577 $this->ctrl->redirect($this, 'create');
578 }
579 return false;
580 }
581 // create import directory
582 include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
584
585 global $DIC; /* @var ILIAS\DI\Container $DIC */
586 // copy uploaded file to import directory
587 $file = pathinfo($_FILES["xmldoc"]["name"]);
588
589 $full_path = $basedir . "/" . $_FILES["xmldoc"]["name"];
590
591 if (strpos($file['filename'], 'qpl') === false
592 && strpos($file['filename'], 'qti') === false) {
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);
596 return;
597 }
598
599
600 $DIC['ilLog']->write(__METHOD__ . ": full path " . $full_path);
601
602 ilUtil::moveUploadedFile($_FILES["xmldoc"]["tmp_name"], $_FILES["xmldoc"]["name"], $full_path);
603
604 if (strcmp($_FILES["xmldoc"]["type"], "text/xml") == 0) {
605 $qti_file = $full_path;
607 } else {
608 // unzip file
609 ilUtil::unzip($full_path);
610
611 // determine filenames of xml files
612 $subdir = basename($file["basename"], "." . $file["extension"]);
614 $xml_file = ilObjQuestionPool::_getImportDirectory() . '/' . $subdir . '/' . $subdir . ".xml";
615 $qti_file = ilObjQuestionPool::_getImportDirectory() . '/' . $subdir . '/' . str_replace("qpl", "qti", $subdir) . ".xml";
616 }
617
618 if (!file_exists($qti_file)) {
619 ilUtil::delDir($basedir);
620 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('cannot_find_xml'), true);
621 $cmd = $this->ctrl->getCmd() === 'upload' ? 'importQuestions' : 'create';
622 $this->ctrl->redirect($this, $cmd);
623 return false;
624 }
625
626 $qtiParser = new ilQTIParser($qti_file, IL_MO_VERIFY_QTI, 0, "");
627 $result = $qtiParser->startParsing();
628 $founditems = &$qtiParser->getFoundItems();
629 if (count($founditems) == 0) {
630 // nothing found
631
632 // delete import directory
633 ilUtil::delDir($basedir);
634
635 ilUtil::sendFailure($this->lng->txt("qpl_import_no_items"), true);
636 if (!$questions_only) {
637 $this->ctrl->redirect($this, 'create');
638 }
639 return false;
640 }
641
642 $complete = 0;
643 $incomplete = 0;
644 foreach ($founditems as $item) {
645 if (strlen($item["type"])) {
646 $complete++;
647 } else {
648 $incomplete++;
649 }
650 }
651
652 if ($complete == 0) {
653 // delete import directory
654 ilUtil::delDir($basedir);
655
656 ilUtil::sendFailure($this->lng->txt("qpl_import_non_ilias_files"), true);
657 if (!$questions_only) {
658 $this->ctrl->redirect($this, 'create');
659 }
660 return false;
661 }
662
663 $_SESSION["qpl_import_xml_file"] = $xml_file;
664 $_SESSION["qpl_import_qti_file"] = $qti_file;
665 $_SESSION["qpl_import_subdir"] = $subdir;
666
667 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.qpl_import_verification.html", "Modules/TestQuestionPool");
668
669 require_once 'Modules/TestQuestionPool/classes/tables/class.ilQuestionPoolImportVerificationTableGUI.php';
670 $table = new ilQuestionPoolImportVerificationTableGUI($this, 'uploadQplObject');
671 $rows = array();
672
673 foreach ($founditems as $item) {
674 $row = array(
675 'title' => $item['title'],
676 'ident' => $item['ident'],
677 );
678
679 include_once "./Services/QTI/classes/class.ilQTIItem.php";
680 switch ($item["type"]) {
682 $type = $this->lng->txt("assClozeTest");
683 break;
685 $type = $this->lng->txt("assImagemapQuestion");
686 break;
688 $type = $this->lng->txt("assJavaApplet");
689 break;
691 $type = $this->lng->txt("assMatchingQuestion");
692 break;
694 $type = $this->lng->txt("assMultipleChoice");
695 break;
697 $type = $this->lng->txt("assKprimChoice");
698 break;
700 $type = $this->lng->txt("assLongMenu");
701 break;
703 $type = $this->lng->txt("assSingleChoice");
704 break;
706 $type = $this->lng->txt("assOrderingQuestion");
707 break;
709 $type = $this->lng->txt("assTextQuestion");
710 break;
712 $type = $this->lng->txt("assNumeric");
713 break;
715 $type = $this->lng->txt("assTextSubset");
716 break;
717 default:
718 $type = $this->lng->txt($item["type"]);
719 break;
720 }
721
722 if (strcmp($type, "-" . $item["type"] . "-") == 0) {
723 global $DIC;
724 $ilPluginAdmin = $DIC['ilPluginAdmin'];
725 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_MODULE, "TestQuestionPool", "qst");
726 foreach ($pl_names as $pl_name) {
727 $pl = ilPlugin::getPluginObject(IL_COMP_MODULE, "TestQuestionPool", "qst", $pl_name);
728 if (strcmp($pl->getQuestionType(), $item["type"]) == 0) {
729 $type = $pl->getQuestionTypeTranslation();
730 }
731 }
732 }
733
734 $row['type'] = $type;
735
736 $rows[] = $row;
737 }
738 $table->setData($rows);
739
740 if (is_file($xml_file)
741 && !$questions_only) {
742 $this->tpl->setCurrentBlock("import_qpl");
743 // read file into a string
744 $fh = @fopen($xml_file, "r");
745 $xml = @fread($fh, filesize($xml_file));
746 @fclose($fh);
747 if (preg_match("/<ContentObject.*?MetaData.*?General.*?Title[^>]*?>([^<]*?)</", $xml, $matches)) {
748 $this->tpl->setVariable("VALUE_NEW_QUESTIONPOOL", $matches[1]);
749 }
750
751 $this->tpl->setVariable("TEXT_CREATE_NEW_QUESTIONPOOL", $this->lng->txt("qpl_import_create_new_qpl"));
752 $this->tpl->parseCurrentBlock();
753 }
754
755 $this->tpl->setCurrentBlock("adm_content");
756 $this->tpl->setVariable("FOUND_QUESTIONS_INTRODUCTION", $this->lng->txt("qpl_import_verify_found_questions"));
757 if ($questions_only) {
758 $this->tpl->setVariable("VERIFICATION_HEADING", $this->lng->txt("import_questions_into_qpl"));
759 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
760 } else {
761 $this->tpl->setVariable("VERIFICATION_HEADING", $this->lng->txt("import_qpl"));
762
763 $this->ctrl->setParameter($this, "new_type", $this->type);
764 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
765 }
766
767 $value_questions_only = 0;
768 if ($questions_only) {
769 $value_questions_only = 1;
770 }
771 $this->tpl->setVariable("VALUE_QUESTIONS_ONLY", $value_questions_only);
772 $this->tpl->setVariable("VERIFICATION_TABLE", $table->getHtml());
773 $this->tpl->setVariable("VERIFICATION_FORM_NAME", $table->getFormName());
774
775 $this->tpl->parseCurrentBlock();
776
777 return true;
778 }
779
783 public function importVerifiedFileObject()
784 {
785 $title = '';
786 $description = null;
787 if ($_POST['questions_only'] == 1) {
788 $newObj = $this->object;
789 $title = $this->object->getTitle();
790 $description = $this->object->getDescription();
791 } else {
792 include_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
793 $newObj = new ilObjQuestionPool(0, true);
794 $newObj->setType($_GET["new_type"]);
795 $newObj->setTitle("dummy");
796 $newObj->setDescription("questionpool import");
797 $newObj->create(true);
798 $newObj->createReference();
799 $newObj->putInTree($_GET["ref_id"]);
800 $newObj->setPermissions($_GET["ref_id"]);
801
802 $title = $_POST['qpl_new'] ?? '';
803 }
804
805 if (is_file($_SESSION["qpl_import_dir"] . '/' . $_SESSION["qpl_import_subdir"] . "/manifest.xml")) {
806 $_SESSION["qpl_import_idents"] = $_POST["ident"];
807
808 $fileName = $_SESSION["qpl_import_subdir"] . '.zip';
809 $fullPath = $_SESSION["qpl_import_dir"] . '/' . $fileName;
810
811 include_once("./Services/Export/classes/class.ilImport.php");
812 $imp = new ilImport((int) $_GET["ref_id"]);
813 $map = $imp->getMapping();
814 $map->addMapping("Modules/TestQuestionPool", "qpl", "new_id", $newObj->getId());
815 $imp->importObject($newObj, $fullPath, $fileName, "qpl", "Modules/TestQuestionPool", true);
816 } else {
817 // start parsing of QTI files
818 include_once "./Services/QTI/classes/class.ilQTIParser.php";
819 $qtiParser = new ilQTIParser($_SESSION["qpl_import_qti_file"], IL_MO_PARSE_QTI, $newObj->getId(), $_POST["ident"]);
820 $result = $qtiParser->startParsing();
821 // import page data
822 if (strlen($_SESSION["qpl_import_xml_file"])) {
823 $contParser = new ilQuestionPageParser($newObj, $_SESSION["qpl_import_xml_file"], $_SESSION["qpl_import_subdir"]);
824 $contParser->setQuestionMapping($qtiParser->getImportMapping());
825 $contParser->startParsing();
826 // #20494
827 $newObj->fromXML($_SESSION["qpl_import_xml_file"]);
828 }
829
830 // set another question pool name (if possible)
831 if ($title !== '') {
832 $newObj->setTitle($title);
833 }
834
835 if ($description !== null) {
836 $newObj->setDescription($description);
837 }
838
839 $newObj->update();
840 $newObj->saveToDb();
841 }
842
843 // delete import directory
844 include_once "./Services/Utilities/classes/class.ilUtil.php";
846
847 if ($_POST["questions_only"] == 1) {
848 $this->ctrl->redirect($this, "questions");
849 } else {
850 ilUtil::sendSuccess($this->lng->txt("object_imported"), true);
851 ilUtil::redirect("ilias.php?ref_id=" . $newObj->getRefId() .
852 "&baseClass=ilObjQuestionPoolGUI");
853 }
854 }
855
856 public function cancelImportObject()
857 {
858 if ($_POST["questions_only"] == 1) {
859 $this->ctrl->redirect($this, "questions");
860 } else {
861 $this->ctrl->redirect($this, "cancel");
862 }
863 }
864
868 public function uploadObject()
869 {
870 $upload_valid = true;
871 $form = $this->getImportQuestionsForm();
872 if ($form->checkInput()) {
873 if (!$this->uploadQplObject(true)) {
874 $form->setValuesByPost();
875 $this->importQuestionsObject($form);
876 }
877 } else {
878 $form->setValuesByPost();
879 $this->importQuestionsObject($form);
880 }
881 }
882
886 public function importQuestionsObject(ilPropertyFormGUI $form = null)
887 {
888 if (!$form instanceof ilPropertyFormGUI) {
889 $form = $this->getImportQuestionsForm();
890 }
891
892 $this->tpl->setContent($form->getHtml());
893 }
894
898 protected function getImportQuestionsForm()
899 {
900 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
901 $form = new ilPropertyFormGUI();
902 $form->setTitle($this->lng->txt('import_question'));
903 $form->setFormAction($this->ctrl->getFormAction($this, 'upload'));
904
905 $file = new ilFileInputGUI($this->lng->txt('select_file'), 'xmldoc');
906 $file->setRequired(true);
907 $form->addItem($file);
908
909 $form->addCommandButton('upload', $this->lng->txt('upload'));
910 $form->addCommandButton('questions', $this->lng->txt('cancel'));
911
912 return $form;
913 }
914
918 public function &createQuestionObject()
919 {
921 $addContEditMode = $_POST['add_quest_cont_edit_mode'];
922 } else {
924 }
925
926 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
927 $q_gui = &assQuestionGUI::_getQuestionGUI($_POST["sel_question_types"]);
928 $this->object->addQuestionChangeListeners($q_gui->object);
929 $q_gui->object->setObjId($this->object->getId());
930 $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
931 $q_gui->object->createNewQuestion();
932 $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
933 $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $_POST["sel_question_types"]);
934 $this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
935 }
936
941 {
942 if (!$_REQUEST['q_id']) {
943 require_once 'Modules/Test/classes/class.ilObjAssessmentFolder.php';
945 $addContEditMode = $_REQUEST['add_quest_cont_edit_mode'];
946 } else {
948 }
949
950 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
951 $q_gui = &assQuestionGUI::_getQuestionGUI($_GET["sel_question_types"]);
952 $q_gui->object->setObjId($this->object->getId());
953 $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
954 $q_gui->object->createNewQuestion();
955
956 $class = get_class($q_gui);
957 $qId = $q_gui->object->getId();
958 } else {
959 $class = $_GET["sel_question_types"] . 'gui';
960 $qId = $_REQUEST['q_id'];
961 }
962
963 $this->ctrl->setParameterByClass($class, "q_id", $qId);
964 $this->ctrl->setParameterByClass($class, "sel_question_types", $_REQUEST["sel_question_types"]);
965 $this->ctrl->setParameterByClass($class, "prev_qid", $_REQUEST["prev_qid"]);
966
967 $this->ctrl->redirectByClass($class, "editQuestion");
968 }
969
974 public function afterSave(ilObject $a_new_object)
975 {
976 // always send a message
977 ilUtil::sendSuccess($this->lng->txt("object_added"), true);
978
979 ilUtil::redirect("ilias.php?ref_id=" . $a_new_object->getRefId() .
980 "&baseClass=ilObjQuestionPoolGUI");
981 }
982
983 public function questionObject()
984 {
985 //echo "<br>ilObjQuestionPoolGUI->questionObject()";
986 $type = $_GET["sel_question_types"];
987 $this->editQuestionForm($type);
988 }
989
993 public function deleteQuestionsObject()
994 {
995 $questionIdsToDelete = isset($_POST['q_id']) ? (array) $_POST['q_id'] : array();
996 if (0 === count($questionIdsToDelete) && isset($_GET['q_id'])) {
997 $questionIdsToDelete = array($_GET['q_id']);
998 }
999
1000 $questionIdsToDelete = array_filter(array_map('intval', $questionIdsToDelete));
1001 if (0 === count($questionIdsToDelete)) {
1002 ilUtil::sendInfo($this->lng->txt("qpl_delete_select_none"), true);
1003 $this->ctrl->redirect($this, "questions");
1004 }
1005
1006 ilUtil::sendQuestion($this->lng->txt("qpl_confirm_delete_questions"));
1007 $deleteable_questions = &$this->object->getDeleteableQuestionDetails($questionIdsToDelete);
1008 include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
1009
1010 $table_gui = new ilQuestionBrowserTableGUI($this, 'questions', $this->checkWriteAccess(), true);
1011 $table_gui->setShowRowsSelector(false);
1012 $table_gui->setLimit(PHP_INT_MAX);
1013 $table_gui->setEditable($this->checkWriteAccess());
1014 $table_gui->setData($deleteable_questions);
1015 $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
1016 }
1017
1018
1023 {
1024 // delete questions after confirmation
1025 foreach ($_POST["q_id"] as $key => $value) {
1026 $this->object->deleteQuestion($value);
1027 $this->object->cleanupClipboard($value);
1028 }
1029 if (count($_POST["q_id"])) {
1030 ilUtil::sendSuccess($this->lng->txt("qpl_questions_deleted"), true);
1031 }
1032
1033 $this->ctrl->setParameter($this, 'q_id', '');
1034
1035 $this->ctrl->redirect($this, "questions");
1036 }
1037
1042 {
1043 $this->ctrl->redirect($this, "questions");
1044 }
1045
1049 public function exportQuestionObject()
1050 {
1051 // export button was pressed
1052 if (array_key_exists('q_id', $_POST) && is_array($_POST['q_id']) && count($_POST['q_id']) > 0) {
1053 include_once("./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
1054 $qpl_exp = new ilQuestionpoolExport($this->object, "xml", $_POST["q_id"]);
1055 $export_file = $qpl_exp->buildExportFile();
1056 $filename = $export_file;
1057 $filename = preg_replace("/.*\//", "", $filename);
1058 include_once "./Services/Utilities/classes/class.ilUtil.php";
1059 ilUtil::deliverFile($export_file, $filename);
1060 exit();
1061 } else {
1062 ilUtil::sendInfo($this->lng->txt("qpl_export_select_none"), true);
1063 }
1064 $this->ctrl->redirect($this, "questions");
1065 }
1066
1068 {
1069 $enableComments = $this->isCommentingEnabled();
1070
1071 require_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
1072 $taxIds = ilObjTaxonomy::getUsageOfObject($this->object->getId());
1073
1074 include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
1075 $table_gui = new ilQuestionBrowserTableGUI($this, 'questions', false, false, $taxIds, $enableComments);
1076 $table_gui->resetOffset();
1077 $table_gui->writeFilterToSession();
1078 $this->questionsObject();
1079 }
1080
1081 protected function isCommentingEnabled() : bool
1082 {
1083 return $this->checkWriteAccess();
1084 }
1085
1086 protected function checkWriteAccess() : bool
1087 {
1088 return $this->rbacsystem->checkAccess('write', $this->id);
1089 }
1090
1092 {
1093 require_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
1094 $taxIds = ilObjTaxonomy::getUsageOfObject($this->object->getId());
1095
1096 include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
1097 $table_gui = new ilQuestionBrowserTableGUI(
1098 $this,
1099 'questions',
1100 false,
1101 false,
1102 $taxIds,
1103 $this->isCommentingEnabled()
1104 );
1105 $table_gui->resetOffset();
1106 $table_gui->resetFilter();
1107 $this->questionsObject();
1108 }
1109
1110 protected function renoveImportFailsObject()
1111 {
1112 require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssQuestionSkillAssignmentImportFails.php';
1113 $qsaImportFails = new ilAssQuestionSkillAssignmentImportFails($this->object->getId());
1114 $qsaImportFails->deleteRegisteredImportFails();
1115
1116 $this->ctrl->redirect($this, 'infoScreen');
1117 }
1118
1122 public function questionsObject()
1123 {
1124 global $DIC;
1125 $rbacsystem = $DIC['rbacsystem'];
1126 $ilAccess = $DIC['ilAccess'];
1127 $ilUser = $DIC['ilUser'];
1128 $ilCtrl = $DIC['ilCtrl'];
1129 $ilDB = $DIC['ilDB'];
1130 $lng = $DIC['lng'];
1131 $ilPluginAdmin = $DIC['ilPluginAdmin'];
1132
1133 if (!$ilAccess->checkAccess("read", "", $_GET['ref_id'])) {
1134 $this->infoScreenForward();
1135 return;
1136 }
1137
1138 if (get_class($this->object) == "ilObjTest") {
1139 if ($_GET["calling_test"] > 0) {
1140 $ref_id = $_GET["calling_test"];
1141 $q_id = $_GET["q_id"];
1142
1143 if ($_REQUEST['test_express_mode']) {
1144 if ($q_id) {
1145 ilUtil::redirect("ilias.php?ref_id=" . $ref_id . "&q_id=" . $q_id . "&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
1146 } else {
1147 ilUtil::redirect("ilias.php?ref_id=" . $ref_id . "&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
1148 }
1149 } else {
1150 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&ref_id=" . $ref_id . "&cmd=questions");
1151 }
1152 }
1153 } elseif (isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer']) {
1154 $ref_id = (int) $_GET['calling_consumer'];
1156 if ($consumer instanceof ilQuestionEditingFormConsumer) {
1157 ilUtil::redirect($consumer->getQuestionEditingFormBackTarget($_GET['consumer_context']));
1158 }
1159 require_once 'Services/Link/classes/class.ilLink.php';
1161 }
1162
1163 $this->object->purgeQuestions();
1164 // reset test_id SESSION variable
1165 $_SESSION["test_id"] = "";
1166
1167 require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssQuestionSkillAssignmentImportFails.php';
1168 $qsaImportFails = new ilAssQuestionSkillAssignmentImportFails($this->object->getId());
1169 if ($qsaImportFails->failedImportsRegistered()) {
1170 require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
1171 $button = ilLinkButton::getInstance();
1172 $button->setUrl($this->ctrl->getLinkTarget($this, 'renoveImportFails'));
1173 $button->setCaption('ass_skl_import_fails_remove_btn');
1174
1175 ilUtil::sendFailure($qsaImportFails->getFailedImportsMessage($this->lng) . '<br />' . $button->render());
1176 }
1177
1178 require_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
1179 $taxIds = ilObjTaxonomy::getUsageOfObject($this->object->getId());
1180
1181 $table_gui = $this->buildQuestionBrowserTableGUI($taxIds);
1182 $table_gui->setPreventDoubleSubmission(false);
1183
1184 if ($rbacsystem->checkAccess('write', $_GET['ref_id'])) {
1185 $toolbar = new ilToolbarGUI();
1186
1187 require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
1189 $btn->setCaption('ass_create_question');
1190 $btn->setUrl($this->ctrl->getLinkTarget($this, 'createQuestionForm'));
1191 $btn->setPrimary(true);
1192 $toolbar->addButtonInstance($btn);
1193
1194
1195 $btnImport = ilLinkButton::getInstance();
1196 $btnImport->setCaption('import');
1197 $btnImport->setUrl($this->ctrl->getLinkTarget($this, 'importQuestions'));
1198 $toolbar->addButtonInstance($btnImport);
1199
1200 if (array_key_exists("qpl_clipboard", $_SESSION) && count($_SESSION['qpl_clipboard'])) {
1201 $btnPaste = ilLinkButton::getInstance();
1202 $btnPaste->setCaption('paste');
1203 $btnPaste->setUrl($this->ctrl->getLinkTarget($this, 'paste'));
1204 $toolbar->addButtonInstance($btnPaste);
1205 }
1206
1207 $this->tpl->setContent(
1208 $this->ctrl->getHTML($toolbar) . $this->ctrl->getHTML($table_gui)
1209 );
1210 } else {
1211 $this->tpl->setContent($this->ctrl->getHTML($table_gui));
1212 }
1213
1214 if ($this->object->getShowTaxonomies()) {
1215 $this->lng->loadLanguageModule('tax');
1216
1217 require_once 'Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php';
1218
1219 foreach ($taxIds as $taxId) {
1220 if ($taxId != $this->object->getNavTaxonomyId()) {
1221 continue;
1222 }
1223
1224 $taxExp = new ilTaxonomyExplorerGUI(
1225 $this,
1226 'showNavTaxonomy',
1227 $taxId,
1228 'ilobjquestionpoolgui',
1229 'questions'
1230 );
1231
1232 if (!$taxExp->handleCommand()) {
1233 $this->tpl->setLeftContent($taxExp->getHTML() . "&nbsp;");
1234 }
1235
1236 break;
1237 }
1238 }
1239 }
1240
1245 {
1246 $qId = (int) $_GET['q_id'];
1247
1248 if ($this->object->checkQuestionParent($qId)) {
1249 return $qId;
1250 }
1251
1252 throw new ilTestQuestionPoolException('question id does not relate to parent object!');
1253 }
1254
1255 private function createQuestionFormObject()
1256 {
1257 global $DIC; /* @var \ILIAS\DI\Container $DIC */
1258 $ilHelp = $DIC['ilHelp']; /* @var ilHelpGUI $ilHelp */
1259
1260 $ilHelp->setScreenId('assQuestions');
1261
1263 $ilHelp->setSubScreenId('createQuestion_editMode');
1264 } else {
1265 $ilHelp->setSubScreenId('createQuestion');
1266 }
1267
1268 $form = $this->buildCreateQuestionForm();
1269
1270 $this->tpl->setContent($this->ctrl->getHTML($form));
1271 }
1272
1273 private function buildCreateQuestionForm()
1274 {
1275 global $DIC;
1276 $ilUser = $DIC['ilUser'];
1277
1278 // form
1279
1280 require_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1281 $form = new ilPropertyFormGUI();
1282 $form->setTitle($this->lng->txt('ass_create_question'));
1283 $form->setFormAction($this->ctrl->getFormAction($this));
1284
1285 // question type
1286
1287 $options = array();
1288 foreach ($this->object->getQuestionTypes(false, true, false) as $translation => $data) {
1289 $options[$data['type_tag']] = $translation;
1290 }
1291
1292 require_once("Services/Form/classes/class.ilSelectInputGUI.php");
1293 $si = new ilSelectInputGUI($this->lng->txt('question_type'), 'sel_question_types');
1294 $si->setOptions($options);
1295 //$si->setValue($ilUser->getPref("tst_lastquestiontype"));
1296
1297 $form->addItem($si);
1298
1299 // content editing mode
1300
1302 $ri = new ilRadioGroupInputGUI($this->lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode");
1303
1304 $option_ipe = new ilRadioOption(
1305 $this->lng->txt('tst_add_quest_cont_edit_mode_IPE'),
1307 );
1308 $option_ipe->setInfo($this->lng->txt('tst_add_quest_cont_edit_mode_IPE_info'));
1309 $ri->addOption($option_ipe);
1310
1311 $option_rte = new ilRadioOption(
1312 $this->lng->txt('tst_add_quest_cont_edit_mode_RTE'),
1314 );
1315 $option_rte->setInfo($this->lng->txt('tst_add_quest_cont_edit_mode_RTE_info'));
1316 $ri->addOption($option_rte);
1317
1319
1320 $form->addItem($ri, true);
1321 } else {
1322 $hi = new ilHiddenInputGUI("question_content_editing_type");
1324 $form->addItem($hi, true);
1325 }
1326
1327 // commands
1328
1329 $form->addCommandButton('createQuestion', $this->lng->txt('create'));
1330 $form->addCommandButton('questions', $this->lng->txt('cancel'));
1331
1332 return $form;
1333 }
1334
1338 public function printObject()
1339 {
1343 global $DIC;
1344 $ilToolbar = $DIC['ilToolbar'];
1345
1346 $output = ilUtil::stripSlashes($_POST['output'] ?? $_GET['output']);
1347
1348 $ilToolbar->setFormAction($this->ctrl->getFormAction($this, 'print'));
1349 require_once 'Services/Form/classes/class.ilSelectInputGUI.php';
1350 $mode = new ilSelectInputGUI($this->lng->txt('output_mode'), 'output');
1351 $mode->setOptions(array(
1352 'overview' => $this->lng->txt('overview'),
1353 'detailed' => $this->lng->txt('detailed_output_solutions'),
1354 'detailed_printview' => $this->lng->txt('detailed_output_printview')
1355 ));
1356 $mode->setValue($output);
1357
1358 $ilToolbar->setFormName('printviewOptions');
1359 $ilToolbar->addInputItem($mode, true);
1360 $ilToolbar->addFormButton($this->lng->txt('submit'), 'print');
1361
1362 include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionPoolPrintViewTableGUI.php";
1363 $table_gui = new ilQuestionPoolPrintViewTableGUI($this, 'print', $output);
1364 $data = $this->object->getPrintviewQuestions();
1365 $totalPoints = 0;
1366 foreach ($data as $d) {
1367 $totalPoints += $d['points'];
1368 }
1369 $table_gui->setTotalPoints($totalPoints);
1370 $table_gui->initColumns();
1371 $table_gui->setData($data);
1372 $this->tpl->setContent($table_gui->getHTML());
1373 }
1374
1375 public function updateObject()
1376 {
1377 // $this->update = $this->object->updateMetaData();
1378 $this->update = $this->object->update();
1379 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1380 }
1381
1385 public function pasteObject()
1386 {
1387 if (array_key_exists("qpl_clipboard", $_SESSION)) {
1388 if ($this->object->pasteFromClipboard()) {
1389 ilUtil::sendSuccess($this->lng->txt("qpl_paste_success"), true);
1390 } else {
1391 ilUtil::sendFailure($this->lng->txt("qpl_paste_error"), true);
1392 }
1393 } else {
1394 ilUtil::sendInfo($this->lng->txt("qpl_paste_no_objects"), true);
1395 }
1396 $this->ctrl->redirect($this, "questions");
1397 }
1398
1402 public function copyObject()
1403 {
1404 if (isset($_POST["q_id"]) && is_array($_POST["q_id"]) && count($_POST["q_id"]) > 0) {
1405 foreach ($_POST["q_id"] as $key => $value) {
1406 $this->object->copyToClipboard($value);
1407 }
1408 ilUtil::sendInfo($this->lng->txt("qpl_copy_insert_clipboard"), true);
1409 } elseif (isset($_GET['q_id']) && $_GET['q_id'] > 0) {
1410 $this->object->copyToClipboard((int) $_GET['q_id']);
1411 ilUtil::sendInfo($this->lng->txt("qpl_copy_insert_clipboard"), true);
1412 } else {
1413 ilUtil::sendInfo($this->lng->txt("qpl_copy_select_none"), true);
1414 }
1415 $this->ctrl->redirect($this, "questions");
1416 }
1417
1421 public function moveObject()
1422 {
1423 if (isset($_POST["q_id"]) && is_array($_POST["q_id"]) && count($_POST["q_id"]) > 0) {
1424 foreach ($_POST["q_id"] as $key => $value) {
1425 $this->object->moveToClipboard($value);
1426 }
1427 ilUtil::sendInfo($this->lng->txt("qpl_move_insert_clipboard"), true);
1428 } elseif (isset($_GET['q_id']) && $_GET['q_id'] > 0) {
1429 $this->object->moveToClipboard((int) $_GET['q_id']);
1430 ilUtil::sendInfo($this->lng->txt("qpl_copy_insert_clipboard"), true);
1431 } else {
1432 ilUtil::sendInfo($this->lng->txt("qpl_move_select_none"), true);
1433 }
1434 $this->ctrl->redirect($this, "questions");
1435 }
1436
1437 public function createExportExcel()
1438 {
1439 global $DIC;
1440 $rbacsystem = $DIC['rbacsystem'];
1441 if ($rbacsystem->checkAccess("write", $_GET['ref_id'])) {
1442 include_once("./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
1443 $question_ids = &$this->object->getAllQuestionIds();
1444 $qpl_exp = new ilQuestionpoolExport($this->object, 'xls', $question_ids);
1445 $qpl_exp->buildExportFile();
1446 $this->ctrl->redirectByClass("ilquestionpoolexportgui", "");
1447 }
1448 }
1449
1453 public function &editQuestionForTestObject()
1454 {
1455 global $DIC;
1456
1457 $p_gui = new ilAssQuestionPreviewGUI(
1458 $this->ctrl,
1459 $this->tabs_gui,
1460 $this->tpl,
1461 $this->lng,
1462 $DIC->database(),
1463 $DIC->user(),
1464 $DIC->rbac()
1465 );
1466 $this->ctrl->redirectByClass(get_class($p_gui), "show");
1467 }
1468
1469 protected function initImportForm($a_new_type)
1470 {
1471 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1472 $form = new ilPropertyFormGUI();
1473 $form->setTarget("_top");
1474 $form->setFormAction($this->ctrl->getFormAction($this));
1475 $form->setTitle($this->lng->txt("import_qpl"));
1476
1477 include_once("./Services/Form/classes/class.ilFileInputGUI.php");
1478 $fi = new ilFileInputGUI($this->lng->txt("import_file"), "xmldoc");
1479 $fi->setSuffixes(array("zip"));
1480 $fi->setRequired(true);
1481 $form->addItem($fi);
1482
1483 $form->addCommandButton("importFile", $this->lng->txt("import"));
1484 $form->addCommandButton("cancel", $this->lng->txt("cancel"));
1485
1486 return $form;
1487 }
1488
1492 protected function importFileObject($parent_id = null, $a_catch_errors = true)
1493 {
1494 if ($_REQUEST['new_type'] === null) {
1495 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('import_file_not_valid'), true);
1496 $this->ctrl->redirect($this, 'create');
1497 return;
1498 }
1499 if (!$this->checkPermissionBool("create", "", $_REQUEST["new_type"])) {
1500 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_create_permission"), true);
1501 $this->ctrl->redirect($this, 'create');
1502 return;
1503 }
1504
1505 $form = $this->initImportForm($_REQUEST["new_type"]);
1506 if ($form->checkInput()) {
1507 $this->uploadQplObject();
1508 }
1509
1510 // display form to correct errors
1511 $this->tpl->setContent($form->getHTML());
1512 }
1513
1514 public function addLocatorItems()
1515 {
1516 global $DIC;
1517 $ilLocator = $DIC['ilLocator'];
1518 switch ($this->ctrl->getCmd()) {
1519 case "create":
1520 case "importFile":
1521 case "cancel":
1522 break;
1523 default:
1524 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $_GET["ref_id"]);
1525 break;
1526 }
1527 if ($_GET["q_id"] > 0) {
1528 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1529 $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
1530 if ($q_gui->object instanceof assQuestion) {
1531 $q_gui->object->setObjId($this->object->getId());
1532 $title = $q_gui->object->getTitle();
1533 if (!$title) {
1534 $title = $this->lng->txt('new') . ': ' . assQuestion::_getQuestionTypeName($q_gui->object->getQuestionType());
1535 }
1536 $ilLocator->addItem($title, $this->ctrl->getLinkTargetByClass(get_class($q_gui), "editQuestion"));
1537 } else {
1538 // Workaround for context issues: If no object was found, redirect without q_id parameter
1539 $this->ctrl->setParameter($this, 'q_id', '');
1540 $this->ctrl->redirect($this);
1541 }
1542 }
1543 }
1544
1548 public function setTitleAndDescription()
1549 {
1550 parent::setTitleAndDescription();
1551 if ($_GET["q_id"] > 0) {
1552 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1553 $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
1554 if ($q_gui->object instanceof assQuestion) {
1555 $q_gui->object->setObjId($this->object->getId());
1556 $title = $q_gui->object->getTitle();
1557 if (!$title) {
1558 $title = $this->lng->txt('new') . ': ' . assQuestion::_getQuestionTypeName($q_gui->object->getQuestionType());
1559 }
1560 $this->tpl->setTitle(
1561 strip_tags(
1562 $title,
1563 self::ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
1564 )
1565 );
1566 $this->tpl->setDescription(
1567 $q_gui->object->getDescriptionForHTMLOutput()
1568 );
1569 $this->tpl->setTitleIcon(ilObject2::_getIcon("", "big", $this->object->getType()));
1570 } else {
1571 // Workaround for context issues: If no object was found, redirect without q_id parameter
1572 $this->ctrl->setParameter($this, 'q_id', '');
1573 $this->ctrl->redirect($this);
1574 }
1575 } else {
1576 $this->tpl->setTitle(
1577 strip_tags(
1578 $this->object->getTitle(),
1579 self::ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
1580 )
1581 );
1582 $this->tpl->setDescription(
1583 strip_tags(
1584 $this->object->getLongDescription(),
1585 self::ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
1586 )
1587 );
1588 $this->tpl->setTitleIcon(ilObject2::_getIcon("", "big", $this->object->getType()));
1589 }
1590 }
1591
1597 public function getTabs()
1598 {
1599 global $DIC;
1600 $ilHelp = $DIC['ilHelp'];
1601
1602 $currentUserHasWriteAccess = $this->access->checkAccess("write", "", $this->object->getRefId());
1603 $currentUserHasReadAccess = $this->access->checkAccess("read", "", $this->object->getRefId());
1604
1605 $ilHelp->setScreenIdComponent("qpl");
1606
1607 $next_class = strtolower($this->ctrl->getNextClass());
1608 switch ($next_class) {
1609 case "":
1610 case "ilpermissiongui":
1611 case "ilobjectmetadatagui":
1612 case "ilquestionpoolexportgui":
1613 case "ilquestionpoolskilladministrationgui":
1614 break;
1615
1616 case 'ilobjtaxonomygui':
1617 case 'ilobjquestionpoolsettingsgeneralgui':
1618
1619 if ($currentUserHasWriteAccess) {
1620 $this->addSettingsSubTabs($this->tabs_gui);
1621 }
1622
1623 break;
1624
1625 default:
1626 return;
1627 break;
1628 }
1629 // questions
1630 $force_active = false;
1631 $commands = $_POST["cmd"];
1632 if (is_array($commands)) {
1633 foreach ($commands as $key => $value) {
1634 if (preg_match("/^delete_.*/", $key, $matches) ||
1635 preg_match("/^addSelectGap_.*/", $key, $matches) ||
1636 preg_match("/^addTextGap_.*/", $key, $matches) ||
1637 preg_match("/^deleteImage_.*/", $key, $matches) ||
1638 preg_match("/^upload_.*/", $key, $matches) ||
1639 preg_match("/^addSuggestedSolution_.*/", $key, $matches)
1640 ) {
1641 $force_active = true;
1642 }
1643 }
1644 }
1645 if (array_key_exists("imagemap_x", $_POST)) {
1646 $force_active = true;
1647 }
1648 if (!$force_active) {
1649 $force_active = ((strtolower($this->ctrl->getCmdClass()) == strtolower(get_class($this)) || strlen($this->ctrl->getCmdClass()) == 0) &&
1650 $this->ctrl->getCmd() == "")
1651 ? true
1652 : false;
1653 }
1654
1655 if ($currentUserHasReadAccess) {
1656 $this->tabs_gui->addTarget(
1657 "assQuestions",
1658 $this->ctrl->getLinkTarget($this, "questions"),
1659 array("questions", "filter", "resetFilter", "createQuestion",
1660 "importQuestions", "deleteQuestions", "filterQuestionBrowser",
1661 "view", "preview", "editQuestion", "exec_pg",
1662 "addItem", "upload", "save", "cancel", "addSuggestedSolution",
1663 "cancelExplorer", "linkChilds", "removeSuggestedSolution",
1664 "add", "addYesNo", "addTrueFalse", "createGaps", "saveEdit",
1665 "setMediaMode", "uploadingImage", "uploadingImagemap", "addArea",
1666 "deletearea", "saveShape", "back", "addPair", "uploadingJavaapplet",
1667 "addParameter", "assessment", "addGIT", "addST", "addPG", "delete",
1668 "toggleGraphicalAnswers", "deleteAnswer", "deleteImage", "removeJavaapplet"),
1669 "",
1670 "",
1671 $force_active
1672 );
1673 }
1674 if ($currentUserHasReadAccess || $this->access->checkAccess("visible", "", $this->ref_id)) {
1675 $this->tabs_gui->addTarget(
1676 "info_short",
1677 $this->ctrl->getLinkTarget($this, "infoScreen"),
1678 array("infoScreen", "showSummary")
1679 );
1680 }
1681
1682 if ($currentUserHasWriteAccess) {
1683 // properties
1684 $this->tabs_gui->addTarget(
1685 'settings',
1686 $this->ctrl->getLinkTargetByClass('ilObjQuestionPoolSettingsGeneralGUI'),
1687 array(),
1688 array('ilObjQuestionPoolSettingsGeneralGUI', 'ilObjTaxonomyGUI')
1689 );
1690
1691 // skill service
1692 if ($this->isSkillsTabRequired()) {
1693 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentsGUI.php';
1694
1695 $link = $this->ctrl->getLinkTargetByClass(
1696 array('ilQuestionPoolSkillAdministrationGUI', 'ilAssQuestionSkillAssignmentsGUI'),
1698 );
1699
1700 $this->tabs_gui->addTarget('qpl_tab_competences', $link, array(), array());
1701 }
1702 }
1703
1704 if ($currentUserHasReadAccess) {
1705 // print view
1706 $this->tabs_gui->addTarget(
1707 "print_view",
1708 $this->ctrl->getLinkTarget($this, 'print'),
1709 array("print"),
1710 "",
1711 ""
1712 );
1713 }
1714
1715 if ($currentUserHasWriteAccess) {
1716 // meta data
1717
1718 $mdgui = new ilObjectMetaDataGUI($this->object);
1719 $mdtab = $mdgui->getTab();
1720 if ($mdtab) {
1721 $this->tabs_gui->addTarget(
1722 "meta_data",
1723 $mdtab,
1724 "",
1725 "ilmdeditorgui"
1726 );
1727 }
1728 }
1729
1730 if ($currentUserHasWriteAccess) {
1731 $this->tabs_gui->addTarget(
1732 "export",
1733 $this->ctrl->getLinkTargetByClass("ilquestionpoolexportgui", ""),
1734 "",
1735 "ilquestionpoolexportgui"
1736 );
1737 }
1738
1739 if ($this->access->checkAccess("edit_permission", "", $this->object->getRefId())) {
1740 $this->tabs_gui->addTarget(
1741 "perm_settings",
1742 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
1743 array("perm","info","owner"),
1744 'ilpermissiongui'
1745 );
1746 }
1747 }
1748
1749 private function isSkillsTabRequired()
1750 {
1751 if (!($this->object instanceof ilObjQuestionPool)) {
1752 return false;
1753 }
1754
1755 if (!$this->object->isSkillServiceEnabled()) {
1756 return false;
1757 }
1758
1760 return false;
1761 }
1762
1763 return true;
1764 }
1765
1766 private function addSettingsSubTabs(ilTabsGUI $tabs)
1767 {
1768 $tabs->addSubTabTarget(
1769 'qpl_settings_subtab_general',
1770 $this->ctrl->getLinkTargetByClass('ilObjQuestionPoolSettingsGeneralGUI'),
1771 '',
1772 'ilObjQuestionPoolSettingsGeneralGUI'
1773 );
1774
1775 $tabs->addSubTabTarget(
1776 'qpl_settings_subtab_taxonomies',
1777 $this->ctrl->getLinkTargetByClass('ilObjTaxonomyGUI', 'editAOTaxonomySettings'),
1778 '',
1779 'ilObjTaxonomyGUI'
1780 );
1781 }
1782
1788 public function infoScreenObject()
1789 {
1790 $this->ctrl->setCmd("showSummary");
1791 $this->ctrl->setCmdClass("ilinfoscreengui");
1792 $this->infoScreenForward();
1793 }
1794
1798 public function infoScreenForward()
1799 {
1800 if (!$this->access->checkAccess("visible", "", $this->ref_id)) {
1801 $this->error->raiseError($this->lng->txt("msg_no_perm_read"));
1802 }
1803
1804 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1805 $info = new ilInfoScreenGUI($this);
1806 $info->enablePrivateNotes();
1807
1808 // standard meta data
1809 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1810
1811 $this->ctrl->forwardCommand($info);
1812 }
1813
1822 public static function _goto($a_target)
1823 {
1825 global $DIC;
1826 $ilAccess = $DIC['ilAccess'];
1827 $ilErr = $DIC['ilErr'];
1828 $lng = $DIC['lng'];
1829 $ctrl = $DIC['ilCtrl'];
1830 $main_tpl = $DIC['tpl'];
1831
1832 if ($ilAccess->checkAccess("write", "", (int) $a_target)
1833 || $ilAccess->checkAccess('read', '', (int) $a_target)
1834 ) {
1835 $target_class = ilObjQuestionPoolGUI::class;
1836 $target_cmd = 'questions';
1837 $ctrl->setParameterByClass($target_class, 'ref_id', $a_target);
1838 $ctrl->redirectByClass([ilRepositoryGUI::class, $target_class], $target_cmd);
1839 return;
1840 }
1841 if ($ilAccess->checkAccess('visible', "", $a_target)) {
1842 ilObjectGUI::_gotoRepositoryNode($a_target, 'infoScreen');
1843 return;
1844 }
1845 if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1846 $main_tpl->setOnScreenMessage(
1847 'info',
1848 sprintf(
1849 $lng->txt("msg_no_perm_read_item"),
1851 ),
1852 true
1853 );
1854
1856 return;
1857 }
1858 $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
1859 }
1860
1869 private function buildQuestionBrowserTableGUI($taxIds)
1870 {
1871 global $DIC;
1872 $ilDB = $DIC['ilDB'];
1873 $lng = $DIC['lng'];
1874 $ilPluginAdmin = $DIC['ilPluginAdmin'];
1875
1876 $writeAccess = $this->checkWriteAccess();
1877 include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
1878 $table_gui = new ilQuestionBrowserTableGUI(
1879 $this,
1880 'questions',
1881 $writeAccess,
1882 false,
1883 $taxIds,
1884 $this->isCommentingEnabled()
1885 );
1886 $table_gui->setEditable($writeAccess);
1887 $questionList = new ilAssQuestionList(
1888 $ilDB,
1889 $lng,
1890 $this->refinery,
1891 $ilPluginAdmin
1892 );
1893 $questionList->setParentObjId($this->object->getId());
1894
1895 foreach ($table_gui->getFilterItems() as $item) {
1896 if (substr($item->getPostVar(), 0, strlen('tax_')) == 'tax_') {
1897 $v = $item->getValue();
1898
1899 if (is_array($v) && count($v) && !(int) $v[0]) {
1900 continue;
1901 }
1902
1903 $taxId = substr($item->getPostVar(), strlen('tax_'));
1904
1905 $questionList->addTaxonomyFilter(
1906 $taxId,
1907 $item->getValue(),
1908 $this->object->getId(),
1909 $this->object->getType()
1910 );
1911 } elseif ($item->getValue() !== false) {
1912 $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
1913 }
1914 }
1915
1916 if ($this->object->isNavTaxonomyActive() && (int) $_GET['tax_node']) {
1917 require_once 'Services/Taxonomy/classes/class.ilTaxonomyTree.php';
1918 $taxTree = new ilTaxonomyTree($this->object->getNavTaxonomyId());
1919 $rootNodeId = $taxTree->readRootId();
1920
1921 if ((int) $_GET['tax_node'] != $rootNodeId) {
1922 $questionList->addTaxonomyFilter(
1923 $this->object->getNavTaxonomyId(),
1924 array((int) $_GET['tax_node']),
1925 $this->object->getId(),
1926 $this->object->getType()
1927 );
1928 }
1929 }
1930
1931 $questionList->load();
1932 $data = $questionList->getQuestionDataArray();
1933
1934 $table_gui->setQuestionData($data);
1935
1936 return $table_gui;
1937 }
1938} // END class.ilObjQuestionPoolGUI
$result
$filename
Definition: buildRTE.php:89
$_GET["client_id"]
$_POST["username"]
$_SESSION["AccountId"]
An exception for terminatinating execution or to throw for unit testing.
const IL_COMP_MODULE
error($a_errmsg)
set error message @access public
const IL_MO_VERIFY_QTI
const IL_MO_PARSE_QTI
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
Abstract basic class which is to be extended by the concrete assessment question type classes.
const ADDITIONAL_CONTENT_EDITING_MODE_RTE
constant for additional content editing mode "default"
const ADDITIONAL_CONTENT_EDITING_MODE_IPE
constant for additional content editing mode "pageobject"
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
Question page GUI class.
Question page object.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
This class represents a file property in a property form.
This class represents a hidden form property in a property form.
Import class.
Class ilInfoScreenGUI.
static getInstance()
Factory.
Class ilLocalUnitConfigurationGUI.
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not
Class ilObjFile.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
importFileObject($parent_id=null, $a_catch_errors=true)
form for new questionpool object import
uploadQplObject($questions_only=false)
imports question(s) into the questionpool
confirmDeleteQuestionsObject()
delete questions
afterSave(ilObject $a_new_object)
save object @access public
updateObject()
updates object entry in object_data
download_paragraphObject()
download source code paragraph
deleteQuestionsObject()
delete questions confirmation screen
& createQuestionForTestObject()
create new question
filterObject()
set question list filter
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually,...
questionsObject()
list questions of question pool
getTabs()
adds tabs to tab gui object
addLocatorItems()
should be overwritten to add object specific items (repository items are preloaded)
importVerifiedFileObject()
imports question(s) into the questionpool (after verification)
uploadObject()
imports question(s) into the questionpool
moveObject()
mark one or more question objects for moving
& createQuestionObject()
create new question
pasteObject()
paste questios from the clipboard into the question pool
initImportForm($a_new_type)
Init object import form.
cancelDeleteQuestionsObject()
Cancel question deletion.
& editQuestionForTestObject()
edit question
setTitleAndDescription()
called by prepare output
infoScreenForward()
show information screen
__construct()
Constructor @access public.
copyObject()
copy one or more question objects to the clipboard
exportObject()
Gateway for exports initiated from workspace, as there is a generic forward to {objTypeMainGUI}::expo...
importQuestionsObject(ilPropertyFormGUI $form=null)
display the import form to import questions into the questionpool
fullscreenObject()
show fullscreen view
static _createImportDirectory()
creates data directory for import files (data_dir/qpl_data/qpl_<id>/import, depending on data directo...
static _getImportDirectory()
get import directory of lm
static _setImportDirectory($a_import_dir=null)
set import directory
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
static _setImportDirectory($a_import_dir=null)
set import directory
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
GUI class for the workflow of copying objects.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilObjectGUI Basic methods of all Output classes.
prepareOutput($a_show_subobjects=true)
prepare output
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
getCreationMode()
get creation mode
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
Class ilObjectMetaDataGUI.
Class ilObject Basic functions for all objects.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
getRefId()
get reference id @access public
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static getPluginObject(string $a_ctype, string $a_cname, string $a_slot_id, string $a_pname)
This class represents a property form user interface.
Legacy Content Object Parser.
Export User Interface Class.
Export class for questionpools.
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a selection list property in a property form.
Tabs GUI.
addSubTabTarget( $a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
DEPRECATED.
Taxonomy explorer GUI class.
Class ilUnitConfigurationRepository.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static unzip(string $path_to_zip_file, bool $overwrite_existing=false, bool $unpack_flat=false)
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
const ROOT_FOLDER_ID
Definition: constants.php:30
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
global $DIC
Definition: goto.php:24
$ilUser
Definition: imgupload.php:18
const CLOZE_TEST_IDENTIFIER
Question identifier constants.
const IMAGEMAP_QUESTION_IDENTIFIER
const SINGLE_CHOICE_QUESTION_IDENTIFIER
const TEXTSUBSET_QUESTION_IDENTIFIER
const NUMERIC_QUESTION_IDENTIFIER
const JAVAAPPLET_QUESTION_IDENTIFIER
const TEXT_QUESTION_IDENTIFIER
const LONG_MENU_QUESTION_IDENTIFIER
const KPRIM_CHOICE_QUESTION_IDENTIFIER
const MATCHING_QUESTION_IDENTIFIER
const MULTIPLE_CHOICE_QUESTION_IDENTIFIER
const ORDERING_QUESTION_IDENTIFIER
exit
Definition: login.php:29
$xml
Definition: metadata.php:332
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$ret
Definition: parser.php:6
$type
global $ilDB
$rows
Definition: xhr_table.php:10