24 include_once
"./Services/Object/classes/class.ilObjectGUI.php";
25 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
26 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
27 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
28 include_once
"./Modules/Test/classes/class.ilObjTest.php";
65 $lng->loadLanguageModule(
"assessment");
68 $this->ctrl->saveParameter($this, array(
"ref_id",
"test_ref_id",
"calling_test",
"test_express_mode",
"q_id"));
87 if ((!$ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"])) && (!$ilAccess->checkAccess(
"visible",
"",
$_GET[
"ref_id"])))
90 $ilias->raiseError($this->lng->txt(
"permission_denied"), $ilias->error_obj->MESSAGE);
95 $ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
97 if(
'qpl' == $this->object->getType())
99 $ilNavigationHistory->addItem(
$_GET[
"ref_id"],
100 "ilias.php?baseClass=ilObjQuestionPoolGUI&cmd=questions&ref_id=" .
$_GET[
"ref_id"],
"qpl");
104 $cmd = $this->ctrl->getCmd(
"questions");
105 $next_class = $this->ctrl->getNextClass($this);
107 if( in_array($next_class, array(
'',
'ilobjquestionpoolgui')) &&
$cmd ==
'questions' )
114 $this->ctrl->setReturn($this,
"questions");
119 if (
$_GET[
"q_id"] < 1)
121 $q_type = (
$_POST[
"sel_question_types"] !=
"")
122 ?
$_POST[
"sel_question_types"]
123 :
$_GET[
"sel_question_types"];
125 if (
$cmd !=
"createQuestion" &&
$cmd !=
"createQuestionForTest"
126 && $next_class !=
"ilpageobjectgui")
128 if ((
$_GET[
"test_ref_id"] !=
"") or (
$_GET[
"calling_test"]))
139 case "ilcommonactiondispatchergui":
140 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
142 $this->ctrl->forwardCommand($gui);
145 case 'ilmdeditorgui':
146 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
148 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->WARNING);
151 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
153 $md_gui =
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
154 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
155 $this->ctrl->forwardCommand($md_gui);
157 case "ilpageobjectgui":
158 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
159 $this->tpl->setCurrentBlock(
"ContentStyle");
160 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
162 $this->tpl->parseCurrentBlock();
165 $this->tpl->setCurrentBlock(
"SyntaxStyle");
166 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
168 $this->tpl->parseCurrentBlock();
169 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
171 $q_gui->setQuestionTabs();
172 $q_gui->outAdditionalOutput();
173 $q_gui->object->setObjId($this->object->getId());
174 $question = $q_gui->object;
175 $this->ctrl->saveParameter($this,
"q_id");
176 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
177 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
178 $this->lng->loadLanguageModule(
"content");
179 $this->ctrl->setReturnByClass(
"ilPageObjectGUI",
"view");
180 $this->ctrl->setReturn($this,
"questions");
183 $page_gui->setEditPreview(
true);
184 $page_gui->setEnabledTabs(
false);
185 $page_gui->setEnabledInternalLinks(
false);
186 if (strlen($this->ctrl->getCmd()) == 0 && !isset(
$_POST[
"editImagemapForward_x"]))
188 $this->ctrl->setCmdClass(get_class($page_gui));
189 $this->ctrl->setCmd(
"preview");
192 $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
193 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
194 $page_gui->setOutputMode(
"edit");
195 $page_gui->setHeader($question->getTitle());
196 $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this,
"downloadFile"));
197 $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this,
"fullscreen"));
198 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this));
199 $page_gui->setPresentationTitle($question->getTitle());
200 $ret = $this->ctrl->forwardCommand($page_gui);
201 $tpl->setContent(
$ret);
204 case 'ilpermissiongui':
205 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
207 $ret = $this->ctrl->forwardCommand($perm_gui);
210 case 'ilobjectcopygui':
211 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
214 $this->ctrl->forwardCommand($cp);
218 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
220 $exp_gui->addFormat(
"zip", $this->lng->txt(
'qpl_export_xml'), $this,
"createExportQTI");
221 $exp_gui->addFormat(
"xls", $this->lng->txt(
'qpl_export_excel'), $this,
"createExportExcel");
224 $ret = $this->ctrl->forwardCommand($exp_gui);
227 case "ilinfoscreengui":
231 case 'ilassquestionhintsgui':
234 $this->ctrl->setReturn($this,
"questions");
237 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
239 $questionGUI->object->setObjId($this->object->getId());
240 $questionGUI->setQuestionTabs();
243 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
245 $ilCtrl->forwardCommand($gui);
249 case "ilobjquestionpoolgui":
252 if(
$cmd ==
'questions' )
254 $this->ctrl->setParameter($this,
'q_id',
'');
262 $this->ctrl->setReturn($this,
"questions");
263 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
265 $q_gui->object->setObjId($this->object->getId());
266 $q_gui->setQuestionTabs();
267 $ret = $this->ctrl->forwardCommand($q_gui);
271 if (strtolower(
$_GET[
"baseClass"]) !=
"iladministrationgui" &&
283 $save = ((strcmp($this->ctrl->getCmd(),
"save") == 0)) ?
true :
false;
285 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
287 $form->setFormAction($this->ctrl->getFormAction($this,
'properties'));
288 $form->setTitle($this->lng->txt(
"properties"));
289 $form->setMultipart(
false);
291 $form->setId(
"properties");
295 $online->
setInfo($this->lng->txt(
"qpl_online_property_description"));
296 $online->setChecked($this->object->getOnline());
297 $form->addItem($online);
299 $form->addCommandButton(
"saveProperties", $this->lng->txt(
"save"));
305 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
313 $qpl_online =
$_POST[
"online"];
314 if (strlen($qpl_online) == 0) $qpl_online =
"0";
315 $this->
object->setOnline($qpl_online);
316 $this->
object->saveToDb();
318 $this->ctrl->redirect($this,
"properties");
327 include_once(
"./Modules/File/classes/class.ilObjFile.php");
329 $fileObj->sendFile();
338 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
339 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
342 $page_gui->showMediaFullscreen();
360 $_POST[
"filter_text"] =
"";
361 $_POST[
"sel_filter_type"] =
"";
370 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
372 $pg_obj->send_paragraph (
$_GET[
"par_id"],
$_GET[
"downloadtitle"]);
381 $this->ctrl->setParameter($this,
'new_type',
$_REQUEST[
'new_type']);
382 if ($_FILES[
"xmldoc"][
"error"] > UPLOAD_ERR_OK)
385 $this->ctrl->redirect($this,
'create');
389 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
393 $file = pathinfo($_FILES[
"xmldoc"][
"name"]);
394 $full_path = $basedir.
"/".$_FILES[
"xmldoc"][
"name"];
395 $GLOBALS[
'ilLog']->write(__METHOD__.
": full path " . $full_path);
396 include_once
"./Services/Utilities/classes/class.ilUtil.php";
398 $GLOBALS[
'ilLog']->write(__METHOD__.
": full path " . $full_path);
399 if (strcmp($_FILES[
"xmldoc"][
"type"],
"text/xml") == 0)
401 $qti_file = $full_path;
410 $subdir = basename(
$file[
"basename"],
".".
$file[
"extension"]);
417 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
419 $result = $qtiParser->startParsing();
420 $founditems =& $qtiParser->getFoundItems();
421 if (count($founditems) == 0)
429 $this->ctrl->redirect($this,
'create');
435 foreach ($founditems as $item)
437 if (strlen($item[
"type"]))
453 $this->ctrl->redirect($this,
'create');
457 $_SESSION[
"qpl_import_xml_file"] = $xml_file;
458 $_SESSION[
"qpl_import_qti_file"] = $qti_file;
459 $_SESSION[
"qpl_import_subdir"] = $subdir;
461 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.qpl_import_verification.html",
462 "Modules/TestQuestionPool");
463 $row_class = array(
"tblrow1",
"tblrow2");
465 foreach ($founditems as $item)
467 $this->tpl->setCurrentBlock(
"verification_row");
468 $this->tpl->setVariable(
"ROW_CLASS", $row_class[$counter++ % 2]);
469 $this->tpl->setVariable(
"QUESTION_TITLE", $item[
"title"]);
470 $this->tpl->setVariable(
"QUESTION_IDENT", $item[
"ident"]);
471 include_once
"./Services/QTI/classes/class.ilQTIItem.php";
472 switch ($item[
"type"])
475 $type = $this->lng->txt(
"assClozeTest");
478 $type = $this->lng->txt(
"assImagemapQuestion");
481 $type = $this->lng->txt(
"assJavaApplet");
484 $type = $this->lng->txt(
"assMatchingQuestion");
487 $type = $this->lng->txt(
"assMultipleChoice");
490 $type = $this->lng->txt(
"assSingleChoice");
493 $type = $this->lng->txt(
"assOrderingQuestion");
496 $type = $this->lng->txt(
"assTextQuestion");
499 $type = $this->lng->txt(
"assNumeric");
502 $type = $this->lng->txt(
"assTextSubset");
505 $type = $this->lng->txt($item[
"type"]);
509 if (strcmp($type,
"-" . $item[
"type"] .
"-") == 0)
511 global $ilPluginAdmin;
512 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_MODULE,
"TestQuestionPool",
"qst");
513 foreach ($pl_names as $pl_name)
516 if (strcmp($pl->getQuestionType(), $item[
"type"]) == 0)
518 $type = $pl->getQuestionTypeTranslation();
522 $this->tpl->setVariable(
"QUESTION_TYPE", $type);
523 $this->tpl->parseCurrentBlock();
526 $this->tpl->setCurrentBlock(
"import_qpl");
527 if (is_file($xml_file))
530 $fh = @fopen($xml_file,
"r") or die(
"");
531 $xml = @fread($fh, filesize($xml_file));
533 if (preg_match(
"/<ContentObject.*?MetaData.*?General.*?Title[^>]*?>([^<]*?)</", $xml, $matches))
535 $this->tpl->setVariable(
"VALUE_NEW_QUESTIONPOOL", $matches[1]);
538 $this->tpl->setVariable(
"TEXT_CREATE_NEW_QUESTIONPOOL", $this->lng->txt(
"qpl_import_create_new_qpl"));
539 $this->tpl->parseCurrentBlock();
541 $this->tpl->setCurrentBlock(
"adm_content");
542 $this->tpl->setVariable(
"TEXT_TYPE", $this->lng->txt(
"question_type"));
543 $this->tpl->setVariable(
"TEXT_TITLE", $this->lng->txt(
"question_title"));
544 $this->tpl->setVariable(
"FOUND_QUESTIONS_INTRODUCTION", $this->lng->txt(
"qpl_import_verify_found_questions"));
547 $this->tpl->setVariable(
"VERIFICATION_HEADING", $this->lng->txt(
"import_questions_into_qpl"));
548 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
552 $this->tpl->setVariable(
"VERIFICATION_HEADING", $this->lng->txt(
"import_qpl"));
554 $this->ctrl->setParameter($this,
"new_type", $this->type);
555 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
560 $this->tpl->setVariable(
"VALUE_IMPORT", $this->lng->txt(
"import"));
561 $this->tpl->setVariable(
"VALUE_CANCEL", $this->lng->txt(
"cancel"));
562 $value_questions_only = 0;
563 if ($questions_only) $value_questions_only = 1;
564 $this->tpl->setVariable(
"VALUE_QUESTIONS_ONLY", $value_questions_only);
566 $this->tpl->parseCurrentBlock();
574 if (
$_POST[
"questions_only"] == 1)
580 include_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
584 $newObj->setType(
$_GET[
"new_type"]);
586 $newObj->setTitle(
"dummy");
588 $newObj->setDescription(
"questionpool import");
590 $newObj->create(
true);
592 $newObj->createReference();
594 $newObj->putInTree(
$_GET[
"ref_id"]);
596 $newObj->setPermissions(
$_GET[
"ref_id"]);
598 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
602 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
604 $result = $qtiParser->startParsing();
607 if (strlen(
$_SESSION[
"qpl_import_xml_file"]))
609 include_once (
"./Modules/LearningModule/classes/class.ilContObjParser.php");
611 $contParser->setQuestionMapping($qtiParser->getImportMapping());
612 $contParser->startParsing();
616 $qpl_name =
$_POST[
"qpl_new"];
617 if ((strcmp($qpl_name, $newObj->getTitle()) != 0) && (strlen($qpl_name) > 0))
619 $newObj->setTitle($qpl_name);
624 include_once
"./Services/Utilities/classes/class.ilUtil.php";
627 if (
$_POST[
"questions_only"] == 1)
629 $this->ctrl->redirect($this,
"questions");
635 "&baseClass=ilObjQuestionPoolGUI");
641 if (
$_POST[
"questions_only"] == 1)
643 $this->ctrl->redirect($this,
"questions");
647 $this->ctrl->redirect($this,
"cancel");
664 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_import_question.html",
"Modules/TestQuestionPool");
665 $this->tpl->setCurrentBlock(
"adm_content");
666 $this->tpl->setVariable(
"TEXT_IMPORT_QUESTION", $this->lng->txt(
"import_question"));
667 $this->tpl->setVariable(
"TEXT_SELECT_FILE", $this->lng->txt(
"select_file"));
668 $this->tpl->setVariable(
"TEXT_UPLOAD", $this->lng->txt(
"upload"));
669 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
670 $this->tpl->parseCurrentBlock();
678 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
680 $q_gui->object->setObjId($this->object->getId());
681 $q_gui->object->createNewQuestion();
682 $this->ctrl->setParameterByClass(get_class($q_gui),
"q_id", $q_gui->object->getId());
683 $this->ctrl->setParameterByClass(get_class($q_gui),
"sel_question_types",
$_POST[
"sel_question_types"]);
684 $this->ctrl->redirectByClass(get_class($q_gui),
"editQuestion");
693 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
695 $q_gui->object->setObjId($this->object->getId());
696 $q_gui->object->createNewQuestion();
697 $this->ctrl->setParameterByClass(get_class($q_gui),
"q_id", $q_gui->object->getId());
698 $this->ctrl->setParameterByClass(get_class($q_gui),
"sel_question_types",
$_REQUEST[
"sel_question_types"]);
699 $this->ctrl->setParameterByClass(get_class($q_gui),
"prev_qid",
$_REQUEST[
"prev_qid"]);
700 $this->ctrl->redirectByClass(get_class($q_gui),
"editQuestion");
703 $class =
$_GET[
"sel_question_types"] .
'gui';
704 $this->ctrl->setParameterByClass($class,
"q_id",
$_REQUEST[
'q_id']);
705 $this->ctrl->setParameterByClass($class,
"sel_question_types",
$_REQUEST[
"sel_question_types"]);
706 $this->ctrl->setParameterByClass($class,
"prev_qid",
$_REQUEST[
"prev_qid"]);
707 $this->ctrl->redirectByClass($class,
"editQuestion");
721 "&baseClass=ilObjQuestionPoolGUI");
729 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.il_as_qpl_content.html",
"Modules/TestQuestionPool");
730 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
735 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
737 $title = $this->lng->txt(
"statistics") .
" - $question_title";
740 $this->tpl->setVariable(
"HEADER",
$title);
742 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
745 $color_class = array(
"tblrow1",
"tblrow2");
746 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_qpl_assessment_of_questions.html",
"Modules/TestQuestionPool");
747 if (!$total_of_answers)
749 $this->tpl->setCurrentBlock(
"emptyrow");
750 $this->tpl->setVariable(
"TXT_NO_ASSESSMENT", $this->lng->txt(
"qpl_assessment_no_assessment_of_questions"));
751 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
752 $this->tpl->parseCurrentBlock();
756 $this->tpl->setCurrentBlock(
"row");
757 $this->tpl->setVariable(
"TXT_RESULT", $this->lng->txt(
"qpl_assessment_total_of_answers"));
758 $this->tpl->setVariable(
"TXT_VALUE", $total_of_answers);
759 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
761 $this->tpl->parseCurrentBlock();
762 $this->tpl->setCurrentBlock(
"row");
763 $this->tpl->setVariable(
"TXT_RESULT", $this->lng->txt(
"qpl_assessment_total_of_right_answers"));
765 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
766 $this->tpl->parseCurrentBlock();
768 $this->tpl->setCurrentBlock(
"adm_content");
769 $this->tpl->setVariable(
"TXT_QUESTION_TITLE", $question_title);
770 $this->tpl->setVariable(
"TXT_RESULT", $this->lng->txt(
"result"));
771 $this->tpl->setVariable(
"TXT_VALUE", $this->lng->txt(
"value"));
772 $this->tpl->parseCurrentBlock();
778 $type =
$_GET[
"sel_question_types"];
779 $this->editQuestionForm($type);
789 if (count(
$_POST[
"q_id"]) < 1)
792 $this->ctrl->redirect($this,
"questions");
796 $deleteable_questions =& $this->
object->getDeleteableQuestionDetails(
$_POST[
"q_id"]);
797 include_once
"./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
799 $table_gui->
setEditable($rbacsystem->checkAccess(
'write',
$_GET[
'ref_id']));
800 $table_gui->setData($deleteable_questions);
801 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
811 foreach (
$_POST[
"q_id"] as $key => $value)
813 $this->
object->deleteQuestion($value);
814 $this->
object->cleanupClipboard($value);
818 $this->ctrl->setParameter($this,
'q_id',
'');
820 $this->ctrl->redirect($this,
"questions");
828 $this->ctrl->redirect($this,
"questions");
837 if (count(
$_POST[
"q_id"]) > 0)
839 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
841 $export_file = $qpl_exp->buildExportFile();
844 include_once
"./Services/Utilities/classes/class.ilUtil.php";
852 $this->ctrl->redirect($this,
"questions");
857 include_once
"./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
859 $table_gui->resetOffset();
860 $table_gui->writeFilterToSession();
866 include_once
"./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
868 $table_gui->resetOffset();
869 $table_gui->resetFilter();
881 if(get_class($this->
object) ==
"ilObjTest")
883 if (
$_GET[
"calling_test"] > 0)
886 $q_id =
$_GET[
"q_id"];
890 ilUtil::redirect(
"ilias.php?ref_id=".
$ref_id.
"&q_id=".$q_id.
"&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
892 ilUtil::redirect(
"ilias.php?ref_id=".
$ref_id.
"&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
901 $this->
object->purgeQuestions();
906 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_qpl_questionbrowser.html",
"Modules/TestQuestionPool");
907 include_once
"./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
909 $table_gui->
setEditable($rbacsystem->checkAccess(
'write',
$_GET[
'ref_id']));
910 $arrFilter = array();
911 foreach ($table_gui->getFilterItems() as $item)
913 if ($item->getValue() !==
false)
915 $arrFilter[$item->getPostVar()] = $item->getValue();
918 $data = $this->
object->getQuestionBrowserData($arrFilter);
919 $table_gui->setData(
$data);
920 $this->tpl->setVariable(
'TABLE', $table_gui->getHTML());
922 if ($rbacsystem->checkAccess(
'write',
$_GET[
'ref_id']))
924 $this->tpl->setCurrentBlock(
"QTypes");
925 $types =& $this->
object->getQuestionTypes(
false,
true);
927 foreach ($types as $translation =>
$data)
933 $this->tpl->setVariable(
"QUESTION_TYPE_ID",
$data[
"type_tag"]);
934 $this->tpl->setVariable(
"QUESTION_TYPE", $translation);
935 $this->tpl->parseCurrentBlock();
937 $this->tpl->setVariable(
"QUESTION_ADD", $this->lng->txt(
"create"));
938 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
'questions'));
939 $this->tpl->parseCurrentBlock();
946 public function printObject()
953 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
'print'));
954 require_once
'Services/Form/classes/class.ilSelectInputGUI.php';
957 'overview' => $this->lng->txt(
'overview'),
958 'detailed' => $this->lng->txt(
'detailed_output_solutions'),
959 'detailed_printview' => $this->lng->txt(
'detailed_output_printview')
963 $ilToolbar->setFormName(
'printviewOptions');
964 $ilToolbar->addInputItem($mode,
true);
965 $ilToolbar->addFormButton($this->lng->txt(
'submit'),
'print');
967 include_once
"./Modules/TestQuestionPool/classes/tables/class.ilQuestionPoolPrintViewTableGUI.php";
969 $data = $this->
object->getPrintviewQuestions();
970 $table_gui->setData(
$data);
971 $this->tpl->setContent($table_gui->getHTML());
977 $this->update = $this->
object->update();
986 if (array_key_exists(
"qpl_clipboard",
$_SESSION))
988 $this->
object->pasteFromClipboard();
995 $this->ctrl->redirect($this,
"questions");
1003 if (count(
$_POST[
"q_id"]) > 0)
1005 foreach (
$_POST[
"q_id"] as $key => $value)
1007 $this->
object->copyToClipboard($value);
1015 $this->ctrl->redirect($this,
"questions");
1023 if (count(
$_POST[
"q_id"]) > 0)
1025 foreach (
$_POST[
"q_id"] as $key => $value)
1027 $this->
object->moveToClipboard($value);
1035 $this->ctrl->redirect($this,
"questions");
1044 if ($rbacsystem->checkAccess(
"write",
$_GET[
'ref_id']))
1046 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
1047 $question_ids =& $this->
object->getAllQuestionIds();
1049 $qpl_exp->buildExportFile();
1050 $this->ctrl->redirectByClass(
"ilexportgui",
"");
1057 if ($rbacsystem->checkAccess(
"write",
$_GET[
'ref_id']))
1059 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
1060 $question_ids =& $this->
object->getAllQuestionIds();
1062 $qpl_exp->buildExportFile();
1063 $this->ctrl->redirectByClass(
"ilexportgui",
"");
1072 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1074 $this->ctrl->redirectByClass(get_class($q_gui),
"editQuestion");
1079 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1081 $form->setTarget(
"_top");
1082 $form->setFormAction($this->ctrl->getFormAction($this));
1083 $form->setTitle($this->lng->txt(
"import_qpl"));
1085 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
1086 $fi =
new ilFileInputGUI($this->lng->txt(
"import_file"),
"xmldoc");
1088 $fi->setRequired(
true);
1089 $form->addItem($fi);
1091 $form->addCommandButton(
"importFile", $this->lng->txt(
"import"));
1092 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
1103 if($form->checkInput())
1109 $this->tpl->setContent($form->getHTML());
1115 switch ($this->ctrl->getCmd())
1122 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"",
$_GET[
"ref_id"]);
1125 if (
$_GET[
"q_id"] > 0)
1127 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1131 $q_gui->object->setObjId($this->object->getId());
1132 $title = $q_gui->object->getTitle();
1137 $ilLocator->addItem(
$title, $this->ctrl->getLinkTargetByClass(get_class($q_gui),
"editQuestion"));
1142 $this->ctrl->setParameter($this,
'q_id',
'');
1143 $this->ctrl->redirect($this);
1154 if (
$_GET[
"q_id"] > 0)
1156 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1160 $q_gui->object->setObjId($this->object->getId());
1161 $title = $q_gui->object->getTitle();
1162 if (strcmp($this->ctrl->getCmd(),
"assessment") == 0)
1164 $title .=
" - " . $this->lng->txt(
"statistics");
1170 $this->tpl->setTitle(
$title);
1171 $this->tpl->setDescription($q_gui->object->getComment());
1172 $this->tpl->setTitleIcon(
ilUtil::getImagePath(
"icon_".$this->object->getType().
"_b.png"), $this->lng->txt(
"obj_qpl"));
1177 $this->ctrl->setParameter($this,
'q_id',
'');
1178 $this->ctrl->redirect($this);
1183 $this->tpl->setTitle($this->object->getTitle());
1184 $this->tpl->setDescription($this->object->getLongDescription());
1185 $this->tpl->setTitleIcon(
ilUtil::getImagePath(
"icon_".$this->object->getType().
"_b.png"), $this->lng->txt(
"obj_qpl"));
1196 global $ilAccess, $ilHelp;
1199 $ilHelp->setScreenIdComponent(
"qpl");
1201 $next_class = strtolower($this->ctrl->getNextClass());
1202 switch ($next_class)
1205 case "ilpermissiongui":
1206 case "ilmdeditorgui":
1214 $force_active =
false;
1215 $commands =
$_POST[
"cmd"];
1216 if (is_array($commands))
1218 foreach ($commands as $key => $value)
1220 if (preg_match(
"/^delete_.*/", $key, $matches) ||
1221 preg_match(
"/^addSelectGap_.*/", $key, $matches) ||
1222 preg_match(
"/^addTextGap_.*/", $key, $matches) ||
1223 preg_match(
"/^deleteImage_.*/", $key, $matches) ||
1224 preg_match(
"/^upload_.*/", $key, $matches) ||
1225 preg_match(
"/^addSuggestedSolution_.*/", $key, $matches)
1228 $force_active =
true;
1232 if (array_key_exists(
"imagemap_x",
$_POST))
1234 $force_active =
true;
1238 $force_active = ((strtolower($this->ctrl->getCmdClass()) == strtolower(get_class($this)) || strlen($this->ctrl->getCmdClass()) == 0) &&
1239 $this->ctrl->getCmd() ==
"")
1243 $tabs_gui->addTarget(
"assQuestions",
1244 $this->ctrl->getLinkTarget($this,
"questions"),
1245 array(
"questions",
"filter",
"resetFilter",
"createQuestion",
1246 "importQuestions",
"deleteQuestions",
"filterQuestionBrowser",
1247 "view",
"preview",
"editQuestion",
"exec_pg",
1248 "addItem",
"upload",
"save",
"cancel",
"addSuggestedSolution",
1249 "cancelExplorer",
"linkChilds",
"removeSuggestedSolution",
1250 "add",
"addYesNo",
"addTrueFalse",
"createGaps",
"saveEdit",
1251 "setMediaMode",
"uploadingImage",
"uploadingImagemap",
"addArea",
1252 "deletearea",
"saveShape",
"back",
"addPair",
"uploadingJavaapplet",
1253 "addParameter",
"assessment",
"addGIT",
"addST",
"addPG",
"delete",
1254 "toggleGraphicalAnswers",
"deleteAnswer",
"deleteImage",
"removeJavaapplet"),
1255 "",
"", $force_active);
1257 if ($ilAccess->checkAccess(
"visible",
"", $this->ref_id))
1259 $tabs_gui->addTarget(
"info_short",
1260 $this->ctrl->getLinkTarget($this,
"infoScreen"),
1261 array(
"infoScreen",
"showSummary"));
1264 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
'ref_id']))
1267 $tabs_gui->addTarget(
"settings",
1268 $this->ctrl->getLinkTarget($this,
'properties'),
1274 $tabs_gui->addTarget(
"print_view",
1275 $this->ctrl->getLinkTarget($this,
'print'),
1279 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1282 $tabs_gui->addTarget(
"meta_data",
1283 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
'listSection'),
1284 "",
"ilmdeditorgui");
1292 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1294 $tabs_gui->addTarget(
"export",
1295 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""),
1299 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->object->getRefId()))
1301 $tabs_gui->addTarget(
"perm_settings",
1302 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1313 $this->ctrl->setCmd(
"showSummary");
1314 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1323 global
$ilErr, $ilAccess;
1325 if(!$ilAccess->checkAccess(
"visible",
"", $this->ref_id))
1327 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"));
1330 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1332 $info->enablePrivateNotes();
1335 $info->addMetaDataSections($this->object->getId(), 0, $this->
object->getType());
1337 $this->ctrl->forwardCommand($info);
1352 if ($ilAccess->checkAccess(
"write",
"", $a_target))
1354 $_GET[
"baseClass"] =
"ilObjQuestionPoolGUI";
1355 $_GET[
"cmd"] =
"questions";
1356 $_GET[
"ref_id"] = $a_target;
1357 include_once(
"ilias.php");
1360 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1366 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);