4require_once
'./Services/Object/classes/class.ilObjectGUI.php';
5require_once
'./Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
6require_once
'./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
7require_once
'./Modules/TestQuestionPool/exceptions/class.ilTestQuestionPoolException.php';
8require_once
'./Modules/Test/classes/inc.AssessmentConstants.php';
9require_once
'./Modules/Test/classes/class.ilObjAssessmentFolder.php';
10require_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');
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());
158 $gui->initPreviewSession(
$ilUser->getId(), (
int)
$_GET[
'q_id']);
159 $gui->initHintTracking();
160 $gui->initStyleSheets();
163 $ilHelp->setScreenIdComponent(
"qpl");
165 $this->ctrl->forwardCommand($gui);
168 case "ilassquestionpagegui":
169 include_once(
"./Services/Style/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";
181 $q_gui->setQuestionTabs();
182 $q_gui->outAdditionalOutput();
183 $q_gui->object->setObjId($this->object->getId());
185 $q_gui->setTargetGuiClass(
null);
186 $q_gui->setQuestionActionCmd(
null);
188 $question = $q_gui->object;
189 $this->ctrl->saveParameter($this,
"q_id");
190 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
191 $this->lng->loadLanguageModule(
"content");
192 $this->ctrl->setReturnByClass(
"ilAssQuestionPageGUI",
"view");
193 $this->ctrl->setReturn($this,
"questions");
195 $page_gui->obj->addUpdateListener(
199 $page_gui->setEditPreview(
true);
200 $page_gui->setEnabledTabs(
false);
201 if (strlen($this->ctrl->getCmd()) == 0 && !isset(
$_POST[
"editImagemapForward_x"]))
203 $this->ctrl->setCmdClass(get_class($page_gui));
204 $this->ctrl->setCmd(
"preview");
206 $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
207 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
208 $page_gui->setOutputMode(
"edit");
209 $page_gui->setHeader($question->getTitle());
210 $page_gui->setPresentationTitle($question->getTitle());
211 $ret = $this->ctrl->forwardCommand($page_gui);
215 case 'ilpermissiongui':
216 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
218 $ret = $this->ctrl->forwardCommand($perm_gui);
221 case 'ilobjectcopygui':
222 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
225 $this->ctrl->forwardCommand($cp);
228 case "ilquestionpoolexportgui":
229 require_once
'Modules/TestQuestionPool/classes/class.ilQuestionPoolExportGUI.php';
231 $exp_gui->addFormat(
'xml', $this->lng->txt(
'qpl_export_xml'));
232 $exp_gui->addFormat(
'xls', $this->lng->txt(
'qpl_export_excel'), $this,
'createExportExcel');
233 $ret = $this->ctrl->forwardCommand($exp_gui);
236 case "ilinfoscreengui":
240 case 'ilassquestionhintsgui':
243 $this->ctrl->setReturn($this,
"questions");
246 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
248 $questionGUI->object->setObjId($this->object->getId());
249 $questionGUI->setQuestionTabs();
251 $ilHelp->setScreenIdComponent(
"qpl");
254 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
260 case 'illocalunitconfigurationgui':
261 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
263 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
266 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
268 $questionGUI->object->setObjId($this->object->getId());
269 $questionGUI->setQuestionTabs();
271 $this->ctrl->setReturn($this,
'questions');
273 require_once
'Modules/TestQuestionPool/classes/class.ilLocalUnitConfigurationGUI.php';
274 require_once
'Modules/TestQuestionPool/classes/class.ilUnitConfigurationRepository.php';
281 case 'ilassquestionfeedbackeditinggui':
284 $this->ctrl->setReturn($this,
"questions");
287 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
289 $questionGUI->object->setObjId($this->object->getId());
290 $questionGUI->setQuestionTabs();
292 $ilHelp->setScreenIdComponent(
"qpl");
295 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
301 case 'ilobjquestionpoolsettingsgeneralgui':
302 require_once
'Modules/TestQuestionPool/classes/class.ilObjQuestionPoolSettingsGeneralGUI.php';
304 $this->ctrl->forwardCommand($gui);
307 case "ilobjtaxonomygui":
309 require_once
'Modules/TestQuestionPool/classes/class.ilObjQuestionPoolTaxonomyEditingCommandForwarder.php';
311 $this->
object, $ilDB, $ilPluginAdmin,
$ilCtrl, $ilTabs,
$lng
314 $forwarder->forward();
318 case 'ilquestionpoolskilladministrationgui':
320 require_once
'Modules/TestQuestionPool/classes/class.ilQuestionPoolSkillAdministrationGUI.php';
325 $this->ctrl->forwardCommand($gui);
329 case 'ilquestionbrowsertablegui':
333 case "ilobjquestionpoolgui":
336 if(
$cmd ==
'questions' )
338 $this->ctrl->setParameter($this,
'q_id',
'');
346 $this->ctrl->setReturn($this,
"questions");
347 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
349 $q_gui->object->setObjId($this->object->getId());
350 if($this->object->getType() ==
'qpl')
352 $q_gui->setTaxonomyIds($this->object->getTaxonomyIds());
353 $this->
object->addQuestionChangeListeners($q_gui->object);
355 $q_gui->setQuestionTabs();
357 $ilHelp->setScreenIdComponent(
"qpl");
358 $ret = $this->ctrl->forwardCommand($q_gui);
362 if ( !(strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui"
363 || strtolower(
$_GET[
'baseClass']) ==
'ilrepositorygui')
377 $DIC->ctrl()->redirectByClass(
'ilQuestionPoolExportGUI');
386 include_once(
"./Modules/File/classes/class.ilObjFile.php");
388 $fileObj->sendFile();
397 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
399 $page_gui->showMediaFullscreen();
416 $_POST[
"filter_text"] =
"";
417 $_POST[
"sel_filter_type"] =
"";
426 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php");
428 $pg_obj->send_paragraph (
$_GET[
"par_id"],
$_GET[
"downloadtitle"]);
437 $this->ctrl->setParameter($this,
'new_type',
$_REQUEST[
'new_type']);
438 if ($_FILES[
"xmldoc"][
"error"] > UPLOAD_ERR_OK)
443 $this->ctrl->redirect($this,
'create');
448 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
452 $file = pathinfo($_FILES[
"xmldoc"][
"name"]);
453 $full_path = $basedir.
"/".$_FILES[
"xmldoc"][
"name"];
454 $GLOBALS[
'ilLog']->write(__METHOD__.
": full path " . $full_path);
455 include_once
"./Services/Utilities/classes/class.ilUtil.php";
457 $GLOBALS[
'ilLog']->write(__METHOD__.
": full path " . $full_path);
458 if (strcmp($_FILES[
"xmldoc"][
"type"],
"text/xml") == 0)
460 $qti_file = $full_path;
469 $subdir = basename(
$file[
"basename"],
".".
$file[
"extension"]);
476 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
478 $result = $qtiParser->startParsing();
479 $founditems =& $qtiParser->getFoundItems();
480 if (count($founditems) == 0)
490 $this->ctrl->redirect($this,
'create');
497 foreach ($founditems as $item)
499 if (strlen($item[
"type"]))
517 $this->ctrl->redirect($this,
'create');
522 $_SESSION[
"qpl_import_xml_file"] = $xml_file;
523 $_SESSION[
"qpl_import_qti_file"] = $qti_file;
524 $_SESSION[
"qpl_import_subdir"] = $subdir;
526 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.qpl_import_verification.html",
527 "Modules/TestQuestionPool");
528 $row_class = array(
"tblrow1",
"tblrow2");
530 foreach ($founditems as $item)
532 $this->tpl->setCurrentBlock(
"verification_row");
533 $this->tpl->setVariable(
"ROW_CLASS", $row_class[$counter++ % 2]);
534 $this->tpl->setVariable(
"QUESTION_TITLE", $item[
"title"]);
535 $this->tpl->setVariable(
"QUESTION_IDENT", $item[
"ident"]);
536 include_once
"./Services/QTI/classes/class.ilQTIItem.php";
537 switch ($item[
"type"])
540 $type = $this->lng->txt(
"assClozeTest");
543 $type = $this->lng->txt(
"assImagemapQuestion");
546 $type = $this->lng->txt(
"assJavaApplet");
549 $type = $this->lng->txt(
"assMatchingQuestion");
552 $type = $this->lng->txt(
"assMultipleChoice");
555 $type = $this->lng->txt(
"assKprimChoice");
558 $type = $this->lng->txt(
"assLongMenu");
561 $type = $this->lng->txt(
"assSingleChoice");
564 $type = $this->lng->txt(
"assOrderingQuestion");
567 $type = $this->lng->txt(
"assTextQuestion");
570 $type = $this->lng->txt(
"assNumeric");
573 $type = $this->lng->txt(
"assTextSubset");
576 $type = $this->lng->txt($item[
"type"]);
580 if (strcmp($type,
"-" . $item[
"type"] .
"-") == 0)
582 global $ilPluginAdmin;
583 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_MODULE,
"TestQuestionPool",
"qst");
584 foreach ($pl_names as $pl_name)
587 if (strcmp($pl->getQuestionType(), $item[
"type"]) == 0)
589 $type = $pl->getQuestionTypeTranslation();
593 $this->tpl->setVariable(
"QUESTION_TYPE", $type);
594 $this->tpl->parseCurrentBlock();
597 $this->tpl->setCurrentBlock(
"import_qpl");
598 if (is_file($xml_file))
601 $fh = @fopen($xml_file,
"r") or die(
"");
602 $xml = @fread($fh, filesize($xml_file));
604 if (preg_match(
"/<ContentObject.*?MetaData.*?General.*?Title[^>]*?>([^<]*?)</", $xml, $matches))
606 $this->tpl->setVariable(
"VALUE_NEW_QUESTIONPOOL", $matches[1]);
609 $this->tpl->setVariable(
"TEXT_CREATE_NEW_QUESTIONPOOL", $this->lng->txt(
"qpl_import_create_new_qpl"));
610 $this->tpl->parseCurrentBlock();
612 $this->tpl->setCurrentBlock(
"adm_content");
613 $this->tpl->setVariable(
"TEXT_TYPE", $this->lng->txt(
"question_type"));
614 $this->tpl->setVariable(
"TEXT_TITLE", $this->lng->txt(
"question_title"));
615 $this->tpl->setVariable(
"FOUND_QUESTIONS_INTRODUCTION", $this->lng->txt(
"qpl_import_verify_found_questions"));
618 $this->tpl->setVariable(
"VERIFICATION_HEADING", $this->lng->txt(
"import_questions_into_qpl"));
619 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
623 $this->tpl->setVariable(
"VERIFICATION_HEADING", $this->lng->txt(
"import_qpl"));
625 $this->ctrl->setParameter($this,
"new_type", $this->type);
626 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
631 $this->tpl->setVariable(
"VALUE_IMPORT", $this->lng->txt(
"import"));
632 $this->tpl->setVariable(
"VALUE_CANCEL", $this->lng->txt(
"cancel"));
633 $value_questions_only = 0;
634 if ($questions_only) $value_questions_only = 1;
635 $this->tpl->setVariable(
"VALUE_QUESTIONS_ONLY", $value_questions_only);
637 $this->tpl->parseCurrentBlock();
647 if (
$_POST[
"questions_only"] == 1)
653 include_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
657 $newObj->setType(
$_GET[
"new_type"]);
659 $newObj->setTitle(
"dummy");
661 $newObj->setDescription(
"questionpool import");
663 $newObj->create(
true);
665 $newObj->createReference();
667 $newObj->putInTree(
$_GET[
"ref_id"]);
669 $newObj->setPermissions(
$_GET[
"ref_id"]);
671 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
674 if (is_file(
$_SESSION[
"qpl_import_dir"].
'/'.
$_SESSION[
"qpl_import_subdir"].
"/manifest.xml"))
678 $fileName =
$_SESSION[
"qpl_import_subdir"].
'.zip';
679 $fullPath =
$_SESSION[
"qpl_import_dir"].
'/'.$fileName;
681 include_once(
"./Services/Export/classes/class.ilImport.php");
683 $map = $imp->getMapping();
684 $map->addMapping(
"Modules/TestQuestionPool",
"qpl",
"new_id", $newObj->getId());
685 $imp->importObject($newObj, $fullPath, $fileName,
"qpl",
"Modules/TestQuestionPool",
true);
690 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
692 $result = $qtiParser->startParsing();
695 if (strlen(
$_SESSION[
"qpl_import_xml_file"]))
697 include_once (
"./Modules/LearningModule/classes/class.ilContObjParser.php");
699 $contParser->setQuestionMapping($qtiParser->getImportMapping());
700 $contParser->startParsing();
703 $newObj->fromXML(
$_SESSION[
"qpl_import_xml_file"]);
707 if( isset(
$_POST[
"qpl_new"]) && strlen(
$_POST[
"qpl_new"]) )
709 $newObj->setTitle(
$_POST[
"qpl_new"]);
717 include_once
"./Services/Utilities/classes/class.ilUtil.php";
720 if (
$_POST[
"questions_only"] == 1)
722 $this->ctrl->redirect($this,
"questions");
728 "&baseClass=ilObjQuestionPoolGUI");
734 if (
$_POST[
"questions_only"] == 1)
736 $this->ctrl->redirect($this,
"questions");
740 $this->ctrl->redirect($this,
"cancel");
749 $upload_valid =
true;
751 if($form->checkInput())
755 $form->setValuesByPost();
761 $form->setValuesByPost();
776 $this->tpl->setContent($form->getHtml());
784 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
786 $form->setTitle($this->lng->txt(
'import_question'));
787 $form->setFormAction($this->ctrl->getFormAction($this,
'upload'));
790 $file->setRequired(
true);
791 $form->addItem(
$file);
793 $form->addCommandButton(
'upload', $this->lng->txt(
'upload'));
794 $form->addCommandButton(
'questions', $this->lng->txt(
'cancel'));
806 $addContEditMode =
$_POST[
'add_quest_cont_edit_mode'];
813 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
815 $this->
object->addQuestionChangeListeners($q_gui->object);
816 $q_gui->object->setObjId($this->object->getId());
817 $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
818 $q_gui->object->createNewQuestion();
819 $this->ctrl->setParameterByClass(get_class($q_gui),
"q_id", $q_gui->object->getId());
820 $this->ctrl->setParameterByClass(get_class($q_gui),
"sel_question_types",
$_POST[
"sel_question_types"]);
821 $this->ctrl->redirectByClass(get_class($q_gui),
"editQuestion");
831 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
834 $addContEditMode =
$_REQUEST[
'add_quest_cont_edit_mode'];
841 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
843 $q_gui->object->setObjId($this->object->getId());
844 $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
845 $q_gui->object->createNewQuestion();
847 $class = get_class($q_gui);
848 $qId = $q_gui->object->getId();
852 $class =
$_GET[
"sel_question_types"] .
'gui';
856 $this->ctrl->setParameterByClass($class,
"q_id", $qId);
857 $this->ctrl->setParameterByClass($class,
"sel_question_types",
$_REQUEST[
"sel_question_types"]);
858 $this->ctrl->setParameterByClass($class,
"prev_qid",
$_REQUEST[
"prev_qid"]);
860 $this->ctrl->redirectByClass($class,
"editQuestion");
873 "&baseClass=ilObjQuestionPoolGUI");
879 $type =
$_GET[
"sel_question_types"];
880 $this->editQuestionForm($type);
890 if (count(
$_POST[
"q_id"]) < 1)
893 $this->ctrl->redirect($this,
"questions");
897 $deleteable_questions =& $this->
object->getDeleteableQuestionDetails(
$_POST[
"q_id"]);
898 include_once
"./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
900 $table_gui->setEditable($rbacsystem->checkAccess(
'write',
$_GET[
'ref_id']));
901 $table_gui->setData($deleteable_questions);
902 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
912 foreach (
$_POST[
"q_id"] as $key => $value)
914 $this->
object->deleteQuestion($value);
915 $this->
object->cleanupClipboard($value);
919 $this->ctrl->setParameter($this,
'q_id',
'');
921 $this->ctrl->redirect($this,
"questions");
929 $this->ctrl->redirect($this,
"questions");
938 if (count(
$_POST[
"q_id"]) > 0)
940 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
942 $export_file = $qpl_exp->buildExportFile();
945 include_once
"./Services/Utilities/classes/class.ilUtil.php";
953 $this->ctrl->redirect($this,
"questions");
958 require_once
'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
961 include_once
"./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
963 $table_gui->resetOffset();
964 $table_gui->writeFilterToSession();
970 require_once
'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
973 include_once
"./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
975 $table_gui->resetOffset();
976 $table_gui->resetFilter();
987 if(get_class($this->
object) ==
"ilObjTest")
989 if (
$_GET[
"calling_test"] > 0)
992 $q_id =
$_GET[
"q_id"];
996 ilUtil::redirect(
"ilias.php?ref_id=".
$ref_id.
"&q_id=".$q_id.
"&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
998 ilUtil::redirect(
"ilias.php?ref_id=".
$ref_id.
"&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
1005 else if(isset(
$_GET[
'calling_consumer']) && (
int)
$_GET[
'calling_consumer'])
1013 require_once
'Services/Link/classes/class.ilLink.php';
1017 $this->
object->purgeQuestions();
1021 require_once
'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
1025 $table_gui->setPreventDoubleSubmission(
false);
1027 if( $rbacsystem->checkAccess(
'write',
$_GET[
'ref_id']) )
1031 require_once
'Services/UIComponent/Button/classes/class.ilLinkButton.php';
1033 $btn->setCaption(
'ass_create_question');
1034 $btn->setUrl($this->ctrl->getLinkTarget($this,
'createQuestionForm'));
1035 $btn->setPrimary(
true);
1036 $toolbar->addButtonInstance($btn);
1038 $this->tpl->setContent(
1039 $this->ctrl->getHTML($toolbar) . $this->ctrl->getHTML($table_gui)
1044 $this->tpl->setContent( $this->ctrl->getHTML($table_gui) );
1047 if( $this->object->getShowTaxonomies() )
1049 $this->lng->loadLanguageModule(
'tax');
1051 require_once
'Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php';
1053 foreach($taxIds as $taxId)
1055 if( $taxId != $this->object->getNavTaxonomyId() )
1061 $this,
'showNavTaxonomy', $taxId,
'ilobjquestionpoolgui',
'questions'
1064 if( !$taxExp->handleCommand() )
1066 $this->tpl->setLeftContent($taxExp->getHTML().
" ");
1078 $this->tpl->setContent( $this->ctrl->getHTML($form) );
1087 require_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1089 $form->setTitle($this->lng->txt(
'ass_create_question'));
1090 $form->setFormAction($this->ctrl->getFormAction($this));
1095 foreach( $this->object->getQuestionTypes(
false,
true) as $translation =>
$data )
1100 require_once(
"Services/Form/classes/class.ilSelectInputGUI.php");
1105 $form->addItem(
$si);
1111 $ri =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_add_quest_cont_edit_mode"),
"add_quest_cont_edit_mode");
1114 $this->lng->txt(
'tst_add_quest_cont_edit_mode_default'),
1119 $this->lng->txt(
'tst_add_quest_cont_edit_mode_page_object'),
1125 $form->addItem($ri,
true);
1131 $form->addItem($hi,
true);
1136 $form->addCommandButton(
'createQuestion', $this->lng->txt(
'create'));
1137 $form->addCommandButton(
'questions', $this->lng->txt(
'cancel'));
1145 public function printObject()
1152 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
'print'));
1153 require_once
'Services/Form/classes/class.ilSelectInputGUI.php';
1155 $mode->setOptions(array(
1156 'overview' => $this->lng->txt(
'overview'),
1157 'detailed' => $this->lng->txt(
'detailed_output_solutions'),
1158 'detailed_printview' => $this->lng->txt(
'detailed_output_printview')
1162 $ilToolbar->setFormName(
'printviewOptions');
1163 $ilToolbar->addInputItem($mode,
true);
1164 $ilToolbar->addFormButton($this->lng->txt(
'submit'),
'print');
1166 include_once
"./Modules/TestQuestionPool/classes/tables/class.ilQuestionPoolPrintViewTableGUI.php";
1168 $data = $this->
object->getPrintviewQuestions();
1172 $totalPoints +=
$d[
'points'];
1174 $table_gui->setTotalPoints($totalPoints);
1175 $table_gui->initColumns();
1176 $table_gui->setData(
$data);
1177 $this->tpl->setContent($table_gui->getHTML());
1183 $this->update = $this->
object->update();
1192 if (array_key_exists(
"qpl_clipboard",
$_SESSION))
1194 if($this->object->pasteFromClipboard())
1207 $this->ctrl->redirect($this,
"questions");
1215 if (count(
$_POST[
"q_id"]) > 0)
1217 foreach (
$_POST[
"q_id"] as $key => $value)
1219 $this->
object->copyToClipboard($value);
1227 $this->ctrl->redirect($this,
"questions");
1235 if (count(
$_POST[
"q_id"]) > 0)
1237 foreach (
$_POST[
"q_id"] as $key => $value)
1239 $this->
object->moveToClipboard($value);
1247 $this->ctrl->redirect($this,
"questions");
1253 if ($rbacsystem->checkAccess(
"write",
$_GET[
'ref_id']))
1255 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
1256 $question_ids =& $this->
object->getAllQuestionIds();
1258 $qpl_exp->buildExportFile();
1259 $this->ctrl->redirectByClass(
"ilquestionpoolexportgui",
"");
1268 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1270 $this->ctrl->redirectByClass(get_class($q_gui),
"editQuestion");
1275 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1277 $form->setTarget(
"_top");
1278 $form->setFormAction($this->ctrl->getFormAction($this));
1279 $form->setTitle($this->lng->txt(
"import_qpl"));
1281 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
1282 $fi =
new ilFileInputGUI($this->lng->txt(
"import_file"),
"xmldoc");
1283 $fi->setSuffixes(array(
"zip"));
1284 $fi->setRequired(
true);
1285 $form->addItem($fi);
1287 $form->addCommandButton(
"importFile", $this->lng->txt(
"import"));
1288 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
1299 if($form->checkInput())
1305 $this->tpl->setContent($form->getHTML());
1311 switch ($this->ctrl->getCmd())
1318 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"",
$_GET[
"ref_id"]);
1321 if (
$_GET[
"q_id"] > 0)
1323 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1327 $q_gui->object->setObjId($this->object->getId());
1328 $title = $q_gui->object->getTitle();
1333 $ilLocator->addItem($title, $this->ctrl->getLinkTargetByClass(get_class($q_gui),
"editQuestion"));
1338 $this->ctrl->setParameter($this,
'q_id',
'');
1339 $this->ctrl->redirect($this);
1349 parent::setTitleAndDescription();
1350 if (
$_GET[
"q_id"] > 0)
1352 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1356 $q_gui->object->setObjId($this->object->getId());
1357 $title = $q_gui->object->getTitle();
1362 $this->tpl->setTitle($title);
1363 $this->tpl->setDescription($q_gui->object->getComment());
1366 $this->tpl->setTitleIcon($this->object->plugin->getImagePath(
"icon_".$this->object->getType().
".svg"), $this->lng->txt(
"obj_" . $this->object->getType()));
1376 $this->ctrl->setParameter($this,
'q_id',
'');
1377 $this->ctrl->redirect($this);
1382 $this->tpl->setTitle($this->object->getTitle());
1383 $this->tpl->setDescription($this->object->getLongDescription());
1395 global $ilAccess, $ilHelp;
1397 $currentUserHasWriteAccess = $ilAccess->checkAccess(
"write",
"", $this->object->getRefId());
1399 $ilHelp->setScreenIdComponent(
"qpl");
1401 $next_class = strtolower($this->ctrl->getNextClass());
1402 switch ($next_class)
1405 case "ilpermissiongui":
1406 case "ilobjectmetadatagui":
1407 case "ilquestionpoolexportgui":
1408 case "ilquestionpoolskilladministrationgui":
1411 case 'ilobjtaxonomygui':
1412 case 'ilobjquestionpoolsettingsgeneralgui':
1414 if( $currentUserHasWriteAccess )
1426 $force_active =
false;
1427 $commands =
$_POST[
"cmd"];
1428 if (is_array($commands))
1430 foreach ($commands as $key => $value)
1432 if (preg_match(
"/^delete_.*/", $key, $matches) ||
1433 preg_match(
"/^addSelectGap_.*/", $key, $matches) ||
1434 preg_match(
"/^addTextGap_.*/", $key, $matches) ||
1435 preg_match(
"/^deleteImage_.*/", $key, $matches) ||
1436 preg_match(
"/^upload_.*/", $key, $matches) ||
1437 preg_match(
"/^addSuggestedSolution_.*/", $key, $matches)
1440 $force_active =
true;
1444 if (array_key_exists(
"imagemap_x",
$_POST))
1446 $force_active =
true;
1450 $force_active = ((strtolower($this->ctrl->getCmdClass()) == strtolower(get_class($this)) || strlen($this->ctrl->getCmdClass()) == 0) &&
1451 $this->ctrl->getCmd() ==
"")
1455 $tabs_gui->addTarget(
"assQuestions",
1456 $this->ctrl->getLinkTarget($this,
"questions"),
1457 array(
"questions",
"filter",
"resetFilter",
"createQuestion",
1458 "importQuestions",
"deleteQuestions",
"filterQuestionBrowser",
1459 "view",
"preview",
"editQuestion",
"exec_pg",
1460 "addItem",
"upload",
"save",
"cancel",
"addSuggestedSolution",
1461 "cancelExplorer",
"linkChilds",
"removeSuggestedSolution",
1462 "add",
"addYesNo",
"addTrueFalse",
"createGaps",
"saveEdit",
1463 "setMediaMode",
"uploadingImage",
"uploadingImagemap",
"addArea",
1464 "deletearea",
"saveShape",
"back",
"addPair",
"uploadingJavaapplet",
1465 "addParameter",
"assessment",
"addGIT",
"addST",
"addPG",
"delete",
1466 "toggleGraphicalAnswers",
"deleteAnswer",
"deleteImage",
"removeJavaapplet"),
1467 "",
"", $force_active);
1469 if ($ilAccess->checkAccess(
"read",
"", $this->ref_id) || $ilAccess->checkAccess(
"visible",
"", $this->ref_id))
1471 $tabs_gui->addTarget(
"info_short",
1472 $this->ctrl->getLinkTarget($this,
"infoScreen"),
1473 array(
"infoScreen",
"showSummary"));
1476 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
'ref_id']))
1479 $tabs_gui->addTarget(
1480 'settings', $this->ctrl->getLinkTargetByClass(
'ilObjQuestionPoolSettingsGeneralGUI'),
1481 array(), array(
'ilObjQuestionPoolSettingsGeneralGUI',
'ilObjTaxonomyGUI')
1487 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentsGUI.php';
1489 $link = $this->ctrl->getLinkTargetByClass(
1490 array(
'ilQuestionPoolSkillAdministrationGUI',
'ilAssQuestionSkillAssignmentsGUI'),
1494 $tabs_gui->addTarget(
'qpl_tab_competences', $link, array(), array());
1499 $tabs_gui->addTarget(
"print_view",
1500 $this->ctrl->getLinkTarget($this,
'print'),
1504 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1507 include_once
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
1509 $mdtab = $mdgui->getTab();
1512 $tabs_gui->addTarget(
"meta_data",
1514 "",
"ilmdeditorgui");
1523 if( $currentUserHasWriteAccess )
1525 $tabs_gui->addTarget(
"export",
1526 $this->ctrl->getLinkTargetByClass(
"ilquestionpoolexportgui",
""),
1527 "",
"ilquestionpoolexportgui");
1530 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->object->getRefId()))
1532 $tabs_gui->addTarget(
"perm_settings",
1533 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1544 if( !$this->object->isSkillServiceEnabled() )
1560 'qpl_settings_subtab_general',
1561 $this->ctrl->getLinkTargetByClass(
'ilObjQuestionPoolSettingsGeneralGUI'),
1562 '',
'ilObjQuestionPoolSettingsGeneralGUI'
1566 'qpl_settings_subtab_taxonomies',
1567 $this->ctrl->getLinkTargetByClass(
'ilObjTaxonomyGUI',
'editAOTaxonomySettings'),
1568 '',
'ilObjTaxonomyGUI'
1579 $this->ctrl->setCmd(
"showSummary");
1580 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1589 global
$ilErr, $ilAccess;
1591 if(!$ilAccess->checkAccess(
"visible",
"", $this->ref_id))
1593 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"));
1596 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1598 $info->enablePrivateNotes();
1601 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1603 $this->ctrl->forwardCommand(
$info);
1618 if ($ilAccess->checkAccess(
"write",
"", $a_target) || $ilAccess->checkAccess(
'read',
'', $a_target))
1620 $_GET[
"baseClass"] =
"ilObjQuestionPoolGUI";
1621 $_GET[
"cmd"] =
"questions";
1622 $_GET[
"ref_id"] = $a_target;
1623 include_once(
"ilias.php");
1626 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1645 global $rbacsystem,
$ilDB,
$lng, $ilPluginAdmin;
1647 include_once
"./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
1648 $table_gui =
new ilQuestionBrowserTableGUI($this,
'questions', (($rbacsystem->checkAccess(
'write',
$_GET[
'ref_id']) ?
true :
false)),
false, $taxIds);
1649 $table_gui->setEditable($rbacsystem->checkAccess(
'write',
$_GET[
'ref_id']));
1651 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
1653 $questionList->setParentObjId($this->object->getId());
1655 foreach ($table_gui->getFilterItems() as $item)
1657 if( substr($item->getPostVar(), 0, strlen(
'tax_')) ==
'tax_' )
1659 $v = $item->getValue();
1661 if( is_array($v) && count($v) && !(
int)$v[0] )
1666 $taxId = substr($item->getPostVar(), strlen(
'tax_'));
1668 $questionList->addTaxonomyFilter(
1669 $taxId, $item->getValue(), $this->object->getId(), $this->object->getType()
1672 elseif( $item->getValue() !==
false )
1674 $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
1678 if( $this->object->isNavTaxonomyActive() && (
int)
$_GET[
'tax_node'] )
1680 $questionList->addTaxonomyFilter(
1681 $this->object->getNavTaxonomyId(), array((
int)
$_GET[
'tax_node']),
1682 $this->object->getId(), $this->object->getType()
1686 $questionList->load();
1687 $data = $questionList->getQuestionDataArray();
1689 $table_gui->setData(
$data);
& _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
Abstract basic class which is to be extended by the concrete assessment question type classes.
const ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT
constant for additional content editing mode "default"
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
const ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT
constant for additional content editing mode "pageobject"
const CMD_SHOW_SKILL_QUEST_ASSIGNS
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
Class ilLocalUnitConfigurationGUI.
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not
Class ilObjQuestionPoolGUI.
ilObjQuestionPoolGUI()
Constructor @access public.
addSettingsSubTabs(ilTabsGUI $tabs)
filterQuestionBrowserObject()
uploadQplObject($questions_only=false)
imports question(s) into the questionpool
confirmDeleteQuestionsObject()
delete questions
afterSave(ilObject $a_new_object)
save object @access public
updateObject()
updates object entry in object_data
download_paragraphObject()
download source code paragraph
deleteQuestionsObject()
delete questions confirmation screen
& createQuestionForTestObject()
create new question
filterObject()
set question list filter
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually,...
questionsObject()
list questions of question pool
addLocatorItems()
should be overwritten to add object specific items (repository items are preloaded)
importVerifiedFileObject()
imports question(s) into the questionpool (after verification)
uploadObject()
imports question(s) into the questionpool
moveObject()
mark one or more question objects for moving
& createQuestionObject()
create new question
buildCreateQuestionForm()
pasteObject()
paste questios from the clipboard into the question pool
resetQuestionBrowserObject()
initImportForm($a_new_type)
Init object import form.
importFileObject()
form for new questionpool object import
cancelDeleteQuestionsObject()
Cancel question deletion.
& editQuestionForTestObject()
edit question
setTitleAndDescription()
called by prepare output
exportQuestionObject()
export question
infoScreenForward()
show information screen
executeCommand()
execute command
static _goto($a_target)
Redirect script to call a test with the question pool reference id.
buildQuestionBrowserTableGUI($taxIds)
createQuestionFormObject()
copyObject()
copy one or more question objects to the clipboard
downloadFileObject()
download file
exportObject()
Gateway for exports initiated from workspace, as there is a generic forward to {objTypeMainGUI}::expo...
resetFilterObject()
resets filter
importQuestionsObject(ilPropertyFormGUI $form=null)
display the import form to import questions into the questionpool
fullscreenObject()
show fullscreen view
getTabs(&$tabs_gui)
adds tabs to tab gui object
_getImportDirectory()
get import directory of lm
static isSkillManagementGloballyActivated()
static _createImportDirectory()
creates data directory for import files (data_dir/qpl_data/qpl_<id>/import, depending on data directo...
_setImportDirectory($a_import_dir=null)
set import directory
getContentStylePath($a_style_id)
get content style path
getSyntaxStylePath()
get syntax style path
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
_setImportDirectory($a_import_dir=null)
set import directory
GUI class for the workflow of copying objects.
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilObjectGUI Basic methods of all Output classes.
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor @access public.
prepareOutput()
prepare output
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
getCreationMode()
get creation mode
Class ilObject Basic functions for all objects.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
getRefId()
get reference id @access public
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin object.
Export User Interface Class.
Export class for questionpools.
This class represents an option in a radio group.
addSubTabTarget($a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
DEPRECATED.
Taxonomy explorer GUI class.
Class ilUnitConfigurationRepository.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static redirect($a_script)
http redirect to other script
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
const CLOZE_TEST_IDENTIFIER
Question identifier constants.
const IMAGEMAP_QUESTION_IDENTIFIER
const SINGLE_CHOICE_QUESTION_IDENTIFIER
const TEXTSUBSET_QUESTION_IDENTIFIER
const NUMERIC_QUESTION_IDENTIFIER
const JAVAAPPLET_QUESTION_IDENTIFIER
const TEXT_QUESTION_IDENTIFIER
const LONG_MENU_QUESTION_IDENTIFIER
const KPRIM_CHOICE_QUESTION_IDENTIFIER
const MATCHING_QUESTION_IDENTIFIER
const MULTIPLE_CHOICE_QUESTION_IDENTIFIER
const ORDERING_QUESTION_IDENTIFIER
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
if(!is_array($argv)) $options