4 require_once
'./Services/Object/classes/class.ilObjectGUI.php';
5 require_once
'./Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
6 require_once
'./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
7 require_once
'./Modules/TestQuestionPool/exceptions/class.ilTestQuestionPoolException.php';
8 require_once
'./Modules/Test/classes/inc.AssessmentConstants.php';
9 require_once
'./Modules/Test/classes/class.ilObjAssessmentFolder.php';
10 require_once
'./Modules/Test/classes/class.ilObjTest.php';
49 $lng->loadLanguageModule(
"assessment");
53 $this->ctrl->saveParameter($this,
array(
54 "ref_id",
"test_ref_id",
"calling_test",
"test_express_mode",
"q_id",
'tax_node',
'calling_consumer',
'consumer_context' 56 $this->ctrl->saveParameter($this,
"calling_consumer");
57 $this->ctrl->saveParameterByClass(
'ilAssQuestionPageGUI',
'calling_consumer');
58 $this->ctrl->saveParameterByClass(
'ilAssQuestionPageGUI',
'consumer_context');
59 $this->ctrl->saveParameterByClass(
'ilobjquestionpoolgui',
'calling_consumer');
60 $this->ctrl->saveParameterByClass(
'ilobjquestionpoolgui',
'consumer_context');
62 parent::__construct(
"",
$_GET[
"ref_id"],
true,
false);
79 global
$ilUser, $ilLocator, $ilAccess, $ilNavigationHistory,
$tpl,
$ilCtrl,
$ilErr, $ilTabs,
$lng,
$ilDB, $ilPluginAdmin,
$ilias;
81 if ((!$ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"])) && (!$ilAccess->checkAccess(
"visible",
"",
$_GET[
"ref_id"])))
84 $ilias->raiseError($this->lng->txt(
"permission_denied"), $ilias->error_obj->MESSAGE);
89 $ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
91 if(
'qpl' == $this->
object->getType())
93 $ilNavigationHistory->addItem(
$_GET[
"ref_id"],
94 "ilias.php?baseClass=ilObjQuestionPoolGUI&cmd=questions&ref_id=".
$_GET[
"ref_id"],
"qpl");
98 $cmd = $this->ctrl->getCmd(
"questions");
99 $next_class = $this->ctrl->getNextClass($this);
101 if( in_array($next_class,
array(
'',
'ilobjquestionpoolgui')) &&
$cmd ==
'questions' )
108 $this->ctrl->setReturn($this,
"questions");
113 if (
$_GET[
"q_id"] < 1)
115 $q_type = (
$_POST[
"sel_question_types"] !=
"")
116 ?
$_POST[
"sel_question_types"]
117 :
$_GET[
"sel_question_types"];
119 if (
$cmd !=
"createQuestion" &&
$cmd !=
"createQuestionForTest" 120 && $next_class !=
"ilassquestionpagegui")
122 if ((
$_GET[
"test_ref_id"] !=
"")
or (
$_GET[
"calling_test"]))
133 case "ilcommonactiondispatchergui":
134 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
136 $this->ctrl->forwardCommand($gui);
139 case 'ilobjectmetadatagui':
140 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
142 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->WARNING);
144 include_once
'Services/Object/classes/class.ilObjectMetaDataGUI.php';
146 $this->ctrl->forwardCommand($md_gui);
149 case 'ilassquestionpreviewgui':
151 $this->ctrl->saveParameter($this,
"q_id");
153 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewGUI.php';
156 $gui->initQuestion((
int)
$_GET[
'q_id'], $this->
object->getId());
157 $gui->initPreviewSettings($this->
object->getRefId());
159 $gui->initHintTracking();
160 $gui->initStyleSheets();
163 $ilHelp->setScreenIdComponent(
"qpl");
165 $this->ctrl->forwardCommand($gui);
168 case "ilassquestionpagegui":
169 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
170 $this->tpl->setCurrentBlock(
"ContentStyle");
172 $this->tpl->parseCurrentBlock();
175 $this->tpl->setCurrentBlock(
"SyntaxStyle");
177 $this->tpl->parseCurrentBlock();
179 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
182 $q_gui->setQuestionTabs();
183 $q_gui->outAdditionalOutput();
184 $q_gui->object->setObjId($this->
object->getId());
186 $q_gui->setTargetGuiClass(null);
187 $q_gui->setQuestionActionCmd(null);
189 $question = $q_gui->object;
190 $this->ctrl->saveParameter($this,
"q_id");
191 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
192 $this->lng->loadLanguageModule(
"content");
193 $this->ctrl->setReturnByClass(
"ilAssQuestionPageGUI",
"view");
194 $this->ctrl->setReturn($this,
"questions");
196 $page_gui->obj->addUpdateListener(
200 $page_gui->setEditPreview(
true);
201 $page_gui->setEnabledTabs(
false);
202 if (strlen($this->ctrl->getCmd()) == 0 && !isset(
$_POST[
"editImagemapForward_x"]))
204 $this->ctrl->setCmdClass(get_class($page_gui));
205 $this->ctrl->setCmd(
"preview");
207 $page_gui->setQuestionHTML(
array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
208 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
209 $page_gui->setOutputMode(
"edit");
210 $page_gui->setHeader($question->getTitle());
211 $page_gui->setPresentationTitle($question->getTitle());
212 $ret = $this->ctrl->forwardCommand($page_gui);
213 $tpl->setContent(
$ret);
216 case 'ilpermissiongui':
217 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
219 $ret = $this->ctrl->forwardCommand($perm_gui);
222 case 'ilobjectcopygui':
223 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
226 $this->ctrl->forwardCommand($cp);
229 case "ilquestionpoolexportgui":
230 require_once
'Modules/TestQuestionPool/classes/class.ilQuestionPoolExportGUI.php';
232 $exp_gui->addFormat(
'xml', $this->lng->txt(
'qpl_export_xml'));
233 $exp_gui->addFormat(
'xls', $this->lng->txt(
'qpl_export_excel'), $this,
'createExportExcel');
234 $ret = $this->ctrl->forwardCommand($exp_gui);
237 case "ilinfoscreengui":
241 case 'ilassquestionhintsgui':
244 $this->ctrl->setReturn($this,
"questions");
247 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
249 $questionGUI->object->setObjId($this->
object->getId());
250 $questionGUI->setQuestionTabs();
252 $ilHelp->setScreenIdComponent(
"qpl");
255 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
260 $gui->setEditingEnabled(
261 $DIC->access()->checkAccess(
'write',
'', $this->
object->getRefId())
264 $ilCtrl->forwardCommand($gui);
268 case 'illocalunitconfigurationgui':
269 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
271 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->WARNING);
274 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
276 $questionGUI->object->setObjId($this->
object->getId());
277 $questionGUI->setQuestionTabs();
279 $this->ctrl->setReturn($this,
'questions');
281 require_once
'Modules/TestQuestionPool/classes/class.ilLocalUnitConfigurationGUI.php';
282 require_once
'Modules/TestQuestionPool/classes/class.ilUnitConfigurationRepository.php';
286 $ilCtrl->forwardCommand($gui);
289 case 'ilassquestionfeedbackeditinggui':
292 $this->ctrl->setReturn($this,
"questions");
295 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
297 $questionGUI->object->setObjId($this->
object->getId());
298 $questionGUI->setQuestionTabs();
300 $ilHelp->setScreenIdComponent(
"qpl");
303 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
305 $ilCtrl->forwardCommand($gui);
309 case 'ilobjquestionpoolsettingsgeneralgui':
310 require_once
'Modules/TestQuestionPool/classes/class.ilObjQuestionPoolSettingsGeneralGUI.php';
312 $this->ctrl->forwardCommand($gui);
315 case "ilobjtaxonomygui":
317 require_once
'Modules/TestQuestionPool/classes/class.ilObjQuestionPoolTaxonomyEditingCommandForwarder.php';
319 $this->
object, $ilDB, $ilPluginAdmin, $ilCtrl, $ilTabs, $lng
322 $forwarder->forward();
326 case 'ilquestionpoolskilladministrationgui':
328 require_once
'Modules/TestQuestionPool/classes/class.ilQuestionPoolSkillAdministrationGUI.php';
330 $ilias, $ilCtrl, $ilAccess, $ilTabs, $tpl, $lng, $ilDB, $ilPluginAdmin, $this->
object, $this->ref_id
333 $this->ctrl->forwardCommand($gui);
337 case 'ilquestionbrowsertablegui':
341 case "ilobjquestionpoolgui":
344 if(
$cmd ==
'questions' )
346 $this->ctrl->setParameter($this,
'q_id',
'');
354 $this->ctrl->setReturn($this,
"questions");
355 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
358 $q_gui->object->setObjId($this->
object->getId());
359 if($this->
object->getType() ==
'qpl')
361 $q_gui->setTaxonomyIds($this->
object->getTaxonomyIds());
362 $this->
object->addQuestionChangeListeners($q_gui->object);
364 $q_gui->setQuestionTabs();
366 $ilHelp->setScreenIdComponent(
"qpl");
367 $ret = $this->ctrl->forwardCommand($q_gui);
371 if ( !(strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" 372 || strtolower(
$_GET[
'baseClass']) ==
'ilrepositorygui')
386 $DIC->ctrl()->redirectByClass(
'ilQuestionPoolExportGUI');
395 include_once(
"./Modules/File/classes/class.ilObjFile.php");
397 $fileObj->sendFile();
406 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
408 $page_gui->showMediaFullscreen();
425 $_POST[
"filter_text"] =
"";
426 $_POST[
"sel_filter_type"] =
"";
435 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php");
437 $pg_obj->send_paragraph (
$_GET[
"par_id"],
$_GET[
"downloadtitle"]);
446 $this->ctrl->setParameter($this,
'new_type', $_REQUEST[
'new_type']);
447 if ($_FILES[
"xmldoc"][
"error"] > UPLOAD_ERR_OK)
452 $this->ctrl->redirect($this,
'create');
457 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
461 $file = pathinfo($_FILES[
"xmldoc"][
"name"]);
462 $full_path = $basedir.
"/".$_FILES[
"xmldoc"][
"name"];
463 $GLOBALS[
'ilLog']->write(__METHOD__.
": full path " . $full_path);
464 include_once
"./Services/Utilities/classes/class.ilUtil.php";
466 $GLOBALS[
'ilLog']->write(__METHOD__.
": full path " . $full_path);
467 if (strcmp($_FILES[
"xmldoc"][
"type"],
"text/xml") == 0)
469 $qti_file = $full_path;
478 $subdir = basename(
$file[
"basename"],
".".
$file[
"extension"]);
485 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
487 $result = $qtiParser->startParsing();
488 $founditems =& $qtiParser->getFoundItems();
489 if (count($founditems) == 0)
499 $this->ctrl->redirect($this,
'create');
506 foreach ($founditems as $item)
508 if (strlen($item[
"type"]))
526 $this->ctrl->redirect($this,
'create');
531 $_SESSION[
"qpl_import_xml_file"] = $xml_file;
532 $_SESSION[
"qpl_import_qti_file"] = $qti_file;
533 $_SESSION[
"qpl_import_subdir"] = $subdir;
535 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.qpl_import_verification.html",
"Modules/TestQuestionPool");
537 require_once
'Modules/TestQuestionPool/classes/tables/class.ilQuestionPoolImportVerificationTableGUI.php';
541 foreach($founditems as $item)
544 'title' => $item[
'title'],
545 'ident' => $item[
'ident'],
548 include_once
"./Services/QTI/classes/class.ilQTIItem.php";
549 switch ($item[
"type"])
552 $type = $this->lng->txt(
"assClozeTest");
555 $type = $this->lng->txt(
"assImagemapQuestion");
558 $type = $this->lng->txt(
"assJavaApplet");
561 $type = $this->lng->txt(
"assMatchingQuestion");
564 $type = $this->lng->txt(
"assMultipleChoice");
567 $type = $this->lng->txt(
"assKprimChoice");
570 $type = $this->lng->txt(
"assLongMenu");
573 $type = $this->lng->txt(
"assSingleChoice");
576 $type = $this->lng->txt(
"assOrderingQuestion");
579 $type = $this->lng->txt(
"assTextQuestion");
582 $type = $this->lng->txt(
"assNumeric");
585 $type = $this->lng->txt(
"assTextSubset");
588 $type = $this->lng->txt($item[
"type"]);
592 if (strcmp($type,
"-" . $item[
"type"] .
"-") == 0)
594 global $ilPluginAdmin;
595 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_MODULE,
"TestQuestionPool",
"qst");
596 foreach ($pl_names as $pl_name)
599 if (strcmp($pl->getQuestionType(), $item[
"type"]) == 0)
601 $type = $pl->getQuestionTypeTranslation();
606 $row[
'type'] = $type;
610 $table->setData($rows);
612 $this->tpl->setCurrentBlock(
"import_qpl");
613 if (is_file($xml_file))
616 $fh = @fopen($xml_file,
"r")
or die(
"");
617 $xml = @fread(
$fh, filesize($xml_file));
619 if (preg_match(
"/<ContentObject.*?MetaData.*?General.*?Title[^>]*?>([^<]*?)</", $xml, $matches))
621 $this->tpl->setVariable(
"VALUE_NEW_QUESTIONPOOL", $matches[1]);
624 $this->tpl->setVariable(
"TEXT_CREATE_NEW_QUESTIONPOOL", $this->lng->txt(
"qpl_import_create_new_qpl"));
625 $this->tpl->parseCurrentBlock();
627 $this->tpl->setCurrentBlock(
"adm_content");
628 $this->tpl->setVariable(
"FOUND_QUESTIONS_INTRODUCTION", $this->lng->txt(
"qpl_import_verify_found_questions"));
631 $this->tpl->setVariable(
"VERIFICATION_HEADING", $this->lng->txt(
"import_questions_into_qpl"));
632 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
636 $this->tpl->setVariable(
"VERIFICATION_HEADING", $this->lng->txt(
"import_qpl"));
638 $this->ctrl->setParameter($this,
"new_type", $this->type);
639 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
642 $value_questions_only = 0;
643 if ($questions_only) $value_questions_only = 1;
644 $this->tpl->setVariable(
"VALUE_QUESTIONS_ONLY", $value_questions_only);
645 $this->tpl->setVariable(
"VERIFICATION_TABLE", $table->getHtml());
646 $this->tpl->setVariable(
"VERIFICATION_FORM_NAME", $table->getFormName());
648 $this->tpl->parseCurrentBlock();
658 if (
$_POST[
"questions_only"] == 1)
664 include_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
668 $newObj->setType(
$_GET[
"new_type"]);
670 $newObj->setTitle(
"dummy");
672 $newObj->setDescription(
"questionpool import");
674 $newObj->create(
true);
676 $newObj->createReference();
678 $newObj->putInTree(
$_GET[
"ref_id"]);
680 $newObj->setPermissions(
$_GET[
"ref_id"]);
683 if (is_file(
$_SESSION[
"qpl_import_dir"].
'/'.
$_SESSION[
"qpl_import_subdir"].
"/manifest.xml"))
685 $_SESSION[
"qpl_import_idents"] =
$_POST[
"ident"];
687 $fileName = $_SESSION[
"qpl_import_subdir"].
'.zip';
688 $fullPath = $_SESSION[
"qpl_import_dir"].
'/'.$fileName;
690 include_once(
"./Services/Export/classes/class.ilImport.php");
692 $map = $imp->getMapping();
693 $map->addMapping(
"Modules/TestQuestionPool",
"qpl",
"new_id", $newObj->getId());
694 $imp->importObject($newObj, $fullPath, $fileName,
"qpl",
"Modules/TestQuestionPool",
true);
699 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
701 $result = $qtiParser->startParsing();
704 if (strlen($_SESSION[
"qpl_import_xml_file"]))
706 include_once (
"./Modules/LearningModule/classes/class.ilContObjParser.php");
707 $contParser =
new ilContObjParser($newObj, $_SESSION[
"qpl_import_xml_file"], $_SESSION[
"qpl_import_subdir"]);
708 $contParser->setQuestionMapping($qtiParser->getImportMapping());
709 $contParser->startParsing();
712 $newObj->fromXML($_SESSION[
"qpl_import_xml_file"]);
716 if( isset(
$_POST[
"qpl_new"]) && strlen(
$_POST[
"qpl_new"]) )
718 $newObj->setTitle(
$_POST[
"qpl_new"]);
726 include_once
"./Services/Utilities/classes/class.ilUtil.php";
729 if (
$_POST[
"questions_only"] == 1)
731 $this->ctrl->redirect($this,
"questions");
737 "&baseClass=ilObjQuestionPoolGUI");
743 if (
$_POST[
"questions_only"] == 1)
745 $this->ctrl->redirect($this,
"questions");
749 $this->ctrl->redirect($this,
"cancel");
758 $upload_valid =
true;
760 if($form->checkInput())
764 $form->setValuesByPost();
770 $form->setValuesByPost();
785 $this->tpl->setContent($form->getHtml());
793 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
795 $form->setTitle($this->lng->txt(
'import_question'));
796 $form->setFormAction($this->ctrl->getFormAction($this,
'upload'));
799 $file->setRequired(
true);
800 $form->addItem(
$file);
802 $form->addCommandButton(
'upload', $this->lng->txt(
'upload'));
803 $form->addCommandButton(
'questions', $this->lng->txt(
'cancel'));
815 $addContEditMode =
$_POST[
'add_quest_cont_edit_mode'];
822 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
824 $this->
object->addQuestionChangeListeners($q_gui->object);
825 $q_gui->object->setObjId($this->
object->getId());
826 $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
827 $q_gui->object->createNewQuestion();
828 $this->ctrl->setParameterByClass(get_class($q_gui),
"q_id", $q_gui->object->getId());
829 $this->ctrl->setParameterByClass(get_class($q_gui),
"sel_question_types",
$_POST[
"sel_question_types"]);
830 $this->ctrl->redirectByClass(get_class($q_gui),
"editQuestion");
838 if( !$_REQUEST[
'q_id'] )
840 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
843 $addContEditMode = $_REQUEST[
'add_quest_cont_edit_mode'];
850 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
852 $q_gui->object->setObjId($this->
object->getId());
853 $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
854 $q_gui->object->createNewQuestion();
856 $class = get_class($q_gui);
857 $qId = $q_gui->object->getId();
861 $class =
$_GET[
"sel_question_types"] .
'gui';
862 $qId = $_REQUEST[
'q_id'];
865 $this->ctrl->setParameterByClass($class,
"q_id", $qId);
866 $this->ctrl->setParameterByClass($class,
"sel_question_types", $_REQUEST[
"sel_question_types"]);
867 $this->ctrl->setParameterByClass($class,
"prev_qid", $_REQUEST[
"prev_qid"]);
869 $this->ctrl->redirectByClass($class,
"editQuestion");
882 "&baseClass=ilObjQuestionPoolGUI");
888 $type =
$_GET[
"sel_question_types"];
889 $this->editQuestionForm($type);
899 if (count(
$_POST[
"q_id"]) < 1)
902 $this->ctrl->redirect($this,
"questions");
906 $deleteable_questions =& $this->
object->getDeleteableQuestionDetails(
$_POST[
"q_id"]);
907 include_once
"./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
909 $table_gui->
setEditable($rbacsystem->checkAccess(
'write',
$_GET[
'ref_id']));
910 $table_gui->setData($deleteable_questions);
911 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
921 foreach (
$_POST[
"q_id"] as $key => $value)
923 $this->
object->deleteQuestion($value);
924 $this->
object->cleanupClipboard($value);
928 $this->ctrl->setParameter($this,
'q_id',
'');
930 $this->ctrl->redirect($this,
"questions");
938 $this->ctrl->redirect($this,
"questions");
947 if (count(
$_POST[
"q_id"]) > 0)
949 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
951 $export_file = $qpl_exp->buildExportFile();
954 include_once
"./Services/Utilities/classes/class.ilUtil.php";
962 $this->ctrl->redirect($this,
"questions");
967 require_once
'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
970 include_once
"./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
972 $table_gui->resetOffset();
973 $table_gui->writeFilterToSession();
979 require_once
'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
982 include_once
"./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
984 $table_gui->resetOffset();
985 $table_gui->resetFilter();
991 require_once
'Modules/TestQuestionPool/classes/questions/class.ilAssQuestionSkillAssignmentImportFails.php';
995 $this->ctrl->redirect($this,
'infoScreen');
1005 if(get_class($this->
object) ==
"ilObjTest")
1007 if (
$_GET[
"calling_test"] > 0)
1010 $q_id =
$_GET[
"q_id"];
1012 if ($_REQUEST[
'test_express_mode']) {
1014 ilUtil::redirect(
"ilias.php?ref_id=".
$ref_id.
"&q_id=".$q_id.
"&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
1016 ilUtil::redirect(
"ilias.php?ref_id=".
$ref_id.
"&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
1023 else if(isset(
$_GET[
'calling_consumer']) && (
int)
$_GET[
'calling_consumer'])
1025 $ref_id = (int)$_GET[
'calling_consumer'];
1029 ilUtil::redirect($consumer->getQuestionEditingFormBackTarget($_GET[
'consumer_context']));
1031 require_once
'Services/Link/classes/class.ilLink.php';
1035 $this->
object->purgeQuestions();
1039 require_once
'Modules/TestQuestionPool/classes/questions/class.ilAssQuestionSkillAssignmentImportFails.php';
1041 if( $qsaImportFails->failedImportsRegistered() )
1043 require_once
'Services/UIComponent/Button/classes/class.ilLinkButton.php';
1045 $button->setUrl($this->ctrl->getLinkTarget($this,
'renoveImportFails'));
1046 $button->setCaption(
'ass_skl_import_fails_remove_btn');
1048 ilUtil::sendFailure($qsaImportFails->getFailedImportsMessage($this->lng).
'<br />'.$button->render());
1051 require_once
'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
1055 $table_gui->setPreventDoubleSubmission(
false);
1057 if( $rbacsystem->checkAccess(
'write', $_GET[
'ref_id']) )
1061 require_once
'Services/UIComponent/Button/classes/class.ilLinkButton.php';
1063 $btn->setCaption(
'ass_create_question');
1064 $btn->setUrl($this->ctrl->getLinkTarget($this,
'createQuestionForm'));
1065 $btn->setPrimary(
true);
1066 $toolbar->addButtonInstance($btn);
1068 $this->tpl->setContent(
1069 $this->ctrl->getHTML($toolbar) . $this->ctrl->getHTML($table_gui)
1074 $this->tpl->setContent( $this->ctrl->getHTML($table_gui) );
1077 if( $this->
object->getShowTaxonomies() )
1079 $this->lng->loadLanguageModule(
'tax');
1081 require_once
'Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php';
1083 foreach($taxIds as $taxId)
1085 if( $taxId != $this->
object->getNavTaxonomyId() )
1091 $this,
'showNavTaxonomy', $taxId,
'ilobjquestionpoolgui',
'questions' 1094 if( !$taxExp->handleCommand() )
1096 $this->tpl->setLeftContent($taxExp->getHTML().
" ");
1109 $qId = (int)
$_GET[
'q_id'];
1111 if( $this->
object->checkQuestionParent($qId) )
1122 $ilHelp = $DIC[
'ilHelp'];
1124 $ilHelp->setScreenId(
'assQuestions');
1128 $ilHelp->setSubScreenId(
'createQuestion_editMode');
1132 $ilHelp->setSubScreenId(
'createQuestion');
1137 $this->tpl->setContent( $this->ctrl->getHTML($form) );
1146 require_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1148 $form->setTitle($this->lng->txt(
'ass_create_question'));
1149 $form->setFormAction($this->ctrl->getFormAction($this));
1154 foreach( $this->
object->getQuestionTypes(
false,
true) as $translation =>
$data )
1159 require_once(
"Services/Form/classes/class.ilSelectInputGUI.php");
1164 $form->addItem(
$si);
1170 $ri =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_add_quest_cont_edit_mode"),
"add_quest_cont_edit_mode");
1173 $this->lng->txt(
'tst_add_quest_cont_edit_mode_default'),
1178 $this->lng->txt(
'tst_add_quest_cont_edit_mode_page_object'),
1184 $form->addItem($ri,
true);
1190 $form->addItem($hi,
true);
1195 $form->addCommandButton(
'createQuestion', $this->lng->txt(
'create'));
1196 $form->addCommandButton(
'questions', $this->lng->txt(
'cancel'));
1204 public function printObject()
1211 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
'print'));
1212 require_once
'Services/Form/classes/class.ilSelectInputGUI.php';
1215 'overview' => $this->lng->txt(
'overview'),
1216 'detailed' => $this->lng->txt(
'detailed_output_solutions'),
1217 'detailed_printview' => $this->lng->txt(
'detailed_output_printview')
1221 $ilToolbar->setFormName(
'printviewOptions');
1222 $ilToolbar->addInputItem($mode,
true);
1223 $ilToolbar->addFormButton($this->lng->txt(
'submit'),
'print');
1225 include_once
"./Modules/TestQuestionPool/classes/tables/class.ilQuestionPoolPrintViewTableGUI.php";
1227 $data = $this->
object->getPrintviewQuestions();
1231 $totalPoints += $d[
'points'];
1233 $table_gui->setTotalPoints($totalPoints);
1234 $table_gui->initColumns();
1235 $table_gui->setData(
$data);
1236 $this->tpl->setContent($table_gui->getHTML());
1242 $this->update = $this->
object->update();
1251 if (array_key_exists(
"qpl_clipboard",
$_SESSION))
1253 if($this->
object->pasteFromClipboard())
1266 $this->ctrl->redirect($this,
"questions");
1276 foreach (
$_POST[
"q_id"] as $key => $value)
1278 $this->
object->copyToClipboard($value);
1286 $this->ctrl->redirect($this,
"questions");
1296 foreach (
$_POST[
"q_id"] as $key => $value)
1298 $this->
object->moveToClipboard($value);
1306 $this->ctrl->redirect($this,
"questions");
1312 if ($rbacsystem->checkAccess(
"write",
$_GET[
'ref_id']))
1314 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
1315 $question_ids =& $this->
object->getAllQuestionIds();
1317 $qpl_exp->buildExportFile();
1318 $this->ctrl->redirectByClass(
"ilquestionpoolexportgui",
"");
1327 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1329 $this->ctrl->redirectByClass(get_class($q_gui),
"editQuestion");
1334 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1336 $form->setTarget(
"_top");
1337 $form->setFormAction($this->ctrl->getFormAction($this));
1338 $form->setTitle($this->lng->txt(
"import_qpl"));
1340 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
1341 $fi =
new ilFileInputGUI($this->lng->txt(
"import_file"),
"xmldoc");
1343 $fi->setRequired(
true);
1344 $form->addItem($fi);
1346 $form->addCommandButton(
"importFile", $this->lng->txt(
"import"));
1347 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
1358 if($form->checkInput())
1364 $this->tpl->setContent($form->getHTML());
1370 switch ($this->ctrl->getCmd())
1377 $ilLocator->addItem($this->
object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"",
$_GET[
"ref_id"]);
1380 if (
$_GET[
"q_id"] > 0)
1382 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1386 $q_gui->object->setObjId($this->
object->getId());
1387 $title = $q_gui->object->getTitle();
1392 $ilLocator->addItem(
$title, $this->ctrl->getLinkTargetByClass(get_class($q_gui),
"editQuestion"));
1397 $this->ctrl->setParameter($this,
'q_id',
'');
1398 $this->ctrl->redirect($this);
1408 parent::setTitleAndDescription();
1409 if (
$_GET[
"q_id"] > 0)
1411 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1415 $q_gui->object->setObjId($this->
object->getId());
1416 $title = $q_gui->object->getTitle();
1421 $this->tpl->setTitle(
$title);
1422 $this->tpl->setDescription($q_gui->object->getComment());
1428 $this->ctrl->setParameter($this,
'q_id',
'');
1429 $this->ctrl->redirect($this);
1434 $this->tpl->setTitle($this->
object->getTitle());
1435 $this->tpl->setDescription($this->
object->getLongDescription());
1447 global $ilAccess, $ilHelp;
1449 $currentUserHasWriteAccess = $ilAccess->checkAccess(
"write",
"", $this->
object->getRefId());
1451 $ilHelp->setScreenIdComponent(
"qpl");
1453 $next_class = strtolower($this->ctrl->getNextClass());
1454 switch ($next_class)
1457 case "ilpermissiongui":
1458 case "ilobjectmetadatagui":
1459 case "ilquestionpoolexportgui":
1460 case "ilquestionpoolskilladministrationgui":
1463 case 'ilobjtaxonomygui':
1464 case 'ilobjquestionpoolsettingsgeneralgui':
1466 if( $currentUserHasWriteAccess )
1478 $force_active =
false;
1479 $commands =
$_POST[
"cmd"];
1480 if (is_array($commands))
1482 foreach ($commands as $key => $value)
1484 if (preg_match(
"/^delete_.*/", $key, $matches) ||
1485 preg_match(
"/^addSelectGap_.*/", $key, $matches) ||
1486 preg_match(
"/^addTextGap_.*/", $key, $matches) ||
1487 preg_match(
"/^deleteImage_.*/", $key, $matches) ||
1488 preg_match(
"/^upload_.*/", $key, $matches) ||
1489 preg_match(
"/^addSuggestedSolution_.*/", $key, $matches)
1492 $force_active =
true;
1496 if (array_key_exists(
"imagemap_x",
$_POST))
1498 $force_active =
true;
1502 $force_active = ((strtolower($this->ctrl->getCmdClass()) == strtolower(get_class($this)) || strlen($this->ctrl->getCmdClass()) == 0) &&
1503 $this->ctrl->getCmd() ==
"")
1507 $this->tabs_gui->addTarget(
"assQuestions",
1508 $this->ctrl->getLinkTarget($this,
"questions"),
1509 array(
"questions",
"filter",
"resetFilter",
"createQuestion",
1510 "importQuestions",
"deleteQuestions",
"filterQuestionBrowser",
1511 "view",
"preview",
"editQuestion",
"exec_pg",
1512 "addItem",
"upload",
"save",
"cancel",
"addSuggestedSolution",
1513 "cancelExplorer",
"linkChilds",
"removeSuggestedSolution",
1514 "add",
"addYesNo",
"addTrueFalse",
"createGaps",
"saveEdit",
1515 "setMediaMode",
"uploadingImage",
"uploadingImagemap",
"addArea",
1516 "deletearea",
"saveShape",
"back",
"addPair",
"uploadingJavaapplet",
1517 "addParameter",
"assessment",
"addGIT",
"addST",
"addPG",
"delete",
1518 "toggleGraphicalAnswers",
"deleteAnswer",
"deleteImage",
"removeJavaapplet"),
1519 "",
"", $force_active);
1521 if ($ilAccess->checkAccess(
"read",
"", $this->ref_id) || $ilAccess->checkAccess(
"visible",
"", $this->ref_id))
1523 $this->tabs_gui->addTarget(
"info_short",
1524 $this->ctrl->getLinkTarget($this,
"infoScreen"),
1525 array(
"infoScreen",
"showSummary"));
1528 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
'ref_id']))
1531 $this->tabs_gui->addTarget(
1532 'settings', $this->ctrl->getLinkTargetByClass(
'ilObjQuestionPoolSettingsGeneralGUI'),
1533 array(),
array(
'ilObjQuestionPoolSettingsGeneralGUI',
'ilObjTaxonomyGUI')
1539 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentsGUI.php';
1541 $link = $this->ctrl->getLinkTargetByClass(
1542 array(
'ilQuestionPoolSkillAdministrationGUI',
'ilAssQuestionSkillAssignmentsGUI'),
1546 $this->tabs_gui->addTarget(
'qpl_tab_competences', $link,
array(),
array());
1551 $this->tabs_gui->addTarget(
"print_view",
1552 $this->ctrl->getLinkTarget($this,
'print'),
1556 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1559 include_once
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
1561 $mdtab = $mdgui->getTab();
1564 $this->tabs_gui->addTarget(
"meta_data",
1566 "",
"ilmdeditorgui");
1575 if( $currentUserHasWriteAccess )
1577 $this->tabs_gui->addTarget(
"export",
1578 $this->ctrl->getLinkTargetByClass(
"ilquestionpoolexportgui",
""),
1579 "",
"ilquestionpoolexportgui");
1582 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->object->getRefId()))
1584 $this->tabs_gui->addTarget(
"perm_settings",
1585 $this->ctrl->getLinkTargetByClass(
array(get_class($this),
'ilpermissiongui'),
"perm"),
array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1596 if( !$this->
object->isSkillServiceEnabled() )
1612 'qpl_settings_subtab_general',
1613 $this->ctrl->getLinkTargetByClass(
'ilObjQuestionPoolSettingsGeneralGUI'),
1614 '',
'ilObjQuestionPoolSettingsGeneralGUI' 1618 'qpl_settings_subtab_taxonomies',
1619 $this->ctrl->getLinkTargetByClass(
'ilObjTaxonomyGUI',
'editAOTaxonomySettings'),
1620 '',
'ilObjTaxonomyGUI' 1631 $this->ctrl->setCmd(
"showSummary");
1632 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1641 global
$ilErr, $ilAccess;
1643 if(!$ilAccess->checkAccess(
"visible",
"", $this->ref_id))
1645 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"));
1648 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1650 $info->enablePrivateNotes();
1653 $info->addMetaDataSections($this->
object->getId(), 0, $this->
object->getType());
1655 $this->ctrl->forwardCommand(
$info);
1670 if ($ilAccess->checkAccess(
"write",
"", $a_target) || $ilAccess->checkAccess(
'read',
'', $a_target))
1672 $_GET[
'cmdClass'] =
'ilObjQuestionPoolGUI';
1673 $_GET[
'cmd'] =
'questions';
1674 $_GET[
'baseClass'] =
'ilRepositoryGUI';
1675 $_GET[
"ref_id"] = $a_target;
1676 include_once(
"ilias.php");
1679 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1685 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
1698 global $rbacsystem,
$ilDB,
$lng, $ilPluginAdmin;
1700 include_once
"./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
1701 $table_gui =
new ilQuestionBrowserTableGUI($this,
'questions', (($rbacsystem->checkAccess(
'write',
$_GET[
'ref_id']) ? true :
false)),
false, $taxIds);
1702 $table_gui->
setEditable($rbacsystem->checkAccess(
'write',
$_GET[
'ref_id']));
1704 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
1706 $questionList->setParentObjId($this->
object->getId());
1708 foreach ($table_gui->getFilterItems() as $item)
1710 if( substr($item->getPostVar(), 0, strlen(
'tax_')) ==
'tax_' )
1712 $v = $item->getValue();
1714 if( is_array($v) && count($v) && !(
int)$v[0] )
1719 $taxId = substr($item->getPostVar(), strlen(
'tax_'));
1721 $questionList->addTaxonomyFilter(
1722 $taxId, $item->getValue(), $this->
object->getId(), $this->
object->getType()
1725 elseif( $item->getValue() !== false )
1727 $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
1731 if( $this->
object->isNavTaxonomyActive() && (int)
$_GET[
'tax_node'] )
1733 require_once
'Services/Taxonomy/classes/class.ilTaxonomyTree.php';
1737 if( (
int)
$_GET[
'tax_node'] != $rootNodeId )
1739 $questionList->addTaxonomyFilter(
1741 $this->
object->getId(), $this->
object->getType()
1746 $questionList->load();
1747 $data = $questionList->getQuestionDataArray();
1749 $table_gui->setData(
$data);
const MATCHING_QUESTION_IDENTIFIER
const MULTIPLE_CHOICE_QUESTION_IDENTIFIER
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _goto($a_target)
Redirect script to call a test with the question pool reference id.
executeCommand()
execute command
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin object.
& createQuestionForTestObject()
create new question
This class represents an option in a radio group.
createQuestionFormObject()
Export User Interface Class.
renoveImportFailsObject()
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
copyObject()
copy one or more question objects to the clipboard
confirmDeleteQuestionsObject()
delete questions
GUI class for the workflow of copying objects.
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually...
const ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT
constant for additional content editing mode "pageobject"
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
filterObject()
set question list filter
Abstract basic class which is to be extended by the concrete assessment question type classes...
Class ilObject Basic functions for all objects.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
const KPRIM_CHOICE_QUESTION_IDENTIFIER
Taxonomy explorer GUI class.
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
const LONG_MENU_QUESTION_IDENTIFIER
Class ilUnitConfigurationRepository.
const TEXTSUBSET_QUESTION_IDENTIFIER
__construct()
Constructor public.
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
static _lookupTitle($a_id)
lookup object title
getTabs()
adds tabs to tab gui object
download_paragraphObject()
download source code paragraph
filterQuestionBrowserObject()
exportObject()
Gateway for exports initiated from workspace, as there is a generic forward to {objTypeMainGUI}export...
for($col=0; $col< 50; $col++) $d
const JAVAAPPLET_QUESTION_IDENTIFIER
resetQuestionBrowserObject()
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
prepareOutput($a_show_subobjects=true)
prepare output
& editQuestionForTestObject()
edit question
importQuestionsObject(ilPropertyFormGUI $form=null)
display the import form to import questions into the questionpool
Export class for questionpools.
deleteQuestionsObject()
delete questions confirmation screen
deleteRegisteredImportFails()
const NUMERIC_QUESTION_IDENTIFIER
if(!is_array($argv)) $options
addSubTabTarget($a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
DEPRECATED.
setTitleAndDescription()
called by prepare output
buildQuestionBrowserTableGUI($taxIds)
questionsObject()
list questions of question pool
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
Class ilObjectGUI Basic methods of all Output classes.
static _lookupObjId($a_id)
const ORDERING_QUESTION_IDENTIFIER
uploadQplObject($questions_only=false)
imports question(s) into the questionpool
downloadFileObject()
download file
cancelDeleteQuestionsObject()
Cancel question deletion.
static _setImportDirectory($a_import_dir=null)
set import directory
addSettingsSubTabs(ilTabsGUI $tabs)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static getSyntaxStylePath()
get syntax style path
importVerifiedFileObject()
imports question(s) into the questionpool (after verification)
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
const TEXT_QUESTION_IDENTIFIER
Class ilObjQuestionPoolGUI.
const EDIT_CONTEXT_AUTHORING
Create styles array
The data for the language used.
& createQuestionObject()
create new question
moveObject()
mark one or more question objects for moving
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
buildCreateQuestionForm()
const ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT
constant for additional content editing mode "default"
Class ilQuestionPoolImportVerificationTableGUI.
static getContentStylePath($a_style_id)
get content style path
fullscreenObject()
show fullscreen view
afterSave(ilObject $a_new_object)
save object public
fetchAuthoringQuestionIdParamater()
static isSkillManagementGloballyActivated()
Create new PHPExcel object
obj_idprivate
pasteObject()
paste questios from the clipboard into the question pool
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not ...
resetFilterObject()
resets filter
getCreationMode()
get creation mode
getRefId()
get reference id public
exportQuestionObject()
export question
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilLocalUnitConfigurationGUI.
infoScreenForward()
show information screen
initImportForm($a_new_type)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static _getImportDirectory()
get import directory of lm
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
importFileObject($parent_id=null, $a_catch_errors=true)
form for new questionpool object import
static redirect($a_script)
http redirect to other script
static _createImportDirectory()
creates data directory for import files (data_dir/qpl_data/qpl_<id>/import, depending on data directo...
const SINGLE_CHOICE_QUESTION_IDENTIFIER
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
const RENDER_PURPOSE_PREVIEW
const CMD_SHOW_SKILL_QUEST_ASSIGNS
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
const CLOZE_TEST_IDENTIFIER
Question identifier constants.
uploadObject()
imports question(s) into the questionpool
static _setImportDirectory($a_import_dir=null)
set import directory
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
const IMAGEMAP_QUESTION_IDENTIFIER
readRootId()
read root id from database