44 include_once
"./classes/class.ilObjectGUI.php";
45 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
46 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
47 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
48 include_once
"./Modules/Test/classes/class.ilObjTest.php";
59 $lng->loadLanguageModule(
"assessment");
62 $this->ctrl->saveParameter($this, array(
"ref_id",
"test_ref_id",
"calling_test",
"test_express_mode",
"q_id"));
72 global $ilLocator, $ilAccess, $ilNavigationHistory,
$tpl;
73 if ((!$ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"])) && (!$ilAccess->checkAccess(
"visible",
"",
$_GET[
"ref_id"])))
76 $ilias->raiseError($this->lng->txt(
"permission_denied"), $ilias->error_obj->MESSAGE);
81 $ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
83 $ilNavigationHistory->addItem(
$_GET[
"ref_id"],
84 "ilias.php?baseClass=ilObjQuestionPoolGUI&cmd=questions&ref_id=".
$_GET[
"ref_id"],
"qpl");
87 $cmd = $this->ctrl->getCmd(
"questions");
88 $next_class = $this->ctrl->getNextClass($this);
90 if( in_array($next_class, array(
'',
'ilobjquestionpoolgui')) &&
$cmd ==
'questions' )
97 $this->ctrl->setReturn($this,
"questions");
102 if (
$_GET[
"q_id"] < 1)
104 $q_type = (
$_POST[
"sel_question_types"] !=
"")
105 ?
$_POST[
"sel_question_types"]
106 :
$_GET[
"sel_question_types"];
108 if (
$cmd !=
"createQuestion" &&
$cmd !=
"createQuestionForTest"
109 && $next_class !=
"ilpageobjectgui")
111 if ((
$_GET[
"test_ref_id"] !=
"") or (
$_GET[
"calling_test"]))
122 case 'ilmdeditorgui':
123 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
125 $md_gui =
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
126 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
127 $this->ctrl->forwardCommand($md_gui);
129 case "ilpageobjectgui":
130 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
131 $this->tpl->setCurrentBlock(
"ContentStyle");
132 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
134 $this->tpl->parseCurrentBlock();
137 $this->tpl->setCurrentBlock(
"SyntaxStyle");
138 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
140 $this->tpl->parseCurrentBlock();
141 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
143 $q_gui->setQuestionTabs();
144 $q_gui->outAdditionalOutput();
145 $q_gui->object->setObjId($this->object->getId());
146 $question = $q_gui->object;
147 $this->ctrl->saveParameter($this,
"q_id");
148 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
149 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
150 $this->lng->loadLanguageModule(
"content");
151 $this->ctrl->setReturnByClass(
"ilPageObjectGUI",
"view");
152 $this->ctrl->setReturn($this,
"questions");
155 $page_gui->setEditPreview(
true);
156 $page_gui->setEnabledTabs(
false);
157 $page_gui->setEnabledInternalLinks(
false);
158 if (strlen($this->ctrl->getCmd()) == 0 && !isset(
$_POST[
"editImagemapForward_x"]))
160 $this->ctrl->setCmdClass(get_class($page_gui));
161 $this->ctrl->setCmd(
"preview");
164 $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
165 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
166 $page_gui->setOutputMode(
"edit");
167 $page_gui->setHeader($question->getTitle());
168 $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this,
"downloadFile"));
169 $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this,
"fullscreen"));
170 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this));
171 $page_gui->setPresentationTitle($question->getTitle());
172 $ret = $this->ctrl->forwardCommand($page_gui);
173 $tpl->setContent(
$ret);
176 case 'ilpermissiongui':
177 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
179 $ret = $this->ctrl->forwardCommand($perm_gui);
182 case 'ilobjectcopygui':
183 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
186 $this->ctrl->forwardCommand($cp);
190 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
192 $exp_gui->addFormat(
"zip", $this->lng->txt(
'qpl_export_xml'), $this,
"createExportQTI");
193 $exp_gui->addFormat(
"xls", $this->lng->txt(
'qpl_export_excel'), $this,
"createExportExcel");
196 $ret = $this->ctrl->forwardCommand($exp_gui);
199 case "ilinfoscreengui":
203 case "ilobjquestionpoolgui":
206 if(
$cmd ==
'questions' )
208 $this->ctrl->setParameter($this,
'q_id',
'');
216 $this->ctrl->setReturn($this,
"questions");
217 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
219 $q_gui->object->setObjId($this->object->getId());
220 $q_gui->setQuestionTabs();
221 $ret = $this->ctrl->forwardCommand($q_gui);
225 if (strtolower(
$_GET[
"baseClass"]) !=
"iladministrationgui" &&
237 $save = ((strcmp($this->ctrl->getCmd(),
"save") == 0)) ?
true :
false;
240 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
242 $form->setFormAction($this->ctrl->getFormAction($this,
'properties'));
243 $form->setTitle($this->lng->txt(
"properties"));
244 $form->setMultipart(
false);
246 $form->setId(
"properties");
250 $online->
setInfo($this->lng->txt(
"qpl_online_property_description"));
251 $online->setChecked($this->object->getOnline());
252 $form->addItem($online);
254 $form->addCommandButton(
"saveProperties", $this->lng->txt(
"save"));
260 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
279 $qpl_online =
$_POST[
"online"];
280 if (strlen($qpl_online) == 0) $qpl_online =
"0";
281 $this->
object->setOnline($qpl_online);
282 $this->
object->saveToDb();
284 $this->ctrl->redirect($this,
"properties");
293 include_once(
"./Modules/File/classes/class.ilObjFile.php");
295 $fileObj->sendFile();
304 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
305 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
308 $page_gui->showMediaFullscreen();
326 $_POST[
"filter_text"] =
"";
327 $_POST[
"sel_filter_type"] =
"";
336 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
338 $pg_obj->send_paragraph (
$_GET[
"par_id"],
$_GET[
"downloadtitle"]);
347 if ($_FILES[
"xmldoc"][
"error"] > UPLOAD_ERR_OK)
350 $this->importObject();
354 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
358 $file = pathinfo($_FILES[
"xmldoc"][
"name"]);
359 $full_path = $basedir.
"/".$_FILES[
"xmldoc"][
"name"];
360 $GLOBALS[
'ilLog']->write(__METHOD__.
": full path " . $full_path);
361 include_once
"./Services/Utilities/classes/class.ilUtil.php";
363 $GLOBALS[
'ilLog']->write(__METHOD__.
": full path " . $full_path);
364 if (strcmp($_FILES[
"xmldoc"][
"type"],
"text/xml") == 0)
366 $qti_file = $full_path;
375 $subdir = basename(
$file[
"basename"],
".".
$file[
"extension"]);
382 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
384 $result = $qtiParser->startParsing();
385 $founditems =& $qtiParser->getFoundItems();
386 if (count($founditems) == 0)
394 $this->importObject();
400 foreach ($founditems as $item)
402 if (strlen($item[
"type"]))
418 $this->importObject();
422 $_SESSION[
"qpl_import_xml_file"] = $xml_file;
423 $_SESSION[
"qpl_import_qti_file"] = $qti_file;
424 $_SESSION[
"qpl_import_subdir"] = $subdir;
426 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.qpl_import_verification.html");
427 $row_class = array(
"tblrow1",
"tblrow2");
429 foreach ($founditems as $item)
431 $this->tpl->setCurrentBlock(
"verification_row");
432 $this->tpl->setVariable(
"ROW_CLASS", $row_class[$counter++ % 2]);
433 $this->tpl->setVariable(
"QUESTION_TITLE", $item[
"title"]);
434 $this->tpl->setVariable(
"QUESTION_IDENT", $item[
"ident"]);
435 include_once
"./Services/QTI/classes/class.ilQTIItem.php";
436 switch ($item[
"type"])
439 $type = $this->lng->txt(
"assClozeTest");
442 $type = $this->lng->txt(
"assImagemapQuestion");
445 $type = $this->lng->txt(
"assJavaApplet");
448 $type = $this->lng->txt(
"assMatchingQuestion");
451 $type = $this->lng->txt(
"assMultipleChoice");
454 $type = $this->lng->txt(
"assSingleChoice");
457 $type = $this->lng->txt(
"assOrderingQuestion");
460 $type = $this->lng->txt(
"assTextQuestion");
463 $type = $this->lng->txt(
"assNumeric");
466 $type = $this->lng->txt(
"assTextSubset");
469 $type = $this->lng->txt($item[
"type"]);
473 if (strcmp($type,
"-" . $item[
"type"] .
"-") == 0)
475 global $ilPluginAdmin;
476 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_MODULE,
"TestQuestionPool",
"qst");
477 foreach ($pl_names as $pl_name)
480 if (strcmp($pl->getQuestionType(), $item[
"type"]) == 0)
482 $type = $pl->getQuestionTypeTranslation();
486 $this->tpl->setVariable(
"QUESTION_TYPE", $type);
487 $this->tpl->parseCurrentBlock();
490 $this->tpl->setCurrentBlock(
"import_qpl");
491 if (is_file($xml_file))
494 $fh = @fopen($xml_file,
"r") or die(
"");
495 $xml = @fread($fh, filesize($xml_file));
497 if (preg_match(
"/<ContentObject.*?MetaData.*?General.*?Title[^>]*?>([^<]*?)</", $xml, $matches))
499 $this->tpl->setVariable(
"VALUE_NEW_QUESTIONPOOL", $matches[1]);
502 $this->tpl->setVariable(
"TEXT_CREATE_NEW_QUESTIONPOOL", $this->lng->txt(
"qpl_import_create_new_qpl"));
503 $this->tpl->parseCurrentBlock();
505 $this->tpl->setCurrentBlock(
"adm_content");
506 $this->tpl->setVariable(
"TEXT_TYPE", $this->lng->txt(
"question_type"));
507 $this->tpl->setVariable(
"TEXT_TITLE", $this->lng->txt(
"question_title"));
508 $this->tpl->setVariable(
"FOUND_QUESTIONS_INTRODUCTION", $this->lng->txt(
"qpl_import_verify_found_questions"));
511 $this->tpl->setVariable(
"VERIFICATION_HEADING", $this->lng->txt(
"import_questions_into_qpl"));
512 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
516 $this->tpl->setVariable(
"VERIFICATION_HEADING", $this->lng->txt(
"import_qpl"));
518 $this->ctrl->setParameter($this,
"new_type", $this->type);
519 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
524 $this->tpl->setVariable(
"VALUE_IMPORT", $this->lng->txt(
"import"));
525 $this->tpl->setVariable(
"VALUE_CANCEL", $this->lng->txt(
"cancel"));
526 $value_questions_only = 0;
527 if ($questions_only) $value_questions_only = 1;
528 $this->tpl->setVariable(
"VALUE_QUESTIONS_ONLY", $value_questions_only);
530 $this->tpl->parseCurrentBlock();
538 if (
$_POST[
"questions_only"] == 1)
544 include_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
548 $newObj->setType(
$_GET[
"new_type"]);
550 $newObj->setTitle(
"dummy");
552 $newObj->setDescription(
"questionpool import");
554 $newObj->create(
true);
556 $newObj->createReference();
558 $newObj->putInTree(
$_GET[
"ref_id"]);
560 $newObj->setPermissions(
$_GET[
"ref_id"]);
562 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
566 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
568 $result = $qtiParser->startParsing();
571 if (strlen(
$_SESSION[
"qpl_import_xml_file"]))
573 include_once (
"./Modules/LearningModule/classes/class.ilContObjParser.php");
575 $contParser->setQuestionMapping($qtiParser->getImportMapping());
576 $contParser->startParsing();
580 $qpl_name =
$_POST[
"qpl_new"];
581 if ((strcmp($qpl_name, $newObj->getTitle()) != 0) && (strlen($qpl_name) > 0))
583 $newObj->setTitle($qpl_name);
588 include_once
"./Services/Utilities/classes/class.ilUtil.php";
591 if (
$_POST[
"questions_only"] == 1)
593 $this->ctrl->redirect($this,
"questions");
599 "&baseClass=ilObjQuestionPoolGUI");
605 if (
$_POST[
"questions_only"] == 1)
607 $this->ctrl->redirect($this,
"questions");
611 $this->ctrl->redirect($this,
"cancel");
628 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_import_question.html",
"Modules/TestQuestionPool");
629 $this->tpl->setCurrentBlock(
"adm_content");
630 $this->tpl->setVariable(
"TEXT_IMPORT_QUESTION", $this->lng->txt(
"import_question"));
631 $this->tpl->setVariable(
"TEXT_SELECT_FILE", $this->lng->txt(
"select_file"));
632 $this->tpl->setVariable(
"TEXT_UPLOAD", $this->lng->txt(
"upload"));
633 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
634 $this->tpl->parseCurrentBlock();
642 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
644 $q_gui->object->setObjId($this->object->getId());
645 $q_gui->object->createNewQuestion();
646 $this->ctrl->setParameterByClass(get_class($q_gui),
"q_id", $q_gui->object->getId());
647 $this->ctrl->setParameterByClass(get_class($q_gui),
"sel_question_types",
$_POST[
"sel_question_types"]);
648 $this->ctrl->redirectByClass(get_class($q_gui),
"editQuestion");
657 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
659 $q_gui->object->setObjId($this->object->getId());
660 $q_gui->object->createNewQuestion();
661 $this->ctrl->setParameterByClass(get_class($q_gui),
"q_id", $q_gui->object->getId());
662 $this->ctrl->setParameterByClass(get_class($q_gui),
"sel_question_types",
$_REQUEST[
"sel_question_types"]);
663 $this->ctrl->setParameterByClass(get_class($q_gui),
"prev_qid",
$_REQUEST[
"prev_qid"]);
664 $this->ctrl->redirectByClass(get_class($q_gui),
"editQuestion");
667 $class =
$_GET[
"sel_question_types"] .
'gui';
668 $this->ctrl->setParameterByClass($class,
"q_id",
$_REQUEST[
'q_id']);
669 $this->ctrl->setParameterByClass($class,
"sel_question_types",
$_REQUEST[
"sel_question_types"]);
670 $this->ctrl->setParameterByClass($class,
"prev_qid",
$_REQUEST[
"prev_qid"]);
671 $this->ctrl->redirectByClass($class,
"editQuestion");
685 "&baseClass=ilObjQuestionPoolGUI");
693 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.il_as_qpl_content.html",
"Modules/TestQuestionPool");
694 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
699 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
701 $title = $this->lng->txt(
"statistics") .
" - $question_title";
704 $this->tpl->setVariable(
"HEADER",
$title);
706 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
709 $color_class = array(
"tblrow1",
"tblrow2");
710 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_qpl_assessment_of_questions.html",
"Modules/TestQuestionPool");
711 if (!$total_of_answers)
713 $this->tpl->setCurrentBlock(
"emptyrow");
714 $this->tpl->setVariable(
"TXT_NO_ASSESSMENT", $this->lng->txt(
"qpl_assessment_no_assessment_of_questions"));
715 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
716 $this->tpl->parseCurrentBlock();
720 $this->tpl->setCurrentBlock(
"row");
721 $this->tpl->setVariable(
"TXT_RESULT", $this->lng->txt(
"qpl_assessment_total_of_answers"));
722 $this->tpl->setVariable(
"TXT_VALUE", $total_of_answers);
723 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
725 $this->tpl->parseCurrentBlock();
726 $this->tpl->setCurrentBlock(
"row");
727 $this->tpl->setVariable(
"TXT_RESULT", $this->lng->txt(
"qpl_assessment_total_of_right_answers"));
729 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
730 $this->tpl->parseCurrentBlock();
732 $this->tpl->setCurrentBlock(
"adm_content");
733 $this->tpl->setVariable(
"TXT_QUESTION_TITLE", $question_title);
734 $this->tpl->setVariable(
"TXT_RESULT", $this->lng->txt(
"result"));
735 $this->tpl->setVariable(
"TXT_VALUE", $this->lng->txt(
"value"));
736 $this->tpl->parseCurrentBlock();
742 $type =
$_GET[
"sel_question_types"];
743 $this->editQuestionForm($type);
753 if (count(
$_POST[
"q_id"]) < 1)
756 $this->ctrl->redirect($this,
"questions");
760 $deleteable_questions =& $this->
object->getDeleteableQuestionDetails(
$_POST[
"q_id"]);
761 include_once
"./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
763 $table_gui->
setEditable($rbacsystem->checkAccess(
'write',
$_GET[
'ref_id']));
764 $table_gui->setData($deleteable_questions);
765 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
775 foreach (
$_POST[
"q_id"] as $key => $value)
777 $this->
object->deleteQuestion($value);
781 $this->ctrl->setParameter($this,
'q_id',
'');
783 $this->ctrl->redirect($this,
"questions");
791 $this->ctrl->redirect($this,
"questions");
800 if (count(
$_POST[
"q_id"]) > 0)
802 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
804 $export_file = $qpl_exp->buildExportFile();
807 include_once
"./Services/Utilities/classes/class.ilUtil.php";
815 $this->ctrl->redirect($this,
"questions");
820 include_once
"./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
822 $table_gui->resetOffset();
823 $table_gui->writeFilterToSession();
829 include_once
"./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
831 $table_gui->resetOffset();
832 $table_gui->resetFilter();
844 if(get_class($this->
object) ==
"ilObjTest")
846 if (
$_GET[
"calling_test"] > 0)
849 $q_id =
$_GET[
"q_id"];
853 ilUtil::redirect(
"ilias.php?ref_id=".
$ref_id.
"&q_id=".$q_id.
"&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
855 ilUtil::redirect(
"ilias.php?ref_id=".
$ref_id.
"&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
863 $this->
object->purgeQuestions();
867 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_qpl_questionbrowser.html",
"Modules/TestQuestionPool");
868 include_once
"./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
870 $table_gui->
setEditable($rbacsystem->checkAccess(
'write',
$_GET[
'ref_id']));
871 $arrFilter = array();
872 foreach ($table_gui->getFilterItems() as $item)
874 if ($item->getValue() !==
false)
876 $arrFilter[$item->getPostVar()] = $item->getValue();
879 $data = $this->
object->getQuestionBrowserData($arrFilter);
880 $table_gui->setData(
$data);
881 $this->tpl->setVariable(
'TABLE', $table_gui->getHTML());
883 if ($rbacsystem->checkAccess(
'write',
$_GET[
'ref_id']))
885 $this->tpl->setCurrentBlock(
"QTypes");
886 $types =& $this->
object->getQuestionTypes();
887 $lastquestiontype = $ilUser->getPref(
"tst_lastquestiontype");
888 foreach ($types as $translation =>
$data)
890 if (
$data[
"type_tag"] == $lastquestiontype)
892 $this->tpl->setVariable(
"QUESTION_TYPE_SELECTED",
" selected=\"selected\"");
894 $this->tpl->setVariable(
"QUESTION_TYPE_ID",
$data[
"type_tag"]);
895 $this->tpl->setVariable(
"QUESTION_TYPE", $translation);
896 $this->tpl->parseCurrentBlock();
898 $this->tpl->setVariable(
"QUESTION_ADD", $this->lng->txt(
"create"));
899 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
'questions'));
900 $this->tpl->parseCurrentBlock();
911 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_qpl_printview.html",
"Modules/TestQuestionPool");
915 $this->tpl->setVariable(
"SELECTED_DETAILED",
" selected=\"selected\"");
917 case 'detailed_printview':
918 $this->tpl->setVariable(
"SELECTED_DETAILED_PRINTVIEW",
" selected=\"selected\"");
923 $this->tpl->setVariable(
"TEXT_DETAILED", $this->lng->txt(
"detailed_output_solutions"));
924 $this->tpl->setVariable(
"TEXT_DETAILED_PRINTVIEW", $this->lng->txt(
"detailed_output_printview"));
925 $this->tpl->setVariable(
"TEXT_OVERVIEW", $this->lng->txt(
"overview"));
926 $this->tpl->setVariable(
"TEXT_SUBMIT", $this->lng->txt(
"submit"));
927 $this->tpl->setVariable(
"OUTPUT_MODE", $this->lng->txt(
"output_mode"));
928 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
'print'));
930 include_once
"./Modules/TestQuestionPool/classes/tables/class.ilQuestionPoolPrintViewTableGUI.php";
932 $data = $this->
object->getPrintviewQuestions();
933 $table_gui->setData(
$data);
934 $this->tpl->setVariable(
'TABLE', $table_gui->getHTML());
940 $this->update = $this->
object->update();
949 if (array_key_exists(
"qpl_clipboard",
$_SESSION))
951 $this->
object->pasteFromClipboard();
958 $this->ctrl->redirect($this,
"questions");
966 if (count(
$_POST[
"q_id"]) > 0)
968 foreach (
$_POST[
"q_id"] as $key => $value)
970 $this->
object->copyToClipboard($value);
978 $this->ctrl->redirect($this,
"questions");
986 if (count(
$_POST[
"q_id"]) > 0)
988 foreach (
$_POST[
"q_id"] as $key => $value)
990 $this->
object->moveToClipboard($value);
998 $this->ctrl->redirect($this,
"questions");
1007 if ($rbacsystem->checkAccess(
"write",
$_GET[
'ref_id']))
1009 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
1010 $question_ids =& $this->
object->getAllQuestionIds();
1012 $qpl_exp->buildExportFile();
1013 $this->ctrl->redirectByClass(
"ilexportgui",
"");
1020 if ($rbacsystem->checkAccess(
"write",
$_GET[
'ref_id']))
1022 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
1023 $question_ids =& $this->
object->getAllQuestionIds();
1025 $qpl_exp->buildExportFile();
1026 $this->ctrl->redirectByClass(
"ilexportgui",
"");
1035 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1037 $this->ctrl->redirectByClass(get_class($q_gui),
"editQuestion");
1042 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1044 $form->setTarget(
"_top");
1045 $form->setFormAction($this->ctrl->getFormAction($this));
1046 $form->setTitle($this->lng->txt(
"import_qpl"));
1048 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
1049 $fi =
new ilFileInputGUI($this->lng->txt(
"import_file"),
"xmldoc");
1051 $fi->setRequired(
true);
1052 $form->addItem($fi);
1054 $form->addCommandButton(
"importFile", $this->lng->txt(
"import"));
1055 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
1066 if($form->checkInput())
1072 $this->tpl->setContent($form->getHTML());
1078 switch ($this->ctrl->getCmd())
1085 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"",
$_GET[
"ref_id"]);
1088 if (
$_GET[
"q_id"] > 0)
1090 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1094 $q_gui->object->setObjId($this->object->getId());
1095 $title = $q_gui->object->getTitle();
1100 $ilLocator->addItem(
$title, $this->ctrl->getLinkTargetByClass(get_class($q_gui),
"editQuestion"));
1105 $this->ctrl->setParameter($this,
'q_id',
'');
1106 $this->ctrl->redirect($this);
1117 if (
$_GET[
"q_id"] > 0)
1119 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1123 $q_gui->object->setObjId($this->object->getId());
1124 $title = $q_gui->object->getTitle();
1125 if (strcmp($this->ctrl->getCmd(),
"assessment") == 0)
1127 $title .=
" - " . $this->lng->txt(
"statistics");
1133 $this->tpl->setTitle(
$title);
1134 $this->tpl->setDescription($q_gui->object->getComment());
1135 $this->tpl->setTitleIcon(
ilUtil::getImagePath(
"icon_".$this->object->getType().
"_b.gif"), $this->lng->txt(
"obj_qpl"));
1140 $this->ctrl->setParameter($this,
'q_id',
'');
1141 $this->ctrl->redirect($this);
1146 $this->tpl->setTitle($this->object->getTitle());
1147 $this->tpl->setDescription($this->object->getLongDescription());
1148 $this->tpl->setTitleIcon(
ilUtil::getImagePath(
"icon_".$this->object->getType().
"_b.gif"), $this->lng->txt(
"obj_qpl"));
1161 $next_class = strtolower($this->ctrl->getNextClass());
1162 switch ($next_class)
1165 case "ilpermissiongui":
1166 case "ilmdeditorgui":
1174 $force_active =
false;
1175 $commands =
$_POST[
"cmd"];
1176 if (is_array($commands))
1178 foreach ($commands as $key => $value)
1180 if (preg_match(
"/^delete_.*/", $key, $matches) ||
1181 preg_match(
"/^addSelectGap_.*/", $key, $matches) ||
1182 preg_match(
"/^addTextGap_.*/", $key, $matches) ||
1183 preg_match(
"/^deleteImage_.*/", $key, $matches) ||
1184 preg_match(
"/^upload_.*/", $key, $matches) ||
1185 preg_match(
"/^addSuggestedSolution_.*/", $key, $matches)
1188 $force_active =
true;
1192 if (array_key_exists(
"imagemap_x",
$_POST))
1194 $force_active =
true;
1198 $force_active = ((strtolower($this->ctrl->getCmdClass()) == strtolower(get_class($this)) || strlen($this->ctrl->getCmdClass()) == 0) &&
1199 $this->ctrl->getCmd() ==
"")
1203 $tabs_gui->addTarget(
"assQuestions",
1204 $this->ctrl->getLinkTarget($this,
"questions"),
1205 array(
"questions",
"filter",
"resetFilter",
"createQuestion",
1206 "importQuestions",
"deleteQuestions",
"filterQuestionBrowser",
1207 "view",
"preview",
"editQuestion",
"exec_pg",
1208 "addItem",
"upload",
"save",
"cancel",
"addSuggestedSolution",
1209 "cancelExplorer",
"linkChilds",
"removeSuggestedSolution",
1210 "add",
"addYesNo",
"addTrueFalse",
"createGaps",
"saveEdit",
1211 "setMediaMode",
"uploadingImage",
"uploadingImagemap",
"addArea",
1212 "deletearea",
"saveShape",
"back",
"addPair",
"uploadingJavaapplet",
1213 "addParameter",
"assessment",
"addGIT",
"addST",
"addPG",
"delete",
1214 "toggleGraphicalAnswers",
"deleteAnswer",
"deleteImage",
"removeJavaapplet"),
1215 "",
"", $force_active);
1217 if ($ilAccess->checkAccess(
"visible",
"", $this->ref_id))
1219 $tabs_gui->addTarget(
"info_short",
1220 $this->ctrl->getLinkTarget($this,
"infoScreen"),
1221 array(
"infoScreen",
"showSummary"));
1224 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
'ref_id']))
1227 $tabs_gui->addTarget(
"settings",
1228 $this->ctrl->getLinkTarget($this,
'properties'),
1234 $tabs_gui->addTarget(
"print_view",
1235 $this->ctrl->getLinkTarget($this,
'print'),
1239 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1242 $tabs_gui->addTarget(
"meta_data",
1243 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
'listSection'),
1244 "",
"ilmdeditorgui");
1252 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1254 $tabs_gui->addTarget(
"export",
1255 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""),
1259 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->object->getRefId()))
1261 $tabs_gui->addTarget(
"perm_settings",
1262 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1273 $this->ctrl->setCmd(
"showSummary");
1274 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1283 global
$ilErr, $ilAccess;
1285 if(!$ilAccess->checkAccess(
"visible",
"", $this->ref_id))
1287 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"));
1290 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1292 $info->enablePrivateNotes();
1295 $info->addMetaDataSections($this->object->getId(), 0, $this->
object->getType());
1297 $this->ctrl->forwardCommand($info);
1312 if ($ilAccess->checkAccess(
"write",
"", $a_target))
1314 $_GET[
"baseClass"] =
"ilObjQuestionPoolGUI";
1315 $_GET[
"cmd"] =
"questions";
1316 $_GET[
"ref_id"] = $a_target;
1317 include_once(
"ilias.php");
1320 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1322 $_GET[
"cmd"] =
"frameset";
1323 $_GET[
"target"] =
"";
1324 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
1327 include(
"repository.php");
1330 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);