32 include_once
"./classes/class.ilObjectGUI.php";
33 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
34 include_once
"./Modules/Test/classes/class.ilObjAssessmentFolderGUI.php";
35 include_once
'Modules/Test/classes/class.ilTestExpressPage.php';
46 $lng->loadLanguageModule(
"assessment");
49 $this->ctrl->saveParameter($this,
"ref_id");
52 if((
int)
$_GET[
'crs_show_result'])
54 $this->ctrl->saveParameter($this,
'crs_show_result',(
int) $_GET[
'crs_show_result']);
63 global $ilAccess, $ilNavigationHistory,
$ilCtrl;
65 if ((!$ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"])) && (!$ilAccess->checkAccess(
"visible",
"",
$_GET[
"ref_id"])))
68 $ilias->raiseError($this->lng->txt(
"permission_denied"), $ilias->error_obj->MESSAGE);
71 $cmd = $this->ctrl->getCmd(
"properties");
73 $cmdsDisabledDueToOfflineStatus = array(
74 'resume',
'start',
'outUserResultsOverview',
'outUserListOfAnswerPasses'
77 if( !$this->
getCreationMode() && !$this->object->isOnline() && in_array(
$cmd, $cmdsDisabledDueToOfflineStatus) )
82 $next_class = $this->ctrl->getNextClass($this);
83 $this->ctrl->setReturn($this,
"properties");
85 if (method_exists($this->
object,
"getTestStyleLocation")) $this->tpl->addCss($this->object->getTestStyleLocation(
"output"),
"screen");
89 $ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
91 $ilNavigationHistory->addItem(
$_GET[
"ref_id"],
92 "ilias.php?baseClass=ilObjTestGUI&cmd=infoScreen&ref_id=".
$_GET[
"ref_id"],
"tst");
97 if(IS_PAYMENT_ENABLED)
99 include_once
'Services/Payment/classes/class.ilPaymentObject.php';
103 $this->tpl->getStandardTemplate();
105 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
107 $ret = $this->ctrl->forwardCommand($pp);
116 global $___prev_question_id;
117 $___prev_question_id =
$_REQUEST[
'prev_qid'];
118 $this->ctrl->setParameter($this,
'prev_qid',
$_REQUEST[
'prev_qid']);
123 case "ilinfoscreengui":
128 case 'ilmdeditorgui':
131 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
132 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
133 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
135 $this->ctrl->forwardCommand($md_gui);
137 case "iltestoutputgui":
138 include_once
"./Modules/Test/classes/class.ilTestOutputGUI.php";
141 $this->ctrl->forwardCommand($output_gui);
144 case "iltestevaluationgui":
147 include_once
"./Modules/Test/classes/class.ilTestEvaluationGUI.php";
149 $this->ctrl->forwardCommand($evaluation_gui);
152 case "iltestservicegui":
155 include_once
"./Modules/Test/classes/class.ilTestServiceGUI.php";
157 $this->ctrl->forwardCommand($serviceGUI);
160 case 'ilpermissiongui':
163 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
165 $ret =& $this->ctrl->forwardCommand($perm_gui);
168 case "illearningprogressgui":
171 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
173 $this->ctrl->forwardCommand($new_gui);
177 case "ilcertificategui":
180 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
181 include_once
"./Modules/Test/classes/class.ilTestCertificateAdapter.php";
183 $this->ctrl->forwardCommand($output_gui);
186 case "iltestscoringgui":
189 include_once
"./Modules/Test/classes/class.ilTestScoringGUI.php";
191 $this->ctrl->forwardCommand($output_gui);
194 case 'ilobjectcopygui':
197 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
200 $this->ctrl->forwardCommand($cp);
203 case 'ilrepositorysearchgui':
206 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
208 $rep_search->setCallback($this,
209 'addParticipantsObject',
215 $this->ctrl->setReturn($this,
'participants');
216 $ret =& $this->ctrl->forwardCommand($rep_search);
217 $this->tabs_gui->setTabActive(
'participants');
220 case 'ilpageeditorgui':
221 case 'iltestexpresspageobjectgui':
228 $questions = $this->
object->getQuestionTitlesAndIndexes();
229 if (!is_array($questions))
230 $questions = array();
232 $keys = array_keys($questions);
236 $_GET[
'q_id'] = $qid;
243 if (!in_array(
$cmd, array(
'addQuestion',
'browseForQuestions'))) {
247 if (!$qid || in_array(
$cmd, array(
'insertQuestions',
'browseForQuestions'))) {
248 include_once(
"./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php");
251 $ret =& $this->ctrl->forwardCommand($pageObject);
254 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
255 $this->tpl->setCurrentBlock(
"ContentStyle");
256 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
258 $this->tpl->parseCurrentBlock();
261 $this->tpl->setCurrentBlock(
"SyntaxStyle");
262 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
264 $this->tpl->parseCurrentBlock();
265 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
268 #$q_gui->setQuestionTabs();
269 $q_gui->outAdditionalOutput();
270 $q_gui->object->setObjId($this->object->getId());
271 $question =& $q_gui->object;
272 $this->ctrl->saveParameter($this,
"q_id");
274 #$this->lng->loadLanguageModule("content");
275 $this->ctrl->setReturnByClass(
"ilTestExpressPageObjectGUI",
"view");
276 $this->ctrl->setReturn($this,
"questions");
279 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
280 include_once(
"./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php");
284 $page_gui->setEditPreview(
true);
285 $page_gui->setEnabledTabs(
false);
286 $page_gui->setEnabledInternalLinks(
false);
287 if (strlen($this->ctrl->getCmd()) == 0)
289 $this->ctrl->setCmdClass(get_class($page_gui));
290 $this->ctrl->setCmd(
"preview");
293 $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
294 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
296 $page_gui->setOutputMode($this->object->evalTotalPersons() == 0 ?
"edit" :
'preview');
298 $page_gui->setHeader($question->getTitle());
299 $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this,
"downloadFile"));
300 $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this,
"fullscreen"));
301 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this));
302 $page_gui->setPresentationTitle($question->getTitle());
303 $ret =& $this->ctrl->forwardCommand($page_gui);
306 $ilTabs->activateTab(
'assQuestions');
308 $this->tpl->setContent(
$ret);
311 case 'ilpageobjectgui':
312 include_once (
"./Services/COPage/classes/class.ilPageObjectGUI.php");
315 $this->ctrl->setParameter($this,
'prev_qid',
$_REQUEST[
'prev_qid']);
321 $_GET[
'calling_test'] = $this->
object->getRefId();
322 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
323 $this->tpl->setCurrentBlock(
"ContentStyle");
324 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
326 $this->tpl->parseCurrentBlock();
329 $this->tpl->setCurrentBlock(
"SyntaxStyle");
330 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
332 $this->tpl->parseCurrentBlock();
333 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
335 $q_gui->setQuestionTabs();
336 $q_gui->outAdditionalOutput();
337 $q_gui->object->setObjId($this->object->getId());
338 $question =& $q_gui->object;
339 $this->ctrl->saveParameter($this,
"q_id");
340 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
341 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
342 $this->lng->loadLanguageModule(
"content");
343 $this->ctrl->setReturnByClass(
"ilPageObjectGUI",
"view");
344 $this->ctrl->setReturn($this,
"questions");
347 $page_gui->setEditPreview(
true);
348 $page_gui->setEnabledTabs(
false);
349 $page_gui->setEnabledInternalLinks(
false);
350 if (strlen($this->ctrl->getCmd()) == 0)
352 $this->ctrl->setCmdClass(get_class($page_gui));
353 $this->ctrl->setCmd(
"preview");
356 $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
357 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
358 $page_gui->setOutputMode($this->object->evalTotalPersons() == 0 ?
"edit" :
'preview');
359 $page_gui->setHeader($question->getTitle());
360 $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this,
"downloadFile"));
361 $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this,
"fullscreen"));
362 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this));
363 $page_gui->setPresentationTitle($question->getTitle());
364 $ret =& $this->ctrl->forwardCommand($page_gui);
365 $this->tpl->setContent(
$ret);
369 case "ilcommonactiondispatchergui":
370 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
372 $this->ctrl->forwardCommand($gui);
379 if (preg_match(
"/deleteqpl_\d+/",
$cmd))
381 $cmd =
"randomQuestions";
383 if ((strcmp(
$cmd,
"properties") == 0) && (
$_GET[
"browse"]))
388 if ((strcmp(
$cmd,
"properties") == 0) && (
$_GET[
"up"] ||
$_GET[
"down"]))
399 global $___prev_question_id;
400 $___prev_question_id =
$_REQUEST[
'prev_qid'];
401 $this->ctrl->setParameterByClass(
'ilpageobjectgui',
'prev_qid',
$_REQUEST[
'prev_qid']);
402 $this->ctrl->setParameterByClass(
$_GET[
'sel_question_types'] .
'gui',
'prev_qid',
$_REQUEST[
'prev_qid']);
404 $this->create_question_mode =
true;
407 $this->ctrl->setReturn($this,
"questions");
408 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
410 $q_gui->object->setObjId($this->object->getId());
411 if (!
$_GET[
'sel_question_types'])
414 $qType =
$_GET[
'sel_question_types'];
416 $this->ctrl->setParameterByClass($qType .
"GUI",
'prev_qid',
$_REQUEST[
'prev_qid']);
417 $this->ctrl->setParameterByClass($qType .
"GUI",
'test_ref_id',
$_REQUEST[
'ref_id']);
418 $this->ctrl->setParameterByClass($qType .
"GUI",
'q_id',
$_REQUEST[
'q_id']);
420 $this->ctrl->setParameterByClass($qType .
"GUI",
'test_express_mode', 1);
422 #global $___test_express_mode;
423 #$___test_express_mode = true;
424 if (!$q_gui->isSaveCommand())
425 $_GET[
'calling_test'] = $this->object->getRefId();
427 $q_gui->setQuestionTabs();
428 #unset($___test_express_mode);
429 $ret =& $this->ctrl->forwardCommand($q_gui);
432 if (strtolower(
$_GET[
"baseClass"]) !=
"iladministrationgui" &&
441 $this->ctrl->redirect($this,
"infoScreen");
446 $this->ctrl->redirectByClass(
"iltestevaluationgui",
"outEvaluation");
455 if($form->checkInput())
457 $this->ctrl->setParameter($this,
"new_type", $this->type);
462 $form->setValuesByPost();
463 $this->tpl->setContent($form->getHTML());
468 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
470 $defaults = $tst->getAvailableDefaults();
471 if (count($defaults))
473 foreach ($defaults as
$row)
475 $a_options[
"tstdef_".$row[
"test_defaults_id"]] = array($row[
"name"],
476 $this->lng->txt(
"tst_default_settings"));
481 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
485 foreach($templates as $item)
487 $a_options[
"tsttpl_".$item[
"id"]] = array($item[
"title"],
488 nl2br(trim($item[
"description"])));
502 $a_new_object->applyDefaults($tstdef);
508 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
511 $template_settings = $template->getSettings();
512 if($template_settings)
517 $a_new_object->setTemplate($template_id);
518 $a_new_object->saveToDb();
524 $a_new_object->
getRefId().
"&cmd=properties");
529 include_once
"./Services/Utilities/classes/class.ilUtil.php";
530 $path = $this->tree->getPathFull($this->object->getRefID());
536 include_once
"./Services/Utilities/classes/class.ilUtil.php";
547 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
551 $this->ctrl->redirect($this,
"infoScreen");
554 $export_dir = $this->
object->getExportDirectory();
555 $export_files = $this->
object->getExportFiles($export_dir);
557 if(count($export_files) > 0)
559 foreach($export_files as $exp_file)
561 $file_arr = explode(
"__", $exp_file);
562 array_push(
$data, array(
564 'size' => filesize($export_dir.
"/".$exp_file),
565 'date' => $file_arr[0]
570 include_once
"./Modules/Test/classes/tables/class.ilTestExportTableGUI.php";
572 $table_gui->setData(
$data);
573 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
583 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
585 include_once(
"./Modules/Test/classes/class.ilTestExport.php");
587 $test_exp->buildExportFile();
593 $this->ctrl->redirect($this,
"export");
603 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
605 include_once(
"./Modules/Test/classes/class.ilTestExport.php");
607 $test_exp->buildExportFile();
613 $this->ctrl->redirect($this,
"export");
623 if( !$ilAccess->checkAccess(
'write',
'', $this->ref_id) )
626 $this->ctrl->redirect($this,
'infoScreen');
629 if(!isset(
$_POST[
"file"]))
632 $this->ctrl->redirect($this,
"export");
635 if (count(
$_POST[
"file"]) > 1)
638 $this->ctrl->redirect($this,
"export");
644 if( !file_exists(
$file) )
646 $this->ctrl->redirect($this,
'export');
658 if( !$ilAccess->checkAccess(
'write',
'', $this->ref_id) )
661 $this->ctrl->redirect($this,
'infoScreen');
664 if (!isset(
$_POST[
"file"]))
667 $this->ctrl->redirect($this,
"export");
672 $export_dir = $this->
object->getExportDirectory();
673 $export_files = $this->
object->getExportFiles($export_dir);
675 if (count(
$_POST[
"file"]) > 0)
677 foreach (
$_POST[
"file"] as $exp_file)
679 $file_arr = explode(
"__", $exp_file);
680 array_push(
$data, array(
682 'size' => filesize($export_dir.
"/".$exp_file),
683 'date' => $file_arr[0]
688 include_once
"./Modules/Test/classes/tables/class.ilTestExportTableGUI.php";
690 $table_gui->setData(
$data);
691 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
710 if( !$ilAccess->checkAccess(
'write',
'', $this->ref_id) )
713 $this->ctrl->redirect($this,
'infoScreen');
717 $this->ctrl->redirect($this,
"export");
727 if( !$ilAccess->checkAccess(
'write',
'', $this->ref_id) )
730 $this->ctrl->redirect($this,
'infoScreen');
733 $export_dir = $this->
object->getExportDirectory();
736 $file = basename($file);
737 $dir = substr($file, 0, strlen($file) - 4);
739 if( !strlen($file) || !strlen(
$dir) )
744 $exp_file = $export_dir.
"/".
$file;
745 $exp_dir = $export_dir.
"/".
$dir;
746 if (@is_file($exp_file))
750 if (@is_dir($exp_dir))
756 $this->ctrl->redirect($this,
"export");
764 if ($_FILES[
"xmldoc"][
"error"] > UPLOAD_ERR_OK)
770 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
775 $file = pathinfo($_FILES[
"xmldoc"][
"name"]);
776 $full_path = $basedir.
"/".$_FILES[
"xmldoc"][
"name"];
783 $subdir = basename(
$file[
"basename"],
".".
$file[
"extension"]);
790 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
792 $result = $qtiParser->startParsing();
793 $founditems =& $qtiParser->getFoundItems();
795 if (count($founditems) == 0)
809 foreach ($founditems as $item)
811 if (strlen($item[
"type"]))
831 $_SESSION[
"tst_import_results_file"] = $results_file;
832 $_SESSION[
"tst_import_xml_file"] = $xml_file;
833 $_SESSION[
"tst_import_qti_file"] = $qti_file;
834 $_SESSION[
"tst_import_subdir"] = $subdir;
836 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.tst_import_verification.html");
837 $row_class = array(
"tblrow1",
"tblrow2");
839 foreach ($founditems as $item)
841 $this->tpl->setCurrentBlock(
"verification_row");
842 $this->tpl->setVariable(
"ROW_CLASS", $row_class[$counter++ % 2]);
843 $this->tpl->setVariable(
"QUESTION_TITLE", $item[
"title"]);
844 $this->tpl->setVariable(
"QUESTION_IDENT", $item[
"ident"]);
845 include_once
"./Services/QTI/classes/class.ilQTIItem.php";
846 switch ($item[
"type"])
848 case "MULTIPLE CHOICE QUESTION":
850 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"qt_multiple_choice"));
852 case "SINGLE CHOICE QUESTION":
854 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assSingleChoice"));
856 case "NUMERIC QUESTION":
858 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assNumeric"));
860 case "TEXTSUBSET QUESTION":
862 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assTextSubset"));
864 case "CLOZE QUESTION":
866 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assClozeTest"));
868 case "IMAGE MAP QUESTION":
870 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assImagemapQuestion"));
872 case "JAVA APPLET QUESTION":
874 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assJavaApplet"));
876 case "MATCHING QUESTION":
878 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assMatchingQuestion"));
880 case "ORDERING QUESTION":
882 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assOrderingQuestion"));
884 case "TEXT QUESTION":
886 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assTextQuestion"));
889 $this->tpl->parseCurrentBlock();
896 $this->tpl->setCurrentBlock(
"adm_content");
897 $this->tpl->setVariable(
"TEXT_TYPE", $this->lng->txt(
"question_type"));
898 $this->tpl->setVariable(
"TEXT_TITLE", $this->lng->txt(
"question_title"));
899 $this->tpl->setVariable(
"FOUND_QUESTIONS_INTRODUCTION", $this->lng->txt(
"tst_import_verify_found_questions"));
900 $this->tpl->setVariable(
"VERIFICATION_HEADING", $this->lng->txt(
"import_tst"));
901 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
903 $this->tpl->setVariable(
"QUESTIONPOOL_ID", $QplOrTstID);
904 $this->tpl->setVariable(
"VALUE_IMPORT", $this->lng->txt(
"import"));
905 $this->tpl->setVariable(
"VALUE_CANCEL", $this->lng->txt(
"cancel"));
906 $this->tpl->parseCurrentBlock();
914 include_once
"./Modules/Test/classes/class.ilObjTest.php";
918 $newObj->setType(
$_GET[
"new_type"]);
920 $newObj->setTitle(
"dummy");
922 $newObj->setDescription(
"test import");
924 $newObj->create(
true);
926 $newObj->createReference();
928 $newObj->putInTree(
$_GET[
"ref_id"]);
930 $newObj->setPermissions(
$_GET[
"ref_id"]);
932 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
934 $newObj->mark_schema->flush();
937 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
940 if (
$_POST[
"qpl_id"] ==
"-1")
942 $qpl_id = $newObj->id;
946 $qpl_id =
$_POST[
"qpl_id"];
950 $qtiParser->setTestObject($newObj);
951 $result = $qtiParser->startParsing();
955 include_once (
"./Modules/LearningModule/classes/class.ilContObjParser.php");
957 $contParser->setQuestionMapping($qtiParser->getImportMapping());
958 $contParser->startParsing();
961 if (@file_exists(
$_SESSION[
"tst_import_results_file"]))
963 include_once (
"./Modules/Test/classes/class.ilTestResultsImportParser.php");
972 "&baseClass=ilObjTestGUI");
997 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_properties_save_confirmation.html",
"Modules/Test");
1002 $information = $this->lng->txt(
"change_properties_from_random_to_standard");
1005 $information = $this->lng->txt(
"change_properties_from_standard_to_random");
1008 foreach (
$_POST as $key => $value)
1010 if (strcmp($key,
"cmd") != 0)
1012 if (is_array($value))
1014 foreach ($value as $k => $v)
1016 $this->tpl->setCurrentBlock(
"hidden_variable");
1017 $this->tpl->setVariable(
"HIDDEN_KEY", $key .
"[" . $k .
"]");
1018 $this->tpl->setVariable(
"HIDDEN_VALUE", $v);
1019 $this->tpl->parseCurrentBlock();
1024 $this->tpl->setCurrentBlock(
"hidden_variable");
1025 $this->tpl->setVariable(
"HIDDEN_KEY", $key);
1026 $this->tpl->setVariable(
"HIDDEN_VALUE", $value);
1027 $this->tpl->parseCurrentBlock();
1031 $this->tpl->setCurrentBlock(
"hidden_variable");
1032 $this->tpl->setVariable(
"HIDDEN_KEY",
"tst_properties_confirmation");
1033 $this->tpl->setVariable(
"HIDDEN_VALUE",
"1");
1034 $this->tpl->parseCurrentBlock();
1035 $this->tpl->setCurrentBlock(
"adm_content");
1036 $this->tpl->setVariable(
"TXT_CONFIRMATION", $this->lng->txt(
"confirmation"));
1037 $this->tpl->setVariable(
"TXT_INFORMATION", $information);
1038 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
1039 $this->tpl->setVariable(
"BTN_CONFIRM", $this->lng->txt(
"confirm"));
1040 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
1041 $this->tpl->parseCurrentBlock();
1054 $total = $this->
object->evalTotalPersons();
1058 $this->
object->setCountSystem(
$_POST[
"count_system"]);
1059 $this->
object->setMCScoring(
$_POST[
"mc_scoring"]);
1060 $this->
object->setScoreCutting(
$_POST[
"score_cutting"]);
1061 $this->
object->setPassScoring(
$_POST[
"pass_scoring"]);
1074 $this->
object->setScoringFeedbackOptionsByArray(
$_POST[
'instant_feedback']);
1077 $this->
object->setScoreReporting(
$_POST[
"results_access"]);
1080 $this->
object->setReportingDate(sprintf(
"%04d%02d%02d%02d%02d%02d",
1081 $_POST[
"reporting_date"][
'date'][
"y"],
1082 $_POST[
"reporting_date"][
'date'][
"m"],
1083 $_POST[
"reporting_date"][
'date'][
"d"],
1084 $_POST[
"reporting_date"][
'time'][
"h"],
1085 $_POST[
"reporting_date"][
'time'][
"m"],
1086 $_POST[
"reporting_date"][
'time'][
"s"]
1091 $this->
object->setReportingDate(
'');
1094 $this->
object->setShowPassDetails((is_array(
$_POST[
'results_presentation']) && in_array(
'pass_details',
$_POST[
'results_presentation'])) ? 1 : 0);
1095 $this->
object->setShowSolutionDetails((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_details',
$_POST[
'results_presentation'])) ? 1 : 0);
1096 $this->
object->setShowSolutionPrintview((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_printview',
$_POST[
'results_presentation'])) ? 1 : 0);
1097 $this->
object->setShowSolutionFeedback((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_feedback',
$_POST[
'results_presentation'])) ? 1 : 0);
1098 $this->
object->setShowSolutionAnswersOnly((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_answers_only',
$_POST[
'results_presentation'])) ? 1 : 0);
1099 $this->
object->setShowSolutionSignature((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_signature',
$_POST[
'results_presentation'])) ? 1 : 0);
1100 $this->
object->setShowSolutionSuggested((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_suggested',
$_POST[
'results_presentation'])) ? 1 : 0);
1102 $this->
object->setExportSettingsSingleChoiceShort((is_array(
$_POST[
'export_settings']) && in_array(
'exp_sc_short',
$_POST[
'export_settings'])) ? 1 : 0);
1104 $this->
object->saveToDb(
true);
1106 $this->ctrl->redirect($this,
"scoring");
1118 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
1122 $this->ctrl->redirect($this,
"infoScreen");
1127 $template_settings = null;
1128 $template = $this->
object->getTemplate();
1132 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
1133 include_once
"Modules/Test/classes/class.ilObjAssessmentFolderGUI.php";
1137 $template_settings = $template->getSettings();
1140 $save = (strcmp($this->ctrl->getCmd(),
"saveScoring") == 0) ? TRUE : FALSE;
1141 $total = $this->
object->evalTotalPersons();
1142 $this->tpl->addJavascript(
"./Services/JavaScript/js/Basic.js");
1144 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1146 $form->setFormAction($this->ctrl->getFormAction($this));
1147 $form->setTableWidth(
"100%");
1148 $form->setId(
"test_properties_scoring");
1152 $header->setTitle($this->lng->txt(
"scoring"));
1153 $form->addItem($header);
1156 $count_system =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_text_count_system"),
"count_system");
1158 $count_system->addOption(
new ilRadioOption($this->lng->txt(
"tst_count_correct_solutions"), 1,
''));
1159 $count_system->setValue($this->object->getCountSystem());
1160 $count_system->setInfo($this->lng->txt(
"tst_count_system_description"));
1163 $count_system->setDisabled(
true);
1165 $form->addItem($count_system);
1168 $mc_scoring =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_score_mcmr_questions"),
"mc_scoring");
1169 $mc_scoring->
addOption(
new ilRadioOption($this->lng->txt(
"tst_score_mcmr_zero_points_when_unanswered"), 0,
''));
1170 $mc_scoring->addOption(
new ilRadioOption($this->lng->txt(
"tst_score_mcmr_use_scoring_system"), 1,
''));
1171 $mc_scoring->setValue($this->object->getMCScoring());
1172 $mc_scoring->setInfo($this->lng->txt(
"tst_score_mcmr_questions_description"));
1175 $mc_scoring->setDisabled(
true);
1177 $form->addItem($mc_scoring);
1180 $score_cutting =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_score_cutting"),
"score_cutting");
1182 $score_cutting->addOption(
new ilRadioOption($this->lng->txt(
"tst_score_cut_test"), 1,
''));
1183 $score_cutting->setValue($this->object->getScoreCutting());
1184 $score_cutting->setInfo($this->lng->txt(
"tst_score_cutting_description"));
1187 $score_cutting->setDisabled(
true);
1189 $form->addItem($score_cutting);
1194 $pass_scoring->addOption(
new ilRadioOption($this->lng->txt(
"tst_pass_best_pass"), 1,
''));
1195 $pass_scoring->setValue($this->object->getPassScoring());
1196 $pass_scoring->setInfo($this->lng->txt(
"tst_pass_scoring_description"));
1199 $pass_scoring->setDisabled(
true);
1201 $form->addItem($pass_scoring);
1205 $instant_feedback->
addOption(
new ilCheckboxOption($this->lng->txt(
"tst_instant_feedback_answer_specific"),
'instant_feedback_answer',
''));
1206 $instant_feedback->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_instant_feedback_results"),
'instant_feedback_points',
''));
1207 $instant_feedback->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_instant_feedback_solution"),
'instant_feedback_solution',
''));
1209 if ($this->object->getAnswerFeedback()) array_push($values,
'instant_feedback_answer');
1210 if ($this->object->getAnswerFeedbackPoints()) array_push($values,
'instant_feedback_points');
1211 if ($this->object->getInstantFeedbackSolution()) array_push($values,
'instant_feedback_solution');
1212 $instant_feedback->setValue($values);
1213 $instant_feedback->setInfo($this->lng->txt(
"tst_instant_feedback_description"));
1214 $form->addItem($instant_feedback);
1217 $results_access =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_results_access"),
"results_access");
1219 $results_access->addOption(
new ilRadioOption($this->lng->txt(
"tst_results_access_always"), 2,
''));
1220 $results_access->addOption(
new ilRadioOption($this->lng->txt(
"tst_results_access_never"), 4,
''));
1221 $results_access->addOption(
new ilRadioOption($this->lng->txt(
"tst_results_access_date"), 3,
''));
1222 $results_access->setValue($this->object->getScoreReporting());
1223 $results_access->setInfo($this->lng->txt(
"tst_results_access_description"));
1227 $reporting_date->setShowDate(
true);
1228 $reporting_date->setShowTime(
true);
1229 if (strlen($this->object->getReportingDate()))
1237 $results_access->addSubItem($reporting_date);
1238 $form->addItem($results_access);
1241 $results_presentation =
new ilCheckboxGroupInputGUI($this->lng->txt(
"tst_results_presentation"),
"results_presentation");
1243 $results_presentation->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_details"),
'solution_details',
''));
1244 $results_presentation->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_printview"),
'solution_printview',
''));
1245 $results_presentation->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_feedback"),
'solution_feedback',
''));
1246 $results_presentation->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_answers_only"),
'solution_answers_only',
''));
1247 $signatureOption =
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_signature"),
'solution_signature',
'');
1248 $results_presentation->addOption($signatureOption);
1249 $results_presentation->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_suggested"),
'solution_suggested',
''));
1251 if ($this->object->getShowPassDetails()) array_push($values,
'pass_details');
1252 if ($this->object->getShowSolutionDetails()) array_push($values,
'solution_details');
1253 if ($this->object->getShowSolutionPrintview()) array_push($values,
'solution_printview');
1254 if ($this->object->getShowSolutionFeedback()) array_push($values,
'solution_feedback');
1255 if ($this->object->getShowSolutionAnswersOnly()) array_push($values,
'solution_answers_only');
1256 if ($this->object->getShowSolutionSignature()) array_push($values,
'solution_signature');
1257 if ($this->object->getShowSolutionSuggested()) array_push($values,
'solution_suggested');
1258 $results_presentation->setValue($values);
1259 $results_presentation->setInfo($this->lng->txt(
"tst_results_presentation_description"));
1260 if ($this->object->getAnonymity())
1262 $signatureOption->setDisabled(
true);
1264 $form->addItem($results_presentation);
1270 if ($this->object->getExportSettingsSingleChoiceShort()) array_push($values,
'exp_sc_short');
1271 $export_settings->setValue($values);
1272 $form->addItem($export_settings);
1274 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])) $form->addCommandButton(
"saveScoring", $this->lng->txt(
"save"));
1277 if($template_settings)
1279 foreach($template_settings as $id => $item)
1283 $form->removeItemByPostVar($id);
1292 $errors = !$form->checkInput();
1293 $form->setValuesByPost();
1294 if (
$errors) $checkonly =
false;
1296 if (!$checkonly) $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
1308 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
1312 $this->ctrl->redirect($this,
"infoScreen");
1316 $template_settings = null;
1317 $template = $this->
object->getTemplate();
1321 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
1324 $template_settings = $template->getSettings();
1325 $hide_rte_switch = $template_settings[
"rte_switch"][
"hide"];
1328 $save = (strcmp($this->ctrl->getCmd(),
"saveProperties") == 0) ? TRUE : FALSE;
1329 $total = $this->
object->evalTotalPersons();
1330 $this->tpl->addJavascript(
"./Services/JavaScript/js/Basic.js");
1332 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1334 $form->setFormAction($this->ctrl->getFormAction($this));
1335 $form->setTableWidth(
"100%");
1336 $form->setId(
"test_properties");
1341 $header->setTitle($this->lng->txt(
"tst_general_properties"));
1342 $form->addItem($header);
1350 $online->setChecked($this->object->isOnline());
1351 $form->addItem($online);
1353 include_once
'Services/MetaData/classes/class.ilMD.php';
1354 $md_obj =
new ilMD($this->object->getId(), 0,
"tst");
1358 $title->setRequired(
true);
1359 $title->setValue($md_section->getTitle());
1362 $ids = $md_section->getDescriptionIds();
1365 $desc_obj = $md_section->getDescription(array_pop($ids));
1370 $desc->setValue($desc_obj->getDescription());
1371 $form->addItem($desc);
1389 $rb =
new ilRadioOption($this->lng->txt(
'tst_anonymity_no_anonymization'), 0);
1390 $anonymity->addOption($rb);
1391 $rb =
new ilRadioOption($this->lng->txt(
'tst_anonymity_anonymous_test'), 1);
1392 $anonymity->addOption($rb);
1393 $anonymity->
setValue((
int)$this->object->getAnonymity());
1394 $form->addItem($anonymity);
1397 $random =
new ilCheckboxInputGUI($this->lng->txt(
"tst_random_selection"),
"random_test");
1399 if (
$total) $random->setDisabled(
true);
1400 $random->setChecked($this->object->isRandomTest());
1402 $info = $this->lng->txt(
"tst_random_test_description");
1403 if ($this->object->hasQuestionsWithoutQuestionpool()) {
1404 $info .= $this->lng->txt(
"tst_random_test_description_warning");
1406 $random->setInfo($info);
1407 $form->addItem($random);
1430 $pool_usage =
new ilCheckboxInputGUI($this->lng->txt(
"test_question_pool_usage"),
"use_pool");
1432 $pool_usage->setChecked($this->object->getPoolUsage());
1433 $form->addItem($pool_usage);
1438 $header->setTitle($this->lng->txt(
"tst_beginning_ending_information"));
1439 $form->addItem($header);
1443 $intro =
new ilTextAreaInputGUI($this->lng->txt(
"tst_introduction"),
"introduction");
1444 $intro->
setValue($this->object->prepareTextareaOutput($this->object->getIntroduction()));
1445 $intro->setRows(10);
1446 $intro->setCols(80);
1447 $intro->setUseRte(TRUE);
1448 $intro->addPlugin(
"latex");
1449 $intro->addButton(
"latex");
1450 $intro->setRTESupport($this->object->getId(),
"tst",
"assessment");
1451 $intro->setRteTagSet(
'full');
1452 $intro->setInfo($this->lng->txt(
'intro_desc'));
1455 $showinfo->setValue(1);
1456 $showinfo->setChecked($this->object->getShowInfo());
1457 $showinfo->setOptionTitle($this->lng->txt(
"showinfo"));
1458 $showinfo->setInfo($this->lng->txt(
"showinfo_desc"));
1459 $intro->addSubItem($showinfo);
1460 $form->addItem($intro);
1463 $finalstatement =
new ilTextAreaInputGUI($this->lng->txt(
"final_statement"),
"finalstatement");
1464 $finalstatement->
setValue($this->object->prepareTextareaOutput($this->object->getFinalStatement()));
1465 $finalstatement->setRows(10);
1466 $finalstatement->setCols(80);
1467 $finalstatement->setUseRte(TRUE);
1468 $finalstatement->addPlugin(
"latex");
1469 $finalstatement->addButton(
"latex");
1470 $finalstatement->setRTESupport($this->object->getId(),
"tst",
"assessment");
1471 $finalstatement->setRteTagSet(
'full');
1474 $showfinal->setValue(1);
1475 $showfinal->setChecked($this->object->getShowFinalStatement());
1476 $showfinal->setOptionTitle($this->lng->txt(
"final_statement_show"));
1477 $showfinal->setInfo($this->lng->txt(
"final_statement_show_desc"));
1478 $finalstatement->addSubItem($showfinal);
1479 $form->addItem($finalstatement);
1484 $sessionheader->setTitle($this->lng->txt(
"tst_session_settings"));
1485 $form->addItem($sessionheader);
1489 $nr_of_tries =
new ilTextInputGUI($this->lng->txt(
"tst_nr_of_tries"),
"nr_of_tries");
1491 $nr_of_tries->setValue($this->object->getNrOfTries());
1492 $nr_of_tries->setRequired(
true);
1493 $nr_of_tries->setSuffix($this->lng->txt(
"0_unlimited"));
1494 if (
$total) $nr_of_tries->setDisabled(
true);
1495 $form->addItem($nr_of_tries);
1498 $processing =
new ilCheckboxInputGUI($this->lng->txt(
"tst_processing_time"),
"chb_processing_time");
1502 if ($template_settings && $template_settings[
'chb_processing_time'] && $template_settings[
'chb_processing_time'][
'value'])
1503 $processing->setChecked(
true);
1505 $processing->setChecked($this->object->getEnableProcessingTime());
1509 $ptime = $this->
object->getProcessingTimeAsArray();
1510 $processingtime->setHours($ptime[
'hh']);
1511 $processingtime->setMinutes($ptime[
'mm']);
1512 $processingtime->setSeconds($ptime[
'ss']);
1513 $processingtime->setShowMonths(
false);
1514 $processingtime->setShowDays(
false);
1515 $processingtime->setShowHours(
true);
1516 $processingtime->setShowMinutes(
true);
1517 $processingtime->setShowSeconds(
true);
1518 $processingtime->setInfo($this->lng->txt(
"tst_processing_time_desc"));
1519 $processing->addSubItem($processingtime);
1523 $resetprocessing->setValue(1);
1524 $resetprocessing->setOptionTitle($this->lng->txt(
"tst_reset_processing_time"));
1525 $resetprocessing->setChecked($this->object->getResetProcessingTime());
1526 $resetprocessing->setInfo($this->lng->txt(
"tst_reset_processing_time_desc"));
1527 $processing->addSubItem($resetprocessing);
1528 $form->addItem($processing);
1531 $enablestartingtime =
new ilCheckboxInputGUI($this->lng->txt(
"tst_starting_time"),
"chb_starting_time");
1535 if ($template_settings && $template_settings[
'chb_starting_time'] && $template_settings[
'chb_starting_time'][
'value'])
1536 $enablestartingtime->setChecked(
true);
1538 $enablestartingtime->setChecked(strlen($this->object->getStartingTime()));
1541 $startingtime->setShowDate(
true);
1542 $startingtime->setShowTime(
true);
1543 if (strlen($this->object->getStartingTime()))
1551 $enablestartingtime->addSubItem($startingtime);
1552 if (
$total) $enablestartingtime->setDisabled(
true);
1553 if (
$total) $startingtime->setDisabled(
true);
1554 $form->addItem($enablestartingtime);
1557 $enableendingtime =
new ilCheckboxInputGUI($this->lng->txt(
"tst_ending_time"),
"chb_ending_time");
1560 if ($template_settings && $template_settings[
'chb_ending_time'] && $template_settings[
'chb_ending_time'][
'value'])
1561 $enableendingtime->setChecked(
true);
1563 $enableendingtime->setChecked(strlen($this->object->getEndingTime()));
1566 $endingtime->setShowDate(
true);
1567 $endingtime->setShowTime(
true);
1568 if (strlen($this->object->getEndingTime()))
1576 $enableendingtime->addSubItem($endingtime);
1577 $form->addItem($enableendingtime);
1580 $password =
new ilTextInputGUI($this->lng->txt(
"tst_password"),
"password");
1582 $password->setValue($this->object->getPassword());
1583 $password->setInfo($this->lng->txt(
"tst_password_details"));
1584 $form->addItem($password);
1589 $seqheader->setTitle($this->lng->txt(
"tst_presentation_properties"));
1590 $form->addItem($seqheader);
1594 $prevanswers =
new ilCheckboxInputGUI($this->lng->txt(
"tst_use_previous_answers"),
"chb_use_previous_answers");
1596 $prevanswers->setChecked($this->object->getUsePreviousAnswers());
1597 $prevanswers->setInfo($this->lng->txt(
"tst_use_previous_answers_description"));
1598 $form->addItem($prevanswers);
1603 $forcejs->setChecked($this->object->getForceJS());
1604 $forcejs->setOptionTitle($this->lng->txt(
"forcejs"));
1605 $forcejs->setInfo($this->lng->txt(
"forcejs_desc"));
1606 $form->addItem($forcejs);
1611 $title_output->addOption(
new ilRadioOption($this->lng->txt(
"tst_title_output_hide_points"), 1,
''));
1612 $title_output->addOption(
new ilRadioOption($this->lng->txt(
"tst_title_output_no_title"), 2,
''));
1613 $title_output->setValue($this->object->getTitleOutput());
1614 $title_output->setInfo($this->lng->txt(
"tst_title_output_description"));
1615 $form->addItem($title_output);
1620 $seqheader->setTitle($this->lng->txt(
"tst_sequence_properties"));
1621 $form->addItem($seqheader);
1627 $postpone->setChecked($this->object->getSequenceSettings());
1628 $postpone->setInfo($this->lng->txt(
"tst_postpone_description"));
1629 $form->addItem($postpone);
1632 $shuffle =
new ilCheckboxInputGUI($this->lng->txt(
"tst_shuffle_questions"),
"chb_shuffle_questions");
1634 $shuffle->setChecked($this->object->getShuffleQuestions());
1635 $shuffle->setInfo($this->lng->txt(
"tst_shuffle_questions_description"));
1636 $form->addItem($shuffle);
1639 $list_of_questions =
new ilCheckboxInputGUI($this->lng->txt(
"tst_show_summary"),
"list_of_questions");
1642 $list_of_questions->setChecked($this->object->getListOfQuestions());
1643 $list_of_questions->setInfo($this->lng->txt(
"tst_show_summary_description"));
1646 $list_of_questions_options->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_list_of_questions_start"),
'chb_list_of_questions_start',
''));
1647 $list_of_questions_options->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_list_of_questions_end"),
'chb_list_of_questions_end',
''));
1648 $list_of_questions_options->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_list_of_questions_with_description"),
'chb_list_of_questions_with_description',
''));
1650 if ($this->object->getListOfQuestionsStart()) array_push($values,
'chb_list_of_questions_start');
1651 if ($this->object->getListOfQuestionsEnd()) array_push($values,
'chb_list_of_questions_end');
1652 if ($this->object->getListOfQuestionsDescription()) array_push($values,
'chb_list_of_questions_with_description');
1653 $list_of_questions_options->setValue($values);
1655 $list_of_questions->addSubItem($list_of_questions_options);
1656 $form->addItem($list_of_questions);
1659 $marking =
new ilCheckboxInputGUI($this->lng->txt(
"question_marking"),
"chb_show_marker");
1661 $marking->setChecked($this->object->getShowMarker());
1662 $marking->setInfo($this->lng->txt(
"question_marking_description"));
1663 $form->addItem($marking);
1666 $cancel =
new ilCheckboxInputGUI($this->lng->txt(
"tst_show_cancel"),
"chb_show_cancel");
1668 $cancel->setChecked($this->object->getShowCancel());
1669 $cancel->setInfo($this->lng->txt(
"tst_show_cancel_description"));
1670 $form->addItem($cancel);
1675 $notifications->setTitle($this->lng->txt(
"tst_mail_notification"));
1676 $form->addItem($notifications);
1680 $mailnotification =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_finish_notification"),
"mailnotification");
1682 $mailnotification->addOption(
new ilRadioOption($this->lng->txt(
"tst_finish_notification_simple"), 1,
''));
1683 $mailnotification->addOption(
new ilRadioOption($this->lng->txt(
"tst_finish_notification_advanced"), 2,
''));
1684 $mailnotification->setValue($this->object->getMailNotification());
1685 $form->addItem($mailnotification);
1688 $mailnottype->setValue(1);
1689 $mailnottype->setOptionTitle($this->lng->txt(
"mailnottype"));
1690 $mailnottype->setChecked($this->object->getMailNotificationType());
1691 $form->addItem($mailnottype);
1697 $kioskheader->setTitle($this->lng->txt(
"kiosk"));
1698 $form->addItem($kioskheader);
1704 $kiosk->setChecked($this->object->getKioskMode());
1705 $kiosk->setInfo($this->lng->txt(
"kiosk_description"));
1710 $kiosktitle->addOption(
new ilCheckboxOption($this->lng->txt(
"kiosk_show_participant"),
'kiosk_participant',
''));
1712 if ($this->object->getShowKioskModeTitle()) array_push($values,
'kiosk_title');
1713 if ($this->object->getShowKioskModeParticipant()) array_push($values,
'kiosk_participant');
1714 $kiosktitle->setValue($values);
1715 $kiosktitle->setInfo($this->lng->txt(
"kiosk_options_desc"));
1716 $kiosk->addSubItem($kiosktitle);
1718 $form->addItem($kiosk);
1723 $restrictions->setTitle($this->lng->txt(
"tst_max_allowed_users"));
1724 $form->addItem($restrictions);
1727 $fixedparticipants =
new ilCheckboxInputGUI($this->lng->txt(
'participants_invitation'),
"fixedparticipants");
1729 $fixedparticipants->setChecked($this->object->getFixedParticipants());
1730 $fixedparticipants->setOptionTitle($this->lng->txt(
"tst_allow_fixed_participants"));
1731 $fixedparticipants->setInfo($this->lng->txt(
"participants_invitation_description"));
1732 $invited_users = $this->
object->getInvitedUsers();
1733 if (
$total && (count($invited_users) == 0))
1735 $fixedparticipants->setDisabled(
true);
1737 $form->addItem($fixedparticipants);
1741 $simul =
new ilTextInputGUI($this->lng->txt(
"tst_allowed_users"),
"allowedUsers");
1743 $simul->setValue(($this->object->getAllowedUsers()) ? $this->object->getAllowedUsers() :
'');
1744 $form->addItem($simul);
1747 $idle =
new ilTextInputGUI($this->lng->txt(
"tst_allowed_users_time_gap"),
"allowedUsersTimeGap");
1749 $idle->setSuffix($this->lng->txt(
"seconds"));
1750 $idle->setValue(($this->object->getAllowedUsersTimeGap()) ? $this->object->getAllowedUsersTimeGap() :
'');
1751 $form->addItem($idle);
1753 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])) $form->addCommandButton(
"saveProperties", $this->lng->txt(
"save"));
1756 if($template_settings)
1758 foreach($template_settings as $id => $item)
1762 $form->removeItemByPostVar($id);
1771 $errors = !$form->checkInput();
1772 $form->setValuesByPost();
1773 if( $online->getChecked() && !$this->
object->isComplete() )
1775 $online->setAlert($this->lng->txt(
"cannot_switch_to_online_no_questions_andor_no_mark_steps"));
1779 if (
$errors) $checkonly =
false;
1790 $link = $this->ctrl->getLinkTarget($this,
"confirmResetTemplate");
1791 $link =
"<a href=\"".$link.
"\">".$this->lng->txt(
"test_using_template_link").
"</a>";
1792 $message =
"<div style=\"margin-top:10px\">".
1793 $tpl->getMessageHTML(sprintf($this->lng->txt(
"test_using_template"), $template->getTitle(), $link),
"info").
1797 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML().$message);
1810 if (!array_key_exists(
"tst_properties_confirmation",
$_POST))
1820 $template_settings = null;
1821 $template = $this->
object->getTemplate();
1824 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
1827 $template_settings = $template->getSettings();
1832 include_once
'Services/MetaData/classes/class.ilMD.php';
1833 $md_obj =&
new ilMD($this->object->getId(), 0,
"svy");
1841 $md_desc_ids = $md_section->getDescriptionIds();
1844 $md_desc = $md_section->getDescription(array_pop($md_desc_ids));
1849 $md_desc = $md_section->addDescription();
1856 $this->
object->update();
1858 $total = $this->
object->evalTotalPersons();
1859 $randomtest_switch =
false;
1863 if (!array_key_exists(
"tst_properties_confirmation",
$_POST))
1865 if (($this->object->isRandomTest()) && (count($this->object->getRandomQuestionpools()) > 0))
1867 if (!
$_POST[
"random_test"])
1874 if ((!$this->object->isRandomTest()) && (count($this->object->questions) > 0))
1876 if (
$_POST[
"random_test"])
1885 if (!strlen(
$_POST[
"random_test"]))
1891 $random_test =
$_POST[
"random_test"];
1896 $random_test = $this->
object->isRandomTest();
1898 if ($random_test != $this->object->isRandomTest())
1900 $randomtest_switch =
true;
1906 $online =
$_POST[
"online"];
1910 if( $randomtest_switch && $this->object->isOnline() && $online )
1916 $info = $this->lng->txt(
1917 "tst_set_offline_due_to_switched_random_test_setting"
1923 $this->
object->setAnonymity(
$_POST[
"anonymity"]);
1924 $this->
object->setRandomTest($random_test);
1925 $this->
object->setNrOfTries(
$_POST[
"nr_of_tries"]);
1926 if (
$_POST[
'chb_starting_time'])
1932 $this->
object->setStartingTime(
'');
1937 $this->
object->setOnline($online);
1939 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
1941 $this->
object->setShowInfo((
$_POST[
"showinfo"]) ? 1 : 0);
1943 $this->
object->setShowFinalStatement((
$_POST[
"showfinalstatement"]) ? 1 : 0);
1944 $this->
object->setSequenceSettings((
$_POST[
"chb_postpone"]) ? 1 : 0);
1945 $this->
object->setShuffleQuestions((
$_POST[
"chb_shuffle_questions"]) ? 1 : 0);
1946 $this->
object->setListOfQuestions(
$_POST[
"list_of_questions"]);
1947 if (is_array(
$_POST[
"list_of_questions_options"]))
1949 $this->
object->setListOfQuestionsStart((in_array(
'chb_list_of_questions_start',
$_POST[
"list_of_questions_options"])) ? 1 : 0);
1950 $this->
object->setListOfQuestionsEnd((in_array(
'chb_list_of_questions_end',
$_POST[
"list_of_questions_options"])) ? 1 : 0);
1951 $this->
object->setListOfQuestionsDescription((in_array(
'chb_list_of_questions_with_description',
$_POST[
"list_of_questions_options"])) ? 1 : 0);
1955 $this->
object->setListOfQuestionsStart(0);
1956 $this->
object->setListOfQuestionsEnd(0);
1957 $this->
object->setListOfQuestionsDescription(0);
1959 $this->
object->setMailNotification(
$_POST[
"mailnotification"]);
1960 $this->
object->setMailNotificationType(
$_POST[
"mailnottype"]);
1961 $this->
object->setShowMarker((
$_POST[
"chb_show_marker"]) ? 1 : 0);
1962 $this->
object->setShowCancel((
$_POST[
"chb_show_cancel"]) ? 1 : 0);
1963 $this->
object->setKioskMode((
$_POST[
"kiosk"]) ? 1 : 0);
1964 $this->
object->setShowKioskModeTitle((is_array(
$_POST[
"kiosk_options"]) && in_array(
'kiosk_title',
$_POST[
"kiosk_options"])) ? 1 : 0);
1965 $this->
object->setShowKioskModeParticipant((is_array(
$_POST[
"kiosk_options"]) && in_array(
'kiosk_participant',
$_POST[
"kiosk_options"])) ? 1 : 0);
1966 $this->
object->setEnableProcessingTime((
$_POST[
"chb_processing_time"]) ? 1 : 0);
1967 if ($this->object->getEnableProcessingTime())
1969 $this->
object->setProcessingTime(sprintf(
"%02d:%02d:%02d",
1970 $_POST[
"processing_time"][
"hh"],
1971 $_POST[
"processing_time"][
"mm"],
1972 $_POST[
"processing_time"][
"ss"]
1977 $this->
object->setProcessingTime(
'');
1979 $this->
object->setResetProcessingTime((
$_POST[
"chb_reset_processing_time"]) ? 1 : 0);
1980 if (
$_POST[
'chb_ending_time'])
1986 $this->
object->setEndingTime(
'');
1988 $this->
object->setUsePreviousAnswers((
$_POST[
"chb_use_previous_answers"]) ? 1 : 0);
1989 $this->
object->setForceJS((
$_POST[
"forcejs"]) ? 1 : 0);
1990 $this->
object->setTitleOutput(
$_POST[
"title_output"]);
1991 $this->
object->setPassword(
$_POST[
"password"]);
1992 $this->
object->setAllowedUsers(
$_POST[
"allowedUsers"]);
1993 $this->
object->setAllowedUsersTimeGap(
$_POST[
"allowedUsersTimeGap"]);
1995 if ($this->object->isRandomTest())
1997 $this->
object->setUsePreviousAnswers(0);
2000 $invited_users = $this->
object->getInvitedUsers();
2001 if (!(
$total && (count($invited_users) == 0)))
2003 $fixed_participants = 0;
2004 if (array_key_exists(
"fixedparticipants",
$_POST))
2006 if (
$_POST[
"fixedparticipants"])
2008 $fixed_participants = 1;
2011 $this->
object->setFixedParticipants($fixed_participants);
2012 if (!$fixed_participants)
2014 $invited_users = $this->
object->getInvitedUsers();
2015 foreach ($invited_users as $user_object)
2017 $this->
object->disinviteUser($user_object[
"usr_id"]);
2023 $this->
object->setEnabledViewMode(
$_POST[
'enabled_view_mode']);
2024 $this->
object->setPoolUsage(
$_POST[
'use_pool']);
2026 $this->
object->saveToDb(
true);
2029 if ($randomtest_switch)
2031 if ($this->object->isRandomTest())
2033 $this->
object->removeNonRandomTestData();
2037 $this->
object->removeRandomTestData();
2041 $this->ctrl->redirect($this,
'properties');
2051 include_once(
"./Modules/File/classes/class.ilObjFile.php");
2053 $fileObj->sendFile();
2062 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
2065 $page_gui->showMediaFullscreen();
2074 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
2076 $pg_obj->send_paragraph (
$_GET[
"par_id"],
$_GET[
"downloadtitle"]);
2113 $this->ctrl->redirect($this,
"questions");
2127 $parent_ref = $tree->getParentId($this->object->getRefId());
2128 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
2130 $qpl->setType(
"qpl");
2131 $qpl->setTitle($name);
2132 $qpl->setDescription($description);
2134 $qpl->createReference();
2135 $qpl->putInTree($parent_ref);
2136 $qpl->setPermissions($parent_ref);
2139 return $qpl->getRefId();
2149 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_random_select.html",
"Modules/Test");
2150 $questionpools =& $this->
object->getAvailableQuestionpools(FALSE, FALSE, FALSE, TRUE);
2151 $this->tpl->setCurrentBlock(
"option");
2152 $this->tpl->setVariable(
"VALUE_OPTION",
"0");
2153 $this->tpl->setVariable(
"TEXT_OPTION", $this->lng->txt(
"all_available_question_pools"));
2154 $this->tpl->parseCurrentBlock();
2155 foreach ($questionpools as $key => $value)
2157 $this->tpl->setCurrentBlock(
"option");
2158 $this->tpl->setVariable(
"VALUE_OPTION", $key);
2159 $this->tpl->setVariable(
"TEXT_OPTION", $value[
"title"]);
2160 $this->tpl->parseCurrentBlock();
2162 $this->tpl->setCurrentBlock(
"hidden");
2163 $this->tpl->setVariable(
"HIDDEN_NAME",
"sel_question_types");
2164 $this->tpl->setVariable(
"HIDDEN_VALUE",
$_POST[
"sel_question_types"]);
2165 $this->tpl->parseCurrentBlock();
2166 $this->tpl->setCurrentBlock(
"adm_content");
2167 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
2168 $this->tpl->setVariable(
"TXT_QPL_SELECT", $this->lng->txt(
"tst_random_select_questionpool"));
2169 $this->tpl->setVariable(
"TXT_NR_OF_QUESTIONS", $this->lng->txt(
"tst_random_nr_of_questions"));
2170 $this->tpl->setVariable(
"BTN_SUBMIT", $this->lng->txt(
"submit"));
2171 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
2172 $this->tpl->parseCurrentBlock();
2184 $this->ctrl->redirect($this,
"questions");
2197 $question_array = $this->
object->randomSelectQuestions(
$_POST[
"nr_of_questions"],
$_POST[
"sel_qpl"]);
2198 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_random_question_offer.html",
"Modules/Test");
2199 $color_class = array(
"tblrow1",
"tblrow2");
2201 $questionpools =& $this->
object->getAvailableQuestionpools(
true);
2202 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
2203 foreach ($question_array as $question_id)
2205 $dataset = $this->
object->getQuestionDataset($question_id);
2206 $this->tpl->setCurrentBlock(
"QTab");
2207 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
2208 $this->tpl->setVariable(
"QUESTION_TITLE", $dataset->title);
2209 $this->tpl->setVariable(
"QUESTION_COMMENT", $dataset->description);
2211 $this->tpl->setVariable(
"QUESTION_AUTHOR", $dataset->author);
2212 $this->tpl->setVariable(
"QUESTION_POOL", $questionpools[$dataset->obj_fi][
"title"]);
2213 $this->tpl->parseCurrentBlock();
2216 if (count($question_array) == 0)
2218 $this->tpl->setCurrentBlock(
"Emptytable");
2219 $this->tpl->setVariable(
"TEXT_NO_QUESTIONS_AVAILABLE", $this->lng->txt(
"no_questions_available"));
2220 $this->tpl->parseCurrentBlock();
2224 $this->tpl->setCurrentBlock(
"Selectionbuttons");
2225 $this->tpl->setVariable(
"BTN_YES", $this->lng->txt(
"random_accept_sample"));
2226 $this->tpl->setVariable(
"BTN_NO", $this->lng->txt(
"random_another_sample"));
2227 $this->tpl->parseCurrentBlock();
2229 $chosen_questions = join($question_array,
",");
2230 $this->tpl->setCurrentBlock(
"adm_content");
2231 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
2232 $this->tpl->setVariable(
"QUESTION_TITLE", $this->lng->txt(
"tst_question_title"));
2233 $this->tpl->setVariable(
"QUESTION_COMMENT", $this->lng->txt(
"description"));
2234 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"tst_question_type"));
2235 $this->tpl->setVariable(
"QUESTION_AUTHOR", $this->lng->txt(
"author"));
2236 $this->tpl->setVariable(
"QUESTION_POOL", $this->lng->txt(
"qpl"));
2237 $this->tpl->setVariable(
"VALUE_CHOSEN_QUESTIONS", $chosen_questions);
2238 $this->tpl->setVariable(
"VALUE_QUESTIONPOOL_SELECTION",
$_POST[
"sel_qpl"]);
2239 $this->tpl->setVariable(
"VALUE_NR_OF_QUESTIONS",
$_POST[
"nr_of_questions"]);
2240 $this->tpl->setVariable(
"TEXT_QUESTION_OFFER", $this->lng->txt(
"tst_question_offer"));
2241 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
2242 $this->tpl->parseCurrentBlock();
2254 $selected_array = split(
",",
$_POST[
"chosen_questions"]);
2255 if (!count($selected_array))
2261 $total = $this->
object->evalTotalPersons();
2271 foreach ($selected_array as $key => $value)
2273 $this->
object->insertQuestion($value);
2275 $this->
object->saveCompleteStatus();
2277 $this->ctrl->redirect($this,
"questions");
2299 $ilUser->setPref(
"tst_question_selection_mode_equal", (
$_POST[
'chbQuestionSelectionMode']) ? 1 : 0);
2300 $ilUser->writePref(
"tst_question_selection_mode_equal", (
$_POST[
'chbQuestionSelectionMode']) ? 1 : 0);
2301 $this->
object->setRandomQuestionCount(
$_POST[
'total_questions']);
2302 if (is_array(
$_POST[
'source'][
'qpl']) && count(array_unique(
$_POST[
'source'][
'qpl'])) == count(
$_POST[
'source'][
'qpl']))
2305 include_once
"./Modules/Test/classes/class.ilRandomTestData.php";
2306 foreach (
$_POST[
'source'][
'qpl'] as $idx => $qpl)
2310 $this->
object->setRandomQuestionpoolData(
$data);
2321 $this->
object->saveRandomQuestionCount($this->object->getRandomQuestionCount());
2322 $this->
object->saveRandomQuestionpools();
2323 $this->
object->saveCompleteStatus();
2325 $this->ctrl->redirect($this,
'randomQuestions');
2332 $position = key(
$_POST[
'cmd'][
'addsource']);
2333 $this->
object->addRandomQuestionpoolData(0, 0, $position+1);
2340 $position = key(
$_POST[
'cmd'][
'removesource']);
2341 $this->
object->removeRandomQuestionpoolData($position);
2349 $total = $this->
object->evalTotalPersons();
2350 $save = (strcmp($this->ctrl->getCmd(),
"saveRandomQuestions") == 0) ? TRUE : FALSE;
2352 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
2354 $form->setFormAction($this->ctrl->getFormAction($this,
'randomQuestions'));
2355 $form->setTitle($this->lng->txt(
'random_selection'));
2356 $form->setDescription($this->lng->txt(
'tst_select_random_questions'));
2357 $form->setMultipart(FALSE);
2358 $form->setTableWidth(
"100%");
2359 $form->setId(
"randomSelectionForm");
2362 $selection_mode = ($save) ?
$_POST[
'chbQuestionSelectionMode'] : $ilUser->getPref(
"tst_question_selection_mode_equal");
2363 $question_selection =
new ilCheckboxInputGUI($this->lng->txt(
"tst_question_selection"),
"chbQuestionSelectionMode");
2365 $question_selection->setChecked($selection_mode);
2366 $question_selection->setOptionTitle($this->lng->txt(
'tst_question_selection_equal'));
2367 $question_selection->setInfo($this->lng->txt(
'tst_question_selection_description'));
2368 $question_selection->setRequired(
false);
2369 $form->addItem($question_selection);
2372 $total_questions =
new ilNumberInputGUI($this->lng->txt(
'tst_total_questions'),
'total_questions');
2373 $total_questions->
setValue($this->object->getRandomQuestionCount());
2374 $total_questions->setSize(3);
2375 $total_questions->setInfo($this->lng->txt(
'tst_total_questions_description'));
2376 $total_questions->setRequired(
false);
2377 $form->addItem($total_questions);
2381 $found_qpls = $this->
object->getRandomQuestionpoolData();
2382 include_once
"./Modules/Test/classes/class.ilRandomTestData.php";
2383 if (count($found_qpls) == 0)
2387 $available_qpl =& $this->
object->getAvailableQuestionpools(TRUE, $selection_mode, FALSE, TRUE, TRUE);
2388 include_once
'./Modules/Test/classes/class.ilRandomTestInputGUI.php';
2391 $source->setRandomQuestionPools($available_qpl);
2392 $source->setUseQuestionCount((array_key_exists(
'total_questions',
$_POST)) ? (
$_POST[
'total_questions'] < 1) : ($this->object->getRandomQuestionCount() < 1));
2393 $source->setValues($found_qpls);
2394 $form->addItem($source);
2398 $qpls = $this->
object->getUsedRandomQuestionpools();
2399 include_once
'./Modules/Test/classes/class.ilRandomTestROInputGUI.php';
2402 $form->addItem($source);
2405 if (
$total == 0) $form->addCommandButton(
"saveRandomQuestions", $this->lng->txt(
"save"));
2411 $form->setValuesByPost();
2412 $errors = !$form->checkInput();
2416 if (
$_POST[
'total_questions'] > 0)
2419 foreach (
$_POST[
'source'][
'qpl'] as $idx => $qpl)
2421 $totalcount += $available_qpl[$qpl][
'count'];
2423 if (
$_POST[
'total_questions'] > $totalcount)
2425 $total_questions->setAlert($this->lng->txt(
'msg_total_questions_too_high'));
2430 if (
$errors) $checkonly =
false;
2433 if (!$checkonly) $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
2440 if (
$_POST[
"chbQuestionSelectionMode"])
2442 $ilUser->setPref(
"tst_question_selection_mode_equal", 1);
2443 $ilUser->writePref(
"tst_question_selection_mode_equal", 1);
2447 $ilUser->setPref(
"tst_question_selection_mode_equal", 0);
2448 $ilUser->writePref(
"tst_question_selection_mode_equal", 0);
2471 if (!$qpl_mode || ($qpl_mode == 2 && strcmp(
$_REQUEST[
"txt_qpl"],
"") == 0) || ($qpl_mode == 3 && strcmp($qpl_ref_id,
"") == 0))
2480 $_SESSION[
"test_id"] = $this->
object->getRefId();
2481 if ($qpl_mode == 2 && strcmp(
$_REQUEST[
"txt_qpl"],
"") != 0)
2486 else if ($qpl_mode == 1)
2488 $qpl_ref_id =
$_GET[
"ref_id"];
2491 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPoolGUI.php";
2493 $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=" .
$_REQUEST[
"sel_question_types"];
2496 $baselink .=
'&q_id=' .
$_REQUEST[
'q_id'];
2499 $baselink .=
'&prev_qid=' .
$_REQUEST[
'prev_qid'];
2502 $baselink .=
'&test_express_mode=1';
2504 #var_dump($_REQUEST['prev_qid']);
2520 $this->ctrl->redirect($this,
"questions");
2535 $questionpools =& $this->
object->getAvailableQuestionpools(FALSE, FALSE, FALSE, TRUE, FALSE,
"write");
2536 if ($this->object->getPoolUsage()) {
2539 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
2542 $form->setFormAction($ilCtrl->getFormAction($this,
"executeCreateQuestion"));
2543 $form->setTitle($lng->txt(
"test_create_question"));
2544 include_once
'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
2548 $hidden->setValue(
$_REQUEST[
"sel_question_types"]);
2549 $form->addItem($hidden);
2554 $no_pool =
new ilRadioOption($this->lng->txt(
"assessment_no_pool"), 1);
2555 $usage->addOption($no_pool);
2556 $existing_pool =
new ilRadioOption($this->lng->txt(
"assessment_existing_pool"), 3);
2557 $usage->addOption($existing_pool);
2558 $new_pool =
new ilRadioOption($this->lng->txt(
"assessment_new_pool"), 2);
2559 $usage->addOption($new_pool);
2560 $form->addItem($usage);
2565 $pools_data = array();
2566 foreach($questionpools as $key => $p) {
2567 $pools_data[$key] = $p[
'title'];
2569 $pools =
new ilSelectInputGUI($this->lng->txt(
"select_questionpool"),
"sel_qpl");
2571 $existing_pool->addSubItem($pools);
2574 $name =
new ilTextInputGUI($this->lng->txt(
"cat_create_qpl"),
"txt_qpl");
2576 $name->setMaxLength(50);
2577 $new_pool->addSubItem($name);
2579 $form->addCommandButton(
"executeCreateQuestion", $lng->txt(
"submit"));
2580 $form->addCommandButton(
"cancelCreateQuestion", $lng->txt(
"cancel"));
2582 return $this->tpl->setVariable(
'ADM_CONTENT', $form->getHTML());
2588 $ilCtrl->setParameterByClass(
'iltestexpresspageobjectgui',
'sel_question_types',
$_REQUEST[
"sel_question_types"]);
2589 $link = $ilCtrl->getLinkTargetByClass(
'iltestexpresspageobjectgui',
'handleToolbarCommand',
'',
false,
false);
2604 $checked_questions = array();
2606 foreach (
$_POST as $key => $value) {
2607 if (preg_match(
"/id_(\d+)/", $key, $matches)) {
2608 array_push($checked_questions, $matches[1]);
2612 $questions = $this->
object->getQuestionTitlesAndIndexes();
2615 foreach ($checked_questions as $key => $value) {
2618 $this->
object->removeQuestion($value);
2620 $this->
object->saveCompleteStatus();
2626 foreach($questions as $key => $value) {
2627 if ($prev === null) {
2631 if ($key == $first) {
2637 if (count($questions) == count($checked_questions)) {
2638 $this->ctrl->redirect($this,
"showPage");
2640 else if (!$return_to)
2641 $return_to = $questions[0];
2643 $this->ctrl->setParameter($this,
'q_id', $return_to);
2644 $this->ctrl->redirect($this,
"showPage");
2647 $this->ctrl->redirect($this,
"questions");
2661 $this->ctrl->setParameter($this,
'q_id',
$_REQUEST[
'q_id']);
2662 $this->ctrl->redirect($this,
"showPage");
2665 $this->ctrl->redirect($this,
"questions");
2679 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_remove_questions.html",
"Modules/Test");
2680 $removablequestions =& $this->
object->getTestQuestions();
2681 $colors = array(
"tblrow1",
"tblrow2");
2683 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
2684 if (count($removablequestions))
2686 foreach ($removablequestions as
$data)
2688 if (in_array($data[
"question_id"], $checked_questions))
2690 $this->tpl->setCurrentBlock(
"row");
2691 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
2692 $this->tpl->setVariable(
"TXT_TITLE", $data[
"title"]);
2693 $this->tpl->setVariable(
"TXT_DESCRIPTION", $data[
"description"]);
2695 $this->tpl->parseCurrentBlock();
2700 foreach ($checked_questions as $id)
2702 $this->tpl->setCurrentBlock(
"hidden");
2703 $this->tpl->setVariable(
"HIDDEN_NAME",
"id_$id");
2704 $this->tpl->setVariable(
"HIDDEN_VALUE",
"1");
2705 $this->tpl->parseCurrentBlock();
2708 $this->tpl->setCurrentBlock(
"adm_content");
2709 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"tst_question_title"));
2710 $this->tpl->setVariable(
"TXT_DESCRIPTION", $this->lng->txt(
"description"));
2711 $this->tpl->setVariable(
"TXT_TYPE", $this->lng->txt(
"tst_question_type"));
2712 $this->tpl->setVariable(
"BTN_CONFIRM", $this->lng->txt(
"confirm"));
2713 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
2715 $this->ctrl->saveParameter($this,
'test_express_mode');
2716 $this->ctrl->saveParameter($this,
'q_id');
2718 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
2719 $this->tpl->parseCurrentBlock();
2733 if (!is_array($checked_questions) && $checked_questions) {
2734 $checked_questions = array($checked_questions);
2736 if (count($checked_questions) > 0)
2738 $total = $this->
object->evalTotalPersons();
2746 if (count($checked_questions) == 1)
2754 elseif (count($checked_questions) == 0)
2756 ilUtil::sendInfo($this->lng->txt(
"tst_no_question_selected_for_removal"),
true);
2757 $this->ctrl->redirect($this,
"questions");
2766 $_SESSION[
'tst_qst_move_' . $this->
object->getTestId()] =
$_POST[
'q_id'];
2768 $this->ctrl->redirect($this,
'questions');
2777 $move_questions =
$_SESSION[
'tst_qst_move_' . $this->
object->getTestId()];
2779 if (count(
$_POST[
'q_id']) == 0)
2782 $this->ctrl->redirect($this,
'questions');
2784 if (count(
$_POST[
'q_id']) > 1)
2787 $this->ctrl->redirect($this,
'questions');
2790 $this->
object->moveQuestions(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()],
$_POST[
'q_id'][0], $insert_mode);
2792 unset(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()]);
2793 $this->ctrl->redirect($this,
"questions");
2802 $move_questions =
$_SESSION[
'tst_qst_move_' . $this->
object->getTestId()];
2803 if (count(
$_POST[
'q_id']) == 0)
2806 $this->ctrl->redirect($this,
'questions');
2808 if (count(
$_POST[
'q_id']) > 1)
2811 $this->ctrl->redirect($this,
'questions');
2814 $this->
object->moveQuestions(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()],
$_POST[
'q_id'][0], $insert_mode);
2816 unset(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()]);
2817 $this->ctrl->redirect($this,
"questions");
2827 $selected_array = (is_array(
$_POST[
'q_id'])) ?
$_POST[
'q_id'] : array();
2828 if (!count($selected_array))
2831 $this->ctrl->redirect($this,
"browseForQuestions");
2835 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
2836 $manscoring = FALSE;
2837 foreach ($selected_array as $key => $value)
2839 $this->
object->insertQuestion($value);
2845 $this->
object->saveCompleteStatus();
2854 $this->ctrl->redirect($this,
"questions");
2861 include_once
"./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
2863 $table_gui->writeFilterToSession();
2864 $this->ctrl->redirect($this,
"browseForQuestions");
2869 include_once
"./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
2871 $table_gui->resetFilter();
2872 $this->ctrl->redirect($this,
"browseForQuestions");
2884 $this->ctrl->setParameterByClass(get_class($this),
"browse",
"1");
2886 include_once
"./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
2887 $table_gui =
new ilTestQuestionBrowserTableGUI($this,
'browseForQuestions', (($ilAccess->checkAccess(
"write",
"", $this->ref_id) ?
true :
false)));
2888 $arrFilter = array();
2889 foreach ($table_gui->getFilterItems() as $item)
2891 if ($item->getValue() !==
false)
2893 $arrFilter[$item->getPostVar()] = $item->getValue();
2896 $data = $this->
object->getAvailableQuestions($arrFilter, 1);
2897 $table_gui->setData(
$data);
2898 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
2903 global $ilAccess, $ilTabs;
2905 $ilTabs->activateTab(
'assQuestions');
2907 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
2911 $this->ctrl->redirect($this,
"infoScreen");
2914 if (
$_GET[
'browse'])
2916 return $this->questionbrowser();
2920 if ($this->object->isRandomTest())
2928 ilUtil::redirect(
"ilias.php?baseClass=ilObjQuestionPoolGUI&ref_id=" .
$_GET[
"eqpl"] .
"&cmd=editQuestionForTest&calling_test=".
$_GET[
"ref_id"].
"&q_id=" .
$_GET[
"eqid"]);
2931 if (
$_GET[
"up"] > 0)
2933 $this->
object->questionMoveUp(
$_GET[
"up"]);
2935 if (
$_GET[
"down"] > 0)
2937 $this->
object->questionMoveDown(
$_GET[
"down"]);
2942 $selected_array = array();
2943 array_push($selected_array,
$_GET[
"add"]);
2944 $total = $this->
object->evalTotalPersons();
2954 $this->insertQuestions($selected_array);
2958 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_questions.html",
"Modules/Test");
2960 $total = $this->
object->evalTotalPersons();
2961 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
2965 $link = $this->ctrl->getLinkTarget($this,
"participants");
2966 $link =
"<a href=\"".$link.
"\">".$this->lng->txt(
"test_has_datasets_warning_page_view_link").
"</a>";
2967 ilUtil::sendInfo($this->lng->txt(
"test_has_datasets_warning_page_view").
" ".$link);
2973 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
2976 $qtypes[
$data[
'type_tag']] = $trans;
2978 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
2979 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
2980 $types =
new ilSelectInputGUI($this->lng->txt(
"create_new"),
"sel_question_types");
2983 $ilToolbar->addInputItem($types);
2984 $ilToolbar->addFormButton($this->lng->txt(
"test_create_question"),
"createQuestion");
2986 if ($this->object->getPoolUsage()) {
2987 $ilToolbar->addSeparator();
2988 $ilToolbar->addButton($this->lng->txt(
"tst_browse_for_questions"), $this->ctrl->getLinkTarget($this,
'browseForQuestions'));
2991 $ilToolbar->addSeparator();
2992 $ilToolbar->addButton($this->lng->txt(
"random_selection"), $this->ctrl->getLinkTarget($this,
"randomselect"));
2996 $this->tpl->setCurrentBlock(
"adm_content");
2997 include_once
"./Modules/Test/classes/tables/class.ilTestQuestionsTableGUI.php";
2998 $checked_move = is_array(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()]) && (count(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()]));
2999 $table_gui =
new ilTestQuestionsTableGUI($this,
'questions', (($ilAccess->checkAccess(
"write",
"", $this->ref_id) ?
true :
false)), $checked_move,
$total);
3000 $data = $this->
object->getTestQuestions();
3001 $table_gui->setData($data);
3002 $this->tpl->setVariable(
'QUESTIONBROWSER', $table_gui->getHTML());
3003 $this->tpl->setVariable(
"ACTION_QUESTION_FORM", $this->ctrl->getFormAction($this));
3004 $this->tpl->parseCurrentBlock();
3020 $this->
object->mark_schema->addMarkStep();
3033 $this->
object->mark_schema->flush();
3034 foreach (
$_POST as $key => $value) {
3035 if (preg_match(
"/mark_short_(\d+)/", $key, $matches))
3040 $this->
object->ects_grades[
"A"] =
$_POST[
"ects_grade_a"];
3041 $this->
object->ects_grades[
"B"] =
$_POST[
"ects_grade_b"];
3042 $this->
object->ects_grades[
"C"] =
$_POST[
"ects_grade_c"];
3043 $this->
object->ects_grades[
"D"] =
$_POST[
"ects_grade_d"];
3044 $this->
object->ects_grades[
"E"] =
$_POST[
"ects_grade_e"];
3047 $this->
object->ects_fx =
$_POST[
"percentFX"];
3051 $this->
object->ects_fx =
"";
3053 $this->
object->ects_output =
$_POST[
"chbECTS"];
3065 $this->
object->mark_schema->createSimpleSchema($this->lng->txt(
"failed_short"), $this->lng->txt(
"failed_official"), 0, 0, $this->lng->txt(
"passed_short"), $this->lng->txt(
"passed_official"), 50, 1);
3079 $delete_mark_steps = array();
3080 foreach (
$_POST as $key => $value) {
3081 if (preg_match(
"/cb_(\d+)/", $key, $matches)) {
3082 array_push($delete_mark_steps, $matches[1]);
3085 if (count($delete_mark_steps)) {
3086 $this->
object->mark_schema->deleteMarkSteps($delete_mark_steps);
3102 $this->ctrl->redirect($this,
"marks");
3117 $mark_check = $this->
object->checkMarks();
3121 $mark_check = $this->lng->txt(
'mark_schema_invalid');
3124 if ($mark_check !==
true)
3128 elseif (
$_POST[
"chbECTS"] && ((strcmp(
$_POST[
"ects_grade_a"],
"") == 0) or (strcmp(
$_POST[
"ects_grade_b"],
"") == 0) or (strcmp(
$_POST[
"ects_grade_c"],
"") == 0) or (strcmp(
$_POST[
"ects_grade_d"],
"") == 0) or (strcmp(
$_POST[
"ects_grade_e"],
"") == 0)))
3132 elseif ((
$_POST[
"ects_grade_a"] > 100) or (
$_POST[
"ects_grade_a"] < 0))
3136 elseif ((
$_POST[
"ects_grade_b"] > 100) or (
$_POST[
"ects_grade_b"] < 0))
3140 elseif ((
$_POST[
"ects_grade_c"] > 100) or (
$_POST[
"ects_grade_c"] < 0))
3144 elseif ((
$_POST[
"ects_grade_d"] > 100) or (
$_POST[
"ects_grade_d"] < 0))
3148 elseif ((
$_POST[
"ects_grade_e"] > 100) or (
$_POST[
"ects_grade_e"] < 0))
3154 $this->
object->mark_schema->saveToDb($this->object->getTestId());
3155 $this->
object->saveCompleteStatus();
3156 if ($this->object->getReportingDate())
3173 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
3177 $this->ctrl->redirect($this,
"infoScreen");
3180 if (!$this->object->canEditMarks())
3185 $this->
object->mark_schema->sort();
3187 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_marks.html",
"Modules/Test");
3188 $marks = $this->
object->mark_schema->mark_steps;
3189 $rows = array(
"tblrow1",
"tblrow2");
3191 foreach ($marks as $key => $value) {
3192 $this->tpl->setCurrentBlock(
"markrow");
3193 $this->tpl->setVariable(
"MARK_SHORT", $value->getShortName());
3194 $this->tpl->setVariable(
"MARK_OFFICIAL", $value->getOfficialName());
3195 $this->tpl->setVariable(
"MARK_PERCENTAGE", sprintf(
"%.2f", $value->getMinimumLevel()));
3196 $this->tpl->setVariable(
"MARK_PASSED", strtolower($this->lng->txt(
"tst_mark_passed")));
3197 $this->tpl->setVariable(
"MARK_ID",
"$key");
3198 $this->tpl->setVariable(
"ROW_CLASS", $rows[$counter % 2]);
3199 if ($value->getPassed()) {
3200 $this->tpl->setVariable(
"MARK_PASSED_CHECKED",
" checked=\"checked\"");
3202 $this->tpl->parseCurrentBlock();
3205 if (count($marks) == 0)
3207 $this->tpl->setCurrentBlock(
"Emptyrow");
3208 $this->tpl->setVariable(
"EMPTY_ROW", $this->lng->txt(
"tst_no_marks_defined"));
3209 $this->tpl->setVariable(
"ROW_CLASS", $rows[$counter % 2]);
3210 $this->tpl->parseCurrentBlock();
3214 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) && $this->
object->canEditMarks())
3216 $this->tpl->setCurrentBlock(
"selectall");
3218 $this->tpl->setVariable(
"ROW_CLASS", $rows[$counter % 2]);
3219 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
3220 $this->tpl->parseCurrentBlock();
3221 $this->tpl->setCurrentBlock(
"Footer");
3222 $this->tpl->setVariable(
"ARROW",
"<img src=\"" .
ilUtil::getImagePath(
"arrow_downright.gif") .
"\" alt=\"".$this->lng->txt(
"arrow_downright").
"\"/>");
3223 $this->tpl->setVariable(
"BUTTON_EDIT", $this->lng->txt(
"edit"));
3224 $this->tpl->setVariable(
"BUTTON_DELETE", $this->lng->txt(
"delete"));
3225 $this->tpl->parseCurrentBlock();
3229 if ($this->object->getReportingDate())
3231 $this->tpl->setCurrentBlock(
"ects");
3232 if ($this->object->ects_output)
3234 $this->tpl->setVariable(
"CHECKED_ECTS",
" checked=\"checked\"");
3236 $this->tpl->setVariable(
"TEXT_OUTPUT_ECTS_GRADES", $this->lng->txt(
"ects_output_of_ects_grades"));
3237 $this->tpl->setVariable(
"TEXT_ALLOW_ECTS_GRADES", $this->lng->txt(
"ects_allow_ects_grades"));
3238 $this->tpl->setVariable(
"TEXT_USE_FX", $this->lng->txt(
"ects_use_fx_grade"));
3239 if (preg_match(
"/\d+/", $this->object->ects_fx))
3241 $this->tpl->setVariable(
"CHECKED_FX",
" checked=\"checked\"");
3242 $this->tpl->setVariable(
"VALUE_PERCENT_FX", sprintf(
"value=\"%s\" ", $this->object->ects_fx));
3244 $this->tpl->setVariable(
"TEXT_PERCENT", $this->lng->txt(
"ects_use_fx_grade_part2"));
3245 $this->tpl->setVariable(
"ECTS_GRADE", $this->lng->txt(
"ects_grade"));
3246 $this->tpl->setVariable(
"PERCENTILE", $this->lng->txt(
"percentile"));
3247 $this->tpl->setVariable(
"ECTS_GRADE_A",
"A - " . $this->lng->txt(
"ects_grade_a_short"));
3248 $this->tpl->setVariable(
"VALUE_GRADE_A", $this->object->ects_grades[
"A"]);
3249 $this->tpl->setVariable(
"ECTS_GRADE_B",
"B - " . $this->lng->txt(
"ects_grade_b_short"));
3250 $this->tpl->setVariable(
"VALUE_GRADE_B", $this->object->ects_grades[
"B"]);
3251 $this->tpl->setVariable(
"ECTS_GRADE_C",
"C - " . $this->lng->txt(
"ects_grade_c_short"));
3252 $this->tpl->setVariable(
"VALUE_GRADE_C", $this->object->ects_grades[
"C"]);
3253 $this->tpl->setVariable(
"ECTS_GRADE_D",
"D - " . $this->lng->txt(
"ects_grade_d_short"));
3254 $this->tpl->setVariable(
"VALUE_GRADE_D", $this->object->ects_grades[
"D"]);
3255 $this->tpl->setVariable(
"ECTS_GRADE_E",
"E - " . $this->lng->txt(
"ects_grade_e_short"));
3256 $this->tpl->setVariable(
"VALUE_GRADE_E", $this->object->ects_grades[
"E"]);
3258 $this->tpl->parseCurrentBlock();
3261 $this->tpl->setCurrentBlock(
"adm_content");
3262 $this->tpl->setVariable(
"ACTION_MARKS", $this->ctrl->getFormAction($this));
3263 $this->tpl->setVariable(
"HEADER_SHORT", $this->lng->txt(
"tst_mark_short_form"));
3264 $this->tpl->setVariable(
"HEADER_OFFICIAL", $this->lng->txt(
"tst_mark_official_form"));
3265 $this->tpl->setVariable(
"HEADER_PERCENTAGE", $this->lng->txt(
"tst_mark_minimum_level"));
3266 $this->tpl->setVariable(
"HEADER_PASSED", $this->lng->txt(
"tst_mark_passed"));
3267 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) && $this->
object->canEditMarks())
3269 $this->tpl->setVariable(
"BUTTON_NEW", $this->lng->txt(
"tst_mark_create_new_mark_step"));
3270 $this->tpl->setVariable(
"BUTTON_NEW_SIMPLE", $this->lng->txt(
"tst_mark_create_simple_mark_schema"));
3271 $this->tpl->setVariable(
"SAVE", $this->lng->txt(
"save"));
3272 $this->tpl->setVariable(
"CANCEL", $this->lng->txt(
"cancel"));
3274 $this->tpl->parseCurrentBlock();
3286 $this->
object->removeAllTestEditings();
3289 include_once
'./Services/Tracking/classes/class.ilLPStatusWrapper.php';
3293 $this->ctrl->redirect($this,
"participants");
3305 $active_ids = array();
3306 foreach (
$_POST[
"chbUser"] as $active_id)
3308 if ($this->object->getFixedParticipants())
3310 array_push($active_ids, $this->object->getActiveIdOfUser($active_id));
3314 array_push($active_ids, $active_id);
3317 $this->
object->removeSelectedTestResults($active_ids);
3320 include_once
'./Services/Tracking/classes/class.ilLPStatusWrapper.php';
3324 $this->ctrl->redirect($this,
"participants");
3336 $this->ctrl->redirect($this,
"participants");
3349 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_maintenance.html",
"Modules/Test");
3351 $this->tpl->setCurrentBlock(
"confirm_delete");
3352 $this->tpl->setVariable(
"BTN_CONFIRM_DELETE_ALL", $this->lng->txt(
"confirm"));
3353 $this->tpl->setVariable(
"BTN_CANCEL_DELETE_ALL", $this->lng->txt(
"cancel"));
3354 $this->tpl->parseCurrentBlock();
3356 $this->tpl->setCurrentBlock(
"adm_content");
3357 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
3358 $this->tpl->parseCurrentBlock();
3367 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html",
"Modules/Test");
3368 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"participants"));
3371 $buttons = array(
"confirmDeleteAllUserResults" => $this->lng->txt(
"proceed"),
3372 "participants" => $this->lng->txt(
"cancel"));
3373 foreach ($buttons as $name => $value)
3375 $this->tpl->setCurrentBlock(
"operation_btn");
3376 $this->tpl->setVariable(
"BTN_NAME",$name);
3377 $this->tpl->setVariable(
"BTN_VALUE",$value);
3378 $this->tpl->parseCurrentBlock();
3391 if (count(
$_POST[
"chbUser"]) == 0)
3394 $this->ctrl->redirect($this,
"participants");
3397 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_maintenance.html",
"Modules/Test");
3399 foreach (
$_POST[
"chbUser"] as $key => $value)
3401 $this->tpl->setCurrentBlock(
"hidden");
3402 $this->tpl->setVariable(
"USER_ID", $value);
3403 $this->tpl->parseCurrentBlock();
3406 include_once
'./Services/User/classes/class.ilObjUser.php';
3407 $color_class = array(
"tblrow1",
"tblrow2");
3409 foreach (
$_POST[
"chbUser"] as $key => $active_id)
3411 if ($this->object->getFixedParticipants())
3413 $user_id = $active_id;
3417 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
3420 $this->tpl->setCurrentBlock(
"row");
3422 $this->tpl->setVariable(
"USER_ALT", $this->lng->txt(
"usr"));
3423 $this->tpl->setVariable(
"USER_TITLE", $this->lng->txt(
"usr"));
3424 if ($this->object->getAnonymity())
3426 $this->tpl->setVariable(
"TXT_FIRSTNAME",
"");
3427 $this->tpl->setVariable(
"TXT_LASTNAME", $this->lng->txt(
"unknown"));
3428 $this->tpl->setVariable(
"TXT_LOGIN",
"");
3432 $this->tpl->setVariable(
"TXT_FIRSTNAME", $user[
"firstname"]);
3433 if (strlen($user[
"lastname"]))
3435 $this->tpl->setVariable(
"TXT_LASTNAME", $user[
"lastname"]);
3439 $this->tpl->setVariable(
"TXT_LASTNAME", $this->lng->txt(
"deleted_user"));
3443 $this->tpl->setVariable(
"ROW_CLASS", $color_class[$counter % 2]);
3444 $this->tpl->parseCurrentBlock();
3447 $this->tpl->setCurrentBlock(
"selectedusers");
3448 $this->tpl->setVariable(
"HEADER_TXT_FIRSTNAME", $this->lng->txt(
"firstname"));
3449 $this->tpl->setVariable(
"HEADER_TXT_LASTNAME", $this->lng->txt(
"lastname"));
3450 $this->tpl->setVariable(
"HEADER_TXT_LOGIN", $this->lng->txt(
"login"));
3451 $this->tpl->setVariable(
"BTN_CONFIRM_DELETE_SELECTED", $this->lng->txt(
"confirm"));
3452 $this->tpl->setVariable(
"BTN_CANCEL_DELETE_SELECTED", $this->lng->txt(
"cancel"));
3453 $this->tpl->parseCurrentBlock();
3455 $this->tpl->setCurrentBlock(
"adm_content");
3456 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
3457 $this->tpl->parseCurrentBlock();
3469 include_once
"./Modules/Test/classes/tables/class.ilTestHistoryTableGUI.php";
3471 $table_gui->setTestObject($this->
object);
3472 include_once
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
3474 $table_gui->setData(
$log);
3475 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
3480 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
3482 $form->setTarget(
"_top");
3483 $form->setFormAction($this->ctrl->getFormAction($this));
3484 $form->setTitle($this->lng->txt(
"import_tst"));
3487 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
3488 $fi =
new ilFileInputGUI($this->lng->txt(
"import_file"),
"xmldoc");
3490 $fi->setRequired(
true);
3491 $form->addItem($fi);
3494 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
3496 $questionpools = $tst->getAvailableQuestionpools(TRUE, FALSE, TRUE, TRUE);
3497 if (count($questionpools))
3499 $options = array(
"-1" => $this->lng->txt(
"dont_use_questionpool"));
3500 foreach ($questionpools as $key => $value)
3502 $options[$key] = $value[
"title"];
3505 $pool =
new ilSelectInputGUI($this->lng->txt(
"select_questionpool"),
"qpl");
3507 $form->addItem($pool);
3510 $form->addCommandButton(
"importFile", $this->lng->txt(
"import"));
3511 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
3527 if (method_exists($this, $method))
3533 $this->ctrl->redirect($this,
"participants");
3543 global $ilAccess, $ilToolbar,
$lng;
3545 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
3549 $this->ctrl->redirect($this,
"infoScreen");
3552 if ($this->object->getFixedParticipants())
3555 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
3560 'auto_complete_name' => $lng->txt(
'user'),
3561 'submit_name' => $lng->txt(
'add')
3566 $ilToolbar->addButton($this->lng->txt(
"tst_search_users"),
3567 $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start'));
3570 $participants =& $this->
object->getInvitedUsers();
3572 foreach ($participants as
$data)
3574 $maxpass = $this->
object->_getMaxPass($data[
"active_id"]);
3575 if (!is_null($maxpass))
3580 if (strlen($data[
"active_id"]))
3582 $last_access = $this->
object->_getLastAccess($data[
"active_id"]);
3583 $access = $last_access;
3585 $this->ctrl->setParameterByClass(
'iltestevaluationgui',
'active_id', $data[
'active_id']);
3587 if ($data[
'active_id'] == null)
3589 if ( strlen($data[
"firstname"].$data[
"lastname"]) == 0 )
3591 $fullname = $lng->txt(
"deleted_user");
3595 $fullname = trim($data[
"lastname"] .
", " . $data[
"firstname"] .
" " . $data[
"title"]);
3598 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
3602 array_push($rows, array(
3603 'usr_id' => $data[
"usr_id"],
3604 'active_id' => $data[
'active_id'],
3605 'login' => $data[
"login"],
3606 'clientip' => $data[
"clientip"],
3607 'firstname' => $data[
"firstname"],
3608 'lastname' => $data[
"lastname"],
3609 'name' => $fullname,
3610 'started' => ($data[
"active_id"] > 0) ? 1 : 0,
3611 'finished' => ($data[
"test_finished"] == 1) ? 1 : 0,
3612 'access' => $access,
3613 'maxpass' => $maxpass,
3614 'result' => $this->ctrl->getLinkTargetByClass(
'iltestevaluationgui',
'outParticipantsResultsOverview')
3617 include_once
"./Modules/Test/classes/tables/class.ilTestFixedParticipantsTableGUI.php";
3620 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
3624 $participants =& $this->
object->getTestParticipants();
3626 foreach ($participants as
$data)
3628 $maxpass = $this->
object->_getMaxPass($data[
"active_id"]);
3629 if (!is_null($maxpass))
3634 if (strlen($data[
"active_id"]))
3636 $last_access = $this->
object->_getLastAccess($data[
"active_id"]);
3637 $access = $last_access;
3639 $this->ctrl->setParameterByClass(
'iltestevaluationgui',
'active_id', $data[
'active_id']);
3640 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
3642 array_push($rows, array(
3643 'usr_id' => $data[
"active_id"],
3644 'active_id' => $data[
'active_id'],
3645 'login' => $data[
"login"],
3646 'name' => $fullname,
3647 'firstname' => $data[
"firstname"],
3648 'lastname' => $data[
"lastname"],
3649 'started' => ($data[
"active_id"] > 0) ? 1 : 0,
3650 'finished' => ($data[
"test_finished"] == 1) ? 1 : 0,
3651 'access' => $access,
3652 'maxpass' => $maxpass,
3653 'result' => $this->ctrl->getLinkTargetByClass(
'iltestevaluationgui',
'outParticipantsResultsOverview')
3656 include_once
"./Modules/Test/classes/tables/class.ilTestParticipantsTableGUI.php";
3659 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
3674 $this->
showUserResults($show_pass_details = TRUE, $show_answers = TRUE, $show_reached_points = TRUE);
3688 $this->
showUserResults($show_pass_details = FALSE, $show_answers = TRUE);
3702 $this->
showUserResults($show_pass_details = TRUE, $show_answers = FALSE);
3712 $template =
new ilTemplate(
"tpl.il_as_tst_participants_result_output.html", TRUE, TRUE,
"Modules/Test");
3714 if (count(
$_SESSION[
"show_user_results"]) == 0)
3717 $this->ctrl->redirect($this,
"participants");
3720 include_once
"./Modules/Test/classes/class.ilTestServiceGUI.php";
3723 foreach (
$_SESSION[
"show_user_results"] as $key => $active_id)
3727 if ($this->object->getFixedParticipants())
3729 $active_id = $this->
object->getActiveIdOfUser($active_id);
3733 $results = $serviceGUI->getResultsOfUserOutput($active_id, $this->object->_getResultPass($active_id), $show_pass_details, $show_answers, FALSE, $show_reached_points);
3735 if ($count < count(
$_SESSION[
"show_user_results"]))
3737 $template->touchBlock(
"break");
3739 $template->setCurrentBlock(
"user_result");
3740 $template->setVariable(
"USER_RESULT",
$results);
3741 $template->parseCurrentBlock();
3743 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"back"));
3744 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"participants"));
3745 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
3746 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
3748 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
3750 if ($this->object->getShowSolutionAnswersOnly())
3758 if (is_array(
$_POST[
"chbUser"]))
3760 foreach (
$_POST[
"chbUser"] as $user_id)
3762 $this->
object->disinviteUser($user_id);
3769 $this->ctrl->redirect($this,
"participants");
3774 if (is_array(
$_POST[
"chbUser"]))
3776 foreach (
$_POST[
"chbUser"] as $user_id)
3778 $this->
object->setClientIP($user_id,
$_POST[
"clientip_".$user_id]);
3785 $this->ctrl->redirect($this,
"participants");
3797 global $ilAccess,
$ilias;
3798 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
3802 $this->ctrl->redirect($this,
"infoScreen");
3805 $template =
new ilTemplate(
"tpl.il_as_tst_print_test_confirm.html", TRUE, TRUE,
"Modules/Test");
3807 include_once
'./Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
3810 $this->ctrl->setParameter($this,
"pdf",
"1");
3811 $template->setCurrentBlock(
"pdf_export");
3812 $template->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this,
"print"));
3813 $this->ctrl->setParameter($this,
"pdf",
"");
3814 $template->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
3815 $template->setVariable(
"PDF_IMG_ALT", $this->lng->txt(
"pdf_export"));
3817 $template->parseCurrentBlock();
3823 $print_date = mktime(date(
"H"), date(
"i"), date(
"s"), date(
"m") , date(
"d"), date(
"Y"));
3827 foreach ($this->object->questions as $question)
3829 $template->setCurrentBlock(
"question");
3830 $question_gui = $this->
object->createQuestionGUI(
"", $question);
3831 $template->setVariable(
"COUNTER_QUESTION", $counter.
".");
3833 if ($question_gui->object->getMaximumPoints() == 1)
3835 $template->setVariable(
"QUESTION_POINTS", $question_gui->object->getMaximumPoints() .
" " . $this->lng->txt(
"point"));
3839 $template->setVariable(
"QUESTION_POINTS", $question_gui->object->getMaximumPoints() .
" " . $this->lng->txt(
"points"));
3841 $result_output = $question_gui->getSolutionOutput(
"", NULL, FALSE, TRUE, FALSE, $this->object->getShowSolutionFeedback());
3842 if (strlen($result_output) == 0) $result_output = $question_gui->getPreview(FALSE);
3843 $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
3844 $template->parseCurrentBlock(
"question");
3846 $max_points += $question_gui->object->getMaximumPoints();
3849 $template->setCurrentBlock(
"navigation_buttons");
3850 $template->setVariable(
"BUTTON_PRINT", $this->lng->txt(
"print"));
3851 $template->parseCurrentBlock();
3860 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1))
3862 $this->
object->deliverPDFfromHTML($template->get(), $this->
object->getTitle());
3866 $this->tpl->setVariable(
"PRINT_CONTENT", $template->get());
3874 if (is_array($a_user_ids))
3877 foreach ($a_user_ids as $user_id)
3879 $client_ip =
$_POST[
"client_ip"][$i];
3880 $this->
object->inviteUser($user_id, $client_ip);
3888 $message = $this->lng->txt(
"tst_invited_selected_users");
3890 if (strlen($message))
3900 $this->ctrl->redirect($this,
"participants");
3913 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
3917 $this->ctrl->redirect($this,
"infoScreen");
3920 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_defaults.html",
"Modules/Test");
3922 $maxentries = $ilUser->getPref(
"hits_per_page");
3923 if ($maxentries < 1)
3928 $offset =
$_GET[
"offset"] ?
$_GET[
"offset"] : 0;
3929 $sortby =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"name";
3930 $sortorder =
$_GET[
"sort_order"] ?
$_GET[
"sort_order"] :
"asc";
3932 $defaults =& $this->
object->getAvailableDefaults($sortby, $sortorder);
3933 if (count($defaults) > 0)
3935 $tablerows = array();
3936 foreach ($defaults as
$row)
3938 array_push($tablerows, array(
"checkbox" =>
"<input type=\"checkbox\" name=\"chb_defaults[]\" value=\"" . $row[
"test_defaults_id"] .
"\"/>",
"name" => $row[
"name"]));
3940 $headervars = array(
"",
"name");
3942 include_once
"./Services/Table/classes/class.ilTableGUI.php";
3944 $tbl->setTitle($this->lng->txt(
"tst_defaults_available"));
3945 $header_names = array(
3947 $this->lng->txt(
"title")
3949 $tbl->setHeaderNames($header_names);
3951 $tbl->disable(
"sort");
3952 $tbl->disable(
"auto_sort");
3953 $tbl->enable(
"title");
3954 $tbl->enable(
"action");
3955 $tbl->enable(
"select_all");
3956 $tbl->setLimit($maxentries);
3957 $tbl->setOffset($offset);
3958 $tbl->setData($tablerows);
3959 $tbl->setMaxCount(count($tablerows));
3960 $tbl->setOrderDirection($sortorder);
3961 $tbl->setSelectAllCheckbox(
"chb_defaults");
3962 $tbl->setFormName(
"formDefaults");
3963 $tbl->addActionButton(
"deleteDefaults", $this->lng->txt(
"delete"));
3964 $tbl->addActionButton(
"applyDefaults", $this->lng->txt(
"apply"));
3966 $header_params = $this->ctrl->getParameterArray($this,
"defaults");
3967 $tbl->setHeaderVars($headervars, $header_params);
3970 $tbl->setFooter(
"tblfooter", $this->lng->txt(
"previous"), $this->lng->txt(
"next"));
3972 $tableoutput = $tbl->render();
3973 $this->tpl->setVariable(
"TEST_DEFAULTS_TABLE", $tableoutput);
3977 $this->tpl->setVariable(
"TEST_DEFAULTS_TABLE", $this->lng->txt(
"tst_defaults_not_defined"));
3979 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"addDefaults"));
3980 $this->tpl->setVariable(
"BUTTON_ADD", $this->lng->txt(
"add"));
3981 $this->tpl->setVariable(
"TEXT_DEFAULTS_OF_TEST", $this->lng->txt(
"tst_defaults_defaults_of_test"));
3989 if (count(
$_POST[
"chb_defaults"]))
3991 foreach (
$_POST[
"chb_defaults"] as $test_default_id)
3993 $this->
object->deleteDefaults($test_default_id);
4004 if (count(
$_POST[
"chb_defaults"]) == 1)
4006 foreach (
$_POST[
"chb_defaults"] as $test_default_id)
4008 $result = $this->
object->applyDefaults($test_default_id);
4031 if (strlen(
$_POST[
"name"]) > 0)
4033 $this->
object->addDefaults(
$_POST[
'name']);
4049 $this->ctrl->setCmd(
"showSummary");
4050 $this->ctrl->setCmdClass(
"ilinfoscreengui");
4056 $this->ctrl->setCmd(
"showSummary");
4057 $this->ctrl->setCmdClass(
"ilinfoscreengui");
4070 if (
$_GET[
'crs_show_result'])
4072 $this->
object->hideCorrectAnsweredQuestions();
4076 if ($this->object->getTestSequence()->hasHiddenQuestions())
4078 $this->
object->getTestSequence()->clearHiddenQuestions();
4079 $this->
object->getTestSequence()->saveToDb();
4083 if (
$_GET[
'createRandomSolutions'])
4085 $this->
object->createRandomSolutions(
$_GET[
'createRandomSolutions']);
4088 if (!$ilAccess->checkAccess(
"visible",
"", $this->ref_id))
4090 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
4093 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
4096 $seq = $this->
object->getTestSession()->getLastSequence();
4098 include_once
"./Modules/Test/classes/class.ilTestOutputGUI.php";
4100 $this->ctrl->setParameter($output_gui,
"sequence", $seq);
4101 $info->setFormAction($this->ctrl->getFormAction($output_gui));
4102 if (strlen($session_lock))
4104 $info->addHiddenElement(
"lock", $session_lock);
4108 $info->addHiddenElement(
"lock", md5(
$_COOKIE[
'PHPSESSID'] . time()));
4110 $online_access =
false;
4111 if ($this->object->getFixedParticipants())
4113 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
4115 if ($online_access_result ===
true)
4117 $online_access =
true;
4124 if( $this->object->isOnline() && $this->
object->isComplete() )
4126 if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess(
"read",
"", $this->ref_id))
4128 $executable = $this->
object->isExecutable($ilUser->getId(), $allowPassIncrease = TRUE);
4129 if ($executable[
"executable"])
4131 if ($this->object->getTestSession()->getActiveId() > 0)
4134 $resume_text = $this->lng->txt(
"tst_resume_test");
4135 if (($seq < 1) || ($seq == $this->object->getTestSequence()->getFirstSequence()))
4137 $resume_text = $this->
object->getStartTestLabel($this->object->getTestSession()->getActiveId());
4140 #if(!$_GET['crs_show_result'] or $this->object->getTestSequence()->getFirstSequence())
4143 $big_button[] = array(
'resume', $resume_text);
4150 $big_button[] = array(
"start", $this->object->getStartTestLabel($this->object->getTestSession()->getActiveId()));
4157 if ($this->object->getTestSession()->getActiveId() > 0)
4160 if ($this->object->canShowTestResults($ilUser->getId()))
4163 $big_button[] = array(
"outUserResultsOverview", $this->lng->txt(
"tst_show_results"));
4167 if ($this->object->getTestSession()->getActiveId() > 0)
4169 if ($this->object->canShowSolutionPrintview($ilUser->getId()))
4172 $big_button[] = array(
"outUserListOfAnswerPasses", $this->lng->txt(
"tst_list_of_answers_show"));
4177 if( !$this->object->isOnline() )
4179 $message = $this->lng->txt(
"test_is_offline");
4181 if($ilAccess->checkAccess(
"write",
"", $this->ref_id))
4183 $message .=
"<br /><a href=\"".$this->ctrl->getLinkTarget($this,
"properties").
"\">".
4184 $this->lng->txt(
"test_edit_settings").
"</a>";
4190 if ($this->object->getShowInfo())
4192 $info->enablePrivateNotes();
4203 $out =
'<div class="il_ButtonGroup" style="margin:25px; text-align:center; font-size:25px;">';
4204 foreach($big_button as $button) {
4205 $out .=
'<input type="submit" class="submit" name="cmd['.$button[0].
']" value="'.
4206 $button[1].
'" style="padding:10px;" />';
4212 if (strlen($this->object->getIntroduction()))
4214 $introduction = $this->
object->getIntroduction();
4215 $info->addSection($this->lng->txt(
"tst_introduction"));
4216 $info->addProperty(
"", $this->object->prepareTextareaOutput($this->object->getIntroduction()).
4217 $big_button.
"<br />".$info->getHiddenToggleButton());
4221 $info->addSection(
"");
4222 $info->addProperty(
"", $big_button.$info->getHiddenToggleButton());
4225 $info->hideFurtherSections(
false);
4227 $info->addSection($this->lng->txt(
"tst_general_properties"));
4228 if ($this->object->getShowInfo())
4230 $info->addProperty($this->lng->txt(
"author"), $this->
object->getAuthor());
4231 $info->addProperty($this->lng->txt(
"title"), $this->
object->getTitle());
4233 if( $this->object->isOnline() && $this->
object->isComplete() )
4235 if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess(
"read",
"", $this->ref_id))
4237 if ($this->object->getShowInfo() || !$this->
object->getForceJS())
4240 $checked_javascript =
false;
4241 if ($this->object->getJavaScriptOutput())
4243 $checked_javascript =
true;
4245 if ($this->object->getForceJS())
4247 $info->addProperty($this->lng->txt(
"tst_test_output"), $this->lng->txt(
"tst_use_javascript"));
4251 $info->addPropertyCheckbox($this->lng->txt(
"tst_test_output"),
"chb_javascript", 1, $this->lng->txt(
"tst_use_javascript"), $checked_javascript);
4255 if( !$this->object->isRandomTest() )
4257 if ($this->object->getNrOfTries() != 1)
4259 if ($this->object->getUsePreviousAnswers() == 0)
4261 if ($this->object->getShowInfo())
4263 $info->addProperty($this->lng->txt(
"tst_use_previous_answers"), $this->lng->txt(
"tst_dont_use_previous_answers"));
4268 $use_previous_answers = FALSE;
4269 if ($ilUser->prefs[
"tst_use_previous_answers"])
4271 $checked_previous_answers = TRUE;
4273 $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);
4277 if (
$_SESSION[
"AccountId"] == ANONYMOUS_USER_ID)
4279 $info->addPropertyTextinput($this->lng->txt(
"enter_anonymous_code"),
"anonymous_id",
"", 8,
"setAnonymousId", $this->lng->txt(
"submit"));
4284 if ($this->object->getShowInfo())
4286 $info->addSection($this->lng->txt(
"tst_sequence_properties"));
4287 $info->addProperty($this->lng->txt(
"tst_sequence"), $this->lng->txt(($this->object->getSequenceSettings() ==
TEST_FIXED_SEQUENCE)?
"tst_sequence_fixed":
"tst_sequence_postpone"));
4289 $info->addSection($this->lng->txt(
"tst_heading_scoring"));
4290 $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"));
4291 $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"));
4292 if ($this->object->isRandomTest())
4294 $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"));
4297 $info->addSection($this->lng->txt(
"tst_score_reporting"));
4298 $score_reporting_text =
"";
4299 switch ($this->object->getScoreReporting())
4302 $score_reporting_text = $this->lng->txt(
"tst_report_after_test");
4305 $score_reporting_text = $this->lng->txt(
"tst_report_after_first_question");
4308 $score_reporting_text = $this->lng->txt(
"tst_report_after_date");
4311 $score_reporting_text = $this->lng->txt(
"tst_report_never");
4314 $info->addProperty($this->lng->txt(
"tst_score_reporting"), $score_reporting_text);
4315 $reporting_date = $this->
object->getReportingDate();
4316 if ($reporting_date)
4318 #preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $reporting_date, $matches);
4319 #$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]));
4320 #$info->addProperty($this->lng->txt("tst_score_reporting_date"), $txt_reporting_date);
4321 $info->addProperty($this->lng->txt(
'tst_score_reporting_date'),
4325 $info->addSection($this->lng->txt(
"tst_session_settings"));
4326 $info->addProperty($this->lng->txt(
"tst_nr_of_tries"), ($this->
object->getNrOfTries() == 0)?$this->lng->txt(
"unlimited"):$this->
object->getNrOfTries());
4327 if ($this->object->getNrOfTries() != 1)
4329 $info->addProperty($this->lng->txt(
"tst_nr_of_tries_of_user"), ($this->
object->getTestSession()->getPass() ==
false)?$this->lng->txt(
"tst_no_tries"):$this->
object->getTestSession()->getPass());
4332 if ($this->object->getEnableProcessingTime())
4334 $info->addProperty($this->lng->txt(
"tst_processing_time"), $this->
object->getProcessingTime());
4336 if (strlen($this->object->getAllowedUsers()) && ($this->object->getAllowedUsersTimeGap()))
4338 $info->addProperty($this->lng->txt(
"tst_allowed_users"), $this->
object->getAllowedUsers());
4341 $starting_time = $this->
object->getStartingTime();
4344 $info->addProperty($this->lng->txt(
"tst_starting_time"),
4347 $ending_time = $this->
object->getEndingTime();
4350 $info->addProperty($this->lng->txt(
"tst_ending_time"),
4353 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
4356 if(
$_GET[
'crs_show_result'] and !$this->object->getTestSequence()->getFirstSequence())
4358 #ilUtil::sendInfo($this->lng->txt('crs_all_questions_answered_successfully'));
4362 $this->ctrl->forwardCommand($info);
4368 switch ($this->ctrl->getCmd())
4372 case "redirectToInfoScreen":
4379 case "outCorrectSolution":
4381 case "showAnswersOfUser":
4382 case "outUserResultsOverview":
4383 case "backFromSummary":
4384 case "show_answers":
4387 case "outTestSummary":
4388 case "outQuestionSummary":
4389 case "gotoQuestion":
4390 case "selectImagemapRegion":
4391 case "confirmSubmitAnswers":
4392 case "finalSubmission":
4394 case "redirectQuestion":
4395 case "outUserPassDetails":
4396 case "checkPassword":
4397 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
4400 case "evalAllUsers":
4401 case "evalUserDetail":
4402 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"eval_stat"),
"",
$_GET[
"ref_id"]);
4409 case "importVerifiedFile":
4410 case "cancelImport":
4413 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"",
$_GET[
"ref_id"]);
4421 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
4423 $this->ctrl->saveParameterByClass($this->ctrl->getCmdClass(),
'q_id');
4425 $tabs_gui->setBackTarget($this->lng->txt(
"backtocallingtest"), $this->ctrl->getLinkTargetByClass($this->ctrl->getCmdClass(),
"questions"));
4426 $tabs_gui->addTarget(
"tst_browse_for_questions",
4427 $this->ctrl->getLinkTarget($this,
"browseForQuestions"),
4428 array(
"browseForQuestions",
"filter",
"resetFilter",
"resetTextFilter",
"insertQuestions"),
4437 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
4440 $tabs_gui->setBackTarget($this->lng->txt(
"backtocallingtest"), $this->ctrl->getLinkTarget($this,
"questions"));
4441 $tabs_gui->addTarget(
"random_selection",
4442 $this->ctrl->getLinkTarget($this,
"randomQuestions"),
4443 array(
"randomQuestions"),
4458 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
4459 include_once
"./Modules/Test/classes/class.ilTestCertificateAdapter.php";
4461 $output_gui->certificateEditor();
4467 $ilTabs->activateTab(
'assQuestions');
4468 $a_cmd = $ilCtrl->getCmd();
4470 if (!$this->object->isRandomTest())
4472 #if (in_array($this->object->getEnabledViewMode(), array('both', 'express'))) {
4473 $questions_per_page = ($a_cmd ==
'questions_per_page' || ($a_cmd ==
'removeQuestions' &&
$_REQUEST[
'test_express_mode'])) ?
true :
false;
4475 $this->tabs_gui->addSubTabTarget(
4476 "questions_per_page_view",
4477 $this->ctrl->getLinkTargetByClass(
'iltestexpresspageobjectgui',
'showPage'),
4478 "",
"",
"", $questions_per_page);
4481 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
4484 if (!in_array(
'questions', $template->getHiddenTabs())) {
4486 $ilTabs->addSubTabTarget(
"edit_test_questions",
4487 $this->ctrl->getLinkTarget($this,
'questions'),
4488 array(
"questions",
"browseForQuestions",
"questionBrowser",
"createQuestion",
4489 "randomselect",
"filter",
"resetFilter",
"insertQuestions",
4490 "back",
"createRandomSelection",
"cancelRandomSelect",
4491 "insertRandomSelection",
"removeQuestions",
"moveQuestions",
4492 "insertQuestionsBefore",
"insertQuestionsAfter",
"confirmRemoveQuestions",
4493 "cancelRemoveQuestions",
"executeCreateQuestion",
"cancelCreateQuestion",
4494 "addQuestionpool",
"saveRandomQuestions",
"saveQuestionSelectionMode"),
4497 if (in_array($a_cmd, array(
'questions',
'createQuestion')) || ($a_cmd ==
'removeQuestions' && !
$_REQUEST[
'test_express_mode']))
4498 $this->tabs_gui->activateSubTab(
'edit_test_questions');
4503 if (!$this->object->isRandomTest())
4505 $ilTabs->addSubTabTarget(
"print_view",
4506 $this->ctrl->getLinkTarget($this,
'print'),
4507 "print",
"",
"", $this->ctrl->getCmd() ==
'print');
4517 $ilTabs->addSubTabTarget(
"eval_all_users",
4518 $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"outEvaluation"),
4519 array(
"outEvaluation",
"detailedEvaluation",
"exportEvaluation",
"evalUserDetail",
"passDetails",
4520 "outStatisticsResultsOverview",
"statisticsPassDetails")
4524 $ilTabs->addSubTabTarget(
"tst_results_aggregated",
4525 $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"eval_a"),
4530 $ilTabs->addSubTabTarget(
"tst_single_results",
4531 $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"singleResults"),
4532 array(
"singleResults"),
4541 $force_active = ($this->ctrl->getCmd() ==
"")
4544 $ilTabs->addSubTabTarget(
"general",
4545 $this->ctrl->getLinkTarget($this,
'properties'),
4546 array(
"properties",
"saveProperties",
"cancelProperties"),
4547 array(
"",
"ilobjtestgui",
"ilcertificategui"),
4550 if (!in_array(
'mark_schema', $hiddenTabs)) {
4552 $ilTabs->addSubTabTarget(
4554 $this->ctrl->getLinkTarget($this,
'marks'),
4555 array(
"marks",
"addMarkStep",
"deleteMarkSteps",
"addSimpleMarkSchema",
4556 "saveMarks",
"cancelMarks"),
4557 array(
"",
"ilobjtestgui",
"ilcertificategui")
4562 $ilTabs->addSubTabTarget(
4564 $this->ctrl->getLinkTarget($this,
'scoring'),
4566 array(
"",
"ilobjtestgui",
"ilcertificategui")
4569 include_once
'./Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
4573 $ilTabs->addSubTabTarget(
4575 $this->ctrl->getLinkTarget($this,
'certificate'),
4576 array(
"certificate",
"certificateEditor",
"certificateRemoveBackground",
"certificateSave",
4577 "certificatePreview",
"certificateDelete",
"certificateUpload",
"certificateImport"),
4578 array(
"",
"ilobjtestgui",
"ilcertificategui")
4582 if (!in_array(
'defaults', $hiddenTabs)) {
4584 $ilTabs->addSubTabTarget(
4585 "tst_default_settings",
4586 $this->ctrl->getLinkTarget($this,
"defaults"),
4587 array(
"defaults",
"deleteDefaults",
"addDefaults",
"applyDefaults"),
4588 array(
"",
"ilobjtestgui",
"ilcertificategui")
4600 global $ilAccess,$ilUser;
4602 if (preg_match(
'/^ass(.*?)gui$/i', $this->ctrl->getNextClass($this))) {
4605 else if ($this->ctrl->getNextClass($this) ==
'ilpageobjectgui') {
4609 $hidden_tabs = array();
4611 $template = $this->
object->getTemplate();
4614 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
4617 $hidden_tabs = $template->getHiddenTabs();
4620 switch ($this->ctrl->getCmd())
4626 case "directfeedback":
4628 case "outCorrectSolution":
4630 case "showAnswersOfUser":
4631 case "outUserResultsOverview":
4632 case "backFromSummary":
4633 case "show_answers":
4636 case "confirmFinish":
4637 case "outTestSummary":
4638 case "outQuestionSummary":
4639 case "gotoQuestion":
4640 case "selectImagemapRegion":
4641 case "confirmSubmitAnswers":
4642 case "finalSubmission":
4644 case "redirectQuestion":
4645 case "outUserPassDetails":
4646 case "checkPassword":
4647 case "exportCertificate":
4648 case "finishListOfAnswers":
4649 case "backConfirmFinish":
4650 case "showFinalStatement":
4653 case "browseForQuestions":
4656 case "resetTextFilter":
4657 case "insertQuestions":
4659 if($this->ctrl->getNextClass($this) !=
"illearningprogressgui")
4670 case "deleteMarkSteps":
4671 case "addSimpleMarkSchema":
4673 case "certificateservice":
4674 case "certificateImport":
4675 case "certificateUpload":
4676 case "certificateEditor":
4677 case "certificateDelete":
4678 case "certificateSave":
4680 case "deleteDefaults":
4682 case "applyDefaults":
4683 case "inviteParticipants":
4684 case "searchParticipants":
4686 if (($ilAccess->checkAccess(
"write",
"", $this->ref_id)) && ((strcmp($this->ctrl->getCmdClass(),
"ilobjtestgui") == 0) || (strcmp($this->ctrl->getCmdClass(),
"ilcertificategui") == 0) || (strlen($this->ctrl->getCmdClass()) == 0)))
4696 case "detailedEvaluation":
4697 case "outEvaluation":
4698 case "singleResults":
4699 case "exportEvaluation":
4700 case "evalUserDetail":
4702 case "outStatisticsResultsOverview":
4703 case "statisticsPassDetails":
4708 if (strcmp(strtolower(get_class($this->
object)),
"ilobjtest") == 0)
4711 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) && !in_array(
'assQuestions', $hidden_tabs))
4713 $force_active = (
$_GET[
"up"] !=
"" ||
$_GET[
"down"] !=
"")
4718 if (
$_GET[
"browse"] == 1) $force_active =
true;
4719 if (preg_match(
"/deleteqpl_\d+/", $this->ctrl->getCmd()))
4721 $force_active =
true;
4725 if ($this->object->isRandomTest()) {
4726 $target = $this->ctrl->getLinkTarget($this,
'questions');
4729 $target = $this->ctrl->getLinkTargetByClass(
'iltestexpresspageobjectgui',
'showPage');
4732 $tabs_gui->addTarget(
"assQuestions",
4735 array(
"questions",
"browseForQuestions",
"questionBrowser",
"createQuestion",
4736 "randomselect",
"filter",
"resetFilter",
"insertQuestions",
4737 "back",
"createRandomSelection",
"cancelRandomSelect",
4738 "insertRandomSelection",
"removeQuestions",
"moveQuestions",
4739 "insertQuestionsBefore",
"insertQuestionsAfter",
"confirmRemoveQuestions",
4740 "cancelRemoveQuestions",
"executeCreateQuestion",
"cancelCreateQuestion",
4741 "addQuestionpool",
"saveRandomQuestions",
"saveQuestionSelectionMode",
"print",
4742 "addsource",
"removesource",
"randomQuestions"),
4743 "",
"", $force_active);
4747 if ($ilAccess->checkAccess(
"visible",
"", $this->ref_id) && !in_array(
'info_short', $hidden_tabs))
4749 $tabs_gui->addTarget(
"info_short",
4750 $this->ctrl->getLinkTarget($this,
'infoScreen'),
4751 array(
"infoScreen",
"outIntroductionPage",
"showSummary",
4752 "setAnonymousId",
"outUserListOfAnswerPasses",
"redirectToInfoScreen"));
4756 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
4758 if (!in_array(
'settings', $hidden_tabs)) {
4759 $tabs_gui->addTarget(
"settings",
4760 $this->ctrl->getLinkTarget($this,
'properties'),
4761 array(
"properties",
"saveProperties",
"cancelProperties",
4762 "marks",
"addMarkStep",
"deleteMarkSteps",
"addSimpleMarkSchema",
4763 "saveMarks",
"cancelMarks",
4764 "certificate",
"certificateEditor",
"certificateRemoveBackground",
4765 "certificateSave",
"certificatePreview",
"certificateDelete",
"certificateUpload",
4766 "certificateImport",
"scoring",
"defaults",
"addDefaults",
"deleteDefaults",
"applyDefaults",
4767 "inviteParticipants",
"saveFixedParticipantsStatus",
"searchParticipants",
"addParticipants",
4770 array(
"",
"ilobjtestgui",
"ilcertificategui")
4774 if (!in_array(
'participants', $hidden_tabs)) {
4776 $tabs_gui->addTarget(
"participants",
4777 $this->ctrl->getLinkTarget($this,
'participants'),
4778 array(
"participants",
"saveClientIP",
4779 "removeParticipant",
4780 "showParticipantAnswersForAuthor",
4781 "deleteAllUserResults",
4782 "cancelDeleteAllUserData",
"deleteSingleUserResults",
4783 "outParticipantsResultsOverview",
"outParticipantsPassDetails",
4784 "showPassOverview",
"showUserAnswers",
"participantsAction",
4785 "showDetailedResults"),
4790 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
4793 $tabs_gui->addTarget(
'learning_progress',
4794 $this->ctrl->getLinkTargetByClass(array(
'illearningprogressgui'),
''),
4796 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui'));
4799 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) && !in_array(
'manscoring', $hidden_tabs))
4801 include_once
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
4803 if (count($scoring))
4806 $tabs_gui->addTarget(
"manscoring",
4807 $this->ctrl->getLinkTargetByClass(
"iltestscoringgui",
"manscoring"),
4808 array(
"manscoring",
"scoringfilter",
"scoringfilterreset",
"setPointsManual",
"setFeedbackManual",
"setManscoringDone"),
4813 if ((($ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) || ($ilAccess->checkAccess(
"write",
"", $this->ref_id))) && !in_array(
'statistics', $hidden_tabs))
4816 $tabs_gui->addTarget(
"statistics",
4817 $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"outEvaluation"),
4818 array(
"statistics",
"outEvaluation",
"exportEvaluation",
"detailedEvaluation",
"eval_a",
"evalUserDetail",
4819 "passDetails",
"outStatisticsResultsOverview",
"statisticsPassDetails",
"singleResults")
4823 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
4825 if (!in_array(
'history', $hidden_tabs)) {
4828 $tabs_gui->addTarget(
"history",
4829 $this->ctrl->getLinkTarget($this,
'history'),
4833 if (!in_array(
'meta_data', $hidden_tabs)) {
4835 $tabs_gui->addTarget(
"meta_data",
4836 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
'listSection'),
4837 "",
"ilmdeditorgui");
4840 if (!in_array(
'export', $hidden_tabs)) {
4842 $tabs_gui->addTarget(
"export",
4843 $this->ctrl->getLinkTarget($this,
'export'),
4844 array(
"export",
"createExportFile",
"confirmDeleteExportFile",
4845 "downloadExportFile",
"deleteExportFile",
"cancelDeleteExportFile"),
4850 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->ref_id)&& !in_array(
'permissions', $hidden_tabs))
4852 $tabs_gui->addTarget(
"perm_settings",
4853 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
4870 if ($ilAccess->checkAccess(
"visible",
"", $a_target))
4873 $_GET[
"baseClass"] =
"ilObjTestGUI";
4874 $_GET[
"cmd"] =
"infoScreen";
4875 $_GET[
"ref_id"] = $a_target;
4876 include_once(
"ilias.php");
4880 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
4882 $_GET[
"cmd"] =
"frameset";
4883 $_GET[
"target"] =
"";
4884 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
4887 include(
"repository.php");
4891 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
4906 if ($this->create_question_mode)
4913 $ilCtrl->saveParameter($this,
'q_mode');
4915 $ilCtrl->setParameterByClass(
'iltestexpresspageobjectgui',
'test_express_mode', 1);
4916 $ilCtrl->setParameter($this,
'test_express_mode', 1);
4917 $ilCtrl->setParameterByClass(
'iltestexpresspageobjectgui',
'q_id',
$_REQUEST[
'q_id']);
4918 $ilCtrl->setParameter($this,
'q_id',
$_REQUEST[
'q_id']);
4919 $ilToolbar->setFormAction($ilCtrl->getFormActionByClass(
'iltestexpresspageobjectgui',
'edit'));
4921 if ($this->object->evalTotalPersons() == 0) {
4942 $ilToolbar->addFormButton($lng->txt(
"test_create_question"),
"addQuestion");
4944 $ilToolbar->addSeparator();
4946 if ($this->object->getPoolUsage()) {
4947 $ilToolbar->addFormButton($lng->txt(
"tst_browse_for_questions"),
"browseForQuestions");
4949 $show_separator =
true;
4953 $questions = $this->
object->getQuestionTitlesAndIndexes();
4957 foreach($questions as $id => $label) {
4958 $options[$id] = $label;
4961 $optionKeys = array_keys($options);
4964 $options[] = $lng->txt(
'none');
4990 if (count($questions)) {
4991 if (isset($show_separator) && $show_separator) {
4992 $ilToolbar->addSeparator();
4995 $ilToolbar->addLink($lng->txt(
"test_prev_question"), $ilCtrl->getLinkTargetByClass(
'iltestexpresspageobjectgui',
'prevQuestion'), !(count($options) > 1 && $optionKeys[0] != $qid));
4996 $ilToolbar->addLink($lng->txt(
"test_next_question"), $ilCtrl->getLinkTargetByClass(
'iltestexpresspageobjectgui',
'nextQuestion'), !(count($options) > 1 && $optionKeys[count($optionKeys)-1] != $qid));
4999 if (count($questions) > 1) {
5001 $ilToolbar->addSeparator();
5003 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
5006 $si->setOptions($options);
5009 $si->setValue($qid);
5012 $ilToolbar->addInputItem($si,
true);
5015 $total = $this->
object->evalTotalPersons();
5030 if (count($questions) && !
$total) {
5031 $ilCtrl->setParameter($this,
'q_id',
$_REQUEST[
'q_id']);
5032 $ilToolbar->addSeparator();
5033 $ilToolbar->addButton($lng->txt(
"test_delete_page"), $ilCtrl->getLinkTarget($this,
"removeQuestions"));
5036 if (count($questions) > 1 && !
$total) {
5037 $ilToolbar->addSeparator();
5038 $ilToolbar->addButton($lng->txt(
"test_move_page"), $ilCtrl->getLinkTarget($this,
"movePageForm"));
5047 include_once
'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
5053 $newId = $qpool->copyQuestion($q_id, $qpool->getId());
5054 $newIds[$q_id] = $newId;
5070 foreach(
$result->ids as $oldId => $newId) {
5072 $questionInstance->setNewOriginalId($newId);
5073 $questionInstance->setObjId(
$result->qpool->getId());
5074 $questionInstance->saveToDb();
5083 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
5087 $title->setRequired(
true);
5091 $form->addItem($description);
5093 $form->addCommandButton(
'createQuestionPoolAndCopy', $lng->txt(
'create'));
5097 $hidden->setValue($id);
5098 $form->addItem($hidden);
5112 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
5117 if ($type !==
'tst') {
5161 global $ilUser, $ilTabs;
5163 $ilTabs->activateSubTab(
'edit_test_questions');
5165 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_qpl_select_copy.html",
"Modules/Test");
5166 $questionpools =& $this->
object->getAvailableQuestionpools(FALSE, FALSE, FALSE, TRUE, FALSE,
"write");
5167 if (count($questionpools) == 0)
5169 $this->tpl->setCurrentBlock(
"option");
5170 $this->tpl->setVariable(
"VALUE_QPL",
"");
5171 $this->tpl->parseCurrentBlock();
5175 foreach ($questionpools as $key => $value)
5177 $this->tpl->setCurrentBlock(
"option");
5178 $this->tpl->setVariable(
"VALUE_OPTION", $key);
5179 $this->tpl->setVariable(
"TEXT_OPTION", $value[
"title"]);
5180 $this->tpl->parseCurrentBlock();
5184 $this->tpl->setCurrentBlock(
"hidden");
5185 $this->tpl->setVariable(
"HIDDEN_NAME",
"q_id[]");
5186 $this->tpl->setVariable(
"HIDDEN_VALUE", $id);
5187 $this->tpl->parseCurrentBlock();
5188 $this->tpl->setCurrentBlock(
"adm_content");
5190 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
5192 if (count($questionpools) == 0)
5194 $this->tpl->setVariable(
"TXT_QPL_SELECT", $this->lng->txt(
"tst_enter_questionpool"));
5195 $cmd =
'createQuestionPoolAndCopy';
5199 $this->tpl->setVariable(
"TXT_QPL_SELECT", $this->lng->txt(
"tst_select_questionpool"));
5202 $this->tpl->setVariable(
"CMD_SUBMIT",
$cmd);
5203 $this->tpl->setVariable(
"BTN_SUBMIT", $this->lng->txt(
"submit"));
5204 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
5208 case 'copyAndLinkQuestionsToPool':
5210 $hidden->setValue(1);
5211 $createForm->addItem($hidden);
5213 case 'copyQuestionsToPool':
5216 $createForm->setFormAction($this->ctrl->getFormAction($this));
5217 #$this->tpl->setVariable('CREATE_QPOOL_FORM', $createForm->getHTML());
5219 $this->tpl->parseCurrentBlock();
5224 $simpleSetters = array(
5225 'anonymity' =>
'setAnonymity',
5226 'random_test' =>
'setRandomTest',
5227 'test_enabled_views' =>
'setEnabledViewMode',
5229 'introduction' =>
'setIntroduction',
5230 'showinfo' =>
'setShowInfo',
5231 'finalstatement' =>
'setFinalStatement',
5232 'showfinalstatement' =>
'setShowFinalStatement',
5233 'chb_shuffle_questions' =>
'setShuffleQuestions',
5234 'list_of_questions' =>
'setListOfQuestionsSettings',
5235 'chb_show_marker' =>
'setShowMarker',
5236 'chb_show_cancel' =>
'setShowCancel',
5237 'kiosk' =>
'setKiosk',
5238 'nr_of_tries' =>
'setNrOfTries',
5239 'chb_processing_time' =>
'setEnableProcessingTime',
5240 'chb_use_previous_answers' =>
'setUsePreviousAnswers',
5241 'forcejs' =>
'setForceJS',
5242 'title_output' =>
'setTitleOutput',
5243 'password' =>
'setPassword',
5244 'fixedparticipants' =>
'setFixedParticipants',
5245 'allowedUsers' =>
'setAllowedUsers',
5246 'allowedUsersTimeGap' =>
'setAllowedUsersTimeGap',
5247 'mailnotification' =>
'setMailNotification',
5248 'mailnottype' =>
'setMailNotificationType',
5250 'count_system' =>
'setCountSystem',
5251 'mc_scoring' =>
'setMCScoring',
5252 'score_cutting' =>
'setScoreCutting',
5253 'pass_scoring' =>
'setScoreReporting',
5255 'instant_feedback' =>
'setScoringFeedbackOptionsByArray',
5257 'results_presentation' =>
'setResultsPresentationOptionsByArray',
5258 'export_settings' =>
'setExportSettings',
5261 if (!$templateData[
'results_presentation'][
'value']) {
5262 $templateData[
'results_presentation'][
'value'] = array();
5265 foreach($simpleSetters as $field => $setter) {
5266 if($templateData[$field]) {
5267 $object->$setter($templateData[$field][
'value']);
5306 'fixedparticipants',
5308 'allowedUsersTimeGap',
5322 foreach($fields as $fld) {
5323 if (isset($templateData[$fld])) {
5324 if(!$templateData[$fld][
'hide'])
5340 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_tst_tst_confirm_resettemplate.html",
"Modules/Test");
5341 $this->tpl->setCurrentBlock(
"adm_content");
5342 $this->tpl->setVariable(
"BTN_CONFIRM_REMOVE", $this->lng->txt(
"confirm"));
5343 $this->tpl->setVariable(
"BTN_CANCEL_REMOVE", $this->lng->txt(
"cancel"));
5344 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"resetTemplateObject"));
5345 $this->tpl->parseCurrentBlock();
5353 $this->
object->setTemplate(null);
5354 $this->
object->saveToDB();
5357 $this->ctrl->redirect($this,
"properties");
5362 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
5366 $this->ctrl->redirect($this,
"infoScreen");
5370 $this->
object->setQuestionOrder(
$_REQUEST[
'order']);
5372 $ilCtrl->redirect($this,
'questions');
5382 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
5384 $form->setFormAction($ilCtrl->getFormAction($this,
"movePage"));
5385 $form->setTitle($lng->txt(
"test_move_page"));
5389 $form->addItem($old_pos);
5391 $questions = $this->
object->getQuestionTitlesAndIndexes();
5392 if (!is_array($questions))
5393 $questions = array();
5395 foreach($questions as $k => $q) {
5397 unset($questions[$k]);
5400 $questions[$k] = $lng->txt(
'behind') .
' '. $q;
5402 #$questions['0'] = $lng->txt('first');
5405 0 => $lng->txt(
'first')
5407 foreach($questions as $k => $q) {
5413 $form->addItem($pos);
5415 $form->addCommandButton(
"movePage", $lng->txt(
"submit"));
5416 $form->addCommandButton(
"showPage", $lng->txt(
"cancel"));
5418 return $tpl->setContent($form->getHTML());
5423 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
5427 $this->ctrl->redirect($this,
"infoScreen");
5437 $ilCtrl->setParameterByClass(
'iltestexpresspageobjectgui',
'q_id',
$_REQUEST[
'q_id']);
5438 $ilCtrl->redirectByClass(
'iltestexpresspageobjectgui',
'showPage');
5443 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
5447 $this->ctrl->redirect($this,
"infoScreen");
5457 $this->ctrl->redirect($this,
'questions');
5462 $questionTitles = $this->
object->getQuestionTitles();
5464 foreach($ids as $id)
5466 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
5470 $title = $question->object->getTitle();
5472 while( in_array(
$title .
' (' . $i .
')', $questionTitles ))
5475 $title .=
' (' . $i .
')';
5477 $questionTitles[] =
$title;
5479 $new_id = $question->object->duplicate(
false,
$title);
5482 $clone->object->setObjId($this->object->getId());
5483 $clone->object->saveToDb();
5485 $this->
object->insertQuestion($new_id,
true);
5493 $this->ctrl->redirect($this,
'questions');