4require_once
'./Modules/Test/exceptions/class.ilTestException.php';
5require_once
'./Services/Object/classes/class.ilObjectGUI.php';
6require_once
'./Modules/Test/classes/inc.AssessmentConstants.php';
7require_once
'./Modules/Test/classes/class.ilObjAssessmentFolderGUI.php';
8require_once
'./Modules/Test/classes/class.ilObjAssessmentFolder.php';
9require_once
'./Modules/Test/classes/class.ilTestExpressPage.php';
10require_once
'Modules/OrgUnit/classes/Positions/Operation/class.ilOrgUnitOperation.php';
11require_once
'Modules/Test/classes/class.ilTestParticipantAccessFilter.php';
55 'ilpublicuserprofilegui',
'ilobjportfoliogui'
99 $ilPluginAdmin =
$DIC[
'ilPluginAdmin'];
101 $lng->loadLanguageModule(
"assessment");
104 $this->ctrl->saveParameter($this, array(
"ref_id",
"test_ref_id",
"calling_test",
"test_express_mode",
"q_id"));
105 if (isset(
$_GET[
'ref_id']) && is_numeric(
$_GET[
'ref_id'])) {
106 $refId = (int)
$_GET[
'ref_id'];
108 parent::__construct(
"", (
int) $refId,
true,
false);
110 if ($this->
object instanceof
ilObjTest) {
111 require_once
'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
114 require_once
'Modules/Test/classes/class.ilTestPlayerFactory.php';
117 require_once
'Modules/Test/classes/class.ilTestSessionFactory.php';
120 require_once
'Modules/Test/classes/class.ilTestSequenceFactory.php';
123 require_once
'Modules/Test/classes/class.ilTestAccess.php';
127 require_once
'Modules/Test/classes/class.ilTestObjectiveOrientedContainer.php';
130 if ($this->
object instanceof
ilObjTest) {
131 require_once
'Modules/Test/classes/class.ilTestTabsManager.php';
134 $tabsManager->setTestSession($this->testSessionFactory->getSession());
135 $tabsManager->setTestQuestionSetConfig($this->testQuestionSetConfigFactory->getQuestionSetConfig());
147 $ilAccess =
$DIC[
'ilAccess'];
148 $ilNavigationHistory =
$DIC[
'ilNavigationHistory'];
153 $ilTabs =
$DIC[
'ilTabs'];
154 $ilPluginAdmin =
$DIC[
'ilPluginAdmin'];
157 $ilias =
$DIC[
'ilias'];
160 if ((!$ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))) {
161 $ilias->raiseError($this->lng->txt(
"permission_denied"), $ilias->error_obj->MESSAGE);
164 $cmd = $this->ctrl->getCmd(
"infoScreen");
166 $cmdsDisabledDueToOfflineStatus = array(
167 'resumePlayer',
'resumePlayer',
'outUserResultsOverview',
'outUserListOfAnswerPasses'
170 if (!$this->
getCreationMode() && $this->object->getOfflineStatus() && in_array($cmd, $cmdsDisabledDueToOfflineStatus)) {
174 $next_class = $this->ctrl->getNextClass($this);
175 $this->ctrl->setReturn($this,
"infoScreen");
177 if (method_exists($this->
object,
"getTestStyleLocation")) {
178 $this->tpl->addCss($this->object->getTestStyleLocation(
"output"),
"screen");
183 $ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"])
185 $ilNavigationHistory->addItem(
187 "ilias.php?baseClass=ilObjTestGUI&cmd=infoScreen&ref_id=" .
$_GET[
"ref_id"],
193 if ($_REQUEST[
'prev_qid']) {
194 global $___prev_question_id;
195 $___prev_question_id = $_REQUEST[
'prev_qid'];
196 $this->ctrl->setParameter($this,
'prev_qid', $_REQUEST[
'prev_qid']);
199 if (!$this->
getCreationMode() && $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken()) {
200 if (!$this->testQuestionSetConfigFactory->getQuestionSetConfig()->isValidRequestOnBrokenQuestionSetDepencies($next_class, $cmd)) {
201 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
207 switch ($next_class) {
208 case 'illtiproviderobjectsettinggui':
211 $this->tabsManager->getSettingsSubTabs();
212 $GLOBALS[
'DIC']->tabs()->activateTab(
'settings');
213 $GLOBALS[
'DIC']->tabs()->activateSubTab(
'lti_provider');
215 $lti_gui->setCustomRolesForSelection(
$GLOBALS[
'DIC']->rbac()->review()->getLocalRoles($this->object->getRefId()));
216 $lti_gui->offerLTIRolesForSelection(
false);
217 $this->ctrl->forwardCommand($lti_gui);
221 case 'iltestexportgui':
222 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
223 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
229 require_once
'Modules/Test/classes/class.ilTestExportGUI.php';
233 case "ilinfoscreengui":
238 case 'ilobjectmetadatagui':
239 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
240 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
246 include_once
'Services/Object/classes/class.ilObjectMetaDataGUI.php';
248 $this->ctrl->forwardCommand($md_gui);
251 case 'iltestdashboardgui':
256 require_once
'Modules/Test/classes/class.ilTestDashboardGUI.php';
260 $this->testQuestionSetConfigFactory->getQuestionSetConfig()
267 $this->ctrl->forwardCommand($gui);
270 case 'iltestresultsgui':
275 require_once
'Modules/Test/classes/class.ilTestResultsGUI.php';
279 $this->testQuestionSetConfigFactory->getQuestionSetConfig()
283 $gui->setTestSession($this->testSessionFactory->getSession());
287 $this->ctrl->forwardCommand($gui);
290 case "iltestplayerfixedquestionsetgui":
292 require_once
"./Modules/Test/classes/class.ilTestPlayerFixedQuestionSetGUI.php";
293 if (!$this->object->getKioskMode()) {
298 $this->ctrl->forwardCommand($gui);
301 case "iltestplayerrandomquestionsetgui":
303 require_once
"./Modules/Test/classes/class.ilTestPlayerRandomQuestionSetGUI.php";
304 if (!$this->object->getKioskMode()) {
309 $this->ctrl->forwardCommand($gui);
312 case "iltestplayerdynamicquestionsetgui":
314 require_once
"./Modules/Test/classes/class.ilTestPlayerDynamicQuestionSetGUI.php";
315 if (!$this->object->getKioskMode()) {
320 $this->ctrl->forwardCommand($gui);
323 case "iltestevaluationgui":
327 case "iltestevalobjectiveorientedgui":
328 $this->forwardToEvalObjectiveOrientedGUI();
331 case "iltestservicegui":
334 require_once
"./Modules/Test/classes/class.ilTestServiceGUI.php";
336 $this->ctrl->forwardCommand($serviceGUI);
339 case 'ilpermissiongui':
343 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
345 $ret = $this->ctrl->forwardCommand($perm_gui);
348 case "illearningprogressgui":
352 require_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
354 $this->ctrl->forwardCommand($new_gui);
358 case "ilcertificategui":
365 $output_gui = $guiFactory->create($this->
object);
367 $this->ctrl->forwardCommand($output_gui);
370 case "iltestscoringgui":
373 require_once
"./Modules/Test/classes/class.ilTestScoringGUI.php";
376 $this->ctrl->forwardCommand($output_gui);
379 case 'ilmarkschemagui':
380 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
382 $this->ctrl->redirect($this,
'infoScreen');
386 require_once
'Modules/Test/classes/class.ilMarkSchemaGUI.php';
388 $this->ctrl->forwardCommand($mark_schema_gui);
391 case 'iltestscoringbyquestionsgui':
394 include_once
'Modules/Test/classes/class.ilTestScoringByQuestionsGUI.php';
397 $this->ctrl->forwardCommand($output_gui);
400 case 'ilobjtestsettingsgeneralgui':
403 require_once
'Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php';
415 $this->ctrl->forwardCommand($gui);
418 case 'ilobjtestsettingsscoringresultsgui':
421 require_once
'Modules/Test/classes/class.ilObjTestSettingsScoringResultsGUI.php';
432 $this->ctrl->forwardCommand($gui);
435 case 'ilobjtestfixedquestionsetconfiggui':
438 require_once
'Modules/Test/classes/class.ilTestFixedQuestionSetConfigGUI.php';
440 $this->ctrl->forwardCommand($gui);
443 case 'iltestrandomquestionsetconfiggui':
446 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetConfigGUI.php';
448 $this->ctrl->forwardCommand($gui);
451 case 'ilobjtestdynamicquestionsetconfiggui':
454 require_once
'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfigGUI.php';
456 $this->ctrl->forwardCommand($gui);
459 case 'iltestquestionbrowsertablegui':
462 require_once
'Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php';
464 $gui->setWriteAccess($ilAccess->checkAccess(
"write",
"", $this->ref_id));
466 $this->ctrl->forwardCommand($gui);
469 case 'iltestskilladministrationgui':
472 require_once
'Modules/Test/classes/class.ilTestSkillAdministrationGUI.php';
473 $gui =
new ilTestSkillAdministrationGUI($ilias, $this->ctrl, $ilAccess, $ilTabs, $this->tpl, $this->lng,
$ilDB,
$tree, $ilPluginAdmin, $this->
object, $this->ref_id);
474 $this->ctrl->forwardCommand($gui);
477 case 'ilobjectcopygui':
480 require_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
483 $this->ctrl->forwardCommand($cp);
486 case 'ilpageeditorgui':
487 case 'iltestexpresspageobjectgui':
492 require_once
'Modules/TestQuestionPool/classes/class.ilAssIncompleteQuestionPurger.php';
494 $incompleteQuestionPurger->setOwnerId(
$ilUser->getId());
495 $incompleteQuestionPurger->purge();
504 if (!in_array($cmd, array(
'addQuestion',
'browseForQuestions'))) {
508 if (!$qid || in_array($cmd, array(
'insertQuestions',
'browseForQuestions'))) {
509 require_once
"./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php";
512 $ret = &$this->ctrl->forwardCommand($pageObject);
515 require_once
"./Services/Style/Content/classes/class.ilObjStyleSheet.php";
516 $this->tpl->setCurrentBlock(
"ContentStyle");
517 $this->tpl->setVariable(
518 "LOCATION_CONTENT_STYLESHEET",
521 $this->tpl->parseCurrentBlock();
524 $this->tpl->setCurrentBlock(
"SyntaxStyle");
525 $this->tpl->setVariable(
526 "LOCATION_SYNTAX_STYLESHEET",
529 $this->tpl->parseCurrentBlock();
530 require_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
534 $this->ctrl->setParameterByClass(
'iltestexpresspageobjectgui',
'q_id',
'');
535 $this->ctrl->redirectByClass(
'iltestexpresspageobjectgui', $this->ctrl->getCmd());
540 $q_gui->outAdditionalOutput();
541 $q_gui->object->setObjId($this->object->getId());
543 $q_gui->setTargetGuiClass(
null);
544 $q_gui->setQuestionActionCmd(
null);
546 $question = $q_gui->object;
547 $this->ctrl->saveParameter($this,
"q_id");
549 #$this->lng->loadLanguageModule("content");
550 $this->ctrl->setReturnByClass(
"ilTestExpressPageObjectGUI",
"view");
551 $this->ctrl->setReturn($this,
"questions");
553 require_once
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php";
554 require_once
"./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php";
558 $page_gui->setEditPreview(
true);
559 $page_gui->setEnabledTabs(
false);
560 if (strlen($this->ctrl->getCmd()) == 0) {
561 $this->ctrl->setCmdClass(get_class($page_gui));
562 $this->ctrl->setCmd(
"preview");
565 $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(
true)));
566 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
568 $page_gui->setOutputMode($this->object->evalTotalPersons() == 0 ?
"edit" :
'preview');
570 $page_gui->setHeader($question->getTitle());
571 $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this,
"downloadFile"));
572 $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this,
"fullscreen"));
573 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this));
574 $page_gui->setPresentationTitle($question->getTitle() .
' [' . $this->lng->txt(
'question_id_short') .
': ' . $question->getId() .
']');
575 $ret = &$this->ctrl->forwardCommand($page_gui);
578 $ilTabs =
$DIC[
'ilTabs'];
579 $ilTabs->activateTab(
'assQuestions');
581 $this->tpl->setContent(
$ret);
584 case 'ilassquestionpreviewgui':
588 $this->ctrl->saveParameter($this,
"q_id");
590 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewGUI.php';
594 $gui->initPreviewSettings($this->object->getRefId());
595 $gui->initPreviewSession(
$ilUser->getId(), (
int)
$_GET[
'q_id']);
596 $gui->initHintTracking();
597 $gui->initStyleSheets();
599 $this->ctrl->forwardCommand($gui);
603 case 'ilassquestionpagegui':
606 require_once
'Modules/Test/classes/class.ilAssQuestionPageCommandForwarder.php';
608 $forwarder->setTestObj($this->
object);
609 $forwarder->forward();
612 case 'ilassspecfeedbackpagegui':
613 require_once
"./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPageGUI.php";
615 $this->ctrl->forwardCommand($pg_gui);
618 case 'ilassgenfeedbackpagegui':
619 require_once
"./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPageGUI.php";
621 $this->ctrl->forwardCommand($pg_gui);
624 case 'illocalunitconfigurationgui':
628 $this->ctrl->setReturn($this,
"questions");
631 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
633 $questionGUI->object->setObjId($this->object->getId());
634 $questionGUI->setQuestionTabs();
636 require_once
'Modules/TestQuestionPool/classes/class.ilLocalUnitConfigurationGUI.php';
637 require_once
'Modules/TestQuestionPool/classes/class.ilUnitConfigurationRepository.php';
641 $this->ctrl->forwardCommand($gui);
644 case "ilcommonactiondispatchergui":
645 require_once
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
647 $this->ctrl->forwardCommand($gui);
650 case 'ilassquestionhintsgui':
655 $this->ctrl->setReturn($this,
"questions");
658 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
660 $questionGUI->object->setObjId($this->object->getId());
661 $questionGUI->setQuestionTabs();
664 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
667 $gui->setEditingEnabled(
668 $DIC->access()->checkAccess(
'write',
'', $this->object->getRefId())
675 case 'ilassquestionfeedbackeditinggui':
680 $this->ctrl->setReturn($this,
"questions");
683 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
685 $questionGUI->object->setObjId($this->object->getId());
686 $questionGUI->setQuestionTabs();
689 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
695 case 'iltestcorrectionsgui':
697 require_once
'./Modules/Test/classes/class.ilTestCorrectionsGUI.php';
699 $this->ctrl->forwardCommand($gui);
706 if ((strcmp($cmd,
"properties") == 0) && (
$_GET[
"browse"])) {
707 $this->questionBrowser();
710 if ((strcmp($cmd,
"properties") == 0) && (
$_GET[
"up"] ||
$_GET[
"down"])) {
715 $ret = &$this->$cmd();
719 if ($_REQUEST[
'prev_qid']) {
720 global $___prev_question_id;
721 $___prev_question_id = $_REQUEST[
'prev_qid'];
722 $this->ctrl->setParameterByClass(
'ilassquestionpagegui',
'prev_qid', $_REQUEST[
'prev_qid']);
723 $this->ctrl->setParameterByClass(
$_GET[
'sel_question_types'] .
'gui',
'prev_qid', $_REQUEST[
'prev_qid']);
725 $this->create_question_mode =
true;
728 $this->ctrl->setReturn($this,
"questions");
729 require_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
732 $q_gui->object->setObjId($this->object->getId());
733 if (!
$_GET[
'sel_question_types']) {
736 $qType =
$_GET[
'sel_question_types'];
738 $this->ctrl->setParameterByClass($qType .
"GUI",
'prev_qid', $_REQUEST[
'prev_qid']);
739 $this->ctrl->setParameterByClass($qType .
"GUI",
'test_ref_id', $_REQUEST[
'ref_id']);
740 $this->ctrl->setParameterByClass($qType .
"GUI",
'q_id', $_REQUEST[
'q_id']);
741 if ($_REQUEST[
'test_express_mode']) {
742 $this->ctrl->setParameterByClass($qType .
"GUI",
'test_express_mode', 1);
745 #global $___test_express_mode;
746 #$___test_express_mode = true;
747 if (!$q_gui->isSaveCommand()) {
748 $_GET[
'calling_test'] = $this->
object->getRefId();
751 $q_gui->setQuestionTabs();
752 #unset($___test_express_mode);
753 $ret = &$this->ctrl->forwardCommand($q_gui);
756 if (!in_array(strtolower(
$_GET[
"baseClass"]), array(
'iladministrationgui',
'ilrepositorygui')) &&
766 require_once
'Services/Tracking/classes/class.ilChangeEvent.php';
769 $this->object->getType(),
770 $this->object->getRefId(),
771 $this->object->getId(),
772 $DIC->user()->getId()
783 $DIC->ctrl()->redirectByClass(
'ilTestExportGUI');
791 $qid = $_REQUEST[
'q_id'];
793 if (!$qid || $qid ==
'Array') {
794 $questions = $this->
object->getQuestionTitlesAndIndexes();
795 if (!is_array($questions)) {
796 $questions = array();
799 $keys = array_keys($questions);
802 $_REQUEST[
'q_id'] = $qid;
803 $_GET[
'q_id'] = $qid;
807 if ($this->object->checkQuestionParent($qid)) {
811 throw new ilTestException(
'question id does not relate to parent object!');
816 switch ($this->object->getQuestionSetType()) {
818 $this->ctrl->redirectByClass(
'ilTestExpressPageObjectGUI',
'showPage');
822 $this->ctrl->redirectByClass(
'ilTestRandomQuestionSetConfigGUI');
826 $this->ctrl->redirectByClass(
'ilObjTestDynamicQuestionSetConfigGUI');
832 $this->ctrl->setCmdClass(
'ilTestEvaluationGUI');
833 $this->ctrl->setCmd(
'outUserResultsOverview');
834 $this->tabs_gui->clearTargets();
876 require_once
'Modules/Test/classes/class.ilTestEvaluationGUI.php';
881 $this->ctrl->forwardCommand($gui);
886 require_once
'Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php';
903 $this->tpl->getStandardTemplate();
915 if (
$ilUser->getId() != ANONYMOUS_USER_ID) {
916 require_once(
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
926 $this->ctrl->redirect($this,
"infoScreen");
931 $this->ctrl->redirectByClass(
"iltestevaluationgui",
"outEvaluation");
940 if (
$form->checkInput()) {
941 $this->ctrl->setParameter($this,
"new_type", $this->type);
946 $form->setValuesByPost();
947 $this->tpl->setContent(
$form->getHTML());
952 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
954 $defaults = $tst->getAvailableDefaults();
955 if (count($defaults)) {
956 foreach ($defaults as
$row) {
957 $a_options[
"tstdef_" .
$row[
"test_defaults_id"]] = array(
$row[
"name"],
958 $this->lng->txt(
"tst_default_settings"));
963 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
966 foreach ($templates as $item) {
967 $a_options[
"tsttpl_" . $item[
"id"]] = array($item[
"title"],
968 nl2br(trim($item[
"description"])));
981 $testDefaultsId = $tstdef;
983 $a_new_object->applyDefaults($testDefaults);
988 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
991 $template_settings =
$template->getSettings();
992 if ($template_settings) {
999 $a_new_object->saveToDb();
1002 ilUtil::sendSuccess($this->lng->txt(
"object_added"),
true);
1003 $this->ctrl->setParameter($this,
'ref_id', $a_new_object->
getRefId());
1004 $this->ctrl->redirectByClass(
'ilObjTestSettingsGeneralGUI');
1009 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1010 $path = $this->tree->getPathFull($this->object->getRefID());
1019 if ($_FILES[
"xmldoc"][
"error"] > UPLOAD_ERR_OK) {
1024 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
1029 $file = pathinfo($_FILES[
"xmldoc"][
"name"]);
1030 $full_path = $basedir .
"/" . $_FILES[
"xmldoc"][
"name"];
1031 ilUtil::moveUploadedFile($_FILES[
"xmldoc"][
"tmp_name"], $_FILES[
"xmldoc"][
"name"], $full_path);
1037 $subdir = basename($file[
"basename"],
"." . $file[
"extension"]);
1043 if (!is_file($qti_file)) {
1051 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
1053 $result = $qtiParser->startParsing();
1054 $founditems = &$qtiParser->getFoundItems();
1058 foreach ($founditems as $item) {
1059 if (strlen($item[
"type"])) {
1066 if (count($founditems) && $complete == 0) {
1075 $_SESSION[
"tst_import_results_file"] = $results_file;
1076 $_SESSION[
"tst_import_xml_file"] = $xml_file;
1077 $_SESSION[
"tst_import_qti_file"] = $qti_file;
1078 $_SESSION[
"tst_import_subdir"] = $subdir;
1086 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.tst_import_verification.html",
"Modules/Test");
1087 $row_class = array(
"tblrow1",
"tblrow2");
1089 foreach ($founditems as $item) {
1090 $this->tpl->setCurrentBlock(
"verification_row");
1091 $this->tpl->setVariable(
"ROW_CLASS", $row_class[$counter++ % 2]);
1092 $this->tpl->setVariable(
"QUESTION_TITLE", $item[
"title"]);
1093 $this->tpl->setVariable(
"QUESTION_IDENT", $item[
"ident"]);
1094 include_once
"./Services/QTI/classes/class.ilQTIItem.php";
1095 switch ($item[
"type"]) {
1098 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assMultipleChoice"));
1102 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assSingleChoice"));
1106 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assKprimChoice"));
1110 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assLongMenu"));
1114 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assNumeric"));
1118 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assFormulaQuestion"));
1122 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assTextSubset"));
1126 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assClozeTest"));
1130 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assErrorText"));
1134 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assImagemapQuestion"));
1138 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assJavaApplet"));
1142 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assFlashApplet"));
1146 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assMatchingQuestion"));
1150 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assOrderingQuestion"));
1154 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assOrderingHorizontal"));
1158 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assTextQuestion"));
1162 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assFileUpload"));
1165 $this->tpl->parseCurrentBlock();
1172 $this->tpl->setCurrentBlock(
"adm_content");
1173 $this->tpl->setVariable(
"TEXT_TYPE", $this->lng->txt(
"question_type"));
1174 $this->tpl->setVariable(
"TEXT_TITLE", $this->lng->txt(
"question_title"));
1175 $this->tpl->setVariable(
"FOUND_QUESTIONS_INTRODUCTION", $this->lng->txt(
"tst_import_verify_found_questions"));
1176 $this->tpl->setVariable(
"VERIFICATION_HEADING", $this->lng->txt(
"import_tst"));
1177 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1179 $this->tpl->setVariable(
"QUESTIONPOOL_ID", $QplOrTstID);
1180 $this->tpl->setVariable(
"VALUE_IMPORT", $this->lng->txt(
"import"));
1181 $this->tpl->setVariable(
"VALUE_CANCEL", $this->lng->txt(
"cancel"));
1182 $this->tpl->parseCurrentBlock();
1190 include_once
"./Modules/Test/classes/class.ilObjTest.php";
1194 $newObj->setType(
$_GET[
"new_type"]);
1196 $newObj->setTitle(
"dummy");
1198 $newObj->setDescription(
"test import");
1200 $newObj->create(
true);
1202 $newObj->createReference();
1204 $newObj->putInTree(
$_GET[
"ref_id"]);
1206 $newObj->setPermissions(
$_GET[
"ref_id"]);
1208 $newObj->mark_schema->flush();
1211 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
1215 if (!isset(
$_POST[
"qpl"]) ||
"-1" === (
string)
$_POST[
"qpl"]) {
1216 $questionParentObjId = $newObj->getId();
1218 $questionParentObjId =
$_POST[
"qpl"];
1221 if (is_file(
$_SESSION[
"tst_import_dir"] .
'/' .
$_SESSION[
"tst_import_subdir"] .
"/manifest.xml")) {
1222 $newObj->saveToDb();
1225 $_SESSION[
'tst_import_qst_parent'] = $questionParentObjId;
1227 $fileName =
$_SESSION[
'tst_import_subdir'] .
'.zip';
1228 $fullPath =
$_SESSION[
'tst_import_dir'] .
'/' . $fileName;
1230 include_once(
"./Services/Export/classes/class.ilImport.php");
1232 $map = $imp->getMapping();
1233 $map->addMapping(
'Modules/Test',
'tst',
'new_id', $newObj->getId());
1234 $imp->importObject($newObj, $fullPath, $fileName,
'tst',
'Modules/Test',
true);
1237 if (!isset(
$_POST[
"ident"]) || !is_array(
$_POST[
"ident"]) || !count(
$_POST[
"ident"])) {
1238 $qtiParser->setIgnoreItemsEnabled(
true);
1240 $qtiParser->setTestObject($newObj);
1241 $result = $qtiParser->startParsing();
1242 $newObj->saveToDb();
1245 include_once(
"./Modules/LearningModule/classes/class.ilContObjParser.php");
1247 $contParser->setQuestionMapping($qtiParser->getImportMapping());
1248 $contParser->startParsing();
1250 if (isset(
$_POST[
"ident"]) && is_array(
$_POST[
"ident"]) && count(
$_POST[
"ident"]) == $qtiParser->getNumImportedItems()) {
1252 if (@file_exists(
$_SESSION[
"tst_import_results_file"])) {
1253 include_once(
"./Modules/Test/classes/class.ilTestResultsImportParser.php");
1255 $results->setQuestionIdMapping($qtiParser->getQuestionIdMapping());
1266 ilUtil::sendSuccess($this->lng->txt(
"object_imported"),
true);
1267 ilUtil::redirect(
"ilias.php?ref_id=" . $newObj->getRefId() .
"&baseClass=ilObjTestGUI");
1286 $file = explode(
"_",
$_GET[
"file_id"]);
1287 include_once(
"./Modules/File/classes/class.ilObjFile.php");
1288 $fileObj =
new ilObjFile($file[count($file) - 1],
false);
1289 $fileObj->sendFile();
1298 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
1300 $page_gui->showMediaFullscreen();
1308 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php");
1310 $pg_obj->send_paragraph(
$_GET[
"par_id"],
$_GET[
"downloadtitle"]);
1323 $this->questionBrowser();
1335 $this->questionBrowser();
1347 $this->ctrl->redirect($this,
"questions");
1362 $parent_ref =
$tree->getParentId($this->object->getRefId());
1363 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
1365 $qpl->setType(
"qpl");
1366 $qpl->setTitle(
$name);
1369 $qpl->createReference();
1370 $qpl->putInTree($parent_ref);
1371 $qpl->setPermissions($parent_ref);
1374 return $qpl->getRefId();
1386 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_random_select.html",
"Modules/Test");
1387 $questionpools = &$this->
object->getAvailableQuestionpools(
false,
false,
false,
true);
1388 $this->tpl->setCurrentBlock(
"option");
1389 $this->tpl->setVariable(
"VALUE_OPTION",
"0");
1390 $this->tpl->setVariable(
"TEXT_OPTION", $this->lng->txt(
"all_available_question_pools"));
1391 $this->tpl->parseCurrentBlock();
1392 foreach ($questionpools as
$key => $value) {
1393 $this->tpl->setCurrentBlock(
"option");
1394 $this->tpl->setVariable(
"VALUE_OPTION",
$key);
1395 $this->tpl->setVariable(
"TEXT_OPTION", $value[
"title"]);
1396 $this->tpl->parseCurrentBlock();
1398 $this->tpl->setCurrentBlock(
"hidden");
1399 $this->tpl->setVariable(
"HIDDEN_NAME",
"sel_question_types");
1400 $this->tpl->setVariable(
"HIDDEN_VALUE",
$_POST[
"sel_question_types"]);
1401 $this->tpl->parseCurrentBlock();
1402 $this->tpl->setCurrentBlock(
"adm_content");
1403 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
1404 $this->tpl->setVariable(
"TXT_QPL_SELECT", $this->lng->txt(
"tst_random_select_questionpool"));
1405 $this->tpl->setVariable(
"TXT_NR_OF_QUESTIONS", $this->lng->txt(
"tst_random_nr_of_questions"));
1406 $this->tpl->setVariable(
"BTN_SUBMIT", $this->lng->txt(
"submit"));
1407 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
1408 $this->tpl->parseCurrentBlock();
1420 $this->ctrl->redirect($this,
"questions");
1434 $question_array = $this->
object->randomSelectQuestions(
$_POST[
"nr_of_questions"],
$_POST[
"sel_qpl"]);
1435 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_random_question_offer.html",
"Modules/Test");
1436 $color_class = array(
"tblrow1",
"tblrow2");
1438 $questionpools = &$this->
object->getAvailableQuestionpools(
true);
1439 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1440 foreach ($question_array as $question_id) {
1441 $dataset = $this->
object->getQuestionDataset($question_id);
1442 $this->tpl->setCurrentBlock(
"QTab");
1443 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
1444 $this->tpl->setVariable(
"QUESTION_TITLE", $dataset->title);
1445 $this->tpl->setVariable(
"QUESTION_COMMENT", $dataset->description);
1447 $this->tpl->setVariable(
"QUESTION_AUTHOR", $dataset->author);
1448 $this->tpl->setVariable(
"QUESTION_POOL", $questionpools[$dataset->obj_fi][
"title"]);
1449 $this->tpl->parseCurrentBlock();
1452 if (count($question_array) == 0) {
1453 $this->tpl->setCurrentBlock(
"Emptytable");
1454 $this->tpl->setVariable(
"TEXT_NO_QUESTIONS_AVAILABLE", $this->lng->txt(
"no_questions_available"));
1455 $this->tpl->parseCurrentBlock();
1457 $this->tpl->setCurrentBlock(
"Selectionbuttons");
1458 $this->tpl->setVariable(
"BTN_YES", $this->lng->txt(
"random_accept_sample"));
1459 $this->tpl->setVariable(
"BTN_NO", $this->lng->txt(
"random_another_sample"));
1460 $this->tpl->parseCurrentBlock();
1462 $chosen_questions = join($question_array,
",");
1463 $this->tpl->setCurrentBlock(
"adm_content");
1464 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
1465 $this->tpl->setVariable(
"QUESTION_TITLE", $this->lng->txt(
"tst_question_title"));
1466 $this->tpl->setVariable(
"QUESTION_COMMENT", $this->lng->txt(
"description"));
1467 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"tst_question_type"));
1468 $this->tpl->setVariable(
"QUESTION_AUTHOR", $this->lng->txt(
"author"));
1469 $this->tpl->setVariable(
"QUESTION_POOL", $this->lng->txt(
"qpl"));
1470 $this->tpl->setVariable(
"VALUE_CHOSEN_QUESTIONS", $chosen_questions);
1471 $this->tpl->setVariable(
"VALUE_QUESTIONPOOL_SELECTION",
$_POST[
"sel_qpl"]);
1472 $this->tpl->setVariable(
"VALUE_NR_OF_QUESTIONS",
$_POST[
"nr_of_questions"]);
1473 $this->tpl->setVariable(
"TEXT_QUESTION_OFFER", $this->lng->txt(
"tst_question_offer"));
1474 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
1475 $this->tpl->parseCurrentBlock();
1487 $selected_array = explode(
",",
$_POST[
"chosen_questions"]);
1488 if (!count($selected_array)) {
1491 $total = $this->
object->evalTotalPersons();
1498 foreach ($selected_array as
$key => $value) {
1499 $this->
object->insertQuestion($this->testQuestionSetConfigFactory->getQuestionSetConfig(), $value);
1501 $this->
object->saveCompleteStatus($this->testQuestionSetConfigFactory->getQuestionSetConfig());
1502 ilUtil::sendSuccess($this->lng->txt(
"tst_questions_inserted"),
true);
1503 $this->ctrl->redirect($this,
"questions");
1510 $this->questionBrowser();
1522 $qpl_ref_id = $_REQUEST[
"sel_qpl"];
1524 $qpl_mode = $_REQUEST[
'usage'];
1526 if (isset($_REQUEST[
'qtype'])) {
1527 include_once
'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
1529 } elseif (isset($_REQUEST[
'sel_question_types'])) {
1530 $sel_question_types = $_REQUEST[
"sel_question_types"];
1533 if (!$qpl_mode || ($qpl_mode == 2 && strcmp($_REQUEST[
"txt_qpl"],
"") == 0) || ($qpl_mode == 3 && strcmp($qpl_ref_id,
"") == 0)) {
1536 $_REQUEST[
'sel_question_types'] = $sel_question_types;
1541 $_SESSION[
"test_id"] = $this->
object->getRefId();
1542 if ($qpl_mode == 2 && strcmp($_REQUEST[
"txt_qpl"],
"") != 0) {
1545 } elseif ($qpl_mode == 1) {
1546 $qpl_ref_id =
$_GET[
"ref_id"];
1549 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPoolGUI.php";
1550 $baselink =
"ilias.php?baseClass=ilObjQuestionPoolGUI&ref_id=" . $qpl_ref_id .
"&cmd=createQuestionForTest&test_ref_id=" .
$_GET[
"ref_id"] .
"&calling_test=" .
$_GET[
"ref_id"] .
"&sel_question_types=" . $sel_question_types;
1552 if (isset($_REQUEST[
'prev_qid'])) {
1553 $baselink .=
'&prev_qid=' . $_REQUEST[
'prev_qid'];
1554 } elseif (isset($_REQUEST[
'position'])) {
1555 $baselink .=
'&prev_qid=' . $_REQUEST[
'position'];
1558 if ($_REQUEST[
'test_express_mode']) {
1559 $baselink .=
'&test_express_mode=1';
1562 if (isset($_REQUEST[
'add_quest_cont_edit_mode'])) {
1565 "add_quest_cont_edit_mode={$_REQUEST['add_quest_cont_edit_mode']}",
1570 #var_dump($_REQUEST['prev_qid']);
1586 $this->ctrl->redirect($this,
"questions");
1603 $questionpools = &$this->
object->getAvailableQuestionpools(
false,
false,
false,
true,
false,
"write");
1605 if ($this->object->getPoolUsage()) {
1611 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1614 $form->setFormAction(
$ilCtrl->getFormAction($this,
"executeCreateQuestion"));
1615 $form->setTitle(
$lng->txt(
"ass_create_question"));
1616 include_once
'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
1620 $hidden->setValue($_REQUEST[
"sel_question_types"]);
1621 $form->addItem($hidden);
1628 $lng->txt(
'tst_add_quest_cont_edit_mode_default'),
1633 $lng->txt(
'tst_add_quest_cont_edit_mode_page_object'),
1639 $form->addItem($ri,
true);
1643 $form->addItem($hi,
true);
1648 $usage->setRequired(
true);
1649 $no_pool =
new ilRadioOption($this->lng->txt(
"assessment_no_pool"), 1);
1650 $usage->addOption($no_pool);
1651 $existing_pool =
new ilRadioOption($this->lng->txt(
"assessment_existing_pool"), 3);
1652 $usage->addOption($existing_pool);
1653 $new_pool =
new ilRadioOption($this->lng->txt(
"assessment_new_pool"), 2);
1654 $usage->addOption($new_pool);
1655 $form->addItem($usage);
1657 $usage->setValue(1);
1660 $pools_data = array();
1661 foreach ($questionpools as
$key => $p) {
1662 $pools_data[
$key] = $p[
'title'];
1664 $pools =
new ilSelectInputGUI($this->lng->txt(
"select_questionpool"),
"sel_qpl");
1665 $pools->setOptions($pools_data);
1666 $existing_pool->addSubItem($pools);
1669 $this->lng->loadLanguageModule(
'rbac');
1672 $name->setMaxLength(50);
1673 $new_pool->addSubItem(
$name);
1675 $form->addCommandButton(
"executeCreateQuestion",
$lng->txt(
"submit"));
1676 $form->addCommandButton(
"cancelCreateQuestion",
$lng->txt(
"cancel"));
1678 return $this->tpl->setVariable(
'ADM_CONTENT',
$form->getHTML());
1683 $ilCtrl->setParameterByClass(
'iltestexpresspageobjectgui',
'sel_question_types', $_REQUEST[
"sel_question_types"]);
1684 $ilCtrl->setParameterByClass(
'iltestexpresspageobjectgui',
'add_quest_cont_edit_mode', $_REQUEST[
"add_quest_cont_edit_mode"]);
1685 $link =
$ilCtrl->getLinkTargetByClass(
'iltestexpresspageobjectgui',
'handleToolbarCommand',
'',
false,
false);
1695 $removeQuestionIds = (array)
$_POST[
"q_id"];
1697 $questions = $this->
object->getQuestionTitlesAndIndexes();
1699 $this->
object->removeQuestions($removeQuestionIds);
1701 $this->
object->saveCompleteStatus($this->testQuestionSetConfigFactory->getQuestionSetConfig());
1703 ilUtil::sendSuccess($this->lng->txt(
"tst_questions_removed"));
1705 if ($_REQUEST[
'test_express_mode']) {
1708 $deleted_tmp = $removeQuestionIds;
1709 $first = array_shift($deleted_tmp);
1710 foreach ((array) $questions as
$key => $value) {
1711 if (!in_array(
$key, $removeQuestionIds)) {
1719 } elseif (
$key == $first) {
1724 $first = array_shift($deleted_tmp);
1729 count($questions) == count($removeQuestionIds) ||
1732 $this->ctrl->setParameter($this,
'q_id',
'');
1733 $this->ctrl->redirect($this,
'showPage');
1736 $this->ctrl->setParameter($this,
'q_id', $return_to);
1737 $this->ctrl->redirect($this,
"showPage");
1739 $this->ctrl->setParameter($this,
'q_id',
'');
1740 $this->ctrl->redirect($this,
'questions');
1753 if ($_REQUEST[
'test_express_mode']) {
1754 $this->ctrl->setParameter($this,
'q_id', $_REQUEST[
'q_id']);
1755 $this->ctrl->redirect($this,
"showPage");
1757 $this->ctrl->redirect($this,
"questions");
1770 $total = $this->
object->evalTotalPersons();
1773 $question = sprintf($this->lng->txt(
"tst_remove_questions_and_results"),
$total);
1775 if (count($checked_questions) == 1) {
1776 $question = $this->lng->txt(
"tst_remove_question");
1778 $question = $this->lng->txt(
"tst_remove_questions");
1782 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1784 $cgui->setHeaderText($question);
1786 $this->ctrl->saveParameter($this,
'test_express_mode');
1787 $this->ctrl->saveParameter($this,
'q_id');
1789 $cgui->setFormAction($this->ctrl->getFormAction($this));
1790 $cgui->setCancel($this->lng->txt(
"cancel"),
"cancelRemoveQuestions");
1791 $cgui->setConfirm($this->lng->txt(
"confirm"),
"confirmRemoveQuestions");
1793 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1794 $removablequestions = &$this->
object->getTestQuestions();
1795 if (count($removablequestions)) {
1796 foreach ($removablequestions as
$data) {
1797 if (in_array(
$data[
"question_id"], $checked_questions)) {
1799 $txt .=
' [' . $this->lng->txt(
'question_id_short') .
': ' .
$data[
'question_id'] .
']';
1801 if (
$data[
"description"]) {
1802 $txt .=
"<div class=\"small\">" .
$data[
"description"] .
"</div>";
1805 $cgui->addItem(
"q_id[]",
$data[
"question_id"],
$txt);
1810 $this->tpl->setContent($cgui->getHTML());
1820 $checked_questions = $_REQUEST[
"q_id"];
1822 if (!is_array($checked_questions) && $checked_questions) {
1823 $checked_questions = array($checked_questions);
1826 if (!is_array($checked_questions)) {
1827 $checked_questions = [];
1830 if (count($checked_questions) > 0) {
1832 } elseif (0 === count($checked_questions)) {
1834 $this->ctrl->redirect($this,
"questions");
1843 $selected_questions =
null;
1844 $selected_questions =
$_POST[
'q_id'];
1845 if (is_array($selected_questions)) {
1846 $_SESSION[
'tst_qst_move_' . $this->
object->getTestId()] =
$_POST[
'q_id'];
1847 ilUtil::sendSuccess($this->lng->txt(
"msg_selected_for_move"),
true);
1851 $this->ctrl->redirect($this,
'questions');
1860 $move_questions =
$_SESSION[
'tst_qst_move_' . $this->
object->getTestId()];
1862 if (!is_array(
$_POST[
'q_id']) || 0 === count(
$_POST[
'q_id'])) {
1864 $this->ctrl->redirect($this,
'questions');
1866 if (count(
$_POST[
'q_id']) > 1) {
1868 $this->ctrl->redirect($this,
'questions');
1871 $this->
object->moveQuestions(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()],
$_POST[
'q_id'][0], $insert_mode);
1872 ilUtil::sendSuccess($this->lng->txt(
"msg_questions_moved"),
true);
1873 unset(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()]);
1874 $this->ctrl->redirect($this,
"questions");
1883 $move_questions =
$_SESSION[
'tst_qst_move_' . $this->
object->getTestId()];
1884 if (!is_array(
$_POST[
'q_id']) || 0 === count(
$_POST[
'q_id'])) {
1886 $this->ctrl->redirect($this,
'questions');
1888 if (count(
$_POST[
'q_id']) > 1) {
1890 $this->ctrl->redirect($this,
'questions');
1893 $this->
object->moveQuestions(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()],
$_POST[
'q_id'][0], $insert_mode);
1894 ilUtil::sendSuccess($this->lng->txt(
"msg_questions_moved"),
true);
1895 unset(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()]);
1896 $this->ctrl->redirect($this,
"questions");
1906 $selected_array = (is_array(
$_POST[
'q_id'])) ?
$_POST[
'q_id'] : array();
1907 if (!count($selected_array)) {
1909 $this->ctrl->redirect($this,
"browseForQuestions");
1911 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1912 $manscoring =
false;
1913 foreach ($selected_array as
$key => $value) {
1914 $this->
object->insertQuestion($this->testQuestionSetConfigFactory->getQuestionSetConfig(), $value);
1919 $this->
object->saveCompleteStatus($this->testQuestionSetConfigFactory->getQuestionSetConfig());
1923 ilUtil::sendSuccess($this->lng->txt(
"tst_questions_inserted"),
true);
1925 $this->ctrl->redirect($this,
"questions");
1937 $ilHelp =
$DIC[
'ilHelp'];
1942 $subScreenId = array(
'createQuestion');
1944 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1946 $ilCtrl->setParameter($this,
'qtype', $_REQUEST[
'qtype']);
1950 $form->setFormAction(
$ilCtrl->getFormAction($this,
"executeCreateQuestion"));
1951 $form->setTitle(
$lng->txt(
"ass_create_question"));
1952 include_once
'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
1955 $questionTypes = $pool->getQuestionTypes(
false,
true,
false);
1959 foreach ($questionTypes as $label =>
$data) {
1963 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
1969 $questions = $this->
object->getQuestionTitlesAndIndexes();
1977 $si->setValue($_REQUEST[
'q_id']);
1983 $subScreenId[] =
'editMode';
1988 $lng->txt(
'tst_add_quest_cont_edit_mode_default'),
1993 $lng->txt(
'tst_add_quest_cont_edit_mode_page_object'),
1999 $form->addItem($ri,
true);
2003 $form->addItem($hi,
true);
2006 if ($this->object->getPoolUsage()) {
2007 $subScreenId[] =
'poolSelect';
2011 $usage->setRequired(
true);
2012 $no_pool =
new ilRadioOption($this->lng->txt(
"assessment_no_pool"), 1);
2013 $usage->addOption($no_pool);
2014 $existing_pool =
new ilRadioOption($this->lng->txt(
"assessment_existing_pool"), 3);
2015 $usage->addOption($existing_pool);
2016 $new_pool =
new ilRadioOption($this->lng->txt(
"assessment_new_pool"), 2);
2017 $usage->addOption($new_pool);
2018 $form->addItem($usage);
2020 $usage->setValue(1);
2023 $pools_data = array();
2024 foreach ($questionpools as
$key => $p) {
2025 $pools_data[
$key] = $p[
'title'];
2027 $pools =
new ilSelectInputGUI($this->lng->txt(
"select_questionpool"),
"sel_qpl");
2028 $pools->setOptions($pools_data);
2029 $existing_pool->addSubItem($pools);
2033 $name->setMaxLength(50);
2034 $new_pool->addSubItem(
$name);
2037 $form->addCommandButton(
"executeCreateQuestion",
$lng->txt(
"create"));
2038 $form->addCommandButton(
"questions",
$lng->txt(
"cancel"));
2040 $DIC->tabs()->activateTab(
'assQuestions');
2041 $ilHelp->setScreenId(
'assQuestions');
2042 $ilHelp->setSubScreenId(implode(
'_', $subScreenId));
2044 return $tpl->setContent(
$form->getHTML());
2050 $ilAccess =
$DIC[
'ilAccess'];
2051 $ilTabs =
$DIC[
'ilTabs'];
2054 $this->ctrl->setParameter($this,
'test_express_mode',
'');
2056 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)) {
2059 $this->ctrl->redirect($this,
"infoScreen");
2062 if (
$_GET[
'browse']) {
2063 return $this->questionbrowser();
2070 $this->ctrl->setParameter($this,
'q_id',
'');
2073 ilUtil::redirect(
"ilias.php?baseClass=ilObjQuestionPoolGUI&ref_id=" .
$_GET[
"eqpl"] .
"&cmd=editQuestionForTest&calling_test=" .
$_GET[
"ref_id"] .
"&q_id=" .
$_GET[
"eqid"]);
2076 if (
$_GET[
"up"] > 0) {
2077 $this->
object->questionMoveUp(
$_GET[
"up"]);
2079 if (
$_GET[
"down"] > 0) {
2080 $this->
object->questionMoveDown(
$_GET[
"down"]);
2084 $selected_array = array();
2085 array_push($selected_array,
$_GET[
"add"]);
2086 $total = $this->
object->evalTotalPersons();
2093 $this->insertQuestions($selected_array);
2097 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_questions.html",
"Modules/Test");
2099 $total = $this->
object->evalTotalPersons();
2100 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id)) {
2102 $link =
$DIC->ui()->factory()->link()->standard(
2103 $DIC->language()->txt(
"test_has_datasets_warning_page_view_link"),
2104 $DIC->ctrl()->getLinkTargetByClass(array(
'ilTestResultsGUI',
'ilParticipantsTestResultsGUI'))
2107 $message =
$DIC->language()->txt(
"test_has_datasets_warning_page_view");
2109 $msgBox =
$DIC->ui()->factory()->messageBox()->info(
$message)->withLinks(array($link));
2111 $DIC->ui()->mainTemplate()->setCurrentBlock(
'mess');
2112 $DIC->ui()->mainTemplate()->setVariable(
2114 $DIC->ui()->renderer()->render($msgBox)
2116 $DIC->ui()->mainTemplate()->parseCurrentBlock();
2119 $ilToolbar =
$DIC[
'ilToolbar'];
2121 $ilToolbar->addButton($this->lng->txt(
"ass_create_question"), $this->ctrl->getLinkTarget($this,
"addQuestion"));
2123 if ($this->object->getPoolUsage()) {
2124 $ilToolbar->addSeparator();
2126 require_once
'Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php';
2131 $ilToolbar->addSeparator();
2132 $ilToolbar->addButton($this->lng->txt(
"random_selection"), $this->ctrl->getLinkTarget($this,
"randomselect"));
2136 $ilAccess =
$DIC[
'ilAccess'];
2140 $online_access =
false;
2141 if ($this->object->getFixedParticipants()) {
2142 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
2144 if ($online_access_result ===
true) {
2145 $online_access =
true;
2149 if (!$this->object->getOfflineStatus() && $this->object->isComplete($this->testQuestionSetConfigFactory->getQuestionSetConfig())) {
2150 if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess(
"read",
"", $this->ref_id)) {
2151 $testSession = $this->testSessionFactory->getSession();
2152 $testSequence = $this->testSequenceFactory->getSequenceByTestSession($testSession);
2154 $testPlayerGUI = $this->testPlayerFactory->getPlayerGUI();
2156 $executable = $this->
object->isExecutable($testSession,
$ilUser->getId(), $allowPassIncrease =
true);
2158 if ($executable[
"executable"]) {
2159 if ($testSession->getActiveId() > 0) {
2162 if ($testSequence->hasStarted($testSession)) {
2163 $execTestLabel = $this->lng->txt(
"tst_resume_test");
2164 $execTestLink = $this->ctrl->getLinkTarget($testPlayerGUI,
'resumePlayer');
2166 $execTestLabel = $this->
object->getStartTestLabel($testSession->getActiveId());
2167 $execTestLink = $this->ctrl->getLinkTarget($testPlayerGUI,
'startPlayer');
2172 $execTestLabel = $this->
object->getStartTestLabel($testSession->getActiveId());
2173 $execTestLink = $this->ctrl->getLinkTarget($testPlayerGUI,
'startPlayer');
2176 $ilToolbar->addSeparator();
2177 $ilToolbar->addButton($execTestLabel, $execTestLink);
2187 $this->object->getRefId()
2190 $table_gui->setPositionInsertCommandsEnabled(
2191 is_array(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()])
2192 && count(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()])
2195 $table_gui->setQuestionTitleLinksEnabled(!
$total);
2196 $table_gui->setQuestionPositioningEnabled(!
$total);
2197 $table_gui->setQuestionManagingEnabled(!
$total);
2198 $table_gui->setObligatoryQuestionsHandlingEnabled($this->object->areObligationsEnabled());
2200 $table_gui->setTotalPoints($this->object->getFixedQuestionSetTotalPoints());
2201 $table_gui->setTotalWorkingTime($this->object->getFixedQuestionSetTotalWorkingTime());
2205 $table_gui->setData($this->object->getTestQuestions());
2207 $this->tpl->setCurrentBlock(
"adm_content");
2208 $this->tpl->setVariable(
"ACTION_QUESTION_FORM", $this->ctrl->getFormAction($this));
2209 $this->tpl->setVariable(
'QUESTIONBROWSER', $table_gui->getHTML());
2210 $this->tpl->parseCurrentBlock();
2219 require_once
'Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php';
2249 include_once
"./Modules/Test/classes/tables/class.ilTestHistoryTableGUI.php";
2251 $table_gui->setTestObject($this->
object);
2252 include_once
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
2254 $table_gui->setData(
$log);
2255 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
2260 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2262 $form->setTarget(
"_top");
2264 $this->ctrl->setParameter($this,
"new_type", $new_type);
2265 $form->setFormAction($this->ctrl->getFormAction($this));
2266 $form->setTitle($this->lng->txt(
"import_tst"));
2269 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
2270 $fi =
new ilFileInputGUI($this->lng->txt(
"import_file"),
"xmldoc");
2271 $fi->setSuffixes(array(
"zip"));
2272 $fi->setRequired(
true);
2273 $form->addItem($fi);
2276 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
2278 $questionpools = $tst->getAvailableQuestionpools(
true,
false,
true,
true);
2279 if (count($questionpools)) {
2280 $options = array(
"-1" => $this->lng->txt(
"dont_use_questionpool"));
2281 foreach ($questionpools as
$key => $value) {
2285 $pool =
new ilSelectInputGUI($this->lng->txt(
"select_questionpool"),
"qpl");
2286 $pool->setInfo($this->lng->txt(
'select_question_pool_info'));
2288 $form->addItem($pool);
2291 $form->addCommandButton(
"importFile", $this->lng->txt(
"import"));
2292 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
2304 $command =
$_POST[
"command"];
2305 if (strlen($command)) {
2306 $method = $command .
"Object";
2307 if (method_exists($this, $method)) {
2312 $this->ctrl->redirect($this,
"participants");
2325 $ilAccess =
$DIC[
'ilAccess'];
2326 $ilias =
$DIC[
'ilias'];
2327 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)) {
2330 $this->ctrl->redirect($this,
"infoScreen");
2333 $isPdfDeliveryRequest = isset(
$_GET[
'pdf']) &&
$_GET[
'pdf'];
2336 $template =
new ilTemplate(
"tpl.il_as_tst_print_test_confirm.html",
true,
true,
"Modules/Test");
2338 if (!$isPdfDeliveryRequest) {
2339 $this->ctrl->setParameter($this,
"pdf",
"1");
2340 $template->setCurrentBlock(
"pdf_export");
2341 $template->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this,
"print"));
2342 $this->ctrl->setParameter($this,
"pdf",
"");
2343 $template->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
2346 $template->setCurrentBlock(
"navigation_buttons");
2347 $template->setVariable(
"BUTTON_PRINT", $this->lng->txt(
"print"));
2359 $print_date = mktime(date(
"H"), date(
"i"), date(
"s"), date(
"m"), date(
"d"), date(
"Y"));
2363 require_once
'Modules/Test/classes/class.ilTestQuestionHeaderBlockBuilder.php';
2365 $questionHeaderBlockBuilder->setHeaderMode($this->object->getTitleOutput());
2367 if ($isPdfDeliveryRequest) {
2368 require_once
'Services/WebAccessChecker/classes/class.ilWACSignedPath.php';
2372 foreach ($this->object->questions as $question) {
2374 $question_gui = $this->
object->createQuestionGUI(
"", $question);
2376 if ($isPdfDeliveryRequest) {
2380 $questionHeaderBlockBuilder->setQuestionTitle($question_gui->object->getTitle());
2381 $questionHeaderBlockBuilder->setQuestionPoints($question_gui->object->getMaximumPoints());
2382 $questionHeaderBlockBuilder->setQuestionPosition($counter);
2383 $template->setVariable(
"QUESTION_HEADER", $questionHeaderBlockBuilder->getHTML());
2385 $template->setVariable(
"TXT_QUESTION_ID", $this->lng->txt(
'question_id_short'));
2386 $template->setVariable(
"QUESTION_ID", $question_gui->object->getId());
2387 $result_output = $question_gui->getSolutionOutput(
"",
null,
false,
true,
false, $this->object->getShowSolutionFeedback());
2388 $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
2389 $template->parseCurrentBlock(
"question");
2391 $max_points += $question_gui->object->getMaximumPoints();
2401 if ($isPdfDeliveryRequest) {
2402 require_once
'Modules/Test/classes/class.ilTestPDFGenerator.php';
2405 $this->tpl->setVariable(
"PRINT_CONTENT",
$template->get());
2419 $ilAccess =
$DIC[
'ilAccess'];
2421 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)) {
2424 $this->ctrl->redirect($this,
"infoScreen");
2427 $template =
new ilTemplate(
"tpl.il_as_tst_print_test_confirm.html",
true,
true,
"Modules/Test");
2431 $isPdfDeliveryRequest = isset(
$_GET[
'pdf']) &&
$_GET[
'pdf'];
2436 require_once
'Modules/Test/classes/class.ilTestQuestionHeaderBlockBuilder.php';
2438 $questionHeaderBlockBuilder->setHeaderMode($this->object->getTitleOutput());
2440 if ($isPdfDeliveryRequest) {
2441 require_once
'Services/WebAccessChecker/classes/class.ilWACSignedPath.php';
2448 foreach ($this->object->questions as $question) {
2450 $question_gui = $this->
object->createQuestionGUI(
"", $question);
2453 $questionHeaderBlockBuilder->setQuestionTitle($question_gui->object->getTitle());
2454 $questionHeaderBlockBuilder->setQuestionPoints($question_gui->object->getMaximumPoints());
2455 $questionHeaderBlockBuilder->setQuestionPosition($counter);
2456 $template->setVariable(
"QUESTION_HEADER", $questionHeaderBlockBuilder->getHTML());
2458 $template->setVariable(
"SOLUTION_OUTPUT", $question_gui->getPreview(
false));
2459 $template->parseCurrentBlock(
"question");
2461 $max_points += $question_gui->object->getMaximumPoints();
2477 if ($isPdfDeliveryRequest) {
2478 require_once
'Modules/Test/classes/class.ilTestPDFGenerator.php';
2481 $this->ctrl->setParameter($this,
"pdf",
"1");
2482 $template->setCurrentBlock(
"pdf_export");
2483 $template->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this,
"review"));
2484 $this->ctrl->setParameter($this,
"pdf",
"");
2485 $template->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
2488 $template->setCurrentBlock(
"navigation_buttons");
2489 $template->setVariable(
"BUTTON_PRINT", $this->lng->txt(
"print"));
2493 $this->tpl->setVariable(
"PRINT_CONTENT",
$template->get());
2500 public function defaultsObject()
2508 $ilAccess =
$DIC[
'ilAccess'];
2509 $ilToolbar =
$DIC[
'ilToolbar'];
2512 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)) {
2514 $this->ctrl->redirect($this,
"infoScreen");
2521 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
'addDefaults'));
2522 $ilToolbar->addFormButton($this->lng->txt(
'add'),
'addDefaults');
2523 require_once
'Services/Form/classes/class.ilTextInputGUI.php';
2524 $ilToolbar->addInputItem(
new ilTextInputGUI($this->lng->txt(
'tst_defaults_defaults_of_test'),
'name'),
true);
2526 require_once
'Modules/Test/classes/tables/class.ilTestPersonalDefaultSettingsTableGUI.php';
2528 $defaults = $this->
object->getAvailableDefaults();
2529 $table->setData((array) $defaults);
2538 if (isset(
$_POST[
'chb_defaults']) && is_array(
$_POST[
'chb_defaults']) && count(
$_POST[
'chb_defaults'])) {
2539 foreach (
$_POST[
'chb_defaults'] as $test_default_id) {
2540 $this->
object->deleteDefaults($test_default_id);
2545 $this->defaultsObject();
2562 if (!is_array(
$_POST[
"chb_defaults"]) || 1 !== count(
$_POST[
"chb_defaults"])) {
2564 $this->lng->txt(
"tst_defaults_apply_select_one")
2567 return $this->defaultsObject();
2571 if ($this->object->evalTotalPersons() > 0) {
2573 $this->lng->txt(
"tst_defaults_apply_not_possible")
2576 return $this->defaultsObject();
2579 $defaults = &$this->
object->getTestDefaults(
$_POST[
"chb_defaults"][0]);
2580 $defaultSettings = unserialize($defaults[
"defaults"]);
2582 if (isset($defaultSettings[
'isRandomTest'])) {
2583 if ($defaultSettings[
'isRandomTest']) {
2590 } elseif (isset($defaultSettings[
'questionSetType'])) {
2591 $newQuestionSetType = $defaultSettings[
'questionSetType'];
2593 $oldQuestionSetType = $this->
object->getQuestionSetType();
2594 $questionSetTypeSettingSwitched = ($oldQuestionSetType != $newQuestionSetType);
2596 $oldQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfigByType($oldQuestionSetType);
2599 case !$questionSetTypeSettingSwitched:
2600 case !$oldQuestionSetConfig->doesQuestionSetRelatedDataExist():
2607 require_once
'Modules/Test/classes/confirmations/class.ilTestSettingsChangeConfirmationGUI.php';
2610 $confirmation->setFormAction($this->ctrl->getFormAction($this));
2611 $confirmation->setCancel($this->lng->txt(
'cancel'),
'defaults');
2612 $confirmation->setConfirm($this->lng->txt(
'confirm'),
'confirmedApplyDefaults');
2614 $confirmation->setOldQuestionSetType($this->object->getQuestionSetType());
2615 $confirmation->setNewQuestionSetType($newQuestionSetType);
2616 $confirmation->setQuestionLossInfoEnabled(
false);
2617 $confirmation->build();
2619 $confirmation->populateParametersFromPost();
2621 $this->tpl->setContent($this->ctrl->getHTML($confirmation));
2626 if ($questionSetTypeSettingSwitched && !$this->object->getOfflineStatus()) {
2627 $this->
object->setOfflineStatus(
true);
2629 $info = $this->lng->txt(
"tst_set_offline_due_to_switched_question_set_type_setting");
2634 $this->
object->applyDefaults($defaults);
2636 ilUtil::sendSuccess($this->lng->txt(
"tst_defaults_applied"),
true);
2638 if ($questionSetTypeSettingSwitched && $oldQuestionSetConfig->doesQuestionSetRelatedDataExist()) {
2639 $oldQuestionSetConfig->removeQuestionSetRelatedData();
2642 $this->ctrl->redirect($this,
'defaults');
2650 if (strlen(
$_POST[
"name"]) > 0) {
2651 $this->
object->addDefaults(
$_POST[
'name']);
2655 $this->defaultsObject();
2660 if (in_array($this->ctrl->getCmdClass(), self::$infoScreenChildClasses)) {
2674 #if( !include 'competenzenRocker.php' ) exit;
2676 $this->ctrl->setCmd(
"showSummary");
2677 $this->ctrl->setCmdClass(
"ilinfoscreengui");
2678 $this->infoScreen();
2683 $this->ctrl->setCmd(
"showSummary");
2684 $this->ctrl->setCmdClass(
"ilinfoscreengui");
2685 $this->infoScreen(
$_GET[
'lock']);
2691 public function infoScreen($session_lock =
"")
2700 $ilAccess =
$DIC[
'ilAccess'];
2702 $ilToolbar =
$DIC[
'ilToolbar'];
2704 if (
$_GET[
'createRandomSolutions']) {
2708 $this->
object->createRandomSolutions(
$_GET[
'createRandomSolutions']);
2713 if (!$ilAccess->checkAccess(
"read",
"", $this->ref_id)) {
2714 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_read"), $this->ilias->error_obj->MESSAGE);
2721 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
2723 $info->setOpenFormTag(
false);
2726 return $this->ctrl->forwardCommand(
$info);
2729 require_once
'Modules/Test/classes/class.ilTestInfoScreenToolbarFactory.php';
2731 $toolbarFactory->setTestOBJ($this->
object);
2732 $toolbar = $toolbarFactory->getToolbarInstance();
2737 $toolbar->setSessionLockString($session_lock);
2741 if ($this->object->getShowInfo()) {
2742 $info->enablePrivateNotes();
2745 if (strlen($this->object->getIntroduction())) {
2746 $info->addSection($this->lng->txt(
"tst_introduction"));
2747 $info->addProperty(
"", $this->object->prepareTextareaOutput($this->object->getIntroduction(),
true) .
2748 $info->getHiddenToggleButton());
2750 $info->addSection(
"");
2751 $info->addProperty(
"",
$info->getHiddenToggleButton());
2754 $info->addSection($this->lng->txt(
"tst_general_properties"));
2755 if ($this->object->getShowInfo()) {
2756 $info->addProperty($this->lng->txt(
"author"), $this->object->getAuthor());
2757 $info->addProperty($this->lng->txt(
"title"), $this->object->getTitle());
2759 if (!$this->object->getOfflineStatus() && $this->object->isComplete($this->testQuestionSetConfigFactory->getQuestionSetConfig())) {
2761 if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess(
"read",
"", $this->ref_id)) {
2762 if ($this->object->getShowInfo() || !$this->object->getForceJS()) {
2764 $checked_javascript =
false;
2765 if ($this->object->getJavaScriptOutput()) {
2766 $checked_javascript =
true;
2770 if (!$this->object->isRandomTest() && !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
2771 if ($this->object->getNrOfTries() != 1) {
2772 if ($this->object->getUsePreviousAnswers() == 0) {
2773 if ($this->object->getShowInfo()) {
2774 $info->addProperty($this->lng->txt(
"tst_use_previous_answers"), $this->lng->txt(
"tst_dont_use_previous_answers"));
2777 $use_previous_answers =
false;
2778 if (
$ilUser->prefs[
"tst_use_previous_answers"]) {
2779 $checked_previous_answers =
true;
2781 $info->addPropertyCheckbox($this->lng->txt(
"tst_use_previous_answers"),
"chb_use_previous_answers", 1, $this->lng->txt(
"tst_use_previous_answers_user"), $checked_previous_answers);
2788 $info->hideFurtherSections(
false);
2790 if ($this->object->getShowInfo()) {
2791 $info->addSection($this->lng->txt(
"tst_sequence_properties"));
2792 $info->addProperty($this->lng->txt(
"tst_sequence"), $this->lng->txt(($this->object->getSequenceSettings() ==
TEST_FIXED_SEQUENCE)?
"tst_sequence_fixed":
"tst_sequence_postpone"));
2794 $info->addSection($this->lng->txt(
"tst_heading_scoring"));
2795 $info->addProperty($this->lng->txt(
"tst_text_count_system"), $this->lng->txt(($this->object->getCountSystem() ==
COUNT_PARTIAL_SOLUTIONS)?
"tst_count_partial_solutions":
"tst_count_correct_solutions"));
2796 $info->addProperty($this->lng->txt(
"tst_score_mcmr_questions"), $this->lng->txt(($this->object->getMCScoring() ==
SCORE_ZERO_POINTS_WHEN_UNANSWERED)?
"tst_score_mcmr_zero_points_when_unanswered":
"tst_score_mcmr_use_scoring_system"));
2797 if ($this->object->isRandomTest()) {
2798 $info->addProperty($this->lng->txt(
"tst_pass_scoring"), $this->lng->txt(($this->object->getPassScoring() ==
SCORE_BEST_PASS)?
"tst_pass_best_pass":
"tst_pass_last_pass"));
2801 $info->addSection($this->lng->txt(
"tst_score_reporting"));
2802 $score_reporting_text =
"";
2803 switch ($this->object->getScoreReporting()) {
2805 $score_reporting_text = $this->lng->txt(
"tst_report_after_test");
2808 $score_reporting_text = $this->lng->txt(
"tst_report_after_first_question");
2811 $score_reporting_text = $this->lng->txt(
"tst_report_after_date");
2814 $score_reporting_text = $this->lng->txt(
"tst_report_after_passed");
2817 $score_reporting_text = $this->lng->txt(
"tst_report_never");
2820 $info->addProperty($this->lng->txt(
"tst_score_reporting"), $score_reporting_text);
2821 $reporting_date = $this->
object->getReportingDate();
2822 if ($reporting_date) {
2823 #preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $reporting_date, $matches);
2824 #$txt_reporting_date = date($this->lng->text["lang_dateformat"] . " " . $this->lng->text["lang_timeformat"], mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]));
2825 #$info->addProperty($this->lng->txt("tst_score_reporting_date"), $txt_reporting_date);
2827 $this->lng->txt(
'tst_score_reporting_date'),
2832 $info->addSection($this->lng->txt(
"tst_session_settings"));
2833 $info->addProperty($this->lng->txt(
"tst_nr_of_tries"), ($this->object->getNrOfTries() == 0)?$this->lng->txt(
"unlimited"):$this->object->getNrOfTries());
2834 if ($this->object->getNrOfTries() != 1) {
2835 $info->addProperty($this->lng->txt(
"tst_nr_of_tries_of_user"), (
$toolbar->getTestSession()->getPass() ==
false)?$this->lng->txt(
"tst_no_tries"):
$toolbar->getTestSequence()->getPass());
2838 if ($this->object->getEnableProcessingTime()) {
2839 $info->addProperty($this->lng->txt(
"tst_processing_time"), $this->object->getProcessingTime());
2841 if (strlen($this->object->getAllowedUsers()) && ($this->object->getAllowedUsersTimeGap())) {
2842 $info->addProperty($this->lng->txt(
"tst_allowed_users"), $this->object->getAllowedUsers());
2845 $starting_time = $this->
object->getStartingTime();
2846 if ($this->object->isStartingTimeEnabled() && $starting_time != 0) {
2849 $ending_time = $this->
object->getEndingTime();
2850 if ($this->object->isEndingTimeEnabled() && $ending_time != 0) {
2853 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
2857 $this->ctrl->forwardCommand(
$info);
2862 require_once
'Modules/TestQuestionPool/classes/questions/class.ilAssQuestionSkillAssignmentImportFails.php';
2864 $qsaImportFails->deleteRegisteredImportFails();
2866 require_once
'Modules/Test/classes/class.ilTestSkillLevelThresholdImportFails.php';
2868 $sltImportFails->deleteRegisteredImportFails();
2870 $this->ctrl->redirect($this,
'infoScreen');
2876 $ilLocator =
$DIC[
'ilLocator'];
2877 switch ($this->ctrl->getCmd()) {
2880 case "redirectToInfoScreen":
2887 case "outCorrectSolution":
2889 case "showAnswersOfUser":
2890 case "outUserResultsOverview":
2891 case "backFromSummary":
2892 case "show_answers":
2895 case "outTestSummary":
2896 case "outQuestionSummary":
2897 case "gotoQuestion":
2898 case "selectImagemapRegion":
2899 case "confirmSubmitAnswers":
2900 case "finalSubmission":
2902 case "outUserPassDetails":
2903 case "checkPassword":
2904 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
2907 case "evalAllUsers":
2908 case "evalUserDetail":
2909 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"eval_stat"),
"",
$_GET[
"ref_id"]);
2916 case "importVerifiedFile":
2917 case "cancelImport":
2920 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"",
$_GET[
"ref_id"]);
2939 $output_gui = $guiFactory->create($this->
object);
2941 $output_gui->certificateEditor();
2952 $help =
$DIC[
'ilHelp'];
2953 $help->setScreenIdComponent(
"tst");
2956 require_once
'Services/Link/classes/class.ilLink.php';
2958 $this->
getTabsManager()->setParentBackLabel($this->lng->txt(
'back_to_objective_container'));
2970 $DIC->ctrl()->redirectByClass(
'ilObjTestGUI',
"infoScreen");
2984 $ilAccess =
$DIC[
'ilAccess'];
2988 if ($ilAccess->checkAccess(
"read",
"", $a_target)) {
2990 $_GET[
"baseClass"] =
"ilObjTestGUI";
2991 $_GET[
"cmd"] =
"infoScreen";
2992 $_GET[
"ref_id"] = $a_target;
2993 include_once(
"ilias.php");
2996 } elseif ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID)) {
2998 $lng->txt(
"msg_no_perm_read_item"),
3015 if ($this->create_question_mode) {
3020 $ilToolbar =
$DIC[
'ilToolbar'];
3024 require_once
'Services/UIComponent/Button/classes/class.ilLinkButton.php';
3026 $ilCtrl->saveParameter($this,
'q_mode');
3028 $ilCtrl->setParameterByClass(
'iltestexpresspageobjectgui',
'test_express_mode', 1);
3029 $ilCtrl->setParameter($this,
'test_express_mode', 1);
3030 $ilCtrl->setParameterByClass(
'iltestexpresspageobjectgui',
'q_id', $_REQUEST[
'q_id']);
3031 $ilCtrl->setParameter($this,
'q_id', $_REQUEST[
'q_id']);
3032 $ilToolbar->setFormAction(
$ilCtrl->getFormActionByClass(
'iltestexpresspageobjectgui',
'edit'));
3034 if ($this->object->evalTotalPersons() == 0) {
3055 $ilToolbar->addFormButton(
$lng->txt(
"ass_create_question"),
"addQuestion");
3057 $ilToolbar->addSeparator();
3059 if ($this->object->getPoolUsage()) {
3060 require_once
'Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php';
3064 $show_separator =
true;
3068 $questions = $this->
object->getQuestionTitlesAndIndexes();
3072 foreach ($questions as
$id => $label) {
3073 $options[
$id] = $label .
' [' . $this->lng->txt(
'question_id_short') .
': ' .
$id .
']';
3076 $optionKeys = array_keys(
$options);
3105 if (count($questions)) {
3106 if (isset($show_separator) && $show_separator) {
3107 $ilToolbar->addSeparator();
3111 $btn->setCaption(
"test_prev_question");
3112 $btn->setUrl(
$ilCtrl->getLinkTargetByClass(
'iltestexpresspageobjectgui',
'prevQuestion'));
3113 $ilToolbar->addButtonInstance($btn);
3115 if (count(
$options) <= 1 || $optionKeys[0] == $qid) {
3116 $btn->setDisabled(
true);
3120 $btn->setCaption(
"test_next_question");
3121 $btn->setUrl(
$ilCtrl->getLinkTargetByClass(
'iltestexpresspageobjectgui',
'nextQuestion'));
3122 $ilToolbar->addButtonInstance($btn);
3124 if (count(
$options) <= 1 || $optionKeys[count($optionKeys) - 1] == $qid) {
3125 $btn->setDisabled(
true);
3129 if (count($questions) > 1) {
3130 $ilToolbar->addSeparator();
3132 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
3134 $si->addCustomAttribute(
"onChange=\"forms['ilToolbar'].submit();\"");
3138 $si->setValue($qid);
3141 $ilToolbar->addInputItem(
$si,
true);
3144 $total = $this->
object->evalTotalPersons();
3159 if (count($questions) && !
$total) {
3160 $ilCtrl->setParameter($this,
'q_id', $_REQUEST[
'q_id']);
3161 $ilToolbar->addSeparator();
3162 $ilToolbar->addButton(
$lng->txt(
"test_delete_page"),
$ilCtrl->getLinkTarget($this,
"removeQuestions"));
3165 if (count($questions) > 1 && !
$total) {
3166 $ilToolbar->addSeparator();
3167 $ilToolbar->addButton(
$lng->txt(
"test_move_page"),
$ilCtrl->getLinkTarget($this,
"movePageForm"));
3171 $ilAccess =
$DIC[
'ilAccess'];
3174 $online_access =
false;
3175 if ($this->object->getFixedParticipants()) {
3176 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
3178 if ($online_access_result ===
true) {
3179 $online_access =
true;
3183 if (!$this->object->getOfflineStatus() && $this->object->isComplete($this->testQuestionSetConfigFactory->getQuestionSetConfig())) {
3184 if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess(
"read",
"", $this->ref_id)) {
3185 $testSession = $this->testSessionFactory->getSession();
3187 $executable = $this->
object->isExecutable($testSession,
$ilUser->getId(), $allowPassIncrease =
true);
3189 if ($executable[
"executable"]) {
3191 $player_instance = $player_factory->getPlayerGUI();
3193 if ($testSession->getActiveId() > 0) {
3194 $ilToolbar->addSeparator();
3195 $ilToolbar->addButton(
$lng->txt(
'tst_resume_test'),
$ilCtrl->getLinkTarget($player_instance,
'resumePlayer'));
3197 $ilToolbar->addSeparator();
3198 $ilToolbar->addButton(
$lng->txt(
'tst_start_test'),
$ilCtrl->getLinkTarget($player_instance,
'startTest'));
3208 $this->ctrl->redirect($this,
'questions');
3214 foreach ($questionIds as $q_id) {
3216 $newIds[$q_id] = $newId;
3228 require_once
'Modules/TestQuestionPool/classes/class.assQuestion.php';
3231 $newtitle = $question_gui->object->getTitle();
3232 if ($question_gui->object->questionTitleExists($targetParentId, $question_gui->object->getTitle())) {
3234 while ($question_gui->object->questionTitleExists($targetParentId, $question_gui->object->getTitle() .
" ($counter)")) {
3237 $newtitle = $question_gui->object->getTitle() .
" ($counter)";
3240 return $question_gui->object->createNewOriginalFromThisDuplicate($targetParentId, $newtitle);
3249 $ilObjDataCache =
$DIC[
'ilObjDataCache'];
3251 $qplId = $ilObjDataCache->lookupObjId($_REQUEST[
'sel_qpl']);
3254 foreach (
$result->ids as $oldId => $newId) {
3259 $oldOriginal->delete($oldOriginal->getId());
3262 $questionInstance->setNewOriginalId($newId);
3265 ilUtil::sendSuccess($this->lng->txt(
'tst_qst_added_to_pool_' . (count(
$result->ids) > 1 ?
'p' :
's')),
true);
3266 $this->ctrl->redirect($this,
'questions');
3273 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
3277 $title->setRequired(
true);
3283 $form->addCommandButton(
'createQuestionPoolAndCopy',
$lng->txt(
'create'));
3285 if (isset($_REQUEST[
'q_id']) && is_array($_REQUEST[
'q_id'])) {
3286 foreach ($_REQUEST[
'q_id'] as
$id) {
3288 $hidden->setValue(
$id);
3289 $form->addItem($hidden);
3306 require_once
'Modules/TestQuestionPool/classes/class.assQuestion.php';
3310 'copyAndLinkToQuestionpool' == $this->ctrl->getCmd() &&
3311 (!isset($_REQUEST[
'q_id']) || !is_array($_REQUEST[
'q_id']))
3314 $this->ctrl->redirect($this,
'questions');
3317 if (isset($_REQUEST[
'q_id']) && is_array($_REQUEST[
'q_id'])) {
3318 foreach ($_REQUEST[
'q_id'] as $q_id) {
3325 if (
$type !==
'tst') {
3327 $this->ctrl->redirect($this,
'questions');
3340 if ($_REQUEST[
'title']) {
3341 $title = $_REQUEST[
'title'];
3343 $title = $_REQUEST[
'txt_qpl'];
3352 $_REQUEST[
'sel_qpl'] =
$ref_id;
3374 $ilTabs =
$DIC[
'ilTabs'];
3378 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_qpl_select_copy.html",
"Modules/Test");
3379 $questionpools = &$this->
object->getAvailableQuestionpools(
false,
false,
false,
true,
false,
"write");
3380 if (count($questionpools) == 0) {
3381 $this->tpl->setCurrentBlock(
"option");
3382 $this->tpl->setVariable(
"VALUE_QPL",
"");
3383 $this->tpl->parseCurrentBlock();
3385 foreach ($questionpools as
$key => $value) {
3386 $this->tpl->setCurrentBlock(
"option");
3387 $this->tpl->setVariable(
"VALUE_OPTION",
$key);
3388 $this->tpl->setVariable(
"TEXT_OPTION", $value[
"title"]);
3389 $this->tpl->parseCurrentBlock();
3393 if (isset($_REQUEST[
'q_id']) && is_array($_REQUEST[
'q_id'])) {
3394 foreach ($_REQUEST[
'q_id'] as
$id) {
3395 $this->tpl->setCurrentBlock(
"hidden");
3396 $this->tpl->setVariable(
"HIDDEN_NAME",
"q_id[]");
3397 $this->tpl->setVariable(
"HIDDEN_VALUE",
$id);
3398 $this->tpl->parseCurrentBlock();
3399 $this->tpl->setCurrentBlock(
"adm_content");
3402 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
3404 if (count($questionpools) == 0) {
3405 $this->tpl->setVariable(
"TXT_QPL_SELECT", $this->lng->txt(
"tst_enter_questionpool"));
3406 $cmd =
'createQuestionPoolAndCopy';
3408 $this->tpl->setVariable(
"TXT_QPL_SELECT", $this->lng->txt(
"tst_select_questionpool"));
3411 $this->tpl->setVariable(
"CMD_SUBMIT", $cmd);
3412 $this->tpl->setVariable(
"BTN_SUBMIT", $this->lng->txt(
"submit"));
3413 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
3417 case 'copyAndLinkQuestionsToPool':
3419 $hidden->setValue(1);
3420 $createForm->addItem($hidden);
3422 case 'copyQuestionsToPool':
3425 $createForm->setFormAction($this->ctrl->getFormAction($this));
3427 $this->tpl->parseCurrentBlock();
3435 $simpleSetters = array(
3438 'use_pool' =>
'setPoolUsage',
3439 'question_set_type' =>
'setQuestionSetType',
3442 'intro_enabled' =>
'setIntroductionEnabled',
3443 'showinfo' =>
'setShowInfo',
3446 'chb_starting_time' =>
'setStartingTimeEnabled',
3447 'chb_ending_time' =>
'setEndingTimeEnabled',
3448 'password_enabled' =>
'setPasswordEnabled',
3449 'fixedparticipants' =>
'setFixedParticipants',
3450 'limitUsers' =>
'setLimitUsersEnabled',
3453 'nr_of_tries' =>
'setNrOfTries',
3454 'chb_processing_time' =>
'setEnableProcessingTime',
3455 'kiosk' =>
'setKiosk',
3456 'examid_in_test_pass' =>
'setShowExamIdInTestPassEnabled',
3459 'title_output' =>
'setTitleOutput',
3461 'chb_shuffle_questions' =>
'setShuffleQuestions',
3462 'offer_hints' =>
'setOfferingQuestionHintsEnabled',
3463 'instant_feedback_contents' =>
'setInstantFeedbackOptionsByArray',
3464 'instant_feedback_trigger' =>
'setForceInstantFeedbackEnabled',
3465 'answer_fixation_handling' =>
null,
3466 'obligations_enabled' =>
'setObligationsEnabled',
3469 'chb_use_previous_answers' =>
'setUsePreviousAnswers',
3470 'chb_show_cancel' =>
'setShowCancel',
3471 'chb_postpone' =>
'setPostponingEnabled',
3472 'list_of_questions' =>
'setListOfQuestionsSettings',
3473 'chb_show_marker' =>
'setShowMarker',
3476 'enable_examview' =>
'setEnableExamview',
3477 'showfinalstatement' =>
'setShowFinalStatement',
3478 'redirection_enabled' =>
null,
3479 'sign_submission' =>
'setSignSubmission',
3480 'mailnotification' =>
'setMailNotification',
3483 'count_system' =>
'setCountSystem',
3484 'mc_scoring' =>
'setMCScoring',
3485 'score_cutting' =>
'setScoreCutting',
3486 'pass_scoring' =>
'setPassScoring',
3487 'pass_deletion_allowed' =>
'setPassDeletionAllowed',
3490 'results_access_enabled' =>
'setScoreReporting',
3491 'grading_status' =>
'setShowGradingStatusEnabled',
3492 'grading_mark' =>
'setShowGradingMarkEnabled',
3495 'solution_details' =>
'setShowSolutionDetails',
3496 'solution_feedback' =>
'setShowSolutionFeedback',
3497 'solution_suggested' =>
'setShowSolutionSuggested',
3498 'solution_printview' =>
'setShowSolutionPrintview',
3499 'highscore_enabled' =>
'setHighscoreEnabled',
3500 'solution_signature' =>
'setShowSolutionSignature',
3501 'examid_in_test_res' =>
'setShowExamIdInTestResultsEnabled',
3502 'exp_sc_short' =>
'setExportSettingsSingleChoiceShort',
3505 'anonymity' =>
'setAnonymity',
3506 'enable_archiving' =>
'setEnableArchiving'
3509 if (!$templateData[
'results_presentation'][
'value']) {
3510 $templateData[
'results_presentation'][
'value'] = array();
3513 foreach ($simpleSetters as $field => $setter) {
3514 if ($templateData[$field] && strlen($setter)) {
3515 $object->$setter($templateData[$field][
'value']);
3521 if ($templateData[$field][
'value'] > 0) {
3523 $object->setAutosaveIval($templateData[$field][
'value'] * 1000);
3529 case 'redirection_enabled':
3538 if (strlen($templateData[$field][
'value'])) {
3540 $object->setRedirectionUrl($templateData[$field][
'value']);
3543 $object->setRedirectionUrl(
'');
3547 case 'answer_fixation_handling':
3548 switch ($templateData[$field][
'value']) {
3550 $object->setInstantFeedbackAnswerFixationEnabled(
false);
3551 $object->setFollowupQuestionAnswerFixationEnabled(
false);
3555 $object->setInstantFeedbackAnswerFixationEnabled(
true);
3556 $object->setFollowupQuestionAnswerFixationEnabled(
false);
3560 $object->setInstantFeedbackAnswerFixationEnabled(
false);
3561 $object->setFollowupQuestionAnswerFixationEnabled(
true);
3565 $object->setInstantFeedbackAnswerFixationEnabled(
true);
3566 $object->setFollowupQuestionAnswerFixationEnabled(
true);
3577 $ilAccess =
$DIC[
'ilAccess'];
3578 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)) {
3581 $this->ctrl->redirect($this,
"infoScreen");
3587 $orders = $obligations = array();
3589 foreach ((array) $_REQUEST[
'order'] as $qId => $order) {
3590 $id = (int) str_replace(
'q_',
'', $qId);
3592 $orders[
$id] = $order;
3595 if ($this->object->areObligationsEnabled() && isset($_REQUEST[
'obligatory']) && is_array($_REQUEST[
'obligatory'])) {
3596 foreach ($_REQUEST[
'obligatory'] as $qId => $obligation) {
3597 $id = (int) str_replace(
'q_',
'', $qId);
3600 $obligations[
$id] = $obligation;
3605 $this->
object->setQuestionOrderAndObligations(
3610 ilUtil::sendSuccess($this->lng->txt(
'saved_successfully'),
true);
3611 $ilCtrl->redirect($this,
'questions');
3624 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
3626 $form->setFormAction(
$ilCtrl->getFormAction($this,
"movePage"));
3627 $form->setTitle(
$lng->txt(
"test_move_page"));
3630 $old_pos->setValue($_REQUEST[
'q_id']);
3631 $form->addItem($old_pos);
3633 $questions = $this->
object->getQuestionTitlesAndIndexes();
3634 if (!is_array($questions)) {
3635 $questions = array();
3638 foreach ($questions as $k => $q) {
3639 if ($k == $_REQUEST[
'q_id']) {
3640 unset($questions[$k]);
3643 $questions[$k] =
$lng->txt(
'behind') .
' ' . $q;
3645 #$questions['0'] = $lng->txt('first');
3648 0 =>
$lng->txt(
'first')
3650 foreach ($questions as $k => $q) {
3651 $options[$k] = $q .
' [' . $this->lng->txt(
'question_id_short') .
': ' . $k .
']';
3656 $form->addItem($pos);
3658 $form->addCommandButton(
"movePage",
$lng->txt(
"submit"));
3659 $form->addCommandButton(
"showPage",
$lng->txt(
"cancel"));
3661 return $tpl->setContent(
$form->getHTML());
3667 $ilAccess =
$DIC[
'ilAccess'];
3668 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)) {
3671 $this->ctrl->redirect($this,
"infoScreen");
3674 $this->
object->moveQuestionAfter($_REQUEST[
'q_id'], $_REQUEST[
'position_after']);
3683 $ilCtrl->setParameterByClass(
'iltestexpresspageobjectgui',
'q_id', $_REQUEST[
'q_id']);
3684 $ilCtrl->redirectByClass(
'iltestexpresspageobjectgui',
'showPage');
3690 $ilAccess =
$DIC[
'ilAccess'];
3691 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)) {
3694 $this->ctrl->redirect($this,
"infoScreen");
3697 if ($_REQUEST[
'q_id'] && !is_array($_REQUEST[
'q_id'])) {
3698 $ids = array($_REQUEST[
'q_id']);
3699 } elseif ($_REQUEST[
'q_id']) {
3700 $ids = $_REQUEST[
'q_id'];
3703 $this->ctrl->redirect($this,
'questions');
3708 $questionTitles = $this->
object->getQuestionTitles();
3710 foreach ($ids as
$id) {
3711 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
3714 $title = $question->object->getTitle();
3716 while (in_array(
$title .
' (' .
$i .
')', $questionTitles)) {
3722 $questionTitles[] =
$title;
3724 $new_id = $question->object->duplicate(
false,
$title);
3727 $clone->object->setObjId($this->object->getId());
3728 $clone->object->saveToDb();
3730 $this->
object->insertQuestion($this->testQuestionSetConfigFactory->getQuestionSetConfig(), $new_id,
true);
3736 ilUtil::sendSuccess($this->lng->txt(
'copy_questions_success'),
true);
3738 $this->ctrl->redirect($this,
'questions');
3743 require_once
'Modules/Course/classes/Objectives/class.ilLOSettings.php';
3748 $this->objectiveOrientedContainer->setObjId($containerObjId);
3749 $this->objectiveOrientedContainer->setRefId($containerRefId);
An exception for terminatinating execution or to throw for unit testing.
const QT_MULTIPLE_CHOICE_MR
const QT_ORDERING_HORIZONTAL
const QT_MULTIPLE_CHOICE_SR
Basic GUI class for assessment questions.
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...
const RENDER_PURPOSE_PRINT_PDF
const EDIT_CONTEXT_AUTHORING
const RENDER_PURPOSE_PREVIEW
static _getOriginalId($question_id)
Returns the original id of a question.
static instantiateQuestionGUI($a_question_id)
Creates an instance of a question gui with a given question id.
static originalQuestionExists($questionId)
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.
static _needsManualScoring($question_id)
static & _instanciateQuestionGUI($question_id)
Creates an instance of a question gui with a given question id.
static lookupParentObjId($questionId)
@global ilDBInterface $ilDB
const ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT
constant for additional content editing mode "pageobject"
static getQuestionTypeFromDb($question_id)
get question type for question id
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
Generic feedback page GUI class.
Specific feedback page GUI class.
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Confirmation screen class.
static _isActive()
Static getter.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
static setUseRelativeDates($a_status)
set use relative dates
static useRelativeDates()
check if relative dates are used
@classDescription Date and time handling
static isObjectiveTest($a_trst_ref_id)
Check if test ref_id is used in an objective course.
GUI class for LTI provider object settings.
const LP_CONTEXT_REPOSITORY
Class ilObjUserTrackingGUI.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
Class ilLocalUnitConfigurationGUI.
static getSettingsTemplateConfig()
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not
static _getLog($ts_from, $ts_to, $test_id, $test_only=false)
Retrieve assessment log datasets from the database.
static getQuestionTypeByTypeId($type_id)
static _getAvailableQuestionpools($use_object_id=false, $equal_points=false, $could_be_offline=false, $showPath=false, $with_questioncount=false, $permission="read", $usr_id="")
Returns the available question pools for the active user.
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true)
get content style path
static _lookupOnlineTestAccess($a_test_id, $a_user_id)
Checks if a user is allowd to run an online exam.
importFileObject($parent_id=null, $a_catch_errors=true)
form for new test object import
trackTestObjectReadEvent()
createQuestionObject()
Called when a new question should be created from a test.
createQuestionpoolTargetObject($cmd)
Called when a new question should be created from a test Important: $cmd may be overwritten if no que...
browseForQuestionsObject()
download_paragraphObject()
download source code paragraph
setTestAccess($testAccess)
printobject()
Print tab to create a print of all questions with points and solutions.
addLocatorItems()
should be overwritten to add object specific items (repository items are preloaded)
userResultsGatewayObject()
backObject()
Called when the back button in the question browser was pressed.
removeQuestionsForm($checked_questions)
Displays a form to confirm the removal of questions from the test.
$objectiveOrientedContainer
insertQuestionsBeforeObject()
Insert checked questions before the actual selection.
cancelRemoveQuestionsObject()
Cancels the removal of questions from the test.
createQuestionPool($name="dummy", $description="")
Creates a new questionpool and returns the reference id.
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually,...
static $infoScreenChildClasses
copyAndLinkQuestionsToPoolObject()
@global ilObjectDataCache $ilObjDataCache
addDidacticTemplateOptions(array &$a_options)
Add custom templates.
createQuestionPoolAndCopyObject()
afterSave(ilObject $a_new_object)
save object @access public
movePageFormObject()
Move current page.
prepareSubGuiOutput()
prepares ilias to get output rendered by sub gui class
buildPageViewToolbar($qid=0)
Questions per page.
participantsActionObject()
Evaluates the actions on the participants page.
isCommandClassAnyInfoScreenChild()
executeCreateQuestionObject()
Called when a new question should be created from a test after confirmation.
executeCommand()
execute command
insertQuestionsObject()
Insert questions from the questionbrowser into the test.
fetchAuthoringQuestionIdParameter()
getObjectiveOrientedContainer()
determineObjectiveOrientedContainer()
static _goto($a_target)
Redirect script to call a test with the test reference id.
copyQuestionToPool($sourceQuestionId, $targetParentId)
$testQuestionSetConfigFactory
cancelRandomSelectObject()
Cancels the form for random selection of questions.
insertRandomSelectionObject()
Inserts a random selection into the test.
applyDefaultsObject($confirmed=false)
Applies the selected test defaults.
removeQuestionsObject()
Called when a selection of questions should be removed from the test.
createRandomSelectionObject()
Offers a random selection for insertion in the test.
downloadFileObject()
download file
copyQuestionsToPoolObject()
importVerifiedFileObject()
imports question(s) into the questionpool (after verification)
setTabsManager($tabsManager)
copyToQuestionpoolObject()
uploadObject($redirect=true)
display status information or report errors messages in case of error
moveQuestionsObject()
Marks selected questions for moving.
copyAndLinkToQuestionpoolObject()
getTabs()
adds tabs to tab gui object
questionsTabGatewayObject()
fullscreenObject()
show fullscreen view
redirectTo_ilObjTestSettingsGeneralGUI_showForm_Object()
confirmRemoveQuestionsObject()
Remove questions from the test after confirmation.
redirectToInfoScreenObject()
cancelCreateQuestionObject()
Called when the creation of a new question is cancelled.
populateQuestionBrowserToolbarButtons(ilToolbarGUI $toolbar, $context)
__construct($refId=null)
Constructor @access public.
reviewobject()
Review tab to create a print of all questions without points and solutions.
initImportForm($a_new_type)
Init object import form.
exportObject()
Gateway for exports initiated from workspace, as there is a generic forward to {objTypeMainGUI}::expo...
deleteDefaultsObject()
Deletes selected test defaults.
historyObject()
Creates the change history for a test.
uploadTstObject()
imports test and question(s)
insertQuestionsAfterObject()
Insert checked questions after the actual selection.
getQuestionpoolCreationForm()
copyQuestionsToPool($questionIds, $qplId)
applyTemplate($templateData, ilObjTest $object)
resetFilterObject()
Resets the filter for the question browser.
removeImportFailsObject()
saveOrderAndObligationsObject()
randomselectObject()
Creates a form for random selection of questions.
confirmedApplyDefaultsObject()
addDefaultsObject()
Adds the defaults of this test to the defaults.
filterObject()
Sets the filter for the question browser.
certificateObject()
Shows the certificate editor.
static accessViolationRedirect()
const ANSWER_FIXATION_ON_IFB_OR_FUQST
const ANSWER_FIXATION_ON_INSTANT_FEEDBACK
const ANSWER_FIXATION_NONE
const CMD_SHOW_FORM
command constants
const ANSWER_FIXATION_ON_FOLLOWUP_QUESTION
const QUESTION_SET_TYPE_DYNAMIC
type setting value for dynamic question set (continues testing mode)
static _getTestDefaults($test_defaults_id)
const QUESTION_SET_TYPE_RANDOM
type setting value for random question set
const SCORE_REPORTING_IMMIDIATLY
const QUESTION_SET_TYPE_FIXED
type setting value for fixed question set
const SCORE_REPORTING_FINISHED
const SCORE_REPORTING_AFTER_PASSED
static _setImportDirectory($a_import_dir=null)
set import directory
static _getImportDirectory()
Get the import directory location of the test.
static isQuestionObligationPossible($questionId)
checks wether the obligation for question with given id is possible or not
static _createImportDirectory()
creates data directory for import files (data_dir/tst_data/tst_<id>/import, depending on data directo...
const SCORE_REPORTING_DATE
GUI class for the workflow of copying objects.
Class ilObjectGUI Basic methods of all Output classes.
getDidacticTemplateVar($a_type)
Get didactic template setting from creation screen.
prepareOutput($a_show_subobjects=true)
prepare output
getReturnLocation($a_cmd, $a_location="")
get return location for command (command is method name without "Object", e.g.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
getCreationMode()
get creation mode
addHeaderAction()
Add header action menu.
createObject()
create new object form
setTitleAndDescription()
called by prepare output
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 _getAllReferences($a_id)
get all reference ids of object
static _lookupType($a_id, $a_reference=false)
lookup object type
static prepareGenerationRequest($service, $purpose)
Prepare the content processing for a PDF generation request This function should be called as in a re...
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This class represents an option in a radio group.
Settings template application class.
static getAllSettingsTemplates($a_type, $a_include_auto_generated=false)
Get all settings templates of type.
special template class to simplify handling of ITX/PEAR
Output class for assessment test evaluation.
Base Exception for all Exceptions relating to Modules/Test.
Export User Interface Class.
@ilCtrl_Calls ilTestExpressPageObjectGUI: assMultipleChoiceGUI, assClozeTestGUI, assMatchingQuestionG...
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
const PDF_OUTPUT_DOWNLOAD
Class ilTestPersonalDefaultSettingsTableGUI.
const CMD_BROWSE_QUESTIONS
Test results import parser.
ilTestScoringByQuestionsGUI
Service GUI class for tests.
const SUBTAB_ID_QST_LIST_VIEW
const SUBTAB_ID_QST_PAGE_VIEW
const TAB_ID_LEARNING_PROGRESS
This class represents a text area property in a property form.
This class represents a text property in a property form.
Class ilUnitConfigurationRepository.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
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)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
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 infoPanel($a_keep=true)
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
static setTokenMaxLifetimeInSeconds($token_max_lifetime_in_seconds)
if(!array_key_exists('StateId', $_REQUEST)) $id
const CLOZE_TEST_IDENTIFIER
Question identifier constants.
const REDIRECT_NONE
Redirect after finishing test constants.
const FLASHAPPLET_QUESTION_IDENTIFIER
const IMAGEMAP_QUESTION_IDENTIFIER
const SINGLE_CHOICE_QUESTION_IDENTIFIER
const FORMULA_QUESTION_IDENTIFIER
const ERROR_TEXT_IDENTIFIER
const SCORE_ZERO_POINTS_WHEN_UNANSWERED
const TEXTSUBSET_QUESTION_IDENTIFIER
const COUNT_PARTIAL_SOLUTIONS
const NUMERIC_QUESTION_IDENTIFIER
const JAVAAPPLET_QUESTION_IDENTIFIER
const TEST_FIXED_SEQUENCE
Test constants.
const FILE_UPLOAD_IDENTIFIER
const TEXT_QUESTION_IDENTIFIER
const PDF_PRINT_VIEW_QUESTIONS
const LONG_MENU_QUESTION_IDENTIFIER
const KPRIM_CHOICE_QUESTION_IDENTIFIER
const ORDERING_HORIZONTAL_IDENTIFIER
const MATCHING_QUESTION_IDENTIFIER
const MULTIPLE_CHOICE_QUESTION_IDENTIFIER
const ORDERING_QUESTION_IDENTIFIER
catch(Exception $e) $message
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
redirection script todo: (a better solution should control the processing via a xml file)
if(empty($password)) $table
if(isset($_POST['submit'])) $form