43 include_once
"./classes/class.ilObjectGUI.php";
44 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
45 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
46 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
57 $lng->loadLanguageModule(
"assessment");
60 $this->ctrl->saveParameter($this, array(
"ref_id",
"test_ref_id",
"calling_test"));
70 global $ilLocator, $ilAccess, $ilNavigationHistory,
$tpl;
73 if (!$ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
75 $this->ilias->raiseError($this->lng->txt(
"permission_denied"), $this->ilias->error_obj->MESSAGE);
79 $ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
81 $ilNavigationHistory->addItem(
$_GET[
"ref_id"],
82 "ilias.php?baseClass=ilObjQuestionPoolGUI&cmd=questions&ref_id=".
$_GET[
"ref_id"],
"qpl");
86 $cmd = $this->ctrl->getCmd(
"questions");
87 $next_class = $this->ctrl->getNextClass($this);
88 $this->ctrl->setReturn($this,
"questions");
89 if (
$_GET[
"q_id"] < 1)
91 $q_type = ($_POST[
"sel_question_types"] !=
"")
92 ? $_POST[
"sel_question_types"]
93 :
$_GET[
"sel_question_types"];
95 if (
$cmd !=
"createQuestion" &&
$cmd !=
"createQuestionForTest"
96 && $next_class !=
"ilpageobjectgui")
98 if ((
$_GET[
"test_ref_id"] !=
"") or (
$_GET[
"calling_test"]))
109 case 'ilmdeditorgui':
110 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
112 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
113 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
114 $this->ctrl->forwardCommand($md_gui);
116 case "ilpageobjectgui":
117 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
118 $this->tpl->setCurrentBlock(
"ContentStyle");
119 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
121 $this->tpl->parseCurrentBlock();
124 $this->tpl->setCurrentBlock(
"SyntaxStyle");
125 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
127 $this->tpl->parseCurrentBlock();
128 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
130 $q_gui->setQuestionTabs();
131 $q_gui->outAdditionalOutput();
132 $q_gui->object->setObjId($this->object->getId());
133 $question =& $q_gui->object;
134 $this->ctrl->saveParameter($this,
"q_id");
135 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
136 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
137 $this->lng->loadLanguageModule(
"content");
138 $this->ctrl->setReturnByClass(
"ilPageObjectGUI",
"view");
139 $this->ctrl->setReturn($this,
"questions");
142 $page_gui->setEditPreview(
true);
143 $page_gui->setEnabledTabs(
false);
144 $page_gui->setEnabledInternalLinks(
false);
145 if (strlen($this->ctrl->getCmd()) == 0)
147 $this->ctrl->setCmdClass(get_class($page_gui));
148 $this->ctrl->setCmd(
"preview");
151 $page_gui->setQuestionHTML($q_gui->getPreview(TRUE));
152 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
153 $page_gui->setOutputMode(
"edit");
154 $page_gui->setHeader($question->getTitle());
155 $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this,
"downloadFile"));
156 $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this,
"fullscreen"));
157 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this));
158 $page_gui->setPresentationTitle($question->getTitle());
159 $ret =& $this->ctrl->forwardCommand($page_gui);
160 $tpl->setContent(
$ret);
163 case 'ilpermissiongui':
164 include_once(
"./classes/class.ilPermissionGUI.php");
166 $ret =& $this->ctrl->forwardCommand($perm_gui);
168 case "ilobjquestionpoolgui":
174 $this->ctrl->setReturn($this,
"questions");
175 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
177 $q_gui->object->setObjId($this->object->getId());
178 $q_gui->setQuestionTabs();
179 $ret =& $this->ctrl->forwardCommand($q_gui);
183 if (strtolower(
$_GET[
"baseClass"]) !=
"iladministrationgui" &&
195 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_qpl_properties.html",
"Modules/TestQuestionPool");
196 $this->tpl->setCurrentBlock(
"adm_content");
197 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
198 $this->tpl->setVariable(
"HEADING_GENERAL", $this->lng->txt(
"qpl_general_properties"));
199 $this->tpl->setVariable(
"PROPERTY_ONLINE", $this->lng->txt(
"qpl_online_property"));
200 $this->tpl->setVariable(
"PROPERTY_ONLINE_DESCRIPTION", $this->lng->txt(
"qpl_online_property_description"));
201 if ($this->object->getOnline() == 1)
203 $this->tpl->setVariable(
"PROPERTY_ONLINE_CHECKED",
" checked=\"checked\"");
206 if ($rbacsystem->checkAccess(
"write", $this->ref_id))
208 $this->tpl->setVariable(
"SAVE", $this->lng->txt(
"save"));
212 $this->tpl->setVariable(
"PROPERTY_ONLINE_DISABLED",
" disabled=\"disabled\"");
214 $this->tpl->parseCurrentBlock();
234 $qpl_online = $_POST[
"online"];
235 if (strlen($qpl_online) == 0) $qpl_online =
"0";
236 $this->
object->setOnline($qpl_online);
237 $this->
object->saveToDb();
239 $this->ctrl->redirect($this,
"properties");
248 include_once(
"./Modules/File/classes/class.ilObjFile.php");
250 $fileObj->sendFile();
259 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
260 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
263 $page_gui->showMediaFullscreen();
281 $_POST[
"filter_text"] =
"";
282 $_POST[
"sel_filter_type"] =
"";
291 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
293 $pg_obj->send_paragraph (
$_GET[
"par_id"],
$_GET[
"downloadtitle"]);
302 if ($_FILES[
"xmldoc"][
"error"] > UPLOAD_ERR_OK)
309 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
313 $file = pathinfo($_FILES[
"xmldoc"][
"name"]);
315 include_once
"./Services/Utilities/classes/class.ilUtil.php";
317 if (strcmp($_FILES[
"xmldoc"][
"type"],
"text/xml") == 0)
319 $qti_file = $full_path;
327 $subdir = basename(
$file[
"basename"],
".".
$file[
"extension"]);
333 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
335 $result = $qtiParser->startParsing();
336 $founditems =& $qtiParser->getFoundItems();
337 if (count($founditems) == 0)
351 foreach ($founditems as $item)
353 if (strlen($item[
"type"]))
373 $_SESSION[
"qpl_import_xml_file"] = $xml_file;
374 $_SESSION[
"qpl_import_qti_file"] = $qti_file;
375 $_SESSION[
"qpl_import_subdir"] = $subdir;
377 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.qpl_import_verification.html");
378 $row_class = array(
"tblrow1",
"tblrow2");
380 foreach ($founditems as $item)
382 $this->tpl->setCurrentBlock(
"verification_row");
383 $this->tpl->setVariable(
"ROW_CLASS", $row_class[$counter++ % 2]);
384 $this->tpl->setVariable(
"QUESTION_TITLE", $item[
"title"]);
385 $this->tpl->setVariable(
"QUESTION_IDENT", $item[
"ident"]);
386 include_once
"./Services/QTI/classes/class.ilQTIItem.php";
387 switch ($item[
"type"])
390 $type = $this->lng->txt(
"assClozeTest");
393 $type = $this->lng->txt(
"assImagemapQuestion");
396 $type = $this->lng->txt(
"assJavaApplet");
399 $type = $this->lng->txt(
"assMatchingQuestion");
402 $type = $this->lng->txt(
"assMultipleChoice");
405 $type = $this->lng->txt(
"assSingleChoice");
408 $type = $this->lng->txt(
"assOrderingQuestion");
411 $type = $this->lng->txt(
"assTextQuestion");
414 $type = $this->lng->txt(
"assNumeric");
417 $type = $this->lng->txt(
"assTextSubset");
420 $type = $this->lng->txt($item[
"type"]);
424 if (strcmp($type,
"-" . $item[
"type"] .
"-") == 0)
426 global $ilPluginAdmin;
427 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_MODULE,
"TestQuestionPool",
"qst");
428 foreach ($pl_names as $pl_name)
431 if (strcmp($pl->getQuestionType(), $item[
"type"]) == 0)
433 $type = $pl->getQuestionTypeTranslation();
437 $this->tpl->setVariable(
"QUESTION_TYPE", $type);
438 $this->tpl->parseCurrentBlock();
441 $this->tpl->setCurrentBlock(
"import_qpl");
442 if (is_file($xml_file))
445 $fh = @fopen($xml_file,
"r") or die(
"");
446 $xml = @fread($fh, filesize($xml_file));
448 if (preg_match(
"/<ContentObject.*?MetaData.*?General.*?Title[^>]*?>([^<]*?)</", $xml, $matches))
450 $this->tpl->setVariable(
"VALUE_NEW_QUESTIONPOOL", $matches[1]);
453 $this->tpl->setVariable(
"TEXT_CREATE_NEW_QUESTIONPOOL", $this->lng->txt(
"qpl_import_create_new_qpl"));
454 $this->tpl->parseCurrentBlock();
456 $this->tpl->setCurrentBlock(
"adm_content");
457 $this->tpl->setVariable(
"TEXT_TYPE", $this->lng->txt(
"question_type"));
458 $this->tpl->setVariable(
"TEXT_TITLE", $this->lng->txt(
"question_title"));
459 $this->tpl->setVariable(
"FOUND_QUESTIONS_INTRODUCTION", $this->lng->txt(
"qpl_import_verify_found_questions"));
462 $this->tpl->setVariable(
"VERIFICATION_HEADING", $this->lng->txt(
"import_questions_into_qpl"));
463 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
467 $this->tpl->setVariable(
"VERIFICATION_HEADING", $this->lng->txt(
"import_qpl"));
469 $this->ctrl->setParameter($this,
"new_type", $this->type);
470 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
475 $this->tpl->setVariable(
"VALUE_IMPORT", $this->lng->txt(
"import"));
476 $this->tpl->setVariable(
"VALUE_CANCEL", $this->lng->txt(
"cancel"));
477 $value_questions_only = 0;
478 if ($questions_only) $value_questions_only = 1;
479 $this->tpl->setVariable(
"VALUE_QUESTIONS_ONLY", $value_questions_only);
481 $this->tpl->parseCurrentBlock();
489 if ($_POST[
"questions_only"] == 1)
495 include_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
499 $newObj->setType(
$_GET[
"new_type"]);
501 $newObj->setTitle(
"dummy");
503 $newObj->setDescription(
"questionpool import");
505 $newObj->create(
true);
507 $newObj->createReference();
509 $newObj->putInTree(
$_GET[
"ref_id"]);
511 $newObj->setPermissions(
$_GET[
"ref_id"]);
513 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
517 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
519 $result = $qtiParser->startParsing();
522 if (strlen(
$_SESSION[
"qpl_import_xml_file"]))
524 include_once (
"./Modules/LearningModule/classes/class.ilContObjParser.php");
526 $contParser->setQuestionMapping($qtiParser->getImportMapping());
527 $contParser->startParsing();
531 $qpl_name = $_POST[
"qpl_new"];
532 if ((strcmp($qpl_name, $newObj->getTitle()) != 0) && (strlen($qpl_name) > 0))
534 $newObj->setTitle($qpl_name);
539 include_once
"./Services/Utilities/classes/class.ilUtil.php";
542 if ($_POST[
"questions_only"] == 1)
544 $this->ctrl->redirect($this,
"questions");
550 "&baseClass=ilObjQuestionPoolGUI");
556 if ($_POST[
"questions_only"] == 1)
558 $this->ctrl->redirect($this,
"questions");
562 $this->ctrl->redirect($this,
"cancel");
579 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_import_question.html",
"Modules/TestQuestionPool");
580 $this->tpl->setCurrentBlock(
"adm_content");
581 $this->tpl->setVariable(
"TEXT_IMPORT_QUESTION", $this->lng->txt(
"import_question"));
582 $this->tpl->setVariable(
"TEXT_SELECT_FILE", $this->lng->txt(
"select_file"));
583 $this->tpl->setVariable(
"TEXT_UPLOAD", $this->lng->txt(
"upload"));
584 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
585 $this->tpl->parseCurrentBlock();
596 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"]))
598 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
601 $this->ctrl->setParameter($this,
"new_type", $this->type);
602 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
604 $this->tpl->setVariable(
"BTN_NAME",
"uploadQpl");
605 $this->tpl->setVariable(
"TXT_UPLOAD", $this->lng->txt(
"import"));
606 $this->tpl->setVariable(
"NEW_TYPE", $this->type);
607 $this->tpl->setVariable(
"TXT_IMPORT_QPL", $this->lng->txt(
"import_qpl"));
608 $this->tpl->setVariable(
"TXT_SELECT_MODE", $this->lng->txt(
"select_mode"));
609 $this->tpl->setVariable(
"TXT_SELECT_FILE", $this->lng->txt(
"select_file"));
610 $this->tpl->parseCurrentBlock();
618 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
620 $q_gui->object->setObjId($this->object->getId());
621 $this->ctrl->setParameterByClass(get_class($q_gui),
"sel_question_types", $_POST[
"sel_question_types"]);
622 $this->ctrl->redirectByClass(get_class($q_gui),
"editQuestion");
630 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
632 $q_gui->object->setObjId($this->object->getId());
633 $this->ctrl->setParameterByClass(get_class($q_gui),
"sel_question_types",
$_GET[
"sel_question_types"]);
634 $this->ctrl->redirectByClass(get_class($q_gui),
"editQuestion");
652 "&baseClass=ilObjQuestionPoolGUI");
670 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.il_as_qpl_content.html",
"Modules/TestQuestionPool");
671 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
676 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
678 $title = $this->lng->txt(
"statistics") .
" - $question_title";
681 $this->tpl->setVariable(
"HEADER",
$title);
683 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
686 $color_class = array(
"tblrow1",
"tblrow2");
687 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_qpl_assessment_of_questions.html",
"Modules/TestQuestionPool");
688 if (!$total_of_answers)
690 $this->tpl->setCurrentBlock(
"emptyrow");
691 $this->tpl->setVariable(
"TXT_NO_ASSESSMENT", $this->lng->txt(
"qpl_assessment_no_assessment_of_questions"));
692 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
693 $this->tpl->parseCurrentBlock();
697 $this->tpl->setCurrentBlock(
"row");
698 $this->tpl->setVariable(
"TXT_RESULT", $this->lng->txt(
"qpl_assessment_total_of_answers"));
699 $this->tpl->setVariable(
"TXT_VALUE", $total_of_answers);
700 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
702 $this->tpl->parseCurrentBlock();
703 $this->tpl->setCurrentBlock(
"row");
704 $this->tpl->setVariable(
"TXT_RESULT", $this->lng->txt(
"qpl_assessment_total_of_right_answers"));
706 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
707 $this->tpl->parseCurrentBlock();
709 $this->tpl->setCurrentBlock(
"adm_content");
710 $this->tpl->setVariable(
"TXT_QUESTION_TITLE", $question_title);
711 $this->tpl->setVariable(
"TXT_RESULT", $this->lng->txt(
"result"));
712 $this->tpl->setVariable(
"TXT_VALUE", $this->lng->txt(
"value"));
713 $this->tpl->parseCurrentBlock();
719 $type =
$_GET[
"sel_question_types"];
720 $this->editQuestionForm($type);
728 if (count($_POST[
"q_id"]) < 1)
731 $this->ctrl->redirect($this,
"questions");
734 $checked_questions =& $this->
object->getQuestionDetails($_POST[
"q_id"]);
735 $deleteable_questions =& $this->
object->getDeleteableQuestionDetails($_POST[
"q_id"]);
736 $used_questions =& $this->
object->getUsedQuestionDetails($_POST[
"q_id"]);
737 $_SESSION[
"ass_q_id"] = $deleteable_questions;
738 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_qpl_confirm_delete_questions.html",
"Modules/TestQuestionPool");
740 $colors = array(
"tblrow1",
"tblrow2");
742 include_once
"./Services/Utilities/classes/class.ilUtil.php";
743 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
744 if (count($deleteable_questions) > 0)
746 foreach ($deleteable_questions as $question)
748 $this->tpl->setCurrentBlock(
"row");
749 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
750 $this->tpl->setVariable(
"TXT_TITLE", $question[
"title"]);
751 $this->tpl->setVariable(
"TXT_DESCRIPTION", $question[
"comment"]);
753 $this->tpl->parseCurrentBlock();
756 $this->tpl->setCurrentBlock(
"hidden");
757 $this->tpl->setVariable(
"HIDDEN_NAME",
"id_" . $question[
"question_id"]);
758 $this->tpl->setVariable(
"HIDDEN_VALUE",
"1");
759 $this->tpl->parseCurrentBlock();
764 $this->tpl->setCurrentBlock(
"emptyrow");
765 $this->tpl->setVariable(
"TEXT_EMPTY_ROW", $this->lng->txt(
"qpl_delete_no_deleteable_questions"));
766 $this->tpl->parseCurrentBlock();
769 if (count($used_questions))
771 foreach ($used_questions as $question)
773 $this->tpl->setCurrentBlock(
"undeleteable_row");
774 $this->tpl->setVariable(
"QUESTION_TITLE", $question[
"title"]);
775 $this->tpl->parseCurrentBlock();
777 $this->tpl->setCurrentBlock(
"undeleteable_questions");
778 $this->tpl->setVariable(
"TEXT_UNDELETEABLE_QUESTIONS", $this->lng->txt(
"qpl_delete_describe_undeleteable_questions"));
779 $this->tpl->parseCurrentBlock();
782 $this->tpl->setCurrentBlock(
"adm_content");
783 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"tst_question_title"));
784 $this->tpl->setVariable(
"TXT_DESCRIPTION", $this->lng->txt(
"description"));
785 $this->tpl->setVariable(
"TXT_TYPE", $this->lng->txt(
"tst_question_type"));
786 $this->tpl->setVariable(
"TXT_LOCKED", $this->lng->txt(
"locked"));
787 $this->tpl->setVariable(
"BTN_CONFIRM", $this->lng->txt(
"confirm"));
788 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
789 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
790 $this->tpl->setVariable(
"DELETE_QUESTION", $this->lng->txt(
"qpl_confirm_delete_questions"));
791 $this->tpl->parseCurrentBlock();
802 foreach (
$_SESSION[
"ass_q_id"] as $key => $value)
804 $this->
object->deleteQuestion($value[
"question_id"]);
806 $this->ctrl->redirect($this,
"questions");
814 $this->ctrl->redirect($this,
"questions");
823 if (count($_POST[
"q_id"]) > 0)
825 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
827 $export_file = $qpl_exp->buildExportFile();
830 include_once
"./Services/Utilities/classes/class.ilUtil.php";
838 $this->ctrl->redirect($this,
"questions");
849 $lastquestiontype = $ilUser->getPref(
"tst_lastquestiontype");
850 $type =
$_GET[
"sel_question_types"];
856 $checked_questions = array();
857 foreach ($_POST as $key => $value)
859 if (preg_match(
"/cb_(\d+)/", $key, $matches))
861 array_push($checked_questions, $matches[1]);
865 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.qpl_questions.html",
"Modules/TestQuestionPool");
866 if ($rbacsystem->checkAccess(
'write', $this->ref_id))
868 $this->tpl->addBlockFile(
"CREATE_QUESTION",
"create_question",
"tpl.il_as_create_new_question.html",
"Modules/TestQuestionPool");
870 $this->tpl->addBlockFile(
"A_BUTTONS",
"a_buttons",
"tpl.il_as_qpl_action_buttons.html",
"Modules/TestQuestionPool");
871 $this->tpl->addBlockFile(
"FILTER_QUESTION_MANAGER",
"filter_questions",
"tpl.il_as_qpl_filter_questions.html",
"Modules/TestQuestionPool");
874 $filter_fields = array(
875 "title" => $this->lng->txt(
"title"),
876 "comment" => $this->lng->txt(
"description"),
877 "author" => $this->lng->txt(
"author"),
879 $this->tpl->setCurrentBlock(
"filterrow");
880 foreach ($filter_fields as $key => $value)
882 $this->tpl->setVariable(
"VALUE_FILTER_TYPE",
"$key");
883 $this->tpl->setVariable(
"NAME_FILTER_TYPE",
"$value");
884 if (strcmp($_POST[
"sel_filter_type"], $key) == 0)
886 $this->tpl->setVariable(
"VALUE_FILTER_SELECTED",
" selected=\"selected\"");
888 $this->tpl->parseCurrentBlock();
891 $this->tpl->setCurrentBlock(
"filter_questions");
892 $this->tpl->setVariable(
"FILTER_TEXT", $this->lng->txt(
"filter"));
893 $this->tpl->setVariable(
"TEXT_FILTER_BY", $this->lng->txt(
"by"));
894 $this->tpl->setVariable(
"VALUE_FILTER_TEXT", $_POST[
"filter_text"]);
895 $this->tpl->setVariable(
"VALUE_SUBMIT_FILTER", $this->lng->txt(
"set_filter"));
896 $this->tpl->setVariable(
"VALUE_RESET_FILTER", $this->lng->txt(
"reset_filter"));
897 $this->tpl->parseCurrentBlock();
900 if ($rbacsystem->checkAccess(
'write', $this->ref_id))
902 $this->tpl->setVariable(
"DELETE", $this->lng->txt(
"delete"));
903 $this->tpl->setVariable(
"EXPORT", $this->lng->txt(
"export"));
904 $this->tpl->setVariable(
"COPY", $this->lng->txt(
"copy"));
905 $this->tpl->setVariable(
"MOVE", $this->lng->txt(
"move"));
906 $this->tpl->parseCurrentBlock();
907 if (array_key_exists(
"qpl_clipboard",
$_SESSION))
909 $this->tpl->setCurrentBlock(
"pastebutton");
910 $this->tpl->setVariable(
"PASTE", $this->lng->txt(
"paste"));
911 $this->tpl->parseCurrentBlock();
916 $this->tpl->setVariable(
"EXPORT", $this->lng->txt(
"export"));
917 $this->tpl->setVariable(
"COPY", $this->lng->txt(
"copy"));
920 $this->tpl->setCurrentBlock(
"Footer");
921 include_once
"./Services/Utilities/classes/class.ilUtil.php";
922 $this->tpl->setVariable(
"ARROW",
"<img src=\"" .
ilUtil::getImagePath(
"arrow_downright.gif") .
"\" alt=\"".$this->lng->txt(
"arrow_downright").
"\"/>");
923 $this->tpl->parseCurrentBlock();
925 $this->tpl->setCurrentBlock(
"QTab");
929 if (
$_GET[
"prevrow"])
931 $startrow =
$_GET[
"prevrow"];
933 if (
$_GET[
"nextrow"])
935 $startrow =
$_GET[
"nextrow"];
937 if (
$_GET[
"startrow"])
939 $startrow =
$_GET[
"startrow"];
945 $this->ctrl->setParameter($this,
"sort", $sort);
946 $this->ctrl->setParameter($this,
"sortorder", $sortorder);
947 $table = $this->
object->getQuestionsTable($sort, $sortorder, $_POST[
"filter_text"], $_POST[
"sel_filter_type"], $startrow);
948 $colors = array(
"tblrow1",
"tblrow2");
949 include_once
"./Services/Utilities/classes/class.ilUtil.php";
952 $editable = $rbacsystem->checkAccess(
'write', $this->ref_id);
953 foreach ($table[
"rows"] as
$data)
955 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
957 $this->ctrl->setParameterByClass(
"ilpageobjectgui",
"q_id", $data[
"question_id"]);
958 $this->ctrl->setParameterByClass($class,
"q_id", $data[
"question_id"]);
960 if ($data[
"complete"] == 0)
962 $this->tpl->setCurrentBlock(
"qpl_warning");
964 $this->tpl->setVariable(
"ALT_WARNING", $this->lng->txt(
"warning_question_not_complete"));
965 $this->tpl->setVariable(
"TITLE_WARNING", $this->lng->txt(
"warning_question_not_complete"));
966 $this->tpl->parseCurrentBlock();
972 $sumPoints += $points;
974 $this->tpl->setCurrentBlock(
"checkable");
975 $this->tpl->setVariable(
"QUESTION_ID", $data[
"question_id"]);
976 $this->tpl->parseCurrentBlock();
979 $this->tpl->setCurrentBlock(
"edit_link");
980 $this->tpl->setVariable(
"TXT_EDIT", $this->lng->txt(
"edit"));
981 $this->tpl->setVariable(
"LINK_EDIT", $this->ctrl->getLinkTargetByClass(
"ilpageobjectgui",
"edit"));
982 $this->tpl->parseCurrentBlock();
984 $this->tpl->setCurrentBlock(
"QTab");
985 $this->tpl->setVariable(
"QUESTION_ID", $data[
"question_id"]);
986 $this->tpl->setVariable(
"QUESTION_TITLE",
"<strong>" .$data[
"title"] .
"</strong>");
988 $this->tpl->setVariable(
"TXT_PREVIEW", $this->lng->txt(
"preview"));
989 $this->tpl->setVariable(
"LINK_PREVIEW", $this->ctrl->getLinkTargetByClass(
"ilpageobjectgui",
"preview"));
991 $this->tpl->setVariable(
"QUESTION_COMMENT", $data[
"comment"]);
992 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
994 $this->tpl->setVariable(
"LINK_ASSESSMENT", $this->ctrl->getLinkTargetByClass($class,
"assessment"));
995 $this->tpl->setVariable(
"TXT_ASSESSMENT", $this->lng->txt(
"statistics"));
996 include_once
"./Services/Utilities/classes/class.ilUtil.php";
997 $this->tpl->setVariable(
"IMG_ASSESSMENT",
ilUtil::getImagePath(
"assessment.gif",
"Modules/TestQuestionPool"));
998 $this->tpl->setVariable(
"QUESTION_AUTHOR", $data[
"author"]);
999 include_once
"./classes/class.ilFormat.php";
1002 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
1003 $this->tpl->setVariable(
"QUESTION_POINTS", $points);
1004 $this->tpl->parseCurrentBlock();
1008 if ($table[
"rowcount"] > count($table[
"rows"]))
1010 $nextstep = $table[
"nextrow"] + $table[
"step"];
1011 if ($nextstep > $table[
"rowcount"])
1013 $nextstep = $table[
"rowcount"];
1016 for ($i = 0; $i < $table[
"rowcount"]; $i += $table[
"step"])
1018 $this->tpl->setCurrentBlock(
"pages");
1019 if ($table[
"startrow"] == $i)
1021 $this->tpl->setVariable(
"PAGE_NUMBER",
"<span class=\"inactivepage\">$counter</span>");
1025 $this->tpl->setVariable(
"PAGE_NUMBER",
"<a href=\"" . $this->ctrl->getFormAction($this) .
"&nextrow=$i" .
"\">$counter</a>");
1027 $this->tpl->parseCurrentBlock();
1030 $this->tpl->setCurrentBlock(
"navigation_bottom");
1031 $this->tpl->setVariable(
"TEXT_ITEM", $this->lng->txt(
"item"));
1032 $this->tpl->setVariable(
"TEXT_ITEM_START", $table[
"startrow"] + 1);
1033 $end = $table[
"startrow"] + $table[
"step"];
1034 if ($end > $table[
"rowcount"])
1036 $end = $table[
"rowcount"];
1038 $this->tpl->setVariable(
"TEXT_ITEM_END", $end);
1039 $this->tpl->setVariable(
"TEXT_OF", strtolower($this->lng->txt(
"of")));
1040 $this->tpl->setVariable(
"TEXT_ITEM_COUNT", $table[
"rowcount"]);
1041 $this->tpl->setVariable(
"TEXT_PREVIOUS", $this->lng->txt(
"previous"));
1042 $this->tpl->setVariable(
"TEXT_NEXT", $this->lng->txt(
"next"));
1043 $this->tpl->setVariable(
"HREF_PREV_ROWS", $this->ctrl->getFormAction($this) .
"&prevrow=" . $table[
"prevrow"]);
1044 $this->tpl->setVariable(
"HREF_NEXT_ROWS", $this->ctrl->getFormAction($this) .
"&nextrow=" . $table[
"nextrow"]);
1045 $this->tpl->parseCurrentBlock();
1051 $this->tpl->setCurrentBlock(
"Emptytable");
1052 $this->tpl->setVariable(
"TEXT_EMPTYTABLE", $this->lng->txt(
"no_questions_available"));
1053 $this->tpl->parseCurrentBlock();
1058 $this->tpl->setCurrentBlock(
"selectall");
1059 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
1060 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
1061 $this->tpl->setVariable(
"SUM_POINTS", $sumPoints);
1062 $this->tpl->parseCurrentBlock();
1065 if ($rbacsystem->checkAccess(
'write', $this->ref_id))
1068 $this->tpl->setCurrentBlock(
"QTypes");
1069 $types =& $this->
object->getQuestionTypes();
1070 foreach ($types as $translation => $data)
1072 if ($data[
"type_tag"] == $lastquestiontype)
1074 $this->tpl->setVariable(
"QUESTION_TYPE_SELECTED",
" selected=\"selected\"");
1076 $this->tpl->setVariable(
"QUESTION_TYPE_ID", $data[
"type_tag"]);
1077 $this->tpl->setVariable(
"QUESTION_TYPE", $translation);
1078 $this->tpl->parseCurrentBlock();
1081 $this->tpl->setCurrentBlock(
"CreateQuestion");
1082 $this->tpl->setVariable(
"QUESTION_ADD", $this->lng->txt(
"create"));
1083 $this->tpl->setVariable(
"ACTION_QUESTION_ADD", $this->ctrl->getFormAction($this));
1084 $this->tpl->setVariable(
"QUESTION_IMPORT", $this->lng->txt(
"import"));
1085 $this->tpl->parseCurrentBlock();
1090 "title" => (strcmp($sort,
"title") == 0) ? $sortorder :
"",
1091 "comment" => (strcmp($sort,
"comment") == 0) ? $sortorder :
"",
1092 "type" => (strcmp($sort,
"type") == 0) ? $sortorder :
"",
1093 "author" => (strcmp($sort,
"author") == 0) ? $sortorder :
"",
1094 "created" => (strcmp($sort,
"created") == 0) ? $sortorder :
"",
1095 "updated" => (strcmp($sort,
"updated") == 0) ? $sortorder :
""
1097 foreach ($sortarray as $key => $value)
1099 if (strcmp($value,
"ASC") == 0)
1101 $sortarray[$key] =
"DESC";
1105 $sortarray[$key] =
"ASC";
1109 $this->tpl->setCurrentBlock(
"adm_content");
1111 $this->ctrl->setParameterByClass(get_class($this),
"startrow", $table[
"startrow"]);
1112 $this->ctrl->setParameter($this,
"sort",
"title");
1113 $this->ctrl->setParameter($this,
"sortorder", $sortarray[
"title"]);
1114 $this->tpl->setVariable(
"QUESTION_TITLE",
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"questions") .
"\">" . $this->lng->txt(
"title") .
"</a>" . $table[
"images"][
"title"]);
1115 $this->ctrl->setParameter($this,
"sort",
"comment");
1116 $this->ctrl->setParameter($this,
"sortorder", $sortarray[
"comment"]);
1117 $this->tpl->setVariable(
"QUESTION_COMMENT",
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"questions") .
"\">" . $this->lng->txt(
"description") .
"</a>". $table[
"images"][
"comment"]);
1118 $this->ctrl->setParameter($this,
"sort",
"type");
1119 $this->ctrl->setParameter($this,
"sortorder", $sortarray[
"type"]);
1120 $this->tpl->setVariable(
"QUESTION_TYPE",
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"questions") .
"\">" . $this->lng->txt(
"question_type") .
"</a>" . $table[
"images"][
"type"]);
1121 $this->ctrl->setParameter($this,
"sort",
"author");
1122 $this->ctrl->setParameter($this,
"sortorder", $sortarray[
"author"]);
1123 $this->tpl->setVariable(
"QUESTION_AUTHOR",
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"questions") .
"\">" . $this->lng->txt(
"author") .
"</a>" . $table[
"images"][
"author"]);
1124 $this->ctrl->setParameter($this,
"sort",
"created");
1125 $this->ctrl->setParameter($this,
"sortorder", $sortarray[
"created"]);
1126 $this->tpl->setVariable(
"QUESTION_CREATED",
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"questions") .
"\">" . $this->lng->txt(
"create_date") .
"</a>" . $table[
"images"][
"created"]);
1127 $this->ctrl->setParameter($this,
"sort",
"updated");
1128 $this->ctrl->setParameter($this,
"sortorder", $sortarray[
"updated"]);
1129 $this->tpl->setVariable(
"QUESTION_UPDATED",
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"questions") .
"\">" . $this->lng->txt(
"last_update") .
"</a>" . $table[
"images"][
"updated"]);
1130 $this->tpl->setVariable(
"QUESTION_POINTS", $this->lng->txt(
"points"));
1131 $this->ctrl->setParameter($this,
"sort", $sort);
1132 $this->ctrl->setParameter($this,
"sortorder", $sortorder);
1133 $this->tpl->setVariable(
"ACTION_QUESTION_FORM", $this->ctrl->getFormAction($this));
1134 $this->tpl->parseCurrentBlock();
1147 if (strlen($_POST[
"sortorder"]))
1149 $sort = $_POST[
"sortorder"];
1151 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_qpl_printview.html",
"Modules/TestQuestionPool");
1153 "title" => $this->lng->txt(
"title"),
1154 "comment" => $this->lng->txt(
"description"),
1155 "type" => $this->lng->txt(
"question_type"),
1156 "author" => $this->lng->txt(
"author"),
1157 "created" => $this->lng->txt(
"create_date"),
1158 "updated" => $this->lng->txt(
"last_update")
1160 foreach ($sortorder as $value => $text)
1162 $this->tpl->setCurrentBlock(
"sortorder");
1163 $this->tpl->setVariable(
"VALUE_SORTORDER", $value);
1164 $this->tpl->setVariable(
"TEXT_SORTORDER", $text);
1165 if (strcmp($sort, $value) == 0)
1167 $this->tpl->setVariable(
"SELECTED_SORTORDER",
" selected=\"selected\"");
1169 $this->tpl->parseCurrentBlock();
1171 $table =& $this->
object->getPrintviewQuestions($sort);
1172 $colors = array(
"tblrow1top",
"tblrow2top");
1174 include_once
"./classes/class.ilFormat.php";
1175 foreach ($table as $row)
1177 if ((strcmp($_POST[
"output"],
"detailed") == 0) || (strcmp($_POST[
"output"],
"detailed_printview") == 0))
1179 $this->tpl->setCurrentBlock(
"overview_row_detail");
1180 $this->tpl->setVariable(
"ROW_CLASS", $colors[$counter % 2]);
1181 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1183 if (strcmp($_POST[
"output"],
"detailed") == 0)
1185 $solutionoutput = $question_gui->getSolutionOutput($active_id =
"",
$pass = NULL, $graphicalOutput = FALSE, $result_output = FALSE, $show_question_only = FALSE, $show_feedback = FALSE);
1186 if (strlen($solutionoutput) == 0) $solutionoutput = $question_gui->getPreview();
1187 $this->tpl->setVariable(
"PREVIEW", $solutionoutput);
1191 $this->tpl->setVariable(
"PREVIEW", $question_gui->getPreview());
1193 $this->tpl->parseCurrentBlock();
1194 $this->tpl->setCurrentBlock(
"overview_row_detail");
1195 $this->tpl->setVariable(
"ROW_CLASS", $colors[$counter % 2]);
1196 $this->tpl->parseCurrentBlock();
1198 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1199 $this->tpl->setCurrentBlock(
"overview_row");
1200 $this->tpl->setVariable(
"ROW_CLASS", $colors[$counter % 2]);
1201 $this->tpl->setVariable(
"TEXT_COUNTER", $counter);
1205 $this->tpl->setVariable(
"TEXT_AUTHOR", $row[
"author"]);
1208 $this->tpl->parseCurrentBlock();
1211 $this->tpl->setCurrentBlock(
"overview");
1212 $this->tpl->setVariable(
"TEXT_TITLE", $this->lng->txt(
"title"));
1213 $this->tpl->setVariable(
"TEXT_DESCRIPTION", $this->lng->txt(
"description"));
1214 $this->tpl->setVariable(
"TEXT_QUESTIONTYPE", $this->lng->txt(
"question_type"));
1215 $this->tpl->setVariable(
"TEXT_AUTHOR", $this->lng->txt(
"author"));
1216 $this->tpl->setVariable(
"TEXT_CREATED", $this->lng->txt(
"create_date"));
1217 $this->tpl->setVariable(
"TEXT_UPDATED", $this->lng->txt(
"last_update"));
1218 $this->tpl->parseCurrentBlock();
1219 $this->tpl->setCurrentBlock(
"adm_content");
1220 if (strcmp($_POST[
"output"],
"detailed") == 0)
1222 $this->tpl->setVariable(
"SELECTED_DETAILED",
" selected=\"selected\"");
1224 else if (strcmp($_POST[
"output"],
"detailed_printview") == 0)
1226 $this->tpl->setVariable(
"SELECTED_DETAILED_PRINTVIEW",
" selected=\"selected\"");
1228 $this->tpl->setVariable(
"TEXT_DETAILED", $this->lng->txt(
"detailed_output_solutions"));
1229 $this->tpl->setVariable(
"TEXT_DETAILED_PRINTVIEW", $this->lng->txt(
"detailed_output_printview"));
1230 $this->tpl->setVariable(
"TEXT_OVERVIEW", $this->lng->txt(
"overview"));
1231 $this->tpl->setVariable(
"OUTPUT_MODE", $this->lng->txt(
"output_mode"));
1232 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1233 $this->tpl->setVariable(
"SORT_TEXT", $this->lng->txt(
"sort_by_this_column"));
1234 $this->tpl->setVariable(
"TEXT_SUBMIT", $this->lng->txt(
"submit"));
1235 $this->tpl->setVariable(
"PRINT", $this->lng->txt(
"print"));
1236 $this->tpl->parseCurrentBlock();
1245 $this->update = $this->
object->update();
1254 if (array_key_exists(
"qpl_clipboard",
$_SESSION))
1256 $this->
object->pasteFromClipboard();
1263 $this->ctrl->redirect($this,
"questions");
1271 if (count($_POST[
"q_id"]) > 0)
1273 foreach ($_POST[
"q_id"] as $key => $value)
1275 $this->
object->copyToClipboard($value);
1283 $this->ctrl->redirect($this,
"questions");
1291 if (count($_POST[
"q_id"]) > 0)
1293 foreach ($_POST[
"q_id"] as $key => $value)
1295 $this->
object->moveToClipboard($value);
1303 $this->ctrl->redirect($this,
"questions");
1314 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.il_as_qpl_export.html",
"Modules/TestQuestionPool");
1317 $this->tpl->setCurrentBlock(
"exporttype");
1318 $this->tpl->setVariable(
"VALUE_EXPORTTYPE",
"xml");
1319 $this->tpl->setVariable(
"TEXT_EXPORTTYPE", $this->lng->txt(
"qpl_export_xml"));
1320 $this->tpl->parseCurrentBlock();
1321 $this->tpl->setCurrentBlock(
"exporttype");
1322 $this->tpl->setVariable(
"VALUE_EXPORTTYPE",
"xls");
1323 $this->tpl->setVariable(
"TEXT_EXPORTTYPE", $this->lng->txt(
"qpl_export_excel"));
1324 $this->tpl->parseCurrentBlock();
1325 $this->tpl->setCurrentBlock(
"buttons");
1326 $this->tpl->setVariable(
"FORMACTION_BUTTONS", $this->ctrl->getFormAction($this));
1327 $this->tpl->setVariable(
"BTN_CREATE", $this->lng->txt(
"create"));
1328 $this->tpl->parseCurrentBlock();
1330 $export_dir = $this->
object->getExportDirectory();
1331 $export_files = $this->
object->getExportFiles($export_dir);
1334 include_once(
"./Services/Table/classes/class.ilTableGUI.php");
1338 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.table.html");
1341 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.export_file_row.html",
"Modules/TestQuestionPool");
1345 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1347 $tbl->setTitle($this->lng->txt(
"ass_export_files"));
1349 $tbl->setHeaderNames(array(
"", $this->lng->txt(
"ass_file"),
1350 $this->lng->txt(
"ass_size"), $this->lng->txt(
"date") ));
1351 $tbl->enabled[
"sort"] =
false;
1352 $tbl->setColumnWidth(array(
"1%",
"49%",
"25%",
"25%"));
1355 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
1356 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
1357 $tbl->setLimit(
$_GET[
"limit"]);
1358 $tbl->setOffset(
$_GET[
"offset"]);
1359 $header_params = $this->ctrl->getParameterArray($this,
"export");
1360 $tbl->setHeaderVars(array(
"",
"file",
"size",
"date"), $header_params);
1363 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
1366 $tbl->setMaxCount(count($export_files));
1367 $export_files = array_slice($export_files,
$_GET[
"offset"],
$_GET[
"limit"]);
1370 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1371 if(count($export_files) > 0)
1373 $this->tpl->setVariable(
"COLUMN_COUNTS", 4);
1376 foreach($export_files as $exp_file)
1378 $this->tpl->setCurrentBlock(
"tbl_content");
1379 $this->tpl->setVariable(
"TXT_FILENAME", $exp_file);
1382 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1384 $this->tpl->setVariable(
"TXT_SIZE", filesize($export_dir.
"/".$exp_file));
1385 $this->tpl->setVariable(
"CHECKBOX_ID", $exp_file);
1387 $file_arr = explode(
"__", $exp_file);
1388 $this->tpl->setVariable(
"TXT_DATE", date(
"Y-m-d H:i:s",$file_arr[0]));
1390 $this->tpl->parseCurrentBlock();
1392 $this->tpl->setCurrentBlock(
"selectall");
1393 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
1394 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1395 $this->tpl->parseCurrentBlock();
1399 $this->tpl->setCurrentBlock(
"tbl_action_btn");
1400 $this->tpl->setVariable(
"BTN_NAME",
"confirmDeleteExportFile");
1401 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
1402 $this->tpl->parseCurrentBlock();
1404 $this->tpl->setCurrentBlock(
"tbl_action_btn");
1405 $this->tpl->setVariable(
"BTN_NAME",
"downloadExportFile");
1406 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"download"));
1407 $this->tpl->parseCurrentBlock();
1411 $this->tpl->setCurrentBlock(
"notfound");
1412 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
1413 $this->tpl->setVariable(
"NUM_COLS", 3);
1414 $this->tpl->parseCurrentBlock();
1417 $this->tpl->parseCurrentBlock();
1427 if ($rbacsystem->checkAccess(
"write", $this->ref_id))
1429 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
1430 $question_ids =& $this->
object->getAllQuestionIds();
1432 $qpl_exp->buildExportFile();
1433 $this->ctrl->redirect($this,
"export");
1438 $this->ctrl->redirect($this,
"export");
1447 if(!isset($_POST[
"file"]))
1450 $this->ctrl->redirect($this,
"export");
1453 if (count($_POST[
"file"]) > 1)
1456 $this->ctrl->redirect($this,
"export");
1460 $export_dir = $this->
object->getExportDirectory();
1461 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1464 $this->ctrl->redirect($this,
"export");
1472 if(!isset($_POST[
"file"]))
1475 $this->ctrl->redirect($this,
"export");
1479 $_SESSION[
"ilExportFiles"] = $_POST[
"file"];
1481 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html",
"Modules/TestQuestionPool");
1485 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1488 $this->tpl->setCurrentBlock(
"table_header");
1489 $this->tpl->setVariable(
"TEXT",$this->lng->txt(
"objects"));
1490 $this->tpl->parseCurrentBlock();
1494 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1495 foreach($_POST[
"file"] as
$file)
1497 $this->tpl->setCurrentBlock(
"table_row");
1499 $this->tpl->setVariable(
"TEXT_CONTENT", $file);
1500 $this->tpl->parseCurrentBlock();
1506 "deleteExportFile" => $this->lng->txt(
"confirm"),
1507 "cancelDeleteExportFile" => $this->lng->txt(
"cancel")
1509 foreach ($buttons as $name => $value)
1511 $this->tpl->setCurrentBlock(
"operation_btn");
1512 $this->tpl->setVariable(
"BTN_NAME",$name);
1513 $this->tpl->setVariable(
"BTN_VALUE",$value);
1514 $this->tpl->parseCurrentBlock();
1524 session_unregister(
"ilExportFiles");
1525 $this->ctrl->redirect($this,
"export");
1533 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1534 $export_dir = $this->
object->getExportDirectory();
1537 $exp_file = $export_dir.
"/".
$file;
1538 include_once
"./Services/Utilities/classes/class.ilStr.php";
1540 if (@is_file($exp_file))
1544 if (@is_dir($exp_dir))
1549 $this->ctrl->redirect($this,
"export");
1557 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1559 $this->ctrl->redirectByClass(get_class($q_gui),
"editQuestion");
1568 $new_type = $_POST[
"new_type"] ? $_POST[
"new_type"] :
$_GET[
"new_type"];
1569 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"], $new_type))
1571 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
1579 $this->tpl->setCurrentBlock(
"adm_content");
1583 $data[
"fields"] = array();
1584 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1588 foreach (
$data[
"fields"] as $key => $val)
1590 $this->tpl->setVariable(
"TXT_".strtoupper($key), $this->lng->txt($key));
1591 $this->tpl->setVariable(strtoupper($key), $val);
1593 if ($this->prepare_output)
1595 $this->tpl->parseCurrentBlock();
1599 $this->ctrl->setParameter($this,
"new_type", $this->type);
1600 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1601 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt($new_type.
"_new"));
1602 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
1603 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt($new_type.
"_add"));
1604 $this->tpl->setVariable(
"CMD_SUBMIT",
"save");
1605 $this->tpl->setVariable(
"TARGET",
' target="'.
1607 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
1609 $this->tpl->setVariable(
"TXT_IMPORT_QPL", $this->lng->txt(
"import_qpl"));
1610 $this->tpl->setVariable(
"TXT_QPL_FILE", $this->lng->txt(
"qpl_upload_file"));
1611 $this->tpl->setVariable(
"NEW_TYPE", $this->type);
1612 $this->tpl->setVariable(
"TXT_IMPORT", $this->lng->txt(
"import"));
1615 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
"obj_qpl"));
1617 $this->tpl->setVariable(
"ALT_IMG2",$this->lng->txt(
"obj_qpl"));
1619 $this->tpl->parseCurrentBlock();
1628 if (strcmp($_FILES[
"xmldoc"][
"tmp_name"],
"") == 0)
1640 switch ($this->ctrl->getCmd())
1647 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"",
$_GET[
"ref_id"]);
1650 if (
$_GET[
"q_id"] > 0)
1652 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1654 $q_gui->object->setObjId($this->object->getId());
1655 if (
$_GET[
"q_id"] > 0)
1657 $ilLocator->addItem($q_gui->object->getTitle(), $this->ctrl->getLinkTargetByClass(get_class($q_gui),
"editQuestion"));
1667 if (
$_GET[
"q_id"] > 0)
1669 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1671 $q_gui->object->setObjId($this->object->getId());
1672 $title = $q_gui->object->getTitle();
1673 if (strcmp($this->ctrl->getCmd(),
"assessment") == 0)
1675 $title .=
" - " . $this->lng->txt(
"statistics");
1677 $this->tpl->setTitle(
$title);
1678 $this->tpl->setDescription($q_gui->object->getComment());
1679 $this->tpl->setTitleIcon(
ilUtil::getImagePath(
"icon_".$this->object->getType().
"_b.gif"), $this->lng->txt(
"obj_qpl"));
1683 $this->tpl->setTitle($this->object->getTitle());
1684 $this->tpl->setDescription($this->object->getLongDescription());
1685 $this->tpl->setTitleIcon(
ilUtil::getImagePath(
"icon_".$this->object->getType().
"_b.gif"), $this->lng->txt(
"obj_qpl"));
1692 $this->ctrl->setParameterByClass(
"ilpageobjectgui",
"q_id",
$_GET[
"q_id"]);
1693 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1696 if (strlen($q_type))
1698 $classname = $q_type .
"GUI";
1699 $this->ctrl->setParameterByClass(strtolower($classname),
"sel_question_types", $q_type);
1700 $this->ctrl->setParameterByClass(strtolower($classname),
"q_id",
$_GET[
"q_id"]);
1705 if ($rbacsystem->checkAccess(
'write', $this->ref_id))
1708 $tabs_gui->addTarget(
"edit_content",
1709 $this->ctrl->getLinkTargetByClass(
"ilPageObjectGUI",
"edit"),
1710 array(
"edit",
"insert",
"exec_pg"),
1711 "",
"", $force_active);
1715 $tabs_gui->addTarget(
"preview",
1716 $this->ctrl->getLinkTargetByClass(
"ilPageObjectGUI",
"preview"),
1718 "ilPageObjectGUI",
"", $force_active);
1721 $force_active =
false;
1722 $commands = $_POST[
"cmd"];
1723 if (is_array($commands))
1725 foreach ($commands as $key => $value)
1727 if (preg_match(
"/^delete_.*/", $key, $matches) ||
1728 preg_match(
"/^addSelectGap_.*/", $key, $matches) ||
1729 preg_match(
"/^addTextGap_.*/", $key, $matches) ||
1730 preg_match(
"/^deleteImage_.*/", $key, $matches) ||
1731 preg_match(
"/^upload_.*/", $key, $matches) ||
1732 preg_match(
"/^addSuggestedSolution_.*/", $key, $matches)
1735 $force_active =
true;
1739 if (array_key_exists(
"imagemap_x", $_POST))
1741 $force_active =
true;
1743 if ($rbacsystem->checkAccess(
'write', $this->ref_id))
1746 if ($classname) $url = $this->ctrl->getLinkTargetByClass($classname,
"editQuestion");
1748 $tabs_gui->addTarget(
"edit_properties",
1750 array(
"questions",
"filter",
"resetFilter",
"createQuestion",
1751 "importQuestions",
"deleteQuestions",
1752 "view",
"preview",
"editQuestion",
"exec_pg",
1753 "addItem",
"upload",
"save",
"cancel",
"addSuggestedSolution",
1754 "cancelExplorer",
"linkChilds",
"removeSuggestedSolution",
1755 "add",
"addYesNo",
"addTrueFalse",
"createGaps",
"saveEdit",
1756 "setMediaMode",
"uploadingImage",
"uploadingImagemap",
"addArea",
1757 "deletearea",
"saveShape",
"back",
"addPair",
"uploadingJavaapplet",
1758 "addParameter",
"addGIT",
"addST",
"addPG",
"delete",
1759 "editMode",
"deleteAnswer",
"deleteImage",
"changeGapType"),
1760 $classname,
"", $force_active);
1765 $tabs_gui->addTarget(
"feedback",
1766 $this->ctrl->getLinkTargetByClass($classname,
"feedback"),
1767 array(
"feedback",
"saveFeedback"),
1774 $tabs_gui->addTarget(
"statistics",
1775 $this->ctrl->getLinkTargetByClass($classname,
"assessment"),
1776 array(
"assessment"),
1779 if ((
$_GET[
"calling_test"] > 0) || (
$_GET[
"test_ref_id"] > 0))
1783 $tabs_gui->setBackTarget($this->lng->txt(
"backtocallingtest"),
"ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=$ref_id");
1787 $tabs_gui->setBackTarget($this->lng->txt(
"qpl"), $this->ctrl->getLinkTarget($this,
"questions"));
1800 $next_class = $this->ctrl->getNextClass($this);
1801 switch ($next_class)
1804 case "ilpermissiongui":
1805 case "ilmdeditorgui":
1812 $force_active =
false;
1813 $commands = $_POST[
"cmd"];
1814 if (is_array($commands))
1816 foreach ($commands as $key => $value)
1818 if (preg_match(
"/^delete_.*/", $key, $matches) ||
1819 preg_match(
"/^addSelectGap_.*/", $key, $matches) ||
1820 preg_match(
"/^addTextGap_.*/", $key, $matches) ||
1821 preg_match(
"/^deleteImage_.*/", $key, $matches) ||
1822 preg_match(
"/^upload_.*/", $key, $matches) ||
1823 preg_match(
"/^addSuggestedSolution_.*/", $key, $matches)
1826 $force_active =
true;
1830 if (array_key_exists(
"imagemap_x", $_POST))
1832 $force_active =
true;
1836 $force_active = ((strtolower($this->ctrl->getCmdClass()) == strtolower(get_class($this)) || strlen($this->ctrl->getCmdClass()) == 0) &&
1837 $this->ctrl->getCmd() ==
"")
1841 $tabs_gui->addTarget(
"assQuestions",
1842 $this->ctrl->getLinkTarget($this,
"questions"),
1843 array(
"questions",
"filter",
"resetFilter",
"createQuestion",
1844 "importQuestions",
"deleteQuestions",
1845 "view",
"preview",
"editQuestion",
"exec_pg",
1846 "addItem",
"upload",
"save",
"cancel",
"addSuggestedSolution",
1847 "cancelExplorer",
"linkChilds",
"removeSuggestedSolution",
1848 "add",
"addYesNo",
"addTrueFalse",
"createGaps",
"saveEdit",
1849 "setMediaMode",
"uploadingImage",
"uploadingImagemap",
"addArea",
1850 "deletearea",
"saveShape",
"back",
"addPair",
"uploadingJavaapplet",
1851 "addParameter",
"assessment",
"addGIT",
"addST",
"addPG",
"delete",
1852 "toggleGraphicalAnswers",
"deleteAnswer",
"deleteImage",
"removeJavaapplet"),
1853 "",
"", $force_active);
1856 $tabs_gui->addTarget(
"properties",
1857 $this->ctrl->getLinkTarget($this,
'properties'),
1862 if ($rbacsystem->checkAccess(
"write", $this->ref_id))
1865 $tabs_gui->addTarget(
"meta_data",
1866 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
'listSection'),
1867 "",
"ilmdeditorgui");
1871 $tabs_gui->addTarget(
"print_view",
1872 $this->ctrl->getLinkTarget($this,
'print'),
1877 $tabs_gui->addTarget(
"export",
1878 $this->ctrl->getLinkTarget($this,
'export'),
1879 array(
"export",
"createExportFile",
"confirmDeleteExportFile",
"downloadExportFile"),
1882 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->ref_id))
1884 $tabs_gui->addTarget(
"perm_settings",
1885 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1901 if ($ilAccess->checkAccess(
"write",
"", $a_target))
1903 $_GET[
"baseClass"] =
"ilObjQuestionPoolGUI";
1904 $_GET[
"cmd"] =
"questions";
1905 $_GET[
"ref_id"] = $a_target;
1906 include_once(
"ilias.php");
1909 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1911 $_GET[
"cmd"] =
"frameset";
1912 $_GET[
"target"] =
"";
1913 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
1916 include(
"repository.php");
1919 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);