41 include_once
"./classes/class.ilObjectGUI.php";
42 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
53 $lng->loadLanguageModule(
"assessment");
56 $this->ctrl->saveParameter($this,
"ref_id");
59 if((
int)
$_GET[
'crs_show_result'])
61 $this->ctrl->saveParameter($this,
'crs_show_result',(
int) $_GET[
'crs_show_result']);
70 global $ilAccess, $ilNavigationHistory;
72 if ((!$ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"])) && (!$ilAccess->checkAccess(
"visible",
"",
$_GET[
"ref_id"])))
75 $ilias->raiseError($this->lng->txt(
"permission_denied"), $ilias->error_obj->MESSAGE);
77 $cmd = $this->ctrl->getCmd(
"properties");
78 $next_class = $this->ctrl->getNextClass($this);
79 $this->ctrl->setReturn($this,
"properties");
80 if (method_exists($this->
object,
"getTestStyleLocation")) $this->tpl->addCss($this->object->getTestStyleLocation(
"output"),
"screen");
84 $ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
86 $ilNavigationHistory->addItem(
$_GET[
"ref_id"],
87 "ilias.php?baseClass=ilObjTestGUI&cmd=infoScreen&ref_id=".
$_GET[
"ref_id"],
"tst");
92 include_once
'payment/classes/class.ilPaymentObject.php';
97 $this->tpl->getStandardTemplate();
99 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
101 $ret = $this->ctrl->forwardCommand($pp);
109 case "ilinfoscreengui":
113 case 'ilmdeditorgui':
114 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
117 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
118 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
120 $this->ctrl->forwardCommand($md_gui);
122 case "iltestoutputgui":
123 include_once
"./Modules/Test/classes/class.ilTestOutputGUI.php";
127 $this->ctrl->forwardCommand($output_gui);
130 case "iltestevaluationgui":
131 include_once
"./Modules/Test/classes/class.ilTestEvaluationGUI.php";
134 $this->ctrl->forwardCommand($evaluation_gui);
137 case "iltestservicegui":
138 include_once
"./Modules/Test/classes/class.ilTestServiceGUI.php";
141 $this->ctrl->forwardCommand($serviceGUI);
144 case 'ilpermissiongui':
145 include_once(
"./classes/class.ilPermissionGUI.php");
148 $ret =& $this->ctrl->forwardCommand($perm_gui);
151 case "illearningprogressgui":
152 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
156 $this->ctrl->forwardCommand($new_gui);
160 case "iltestcertificategui":
161 include_once
"./Modules/Test/classes/class.ilTestCertificateGUI.php";
164 $this->ctrl->forwardCommand($output_gui);
167 case "iltestscoringgui":
168 include_once
"./Modules/Test/classes/class.ilTestScoringGUI.php";
171 $this->ctrl->forwardCommand($output_gui);
176 if (preg_match(
"/deleteqpl_\d+/",
$cmd))
178 $cmd =
"randomQuestions";
180 if ((strcmp(
$cmd,
"properties") == 0) && (
$_GET[
"browse"]))
185 if ((strcmp(
$cmd,
"properties") == 0) && (
$_GET[
"up"] ||
$_GET[
"down"]))
194 if (strtolower(
$_GET[
"baseClass"]) !=
"iladministrationgui" &&
203 $this->ctrl->redirect($this,
"infoScreen");
208 $this->ctrl->redirectByClass(
"iltestevaluationgui",
"outEvaluation");
216 if ($_POST[
"qpl"] < 1)
222 if (strcmp($_FILES[
"xmldoc"][
"tmp_name"],
"") == 0)
228 $this->ctrl->setParameter($this,
"new_type", $this->type);
242 if ($_POST[
"defaults"] > 0)
244 $newObj->applyDefaults($_POST[
"defaults"]);
249 ilUtil::redirect(
"ilias.php?baseClass=ilObjTestGUI&ref_id=".$newObj->getRefId().
"&cmd=properties");
254 include_once
"./Services/Utilities/classes/class.ilUtil.php";
255 $path = $this->tree->getPathFull($this->object->getRefID());
261 include_once
"./Services/Utilities/classes/class.ilUtil.php";
272 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
276 $this->ctrl->redirect($this,
"infoScreen");
280 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
282 if ($this->object->isRandomTest())
289 $this->tpl->setCurrentBlock(
"btn_cell");
290 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"createExportFile").
"&mode=xml");
291 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"ass_create_export_file"));
292 $this->tpl->parseCurrentBlock();
296 $this->tpl->setCurrentBlock(
"btn_cell");
297 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"createExportfile").
"&mode=results");
298 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"ass_create_export_test_results"));
299 $this->tpl->parseCurrentBlock();
301 $export_dir = $this->
object->getExportDirectory();
303 $export_files = $this->
object->getExportFiles($export_dir);
306 include_once(
"./Services/Table/classes/class.ilTableGUI.php");
310 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.table.html");
313 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.export_file_row.html",
"Modules/Test");
317 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
319 $tbl->setTitle($this->lng->txt(
"ass_export_files"));
321 $tbl->setHeaderNames(array(
"", $this->lng->txt(
"ass_file"),
322 $this->lng->txt(
"ass_size"), $this->lng->txt(
"date") ));
324 $tbl->enabled[
"sort"] =
false;
325 $tbl->setColumnWidth(array(
"1%",
"49%",
"25%",
"25%"));
328 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
329 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
330 $tbl->setLimit(
$_GET[
"limit"]);
331 $tbl->setOffset(
$_GET[
"offset"]);
332 $tbl->setMaxCount($this->maxcount);
333 $header_params = $this->ctrl->getParameterArray($this,
"export");
334 $tbl->setHeaderVars(array(
"",
"file",
"size",
"date"), $header_params);
338 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
341 $tbl->setMaxCount(count($export_files));
342 $export_files = array_slice($export_files,
$_GET[
"offset"],
$_GET[
"limit"]);
345 if(count($export_files) > 0)
347 $this->tpl->setVariable(
"COLUMN_COUNTS", 4);
350 foreach($export_files as $exp_file)
352 $this->tpl->setCurrentBlock(
"tbl_content");
353 $this->tpl->setVariable(
"TXT_FILENAME", $exp_file);
356 $this->tpl->setVariable(
"CSS_ROW", $css_row);
358 $this->tpl->setVariable(
"TXT_SIZE", filesize($export_dir.
"/".$exp_file));
359 $this->tpl->setVariable(
"CHECKBOX_ID", $exp_file);
361 $file_arr = explode(
"__", $exp_file);
362 $this->tpl->setVariable(
"TXT_DATE", date(
"Y-m-d H:i:s",$file_arr[0]));
364 $this->tpl->parseCurrentBlock();
366 $this->tpl->setCurrentBlock(
"selectall");
367 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
368 $this->tpl->setVariable(
"CSS_ROW", $css_row);
369 $this->tpl->parseCurrentBlock();
372 $this->tpl->setCurrentBlock(
"tbl_action_btn");
373 $this->tpl->setVariable(
"BTN_NAME",
"confirmDeleteExportFile");
374 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
375 $this->tpl->parseCurrentBlock();
377 $this->tpl->setCurrentBlock(
"tbl_action_btn");
378 $this->tpl->setVariable(
"BTN_NAME",
"downloadExportFile");
379 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"download"));
380 $this->tpl->parseCurrentBlock();
384 $this->tpl->setCurrentBlock(
"notfound");
385 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
386 $this->tpl->setVariable(
"NUM_COLS", 3);
387 $this->tpl->parseCurrentBlock();
390 $this->tpl->parseCurrentBlock();
401 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
403 include_once(
"./Modules/Test/classes/class.ilTestExport.php");
405 $test_exp->buildExportFile();
411 $this->ctrl->redirect($this,
"export");
420 if(!isset($_POST[
"file"]))
423 $this->ctrl->redirect($this,
"export");
426 if (count($_POST[
"file"]) > 1)
429 $this->ctrl->redirect($this,
"export");
433 $export_dir = $this->
object->getExportDirectory();
443 if(!isset($_POST[
"file"]))
446 $this->ctrl->redirect($this,
"export");
450 $_SESSION[
"ilExportFiles"] = $_POST[
"file"];
452 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html",
"Modules/Test");
456 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
459 $this->tpl->setCurrentBlock(
"table_header");
460 $this->tpl->setVariable(
"TEXT",$this->lng->txt(
"objects"));
461 $this->tpl->parseCurrentBlock();
465 foreach($_POST[
"file"] as
$file)
467 $this->tpl->setCurrentBlock(
"table_row");
469 $this->tpl->setVariable(
"TEXT_CONTENT", $file);
470 $this->tpl->parseCurrentBlock();
475 $buttons = array(
"cancelDeleteExportFile" => $this->lng->txt(
"cancel"),
476 "deleteExportFile" => $this->lng->txt(
"confirm"));
477 foreach ($buttons as $name => $value)
479 $this->tpl->setCurrentBlock(
"operation_btn");
480 $this->tpl->setVariable(
"BTN_NAME",$name);
481 $this->tpl->setVariable(
"BTN_VALUE",$value);
482 $this->tpl->parseCurrentBlock();
502 session_unregister(
"ilExportFiles");
503 $this->ctrl->redirect($this,
"export");
512 $export_dir = $this->
object->getExportDirectory();
515 $exp_file = $export_dir.
"/".
$file;
516 $exp_dir = $export_dir.
"/".substr($file, 0, strlen($file) - 4);
517 if (@is_file($exp_file))
521 if (@is_dir($exp_dir))
526 $this->ctrl->redirect($this,
"export");
537 $this->tpl->setCurrentBlock(
"option_qpl");
538 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
540 $questionpools =& $tst->getAvailableQuestionpools(TRUE, FALSE, FALSE, TRUE);
541 if (count($questionpools) == 0)
546 foreach ($questionpools as $key => $value)
548 $this->tpl->setCurrentBlock(
"option_qpl");
549 $this->tpl->setVariable(
"OPTION_VALUE", $key);
550 $this->tpl->setVariable(
"TXT_OPTION", $value[
"title"]);
551 $this->tpl->parseCurrentBlock();
554 $this->tpl->setVariable(
"TXT_SELECT_QUESTIONPOOL", $this->lng->txt(
"select_questionpool"));
555 $this->tpl->setVariable(
"OPTION_SELECT_QUESTIONPOOL", $this->lng->txt(
"select_questionpool_option"));
556 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
557 $this->tpl->setVariable(
"BTN_NAME",
"uploadTst");
558 $this->tpl->setVariable(
"TXT_UPLOAD", $this->lng->txt(
"upload"));
559 $this->tpl->setVariable(
"NEW_TYPE", $this->type);
560 $this->tpl->setVariable(
"TXT_IMPORT_TST", $this->lng->txt(
"import_tst"));
561 $this->tpl->setVariable(
"TXT_SELECT_MODE", $this->lng->txt(
"select_mode"));
562 $this->tpl->setVariable(
"TXT_SELECT_FILE", $this->lng->txt(
"select_file"));
571 if ($_POST[
"qpl"] < 1)
578 if ($_FILES[
"xmldoc"][
"error"] > UPLOAD_ERR_OK)
584 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
589 $file = pathinfo($_FILES[
"xmldoc"][
"name"]);
597 $subdir = basename(
$file[
"basename"],
".".
$file[
"extension"]);
601 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
603 $result = $qtiParser->startParsing();
604 $founditems =& $qtiParser->getFoundItems();
606 if (count($founditems) == 0)
620 foreach ($founditems as $item)
622 if (strlen($item[
"type"]))
642 $_SESSION[
"tst_import_xml_file"] = $xml_file;
643 $_SESSION[
"tst_import_qti_file"] = $qti_file;
644 $_SESSION[
"tst_import_subdir"] = $subdir;
646 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.tst_import_verification.html");
647 $row_class = array(
"tblrow1",
"tblrow2");
649 foreach ($founditems as $item)
651 $this->tpl->setCurrentBlock(
"verification_row");
652 $this->tpl->setVariable(
"ROW_CLASS", $row_class[$counter++ % 2]);
653 $this->tpl->setVariable(
"QUESTION_TITLE", $item[
"title"]);
654 $this->tpl->setVariable(
"QUESTION_IDENT", $item[
"ident"]);
655 include_once
"./Services/QTI/classes/class.ilQTIItem.php";
656 switch ($item[
"type"])
658 case "MULTIPLE CHOICE QUESTION":
660 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"qt_multiple_choice"));
662 case "SINGLE CHOICE QUESTION":
664 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assSingleChoice"));
666 case "NUMERIC QUESTION":
668 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assNumeric"));
670 case "TEXTSUBSET QUESTION":
672 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assTextSubset"));
674 case "CLOZE QUESTION":
676 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assClozeTest"));
678 case "IMAGE MAP QUESTION":
680 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assImagemapQuestion"));
682 case "JAVA APPLET QUESTION":
684 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assJavaApplet"));
686 case "MATCHING QUESTION":
688 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assMatchingQuestion"));
690 case "ORDERING QUESTION":
692 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assOrderingQuestion"));
694 case "TEXT QUESTION":
696 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assTextQuestion"));
699 $this->tpl->parseCurrentBlock();
701 $this->tpl->setCurrentBlock(
"adm_content");
702 $this->tpl->setVariable(
"TEXT_TYPE", $this->lng->txt(
"question_type"));
703 $this->tpl->setVariable(
"TEXT_TITLE", $this->lng->txt(
"question_title"));
704 $this->tpl->setVariable(
"FOUND_QUESTIONS_INTRODUCTION", $this->lng->txt(
"tst_import_verify_found_questions"));
705 $this->tpl->setVariable(
"VERIFICATION_HEADING", $this->lng->txt(
"import_tst"));
706 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
708 $this->tpl->setVariable(
"QUESTIONPOOL_ID", $_POST[
"qpl"]);
709 $this->tpl->setVariable(
"VALUE_IMPORT", $this->lng->txt(
"import"));
710 $this->tpl->setVariable(
"VALUE_CANCEL", $this->lng->txt(
"cancel"));
711 $this->tpl->parseCurrentBlock();
719 include_once
"./Modules/Test/classes/class.ilObjTest.php";
723 $newObj->setType(
$_GET[
"new_type"]);
725 $newObj->setTitle(
"dummy");
727 $newObj->setDescription(
"test import");
729 $newObj->create(
true);
731 $newObj->createReference();
733 $newObj->putInTree(
$_GET[
"ref_id"]);
735 $newObj->setPermissions(
$_GET[
"ref_id"]);
737 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
739 $newObj->mark_schema->flush();
742 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
744 $qtiParser->setTestObject($newObj);
745 $result = $qtiParser->startParsing();
751 include_once (
"./Modules/LearningModule/classes/class.ilContObjParser.php");
753 $contParser->setQuestionMapping($qtiParser->getImportMapping());
754 $contParser->startParsing();
760 "&baseClass=ilObjTestGUI");
765 $this->ctrl->redirect($this,
"cancel");
792 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_properties_save_confirmation.html",
"Modules/Test");
797 $information = $this->lng->txt(
"change_properties_from_random_to_standard");
800 $information = $this->lng->txt(
"change_properties_from_standard_to_random");
803 foreach ($_POST as $key => $value)
805 if (strcmp($key,
"cmd") != 0)
807 if (is_array($value))
809 foreach ($value as $k => $v)
811 $this->tpl->setCurrentBlock(
"hidden_variable");
812 $this->tpl->setVariable(
"HIDDEN_KEY", $key .
"[" . $k .
"]");
813 $this->tpl->setVariable(
"HIDDEN_VALUE", $v);
814 $this->tpl->parseCurrentBlock();
819 $this->tpl->setCurrentBlock(
"hidden_variable");
820 $this->tpl->setVariable(
"HIDDEN_KEY", $key);
821 $this->tpl->setVariable(
"HIDDEN_VALUE", $value);
822 $this->tpl->parseCurrentBlock();
826 $this->tpl->setCurrentBlock(
"hidden_variable");
827 $this->tpl->setVariable(
"HIDDEN_KEY",
"tst_properties_confirmation");
828 $this->tpl->setVariable(
"HIDDEN_VALUE",
"1");
829 $this->tpl->parseCurrentBlock();
830 $this->tpl->setCurrentBlock(
"adm_content");
831 $this->tpl->setVariable(
"TXT_CONFIRMATION", $this->lng->txt(
"confirmation"));
832 $this->tpl->setVariable(
"TXT_INFORMATION", $information);
833 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
834 $this->tpl->setVariable(
"BTN_CONFIRM", $this->lng->txt(
"confirm"));
835 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
836 $this->tpl->parseCurrentBlock();
848 $total = $this->
object->evalTotalPersons();
849 $randomtest_switch =
false;
853 if (!array_key_exists(
"tst_properties_confirmation", $_POST))
855 if (($this->object->isRandomTest()) && (count($this->object->getRandomQuestionpools()) > 0))
857 if (!$_POST[
"chb_random"])
864 if ((!$this->object->isRandomTest()) && (count($this->object->questions) > 0))
866 if ($_POST[
"chb_random"])
875 if (!strlen($_POST[
"chb_random"]))
877 $data[
"random_test"] = 0;
886 $data[
"random_test"] = $this->
object->random_test;
888 if (
$data[
"random_test"] != $this->object->random_test)
890 $randomtest_switch =
true;
892 $data[
"anonymity"] = $_POST[
"anonymity"];
895 $data[
"anonymity"] = $this->
object->getAnonymity();
897 $data[
"show_cancel"] = $_POST[
"show_cancel"];
898 $data[
"password"] = $_POST[
"password"];
899 $data[
"allowedUsers"] = $_POST[
"allowedUsers"];
900 $data[
"show_cancel"] = $_POST[
"chb_show_cancel"];
901 $data[
"show_marker"] = ($_POST[
"chb_show_marker"] ? 1 : 0);
902 $data[
"allowedUsersTimeGap"] = $_POST[
"allowedUsersTimeGap"];
903 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
905 $data[
"introduction"] = $introduction;
907 $data[
"finalstatement"] = $finalstatement;
908 $data[
"showfinalstatement"] = ($_POST[
"showfinalstatement"]) ? 1 : 0;
909 $data[
"showinfo"] = ($_POST[
"showinfo"]) ? 1 : 0;
910 $data[
"forcejs"] = ($_POST[
"forcejs"]) ? 1 : 0;
911 $data[
"customstyle"] = (strcmp($_POST[
"customstyle"],
"0") == 0) ?
"" : $_POST[
"customstyle"];
913 $data[
"shuffle_questions"] = 0;
914 if ($_POST[
"chb_shuffle_questions"])
916 $data[
"shuffle_questions"] = $_POST[
"chb_shuffle_questions"];
918 $data[
"list_of_questions"] = 0;
919 if ($_POST[
"list_of_questions"] == 1)
921 $data[
"list_of_questions"] = 1;
923 $data[
"list_of_questions_start"] = 0;
924 if ($_POST[
"chb_list_of_questions_start"] == 1)
926 $data[
"list_of_questions_start"] = 1;
928 $data[
"list_of_questions_end"] = 0;
929 if ($_POST[
"chb_list_of_questions_end"] == 1)
931 $data[
"list_of_questions_end"] = 1;
933 $data[
"list_of_questions_with_description"] = 0;
934 if ($_POST[
"chb_list_of_questions_with_description"] == 1)
936 $data[
"list_of_questions_with_description"] = 1;
943 if (!$_POST[
"chb_starting_time"])
945 $data[
"starting_time"] =
"";
949 $data[
"starting_time"] = sprintf(
"%04d%02d%02d%02d%02d%02d",
950 $_POST[
"starting_date"][
"y"],
951 $_POST[
"starting_date"][
"m"],
952 $_POST[
"starting_date"][
"d"],
953 $_POST[
"starting_time"][
"h"],
954 $_POST[
"starting_time"][
"m"],
958 if (!$_POST[
"chb_ending_time"])
960 $data[
"ending_time"] =
"";
964 $data[
"ending_time"] = sprintf(
"%04d%02d%02d%02d%02d%02d",
965 $_POST[
"ending_date"][
"y"],
966 $_POST[
"ending_date"][
"m"],
967 $_POST[
"ending_date"][
"d"],
968 $_POST[
"ending_time"][
"h"],
969 $_POST[
"ending_time"][
"m"],
974 if ($_POST[
"chb_processing_time"])
976 $data[
"enable_processing_time"] =
"1";
980 $data[
"enable_processing_time"] =
"0";
982 $data[
"reset_processing_time"] =
"0";
983 if ($_POST[
"chb_processing_time"])
985 if ($_POST[
"chb_reset_processing_time"])
987 $data[
"reset_processing_time"] =
"1";
990 if ($_POST[
"chb_use_previous_answers"])
992 $data[
"use_previous_answers"] =
"1";
996 $data[
"use_previous_answers"] =
"0";
999 $data[
"title_output"] = $_POST[
"title_output"];
1001 if (
$data[
"enable_processing_time"])
1003 $data[
"processing_time"] = sprintf(
"%02d:%02d:%02d",
1004 $_POST[
"processing_time"][
"h"],
1005 $_POST[
"processing_time"][
"m"],
1006 $_POST[
"processing_time"][
"s"]
1011 $proc_time = $this->
object->getEstimatedWorkingTime();
1012 $data[
"processing_time"] = sprintf(
"%02d:%02d:%02d",
1019 if (
$data[
"nr_of_tries"] == 1)
1023 $this->
object->setIntroduction(
$data[
"introduction"]);
1024 $this->
object->setFinalStatement(
$data[
"finalstatement"]);
1025 $this->
object->setShowFinalStatement(
$data[
"showfinalstatement"]);
1026 $this->
object->setShowInfo(
$data[
"showinfo"]);
1027 $this->
object->setForceJS(
$data[
"forcejs"]);
1028 $this->
object->setCustomStyle(
$data[
"customstyle"]);
1029 $this->
object->setSequenceSettings(
$data[
"sequence_settings"]);
1030 $this->
object->setAnonymity(
$data[
"anonymity"]);
1031 $this->
object->setShowCancel(
$data[
"show_cancel"]);
1032 $this->
object->setShowMarker(
$data[
"show_marker"]);
1033 $this->
object->setPassword(
$data[
"password"]);
1034 $this->
object->setAllowedUsers(
$data[
"allowedUsers"]);
1035 $this->
object->setAllowedUsersTimeGap(
$data[
"allowedUsersTimeGap"]);
1036 $this->
object->setKioskMode(
$data[
"kiosk"]);
1037 $this->
object->setShowKioskModeTitle(
$data[
"kiosk_title"]);
1038 $this->
object->setShowKioskModeParticipant(
$data[
"kiosk_participant"]);
1039 $this->
object->setNrOfTries(
$data[
"nr_of_tries"]);
1040 $this->
object->setStartingTime(
$data[
"starting_time"]);
1041 $this->
object->setEndingTime(
$data[
"ending_time"]);
1042 $this->
object->setProcessingTime(
$data[
"processing_time"]);
1043 $this->
object->setRandomTest(
$data[
"random_test"]);
1044 $this->
object->setEnableProcessingTime(
$data[
"enable_processing_time"]);
1045 $this->
object->setResetProcessingTime(
$data[
"reset_processing_time"]);
1046 $this->
object->setUsePreviousAnswers(
$data[
"use_previous_answers"]);
1047 $this->
object->setTitleOutput(
$data[
"title_output"]);
1049 if ($this->object->isRandomTest())
1051 $this->
object->setUsePreviousAnswers(0);
1052 $this->
object->setRandomTest(1);
1054 if (
$data[
"shuffle_questions"])
1056 $this->
object->setShuffleQuestions(TRUE);
1060 $this->
object->setShuffleQuestions(FALSE);
1062 $this->
object->setListOfQuestions(
$data[
"list_of_questions"]);
1063 $this->
object->setListOfQuestionsStart(
$data[
"list_of_questions_start"]);
1064 $this->
object->setListOfQuestionsEnd(
$data[
"list_of_questions_end"]);
1065 $this->
object->setListOfQuestionsDescription(
$data[
"list_of_questions_with_description"]);
1067 $this->
object->saveToDb(
true);
1070 if ($randomtest_switch)
1072 if ($this->object->isRandomTest())
1074 $this->
object->removeNonRandomTestData();
1078 $this->
object->removeRandomTestData();
1081 $this->ctrl->redirect($this,
"properties");
1093 $total = $this->
object->evalTotalPersons();
1097 $data[
"count_system"] = $_POST[
"count_system"];
1098 $data[
"mc_scoring"] = $_POST[
"mc_scoring"];
1099 $data[
"score_cutting"] = $_POST[
"score_cutting"];
1100 $data[
"pass_scoring"] = $_POST[
"pass_scoring"];
1104 $data[
"count_system"] = $this->
object->getCountSystem();
1105 $data[
"mc_scoring"] = $this->
object->getMCScoring();
1106 $data[
"score_cutting"] = $this->
object->getScoreCutting();
1107 $data[
"pass_scoring"] = $this->
object->getPassScoring();
1110 $data[
"instant_feedback_solution"] = $_POST[
"chb_instant_feedback_solution"];
1111 $data[
"answer_feedback"] = ($_POST[
"chb_instant_feedback_answer"]) ? 1 : 0;
1112 $data[
"answer_feedback_points"] = ($_POST[
"chb_instant_feedback_results"]) ? 1 : 0;
1114 $data[
"show_solution_printview"] = ($_POST[
"chb_show_solution_printview"] == 1) ? 1 : 0;
1115 $data[
"show_solution_feedback"] = ($_POST[
"chb_show_solution_feedback"] == 1) ? 1 : 0;
1116 $data[
"show_solution_details"] = $_POST[
"chb_show_solution_details"];
1117 $data[
"show_solution_answers_only"] = $_POST[
"chb_show_solution_answers_only"];
1118 $data[
"show_solution_signature"] = $_POST[
"chb_show_solution_signature"];
1119 $data[
"show_pass_details"] = $_POST[
"chb_show_pass_details"];
1120 $data[
"results_access"] = $_POST[
"results_access"];
1122 $this->
object->setCountSystem(
$data[
"count_system"]);
1123 $this->
object->setMCScoring(
$data[
"mc_scoring"]);
1124 $this->
object->setScoreCutting(
$data[
"score_cutting"]);
1125 $this->
object->setPassScoring(
$data[
"pass_scoring"]);
1126 $this->
object->setInstantFeedbackSolution(
$data[
"instant_feedback_solution"]);
1127 $this->
object->setAnswerFeedback(
$data[
"answer_feedback"]);
1128 $this->
object->setAnswerFeedbackPoints(
$data[
"answer_feedback_points"]);
1129 $this->
object->setShowSolutionDetails(
$data[
"show_solution_details"]);
1130 $this->
object->setShowSolutionAnswersOnly(
$data[
"show_solution_answers_only"]);
1131 $this->
object->setShowSolutionSignature(
$data[
"show_solution_signature"]);
1132 $this->
object->setShowPassDetails(
$data[
"show_pass_details"]);
1133 $this->
object->setScoreReporting(
$data[
"results_access"]);
1134 $this->
object->setShowSolutionPrintview(
$data[
"show_solution_printview"]);
1135 $this->
object->setShowSolutionFeedback(
$data[
"show_solution_feedback"]);
1138 $data[
"reporting_date"] = sprintf(
"%04d%02d%02d%02d%02d%02d",
1139 $_POST[
"reporting_date"][
"y"],
1140 $_POST[
"reporting_date"][
"m"],
1141 $_POST[
"reporting_date"][
"d"],
1142 $_POST[
"reporting_time"][
"h"],
1143 $_POST[
"reporting_time"][
"m"],
1146 $this->
object->setReportingDate(
$data[
"reporting_date"]);
1150 $this->
object->setReportingDate(
"");
1152 $this->
object->saveToDb(
true);
1155 $this->ctrl->redirect($this,
"scoring");
1168 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
1172 $this->ctrl->redirect($this,
"infoScreen");
1175 $data[
"count_system"] = $this->
object->getCountSystem();
1176 $data[
"mc_scoring"] = $this->
object->getMCScoring();
1177 $data[
"score_cutting"] = $this->
object->getScoreCutting();
1178 $data[
"pass_scoring"] = $this->
object->getPassScoring();
1179 $data[
"instant_feedback_solution"] = $this->
object->getInstantFeedbackSolution();
1180 $data[
"answer_feedback"] = $this->
object->getAnswerFeedback();
1181 $data[
"answer_feedback_points"] = $this->
object->getAnswerFeedbackPoints();
1182 $data[
"show_solution_printview"] = $this->
object->getShowSolutionPrintview();
1183 $data[
"show_solution_feedback"] = $this->
object->getShowSolutionFeedback();
1184 $data[
"show_solution_details"] = $this->
object->getShowSolutionDetails();
1185 $data[
"show_solution_answers_only"] = $this->
object->getShowSolutionAnswersOnly();
1186 $data[
"show_solution_signature"] = $this->
object->getShowSolutionSignature();
1187 $data[
"show_pass_details"] = $this->
object->getShowPassDetails();
1188 $data[
"results_access"] = $this->
object->getScoreReporting();
1190 $total = $this->
object->evalTotalPersons();
1192 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_scoring.html",
"Modules/Test");
1194 $this->lng->loadLanguageModule(
"jscalendar");
1195 $this->tpl->addBlockFile(
"CALENDAR_LANG_JAVASCRIPT",
"calendar_javascript",
"tpl.calendar.html");
1196 $this->tpl->setCurrentBlock(
"calendar_javascript");
1197 $this->tpl->setVariable(
"FULL_SUNDAY", $this->lng->txt(
"l_su"));
1198 $this->tpl->setVariable(
"FULL_MONDAY", $this->lng->txt(
"l_mo"));
1199 $this->tpl->setVariable(
"FULL_TUESDAY", $this->lng->txt(
"l_tu"));
1200 $this->tpl->setVariable(
"FULL_WEDNESDAY", $this->lng->txt(
"l_we"));
1201 $this->tpl->setVariable(
"FULL_THURSDAY", $this->lng->txt(
"l_th"));
1202 $this->tpl->setVariable(
"FULL_FRIDAY", $this->lng->txt(
"l_fr"));
1203 $this->tpl->setVariable(
"FULL_SATURDAY", $this->lng->txt(
"l_sa"));
1204 $this->tpl->setVariable(
"SHORT_SUNDAY", $this->lng->txt(
"s_su"));
1205 $this->tpl->setVariable(
"SHORT_MONDAY", $this->lng->txt(
"s_mo"));
1206 $this->tpl->setVariable(
"SHORT_TUESDAY", $this->lng->txt(
"s_tu"));
1207 $this->tpl->setVariable(
"SHORT_WEDNESDAY", $this->lng->txt(
"s_we"));
1208 $this->tpl->setVariable(
"SHORT_THURSDAY", $this->lng->txt(
"s_th"));
1209 $this->tpl->setVariable(
"SHORT_FRIDAY", $this->lng->txt(
"s_fr"));
1210 $this->tpl->setVariable(
"SHORT_SATURDAY", $this->lng->txt(
"s_sa"));
1211 $this->tpl->setVariable(
"FULL_JANUARY", $this->lng->txt(
"l_01"));
1212 $this->tpl->setVariable(
"FULL_FEBRUARY", $this->lng->txt(
"l_02"));
1213 $this->tpl->setVariable(
"FULL_MARCH", $this->lng->txt(
"l_03"));
1214 $this->tpl->setVariable(
"FULL_APRIL", $this->lng->txt(
"l_04"));
1215 $this->tpl->setVariable(
"FULL_MAY", $this->lng->txt(
"l_05"));
1216 $this->tpl->setVariable(
"FULL_JUNE", $this->lng->txt(
"l_06"));
1217 $this->tpl->setVariable(
"FULL_JULY", $this->lng->txt(
"l_07"));
1218 $this->tpl->setVariable(
"FULL_AUGUST", $this->lng->txt(
"l_08"));
1219 $this->tpl->setVariable(
"FULL_SEPTEMBER", $this->lng->txt(
"l_09"));
1220 $this->tpl->setVariable(
"FULL_OCTOBER", $this->lng->txt(
"l_10"));
1221 $this->tpl->setVariable(
"FULL_NOVEMBER", $this->lng->txt(
"l_11"));
1222 $this->tpl->setVariable(
"FULL_DECEMBER", $this->lng->txt(
"l_12"));
1223 $this->tpl->setVariable(
"SHORT_JANUARY", $this->lng->txt(
"s_01"));
1224 $this->tpl->setVariable(
"SHORT_FEBRUARY", $this->lng->txt(
"s_02"));
1225 $this->tpl->setVariable(
"SHORT_MARCH", $this->lng->txt(
"s_03"));
1226 $this->tpl->setVariable(
"SHORT_APRIL", $this->lng->txt(
"s_04"));
1227 $this->tpl->setVariable(
"SHORT_MAY", $this->lng->txt(
"s_05"));
1228 $this->tpl->setVariable(
"SHORT_JUNE", $this->lng->txt(
"s_06"));
1229 $this->tpl->setVariable(
"SHORT_JULY", $this->lng->txt(
"s_07"));
1230 $this->tpl->setVariable(
"SHORT_AUGUST", $this->lng->txt(
"s_08"));
1231 $this->tpl->setVariable(
"SHORT_SEPTEMBER", $this->lng->txt(
"s_09"));
1232 $this->tpl->setVariable(
"SHORT_OCTOBER", $this->lng->txt(
"s_10"));
1233 $this->tpl->setVariable(
"SHORT_NOVEMBER", $this->lng->txt(
"s_11"));
1234 $this->tpl->setVariable(
"SHORT_DECEMBER", $this->lng->txt(
"s_12"));
1235 $this->tpl->setVariable(
"ABOUT_CALENDAR", $this->lng->txt(
"about_calendar"));
1236 $this->tpl->setVariable(
"ABOUT_CALENDAR_LONG", $this->lng->txt(
"about_calendar_long"));
1237 $this->tpl->setVariable(
"ABOUT_TIME_LONG", $this->lng->txt(
"about_time"));
1238 $this->tpl->setVariable(
"PREV_YEAR", $this->lng->txt(
"prev_year"));
1239 $this->tpl->setVariable(
"PREV_MONTH", $this->lng->txt(
"prev_month"));
1240 $this->tpl->setVariable(
"GO_TODAY", $this->lng->txt(
"go_today"));
1241 $this->tpl->setVariable(
"NEXT_MONTH", $this->lng->txt(
"next_month"));
1242 $this->tpl->setVariable(
"NEXT_YEAR", $this->lng->txt(
"next_year"));
1243 $this->tpl->setVariable(
"SEL_DATE", $this->lng->txt(
"select_date"));
1244 $this->tpl->setVariable(
"DRAG_TO_MOVE", $this->lng->txt(
"drag_to_move"));
1245 $this->tpl->setVariable(
"PART_TODAY", $this->lng->txt(
"part_today"));
1246 $this->tpl->setVariable(
"DAY_FIRST", $this->lng->txt(
"day_first"));
1247 $this->tpl->setVariable(
"CLOSE", $this->lng->txt(
"close"));
1248 $this->tpl->setVariable(
"TODAY", $this->lng->txt(
"today"));
1249 $this->tpl->setVariable(
"TIME_PART", $this->lng->txt(
"time_part"));
1250 $this->tpl->setVariable(
"DEF_DATE_FORMAT", $this->lng->txt(
"def_date_format"));
1251 $this->tpl->setVariable(
"TT_DATE_FORMAT", $this->lng->txt(
"tt_date_format"));
1252 $this->tpl->setVariable(
"WK", $this->lng->txt(
"wk"));
1253 $this->tpl->setVariable(
"TIME", $this->lng->txt(
"time"));
1254 $this->tpl->parseCurrentBlock();
1255 $this->tpl->setCurrentBlock(
"CalendarJS");
1256 $this->tpl->setVariable(
"LOCATION_JAVASCRIPT_CALENDAR",
"./Modules/Test/js/calendar/calendar.js");
1257 $this->tpl->setVariable(
"LOCATION_JAVASCRIPT_CALENDAR_SETUP",
"./Modules/Test/js/calendar/calendar-setup.js");
1258 $this->tpl->setVariable(
"LOCATION_JAVASCRIPT_CALENDAR_STYLESHEET",
"./Modules/Test/js/calendar/calendar.css");
1259 $this->tpl->parseCurrentBlock();
1260 $this->tpl->setCurrentBlock(
"javascript_call_calendar");
1261 $this->tpl->setVariable(
"INPUT_FIELDS_REPORTING_DATE",
"reporting_date");
1262 $this->tpl->parseCurrentBlock();
1264 $this->tpl->setVariable(
"HEADING_SCORING_AND_RESULTS", $this->lng->txt(
"scoring"));
1265 $this->tpl->setVariable(
"DEFAULT",
"(" . $this->lng->txt(
"default") .
")");
1266 $this->tpl->setVariable(
"TEXT_COUNT_SYSTEM", $this->lng->txt(
"tst_text_count_system"));
1267 $this->tpl->setVariable(
"COUNT_PARTIAL_SOLUTIONS", $this->lng->txt(
"tst_count_partial_solutions"));
1268 $this->tpl->setVariable(
"COUNT_CORRECT_SOLUTIONS", $this->lng->txt(
"tst_count_correct_solutions"));
1269 $this->tpl->setVariable(
"COUNT_SYSTEM_DESCRIPTION", $this->lng->txt(
"tst_count_system_description"));
1270 switch (
$data[
"count_system"])
1273 $this->tpl->setVariable(
"CHECKED_COUNT_CORRECT_SOLUTIONS",
" checked=\"checked\"");
1277 $this->tpl->setVariable(
"CHECKED_COUNT_PARTIAL_SOLUTIONS",
" checked=\"checked\"");
1282 $this->tpl->setVariable(
"DISABLED_COUNT_CORRECT_SOLUTIONS",
" disabled=\"disabled\"");
1283 $this->tpl->setVariable(
"DISABLED_COUNT_PARTIAL_SOLUTIONS",
" disabled=\"disabled\"");
1286 $this->tpl->setVariable(
"TEXT_SCORE_MCMR", $this->lng->txt(
"tst_score_mcmr_questions"));
1287 $this->tpl->setVariable(
"ZERO_POINTS_WHEN_UNANSWERED", $this->lng->txt(
"tst_score_mcmr_zero_points_when_unanswered"));
1288 $this->tpl->setVariable(
"USE_SCORING_SYSTEM", $this->lng->txt(
"tst_score_mcmr_use_scoring_system"));
1289 $this->tpl->setVariable(
"TEXT_SCORE_MCMR_DESCRIPTION", $this->lng->txt(
"tst_score_mcmr_questions_description"));
1290 switch (
$data[
"mc_scoring"])
1293 $this->tpl->setVariable(
"CHECKED_ZERO_POINTS_WHEN_UNANSWERED",
" checked=\"checked\"");
1297 $this->tpl->setVariable(
"CHECKED_USE_SCORING_SYSTEM",
" checked=\"checked\"");
1302 $this->tpl->setVariable(
"DISABLED_ZERO_POINTS_WHEN_UNANSWERED",
" disabled=\"disabled\"");
1303 $this->tpl->setVariable(
"DISABLED_USE_SCORING_SYSTEM",
" disabled=\"disabled\"");
1306 $this->tpl->setVariable(
"TEXT_SCORE_CUTTING", $this->lng->txt(
"tst_score_cutting"));
1307 $this->tpl->setVariable(
"TEXT_CUT_QUESTION", $this->lng->txt(
"tst_score_cut_question"));
1308 $this->tpl->setVariable(
"TEXT_CUT_TEST", $this->lng->txt(
"tst_score_cut_test"));
1309 $this->tpl->setVariable(
"TEXT_SCORE_CUTTING_DESCRIPTION", $this->lng->txt(
"tst_score_cutting_description"));
1310 switch (
$data[
"score_cutting"])
1313 $this->tpl->setVariable(
"CHECKED_CUT_QUESTION",
" checked=\"checked\"");
1317 $this->tpl->setVariable(
"CHECKED_CUT_TEST",
" checked=\"checked\"");
1322 $this->tpl->setVariable(
"DISABLED_CUT_QUESTION",
" disabled=\"disabled\"");
1323 $this->tpl->setVariable(
"DISABLED_CUT_TEST",
" disabled=\"disabled\"");
1326 $this->tpl->setVariable(
"TEXT_PASS_SCORING", $this->lng->txt(
"tst_pass_scoring"));
1327 $this->tpl->setVariable(
"TEXT_LASTPASS", $this->lng->txt(
"tst_pass_last_pass"));
1328 $this->tpl->setVariable(
"TEXT_BESTPASS", $this->lng->txt(
"tst_pass_best_pass"));
1329 $this->tpl->setVariable(
"TEXT_PASS_SCORING_DESCRIPTION", $this->lng->txt(
"tst_pass_scoring_description"));
1330 switch (
$data[
"pass_scoring"])
1333 $this->tpl->setVariable(
"CHECKED_BESTPASS",
" checked=\"checked\"");
1337 $this->tpl->setVariable(
"CHECKED_LASTPASS",
" checked=\"checked\"");
1342 $this->tpl->setVariable(
"DISABLED_BESTPASS",
" disabled=\"disabled\"");
1343 $this->tpl->setVariable(
"DISABLED_LASTPASS",
" disabled=\"disabled\"");
1346 $this->tpl->setVariable(
"TEXT_INSTANT_FEEDBACK", $this->lng->txt(
"tst_instant_feedback"));
1347 $this->tpl->setVariable(
"TEXT_ANSWER_SPECIFIC_FEEDBACK", $this->lng->txt(
"tst_instant_feedback_answer_specific"));
1348 $this->tpl->setVariable(
"TEXT_SHOW_RESULTS", $this->lng->txt(
"tst_instant_feedback_results"));
1349 if (
$data[
"answer_feedback_points"])
1351 $this->tpl->setVariable(
"CHECKED_SHOW_RESULTS",
" checked=\"checked\"");
1353 $this->tpl->setVariable(
"TEXT_SHOW_SOLUTION", $this->lng->txt(
"tst_instant_feedback_solution"));
1354 $this->tpl->setVariable(
"TEXT_INSTANT_FEEDBACK_DESCRIPTION", $this->lng->txt(
"tst_instant_feedback_description"));
1355 if (
$data[
"instant_feedback_solution"])
1357 $this->tpl->setVariable(
"CHECKED_SHOW_SOLUTION",
" checked=\"checked\"");
1359 if (
$data[
"answer_feedback"])
1361 $this->tpl->setVariable(
"CHECKED_ANSWER_SPECIFIC_FEEDBACK",
" checked=\"checked\"");
1363 $this->tpl->setVariable(
"TEXT_RESULTS_PRESENTATION", $this->lng->txt(
"tst_results_presentation"));
1364 $this->tpl->setVariable(
"TEXT_SHOW_PASS_DETAILS", $this->lng->txt(
"tst_show_pass_details"));
1365 if (
$data[
"show_pass_details"])
1367 $this->tpl->setVariable(
"CHECKED_SHOW_PASS_DETAILS",
" checked=\"checked\"");
1369 $this->tpl->setVariable(
"TEXT_SHOW_SOLUTION_DETAILS", $this->lng->txt(
"tst_show_solution_details"));
1370 if (
$data[
"show_solution_details"])
1372 $this->tpl->setVariable(
"CHECKED_SHOW_SOLUTION_DETAILS",
" checked=\"checked\"");
1374 $this->tpl->setVariable(
"TEXT_SHOW_SOLUTION_ANSWERS_ONLY", $this->lng->txt(
"tst_show_solution_answers_only"));
1375 if (
$data[
"show_solution_answers_only"])
1377 $this->tpl->setVariable(
"CHECKED_SHOW_SOLUTION_ANSWERS_ONLY",
" checked=\"checked\"");
1379 $this->tpl->setVariable(
"TEXT_SHOW_SOLUTION_SIGNATURE", $this->lng->txt(
"tst_show_solution_signature"));
1380 if ($this->object->getAnonymity())
1382 $this->tpl->setVariable(
"DISABLED_SHOW_SOLUTION_SIGNATURE",
" disabled=\"disabled\"");
1386 if (
$data[
"show_solution_signature"])
1388 $this->tpl->setVariable(
"CHECKED_SHOW_SOLUTION_SIGNATURE",
" checked=\"checked\"");
1392 $this->tpl->setVariable(
"TEXT_SHOW_SOLUTION_FEEDBACK", $this->lng->txt(
"tst_show_solution_feedback"));
1393 if (
$data[
"show_solution_feedback"])
1395 $this->tpl->setVariable(
"CHECKED_SHOW_SOLUTION_FEEDBACK",
" checked=\"checked\"");
1398 $this->tpl->setVariable(
"TEXT_SHOW_SOLUTION_PRINTVIEW", $this->lng->txt(
"tst_show_solution_printview"));
1399 $this->tpl->setVariable(
"TEXT_RESULTS_PRESENTATION_DESCRIPTION", $this->lng->txt(
"tst_results_presentation_description"));
1400 if (
$data[
"show_solution_printview"])
1402 $this->tpl->setVariable(
"CHECKED_SHOW_SOLUTION_PRINTVIEW",
" checked=\"checked\"");
1405 $this->tpl->setVariable(
"TEXT_RESULTS_ACCESS", $this->lng->txt(
"tst_results_access"));
1406 $this->tpl->setVariable(
"TEXT_RESULTS_FINISHED", $this->lng->txt(
"tst_results_access_finished"));
1407 $this->tpl->setVariable(
"TEXT_RESULTS_DATE", $this->lng->txt(
"tst_results_access_date"));
1410 $report = getdate(time()+60*60*24*7);
1411 $date_input =
ilUtil::makeDateSelect(
"reporting_date", $report[
"year"], $report[
"mon"], $report[
"mday"]);
1414 preg_match(
"/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->object->getReportingDate(), $matches);
1415 $date_input =
ilUtil::makeDateSelect(
"reporting_date", $matches[1], sprintf(
"%d", $matches[2]), sprintf(
"%d", $matches[3]));
1416 $time_input =
ilUtil::makeTimeSelect(
"reporting_time",
true, sprintf(
"%d", $matches[4]), sprintf(
"%d", $matches[5]), sprintf(
"%d", $matches[6]));
1418 switch (
$data[
"results_access"])
1421 $this->tpl->setVariable(
"CHECKED_RESULTS_ALWAYS",
" checked=\"checked\"");
1424 $this->tpl->setVariable(
"CHECKED_RESULTS_DATE",
" checked=\"checked\"");
1428 $this->tpl->setVariable(
"CHECKED_RESULTS_FINISHED",
" checked=\"checked\"");
1431 $this->tpl->setVariable(
"INPUT_REPORTING_DATE", $this->lng->txt(
"date") .
": " . $date_input . $this->lng->txt(
"time") .
": " . $time_input);
1433 $this->tpl->setVariable(
"TXT_REPORTING_DATE_CALENDAR", $this->lng->txt(
"open_calendar"));
1434 $this->tpl->setVariable(
"TEXT_RESULTS_ALWAYS", $this->lng->txt(
"tst_results_access_always"));
1435 $this->tpl->setVariable(
"TEXT_RESULTS_ACCESS_DESCRIPTION", $this->lng->txt(
"tst_results_access_description"));
1437 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1438 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
1440 $this->tpl->setVariable(
"SAVE", $this->lng->txt(
"save"));
1443 $this->tpl->parseCurrentBlock();
1456 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
1460 $this->ctrl->redirect($this,
"infoScreen");
1463 if (strlen($this->ctrl->getCmdClass()) == 0) $this->ctrl->setCmdClass(
"ilobjtestgui");
1464 include_once
"./Services/RTE/classes/class.ilRTE.php";
1466 include_once
"./Services/RTE/classes/class.$rtestring.php";
1467 $rte =
new $rtestring();
1468 include_once
"./classes/class.ilObject.php";
1471 $rte->addRTESupport(
$obj_id, $obj_type,
"assessment");
1473 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_properties.html",
"Modules/Test");
1474 $this->lng->loadLanguageModule(
"jscalendar");
1475 $this->tpl->addBlockFile(
"CALENDAR_LANG_JAVASCRIPT",
"calendar_javascript",
"tpl.calendar.html");
1476 $this->tpl->setCurrentBlock(
"calendar_javascript");
1477 $this->tpl->setVariable(
"FULL_SUNDAY", $this->lng->txt(
"l_su"));
1478 $this->tpl->setVariable(
"FULL_MONDAY", $this->lng->txt(
"l_mo"));
1479 $this->tpl->setVariable(
"FULL_TUESDAY", $this->lng->txt(
"l_tu"));
1480 $this->tpl->setVariable(
"FULL_WEDNESDAY", $this->lng->txt(
"l_we"));
1481 $this->tpl->setVariable(
"FULL_THURSDAY", $this->lng->txt(
"l_th"));
1482 $this->tpl->setVariable(
"FULL_FRIDAY", $this->lng->txt(
"l_fr"));
1483 $this->tpl->setVariable(
"FULL_SATURDAY", $this->lng->txt(
"l_sa"));
1484 $this->tpl->setVariable(
"SHORT_SUNDAY", $this->lng->txt(
"s_su"));
1485 $this->tpl->setVariable(
"SHORT_MONDAY", $this->lng->txt(
"s_mo"));
1486 $this->tpl->setVariable(
"SHORT_TUESDAY", $this->lng->txt(
"s_tu"));
1487 $this->tpl->setVariable(
"SHORT_WEDNESDAY", $this->lng->txt(
"s_we"));
1488 $this->tpl->setVariable(
"SHORT_THURSDAY", $this->lng->txt(
"s_th"));
1489 $this->tpl->setVariable(
"SHORT_FRIDAY", $this->lng->txt(
"s_fr"));
1490 $this->tpl->setVariable(
"SHORT_SATURDAY", $this->lng->txt(
"s_sa"));
1491 $this->tpl->setVariable(
"FULL_JANUARY", $this->lng->txt(
"l_01"));
1492 $this->tpl->setVariable(
"FULL_FEBRUARY", $this->lng->txt(
"l_02"));
1493 $this->tpl->setVariable(
"FULL_MARCH", $this->lng->txt(
"l_03"));
1494 $this->tpl->setVariable(
"FULL_APRIL", $this->lng->txt(
"l_04"));
1495 $this->tpl->setVariable(
"FULL_MAY", $this->lng->txt(
"l_05"));
1496 $this->tpl->setVariable(
"FULL_JUNE", $this->lng->txt(
"l_06"));
1497 $this->tpl->setVariable(
"FULL_JULY", $this->lng->txt(
"l_07"));
1498 $this->tpl->setVariable(
"FULL_AUGUST", $this->lng->txt(
"l_08"));
1499 $this->tpl->setVariable(
"FULL_SEPTEMBER", $this->lng->txt(
"l_09"));
1500 $this->tpl->setVariable(
"FULL_OCTOBER", $this->lng->txt(
"l_10"));
1501 $this->tpl->setVariable(
"FULL_NOVEMBER", $this->lng->txt(
"l_11"));
1502 $this->tpl->setVariable(
"FULL_DECEMBER", $this->lng->txt(
"l_12"));
1503 $this->tpl->setVariable(
"SHORT_JANUARY", $this->lng->txt(
"s_01"));
1504 $this->tpl->setVariable(
"SHORT_FEBRUARY", $this->lng->txt(
"s_02"));
1505 $this->tpl->setVariable(
"SHORT_MARCH", $this->lng->txt(
"s_03"));
1506 $this->tpl->setVariable(
"SHORT_APRIL", $this->lng->txt(
"s_04"));
1507 $this->tpl->setVariable(
"SHORT_MAY", $this->lng->txt(
"s_05"));
1508 $this->tpl->setVariable(
"SHORT_JUNE", $this->lng->txt(
"s_06"));
1509 $this->tpl->setVariable(
"SHORT_JULY", $this->lng->txt(
"s_07"));
1510 $this->tpl->setVariable(
"SHORT_AUGUST", $this->lng->txt(
"s_08"));
1511 $this->tpl->setVariable(
"SHORT_SEPTEMBER", $this->lng->txt(
"s_09"));
1512 $this->tpl->setVariable(
"SHORT_OCTOBER", $this->lng->txt(
"s_10"));
1513 $this->tpl->setVariable(
"SHORT_NOVEMBER", $this->lng->txt(
"s_11"));
1514 $this->tpl->setVariable(
"SHORT_DECEMBER", $this->lng->txt(
"s_12"));
1515 $this->tpl->setVariable(
"ABOUT_CALENDAR", $this->lng->txt(
"about_calendar"));
1516 $this->tpl->setVariable(
"ABOUT_CALENDAR_LONG", $this->lng->txt(
"about_calendar_long"));
1517 $this->tpl->setVariable(
"ABOUT_TIME_LONG", $this->lng->txt(
"about_time"));
1518 $this->tpl->setVariable(
"PREV_YEAR", $this->lng->txt(
"prev_year"));
1519 $this->tpl->setVariable(
"PREV_MONTH", $this->lng->txt(
"prev_month"));
1520 $this->tpl->setVariable(
"GO_TODAY", $this->lng->txt(
"go_today"));
1521 $this->tpl->setVariable(
"NEXT_MONTH", $this->lng->txt(
"next_month"));
1522 $this->tpl->setVariable(
"NEXT_YEAR", $this->lng->txt(
"next_year"));
1523 $this->tpl->setVariable(
"SEL_DATE", $this->lng->txt(
"select_date"));
1524 $this->tpl->setVariable(
"DRAG_TO_MOVE", $this->lng->txt(
"drag_to_move"));
1525 $this->tpl->setVariable(
"PART_TODAY", $this->lng->txt(
"part_today"));
1526 $this->tpl->setVariable(
"DAY_FIRST", $this->lng->txt(
"day_first"));
1527 $this->tpl->setVariable(
"CLOSE", $this->lng->txt(
"close"));
1528 $this->tpl->setVariable(
"TODAY", $this->lng->txt(
"today"));
1529 $this->tpl->setVariable(
"TIME_PART", $this->lng->txt(
"time_part"));
1530 $this->tpl->setVariable(
"DEF_DATE_FORMAT", $this->lng->txt(
"def_date_format"));
1531 $this->tpl->setVariable(
"TT_DATE_FORMAT", $this->lng->txt(
"tt_date_format"));
1532 $this->tpl->setVariable(
"WK", $this->lng->txt(
"wk"));
1533 $this->tpl->setVariable(
"TIME", $this->lng->txt(
"time"));
1534 $this->tpl->parseCurrentBlock();
1535 $this->tpl->setCurrentBlock(
"CalendarJS");
1536 $this->tpl->setVariable(
"LOCATION_JAVASCRIPT_CALENDAR",
"./Modules/Test/js/calendar/calendar.js");
1537 $this->tpl->setVariable(
"LOCATION_JAVASCRIPT_CALENDAR_SETUP",
"./Modules/Test/js/calendar/calendar-setup.js");
1538 $this->tpl->setVariable(
"LOCATION_JAVASCRIPT_CALENDAR_STYLESHEET",
"./Modules/Test/js/calendar/calendar.css");
1539 $this->tpl->parseCurrentBlock();
1540 $this->tpl->setCurrentBlock(
"javascript_call_calendar");
1541 $this->tpl->setVariable(
"INPUT_FIELDS_STARTING_DATE",
"starting_date");
1542 $this->tpl->setVariable(
"INPUT_FIELDS_ENDING_DATE",
"ending_date");
1543 $this->tpl->parseCurrentBlock();
1545 $customstyles = $this->
object->getCustomStyles();
1546 if (is_array($customstyles) && count($customstyles) > 0)
1548 foreach ($customstyles as $customstyle)
1550 $this->tpl->setCurrentBlock(
"customstyle_option");
1551 $this->tpl->setVariable(
"VALUE_OPTION_CUSTOMSTYLE", $customstyle);
1552 $this->tpl->setVariable(
"TEXT_OPTION_CUSTOMSTYLE", $customstyle);
1553 if (strcmp($this->object->getCustomStyle(), $customstyle) == 0)
1555 $this->tpl->setVariable(
"SELECTION_OPTION_CUSTOMSTYLE",
" selected=\"selected\"");
1557 $this->tpl->parseCurrentBlock();
1559 $this->tpl->setCurrentBlock(
"customtyle");
1560 $this->tpl->setVariable(
"TEXT_CUSTOMSTYLE", $this->lng->txt(
"customstyle"));
1561 $this->tpl->setVariable(
"TEXT_NO_CUSTOMSTYLE", $this->lng->txt(
"no_selection"));
1562 $this->tpl->setVariable(
"TEXT_DESCRIPTION_CUSTOMSTYLE", $this->lng->txt(
"customstyle_description"));
1563 $this->tpl->parseCurrentBlock();
1566 $total = $this->
object->evalTotalPersons();
1567 $data[
"anonymity"] = $this->
object->getAnonymity();
1568 $data[
"show_cancel"] = $this->
object->getShowCancel();
1569 $data[
"show_marker"] = $this->
object->getShowMarker();
1570 $data[
"introduction"] = $this->
object->getIntroduction();
1571 $data[
"sequence_settings"] = $this->
object->getSequenceSettings();
1572 $data[
"nr_of_tries"] = $this->
object->getNrOfTries();
1573 $data[
"kiosk"] = $this->
object->getKioskMode();
1574 $data[
"kiosk_title"] = $this->
object->getShowKioskModeTitle();
1575 $data[
"kiosk_participant"] = $this->
object->getShowKioskModeParticipant();
1576 $data[
"use_previous_answers"] = $this->
object->getUsePreviousAnswers();
1577 $data[
"title_output"] = $this->
object->getTitleOutput();
1578 $data[
"enable_processing_time"] = $this->
object->getEnableProcessingTime();
1579 $data[
"reset_processing_time"] = $this->
object->getResetProcessingTime();
1580 $data[
"processing_time"] = $this->
object->getProcessingTime();
1581 $data[
"random_test"] = $this->
object->isRandomTest();
1582 $data[
"password"] = $this->
object->getPassword();
1583 $data[
"allowedUsers"] = $this->
object->getAllowedUsers();
1584 $data[
"allowedUsersTimeGap"] = $this->
object->getAllowedUsersTimeGap();
1585 if (!$this->object->getEnableProcessingTime())
1587 $proc_time = $this->
object->getEstimatedWorkingTime();
1588 $data[
"processing_time"] = sprintf(
"%02d:%02d:%02d",
1594 $data[
"starting_time"] = $this->
object->getStartingTime();
1595 $data[
"ending_time"] = $this->
object->getEndingTime();
1597 $this->tpl->setCurrentBlock(
"starting_time");
1598 $this->tpl->setVariable(
"TEXT_STARTING_TIME", $this->lng->txt(
"tst_starting_time"));
1599 if (!
$data[
"starting_time"])
1606 preg_match(
"/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/",
$data[
"starting_time"], $matches);
1607 $date_input =
ilUtil::makeDateSelect(
"starting_date", $matches[1], sprintf(
"%d", $matches[2]), sprintf(
"%d", $matches[3]));
1608 $time_input =
ilUtil::makeTimeSelect(
"starting_time",
true, sprintf(
"%d", $matches[4]), sprintf(
"%d", $matches[5]), sprintf(
"%d", $matches[6]));
1611 $this->tpl->setVariable(
"TXT_STARTING_TIME_CALENDAR", $this->lng->txt(
"open_calendar"));
1612 $this->tpl->setVariable(
"TXT_ENABLED", $this->lng->txt(
"enabled"));
1613 if (
$data[
"starting_time"])
1615 $this->tpl->setVariable(
"CHECKED_STARTING_TIME",
" checked=\"checked\"");
1617 $this->tpl->setVariable(
"INPUT_STARTING_TIME", $this->lng->txt(
"date") .
": " . $date_input . $this->lng->txt(
"time") .
": " . $time_input);
1618 $this->tpl->parseCurrentBlock();
1620 $this->tpl->setCurrentBlock(
"ending_time");
1621 $this->tpl->setVariable(
"TEXT_ENDING_TIME", $this->lng->txt(
"tst_ending_time"));
1622 if (!
$data[
"ending_time"])
1629 preg_match(
"/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/",
$data[
"ending_time"], $matches);
1630 $date_input =
ilUtil::makeDateSelect(
"ending_date", $matches[1], sprintf(
"%d", $matches[2]), sprintf(
"%d", $matches[3]));
1631 $time_input =
ilUtil::makeTimeSelect(
"ending_time",
true, sprintf(
"%d", $matches[4]), sprintf(
"%d", $matches[5]), sprintf(
"%d", $matches[6]));
1634 $this->tpl->setVariable(
"TXT_ENDING_TIME_CALENDAR", $this->lng->txt(
"open_calendar"));
1635 $this->tpl->setVariable(
"TXT_ENABLED", $this->lng->txt(
"enabled"));
1636 if (
$data[
"ending_time"])
1638 $this->tpl->setVariable(
"CHECKED_ENDING_TIME",
" checked=\"checked\"");
1640 $this->tpl->setVariable(
"INPUT_ENDING_TIME", $this->lng->txt(
"date") .
": " . $date_input . $this->lng->txt(
"time") .
": " . $time_input);
1641 $this->tpl->parseCurrentBlock();
1643 $this->tpl->setCurrentBlock(
"adm_content");
1644 $this->tpl->setVariable(
"ACTION_PROPERTIES", $this->ctrl->getFormAction($this));
1645 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
1647 $this->tpl->setVariable(
"SUBMIT_TYPE", $this->lng->txt(
"change"));
1649 $this->tpl->setVariable(
"HEADING_GENERAL", $this->lng->txt(
"tst_general_properties"));
1650 $this->tpl->setVariable(
"TEXT_ANONYMITY", $this->lng->txt(
"tst_anonymity"));
1651 $this->tpl->setVariable(
"DESCRIPTION_ANONYMITY", $this->lng->txt(
"tst_anonymity_description"));
1652 if (
$data[
"anonymity"])
1654 $this->tpl->setVariable(
"CHECKED_ANONYMITY",
" checked=\"checked\"");
1658 $this->tpl->setVariable(
"DISABLED_ANONYMITY",
" disabled=\"disabled\"");
1661 $this->tpl->setVariable(
"TEXT_SHOW_MARKER", $this->lng->txt(
"question_marking"));
1662 $this->tpl->setVariable(
"TEXT_SHOW_MARKER_DESCRIPTION", $this->lng->txt(
"question_marking_description"));
1663 if (
$data[
"show_marker"])
1665 $this->tpl->setVariable(
"CHECKED_SHOW_MARKER",
" checked=\"checked\"");
1668 $this->tpl->setVariable(
"TEXT_SHOW_CANCEL", $this->lng->txt(
"tst_show_cancel"));
1669 $this->tpl->setVariable(
"TEXT_SHOW_CANCEL_DESCRIPTION", $this->lng->txt(
"tst_show_cancel_description"));
1670 if (
$data[
"show_cancel"])
1672 $this->tpl->setVariable(
"CHECKED_SHOW_CANCEL",
" checked=\"checked\"");
1674 $this->tpl->setVariable(
"TEXT_INTRODUCTION", $this->lng->txt(
"tst_introduction"));
1676 $this->tpl->setVariable(
"SHOWINFO", $this->lng->txt(
"showinfo"));
1677 $this->tpl->setVariable(
"SHOWINFO_DESC", $this->lng->txt(
"showinfo_desc"));
1678 if ($this->object->getShowInfo())
1680 $this->tpl->setVariable(
"CHECKED_SHOWINFO",
" checked=\"checked\"");
1682 $this->tpl->setVariable(
"FINAL_STATEMENT", $this->lng->txt(
"final_statement"));
1683 $this->tpl->setVariable(
"VALUE_FINAL_STATEMENT",
ilUtil::prepareFormOutput($this->object->prepareTextareaOutput($this->object->getFinalStatement())));
1684 $this->tpl->setVariable(
"FINAL_STATEMENT_SHOW", $this->lng->txt(
"final_statement_show"));
1685 $this->tpl->setVariable(
"FINAL_STATEMENT_SHOW_DESC", $this->lng->txt(
"final_statement_show_desc"));
1686 if ($this->object->getShowFinalStatement())
1688 $this->tpl->setVariable(
"CHECKED_FINAL_STATEMENT_SHOW",
" checked=\"checked\"");
1690 $this->tpl->setVariable(
"HEADING_SEQUENCE", $this->lng->txt(
"tst_sequence_properties"));
1691 $this->tpl->setVariable(
"TEXT_POSTPONE", $this->lng->txt(
"tst_postpone"));
1692 $this->tpl->setVariable(
"TEXT_POSTPONE_DESCRIPTION", $this->lng->txt(
"tst_postpone_description"));
1693 if (
$data[
"sequence_settings"] == 1)
1695 $this->tpl->setVariable(
"CHECKED_POSTPONE",
" checked=\"checked\"");
1697 $this->tpl->setVariable(
"TEXT_SHUFFLE_QUESTIONS", $this->lng->txt(
"tst_shuffle_questions"));
1698 $this->tpl->setVariable(
"TEXT_SHUFFLE_QUESTIONS_DESCRIPTION", $this->lng->txt(
"tst_shuffle_questions_description"));
1699 if ($this->object->getShuffleQuestions())
1701 $this->tpl->setVariable(
"CHECKED_SHUFFLE_QUESTIONS",
" checked=\"checked\"");
1704 $this->tpl->setVariable(
"TEXT_SHOW_SUMMARY", $this->lng->txt(
"tst_show_summary"));
1705 $this->tpl->setVariable(
"TEXT_SHOW_SUMMARY_DESCRIPTION", $this->lng->txt(
"tst_show_summary_description"));
1706 $this->tpl->setVariable(
"TEXT_NO", $this->lng->txt(
"no"));
1707 $this->tpl->setVariable(
"TEXT_YES", $this->lng->txt(
"tst_list_of_questions_yes"));
1708 $this->tpl->setVariable(
"TEXT_LIST_OF_QUESTIONS_START", $this->lng->txt(
"tst_list_of_questions_start"));
1709 $this->tpl->setVariable(
"TEXT_LIST_OF_QUESTIONS_END", $this->lng->txt(
"tst_list_of_questions_end"));
1710 $this->tpl->setVariable(
"TEXT_LIST_OF_QUESTIONS_WITH_DESCRIPTION", $this->lng->txt(
"tst_list_of_questions_with_description"));
1711 if ($this->object->getListOfQuestions())
1713 $this->tpl->setVariable(
"CHECKED_LIST_OF_QUESTIONS_YES",
" checked=\"checked\"");
1714 if ($this->object->getListOfQuestionsStart())
1716 $this->tpl->setVariable(
"CHECKED_LIST_OF_QUESTIONS_START",
" checked=\"checked\"");
1718 if ($this->object->getListOfQuestionsEnd())
1720 $this->tpl->setVariable(
"CHECKED_LIST_OF_QUESTIONS_END",
" checked=\"checked\"");
1722 if ($this->object->getListOfQuestionsDescription())
1724 $this->tpl->setVariable(
"CHECKED_LIST_OF_QUESTIONS_WITH_DESCRIPTION",
" checked=\"checked\"");
1729 $this->tpl->setVariable(
"CHECKED_LIST_OF_QUESTIONS_NO",
" checked=\"checked\"");
1732 $this->tpl->setVariable(
"TEXT_USE_PREVIOUS_ANSWERS", $this->lng->txt(
"tst_use_previous_answers"));
1733 $this->tpl->setVariable(
"TEXT_USE_PREVIOUS_ANSWERS_DESCRIPTION", $this->lng->txt(
"tst_use_previous_answers_description"));
1735 $this->tpl->setVariable(
"FORCEJS", $this->lng->txt(
"forcejs"));
1736 $this->tpl->setVariable(
"FORCEJS_SHORT", $this->lng->txt(
"forcejs_short"));
1737 $this->tpl->setVariable(
"FORCEJS_DESC", $this->lng->txt(
"forcejs_desc"));
1738 if ($this->object->getForceJS())
1740 $this->tpl->setVariable(
"CHECKED_FORCEJS",
" checked=\"checked\"");
1742 $this->tpl->setVariable(
"TEXT_TITLE_OUTPUT", $this->lng->txt(
"tst_title_output"));
1743 $this->tpl->setVariable(
"TEXT_TITLE_OUTPUT_FULL", $this->lng->txt(
"tst_title_output_full"));
1744 $this->tpl->setVariable(
"TEXT_TITLE_OUTPUT_HIDE_POINTS", $this->lng->txt(
"tst_title_output_hide_points"));
1745 $this->tpl->setVariable(
"TEXT_TITLE_OUTPUT_NO_TITLE", $this->lng->txt(
"tst_title_output_no_title"));
1746 $this->tpl->setVariable(
"TEXT_TITLE_OUTPUT_DESCRIPTION", $this->lng->txt(
"tst_title_output_description"));
1747 switch (
$data[
"title_output"])
1750 $this->tpl->setVariable(
"CHECKED_TITLE_OUTPUT_HIDE_POINTS",
" checked=\"checked\"");
1753 $this->tpl->setVariable(
"CHECKED_TITLE_OUTPUT_NO_TITLE",
" checked=\"checked\"");
1757 $this->tpl->setVariable(
"CHECKED_TITLE_OUTPUT_FULL",
" checked=\"checked\"");
1760 if (
$data[
"random_test"])
1762 $data[
"use_previous_answers"] = 0;
1764 if (
$data[
"use_previous_answers"])
1766 $this->tpl->setVariable(
"CHECKED_USE_PREVIOUS_ANSWERS",
" checked=\"checked\"");
1768 if (
$data[
"random_test"])
1770 $this->tpl->setVariable(
"DISABLE_USE_PREVIOUS_ANSWERS",
" disabled=\"disabled\"");
1772 $this->tpl->setVariable(
"HEADING_KIOSK", $this->lng->txt(
"kiosk"));
1773 $this->tpl->setVariable(
"TEXT_KIOSK", $this->lng->txt(
"kiosk"));
1776 $this->tpl->setVariable(
"CHECKED_KIOSK",
" checked=\"checked\"");
1778 $this->tpl->setVariable(
"TEXT_KIOSK_DESCRIPTION", $this->lng->txt(
"kiosk_description"));
1779 $this->tpl->setVariable(
"TEXT_KIOSK_OPTIONS", $this->lng->txt(
"kiosk_options"));
1780 $this->tpl->setVariable(
"TEXT_KIOSK_OPTIONS_DESCRIPTION", $this->lng->txt(
"kiosk_options_desc"));
1781 $this->tpl->setVariable(
"TEXT_KIOSK_TITLE", $this->lng->txt(
"kiosk_show_title"));
1782 if (
$data[
"kiosk_title"])
1784 $this->tpl->setVariable(
"CHECKED_KIOSK_TITLE",
" checked=\"checked\"");
1786 $this->tpl->setVariable(
"TEXT_KIOSK_PARTICIPANT", $this->lng->txt(
"kiosk_show_participant"));
1787 if (
$data[
"kiosk_participant"])
1789 $this->tpl->setVariable(
"CHECKED_KIOSK_PARTICIPANT",
" checked=\"checked\"");
1791 $this->tpl->setVariable(
"HEADING_SESSION", $this->lng->txt(
"tst_session_settings"));
1792 $this->tpl->setVariable(
"TEXT_NR_OF_TRIES", $this->lng->txt(
"tst_nr_of_tries"));
1793 $this->tpl->setVariable(
"VALUE_NR_OF_TRIES",
$data[
"nr_of_tries"]);
1794 $this->tpl->setVariable(
"COMMENT_NR_OF_TRIES", $this->lng->txt(
"0_unlimited"));
1795 $this->tpl->setVariable(
"TXT_ENABLED", $this->lng->txt(
"enabled"));
1796 $this->tpl->setVariable(
"TXT_RESET_PROCESSING_TIME", $this->lng->txt(
"tst_reset_processing_time"));
1797 $this->tpl->setVariable(
"TEXT_RESET_PROCESSING_TIME_DESC", $this->lng->txt(
"tst_reset_processing_time_desc"));
1798 $this->tpl->setVariable(
"TEXT_PROCESSING_TIME", $this->lng->txt(
"tst_processing_time"));
1799 $this->tpl->setVariable(
"TEXT_PROCESSING_TIME_DESC", $this->lng->txt(
"tst_processing_time_desc"));
1800 $time_input =
ilUtil::makeTimeSelect(
"processing_time",
false, substr(
$data[
"processing_time"], 0, 2), substr(
$data[
"processing_time"], 3, 2), substr(
$data[
"processing_time"], 6, 2));
1801 $this->tpl->setVariable(
"MAX_PROCESSING_TIME", $time_input .
" (hh:mm:ss)");
1802 if (
$data[
"enable_processing_time"]) {
1803 $this->tpl->setVariable(
"CHECKED_PROCESSING_TIME",
" checked=\"checked\"");
1805 if (
$data[
"reset_processing_time"])
1807 $this->tpl->setVariable(
"CHECKED_RESET_PROCESSING_TIME",
" checked=\"checked\"");
1809 $this->tpl->setVariable(
"TEXT_RANDOM_TEST", $this->lng->txt(
"tst_random_selection"));
1810 $this->tpl->setVariable(
"TEXT_RANDOM_TEST_DESCRIPTION", $this->lng->txt(
"tst_random_test_description"));
1811 if (
$data[
"random_test"])
1813 $this->tpl->setVariable(
"CHECKED_RANDOM_TEST",
" checked=\"checked\"");
1816 $this->tpl->setVariable(
"TEXT_MAX_ALLOWED_USERS", $this->lng->txt(
"tst_max_allowed_users"));
1817 $this->tpl->setVariable(
"TEXT_ALLOWED_USERS", $this->lng->txt(
"tst_allowed_users"));
1818 $this->tpl->setVariable(
"TEXT_ALLOWED_USERS_TIME_GAP", $this->lng->txt(
"tst_allowed_users_time_gap"));
1819 if (
$data[
"allowedUsers"] > 0)
1821 $this->tpl->setVariable(
"VALUE_ALLOWED_USERS",
" value=\"" .
$data[
"allowedUsers"] .
"\"");
1823 $this->tpl->setVariable(
"TEXT_ALLOWED_USERS_TIME_GAP", $this->lng->txt(
"tst_allowed_users_time_gap"));
1824 if (
$data[
"allowedUsersTimeGap"] > 0)
1826 $this->tpl->setVariable(
"VALUE_ALLOWED_USERS_TIME_GAP",
" value=\"" .
$data[
"allowedUsersTimeGap"] .
"\"");
1828 $this->tpl->setVariable(
"SECONDS", $this->lng->txt(
"seconds"));
1829 $this->tpl->setVariable(
"TEXT_PASSWORD", $this->lng->txt(
"tst_password"));
1830 $this->tpl->setVariable(
"TEXT_PASSWORD_DETAILS", $this->lng->txt(
"tst_password_details"));
1831 if (strlen(
$data[
"password"]))
1835 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
1837 $this->tpl->setVariable(
"SAVE", $this->lng->txt(
"save"));
1841 $this->tpl->setVariable(
"ENABLED_RANDOM_TEST",
" disabled=\"disabled\"");
1843 $this->tpl->parseCurrentBlock();
1852 include_once(
"./Modules/File/classes/class.ilObjFile.php");
1854 $fileObj->sendFile();
1863 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
1866 $page_gui->showMediaFullscreen();
1875 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
1877 $pg_obj->send_paragraph (
$_GET[
"par_id"],
$_GET[
"downloadtitle"]);
1914 $this->ctrl->redirect($this,
"questions");
1927 $selected_array = array();
1928 foreach ($_POST as $key => $value)
1930 if (preg_match(
"/cb_(\d+)/", $key, $matches))
1932 array_push($selected_array, $matches[1]);
1935 if (!count($selected_array))
1938 $this->ctrl->setParameterByClass(get_class($this),
"sel_filter_type", $_POST[
"sel_filter_type"]);
1939 $this->ctrl->setParameterByClass(get_class($this),
"sel_question_type", $_POST[
"sel_question_type"]);
1940 $this->ctrl->setParameterByClass(get_class($this),
"sel_questionpool", $_POST[
"sel_questionpool"]);
1941 $this->ctrl->setParameterByClass(get_class($this),
"filter_text", $_POST[
"filter_text"]);
1942 $this->ctrl->redirect($this,
"browseForQuestions");
1946 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1947 $manscoring = FALSE;
1948 foreach ($selected_array as $key => $value)
1950 $this->
object->insertQuestion($value);
1956 $this->
object->saveCompleteStatus();
1965 $this->ctrl->redirect($this,
"questions");
1981 $this->ctrl->setParameterByClass(get_class($this),
"browse",
"1");
1982 $textfilters = array();
1983 if (strcmp($this->ctrl->getCmd(),
"resetFilter") == 0)
1986 $filter_question_type =
"";
1987 $filter_questionpool =
"";
1992 $filter_question_type = (array_key_exists(
"sel_question_type", $_POST)) ? $_POST[
"sel_question_type"] :
$_GET[
"sel_question_type"];
1993 $filter_type = (array_key_exists(
"sel_filter_type", $_POST)) ? $_POST[
"sel_filter_type"] :
$_GET[
"sel_filter_type"];
1994 $filter_questionpool = (array_key_exists(
"sel_questionpool", $_POST)) ? $_POST[
"sel_questionpool"] :
$_GET[
"sel_questionpool"];
1995 $filter_text = (array_key_exists(
"filter_text", $_POST)) ? $_POST[
"filter_text"] :
$_GET[
"filter_text"];
1998 $filter_title = (array_key_exists(
"filter_title", $_POST)) ? $_POST[
"filter_title"] :
$_GET[
"filter_title"];
1999 if (strlen($filter_title)) $textfilters[
"title"] = $filter_title;
2000 $filter_qpl = (array_key_exists(
"filter_qpl", $_POST)) ? $_POST[
"filter_qpl"] :
$_GET[
"filter_qpl"];
2001 if (strlen($filter_qpl)) $textfilters[
"qpl"] = $filter_qpl;
2002 $filter_comment = (array_key_exists(
"filter_comment", $_POST)) ? $_POST[
"filter_comment"] :
$_GET[
"filter_comment"];
2003 if (strlen($filter_comment)) $textfilters[
"comment"] = $filter_comment;
2004 $filter_author = (array_key_exists(
"filter_author", $_POST)) ? $_POST[
"filter_author"] :
$_GET[
"filter_author"];
2005 if (strlen($filter_author)) $textfilters[
"author"] = $filter_author;
2007 $this->ctrl->setParameterByClass(get_class($this),
"sel_filter_type", $filter_type);
2008 $this->ctrl->setParameterByClass(get_class($this),
"sel_question_type", $filter_question_type);
2009 $this->ctrl->setParameterByClass(get_class($this),
"sel_questionpool", $filter_questionpool);
2010 $this->ctrl->setParameterByClass(get_class($this),
"filter_text", $filter_text);
2011 $this->ctrl->setParameterByClass(get_class($this),
"filter_title", $filter_title);
2012 $this->ctrl->setParameterByClass(get_class($this),
"filter_qpl", $filter_qpl);
2013 $this->ctrl->setParameterByClass(get_class($this),
"filter_comment", $filter_comment);
2014 $this->ctrl->setParameterByClass(get_class($this),
"filter_author", $filter_author);
2016 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_questionbrowser.html",
"Modules/Test");
2017 $this->tpl->addBlockFile(
"A_BUTTONS",
"a_buttons",
"tpl.il_as_qpl_action_buttons.html",
"Modules/Test");
2018 $this->tpl->addBlockFile(
"FILTER_QUESTION_MANAGER",
"filter_questions",
"tpl.il_as_tst_filter_questions.html",
"Modules/Test");
2020 $questionpools =& $this->
object->getAvailableQuestionpools(
true);
2021 $filter_fields = array(
2022 "title" => $this->lng->txt(
"title"),
2023 "comment" => $this->lng->txt(
"description"),
2024 "author" => $this->lng->txt(
"author"),
2026 $this->tpl->setCurrentBlock(
"filterrow");
2027 foreach ($filter_fields as $key => $value) {
2028 $this->tpl->setVariable(
"VALUE_FILTER_TYPE",
"$key");
2029 $this->tpl->setVariable(
"NAME_FILTER_TYPE",
"$value");
2030 if (strcmp($this->ctrl->getCmd(),
"resetFilter") != 0)
2032 if (strcmp($filter_type, $key) == 0)
2034 $this->tpl->setVariable(
"VALUE_FILTER_SELECTED",
" selected=\"selected\"");
2037 $this->tpl->parseCurrentBlock();
2040 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
2042 foreach ($questiontypes as $key => $value)
2044 $this->tpl->setCurrentBlock(
"questiontype_row");
2045 $this->tpl->setVariable(
"VALUE_QUESTION_TYPE", $value[
"type_tag"]);
2046 $this->tpl->setVariable(
"TEXT_QUESTION_TYPE", $key);
2047 if (strcmp($filter_question_type, $value[
"type_tag"]) == 0)
2049 $this->tpl->setVariable(
"SELECTED_QUESTION_TYPE",
" selected=\"selected\"");
2051 $this->tpl->parseCurrentBlock();
2054 foreach ($questionpools as $key => $value)
2056 $this->tpl->setCurrentBlock(
"questionpool_row");
2057 $this->tpl->setVariable(
"VALUE_QUESTIONPOOL", $key);
2058 $this->tpl->setVariable(
"TEXT_QUESTIONPOOL", $value[
"title"]);
2059 if (strcmp($filter_questionpool, $key) == 0)
2061 $this->tpl->setVariable(
"SELECTED_QUESTIONPOOL",
" selected=\"selected\"");
2063 $this->tpl->parseCurrentBlock();
2066 $this->tpl->setCurrentBlock(
"filter_questions");
2067 $this->tpl->setVariable(
"SHOW_QUESTION_TYPES", $this->lng->txt(
"filter_show_question_types"));
2068 $this->tpl->setVariable(
"TEXT_ALL_QUESTION_TYPES", $this->lng->txt(
"filter_all_question_types"));
2069 $this->tpl->setVariable(
"SHOW_QUESTIONPOOLS", $this->lng->txt(
"filter_show_questionpools"));
2070 $this->tpl->setVariable(
"TEXT_ALL_QUESTIONPOOLS", $this->lng->txt(
"filter_all_questionpools"));
2071 $this->tpl->setVariable(
"FILTER_TEXT", $this->lng->txt(
"filter"));
2072 $this->tpl->setVariable(
"TEXT_FILTER_BY", $this->lng->txt(
"by"));
2073 if (strcmp($this->ctrl->getCmd(),
"resetFilter") != 0)
2075 $this->tpl->setVariable(
"VALUE_FILTER_TEXT", $filter_text);
2077 $this->tpl->setVariable(
"VALUE_SUBMIT_FILTER", $this->lng->txt(
"set_filter"));
2078 $this->tpl->setVariable(
"VALUE_RESET_FILTER", $this->lng->txt(
"reset_filter"));
2079 $this->tpl->parseCurrentBlock();
2082 if (
$_GET[
"prevrow"])
2084 $startrow =
$_GET[
"prevrow"];
2086 if (
$_GET[
"nextrow"])
2088 $startrow =
$_GET[
"nextrow"];
2090 if (
$_GET[
"startrow"])
2092 $startrow =
$_GET[
"startrow"];
2094 $sort = (
$_GET[
"sort"]) ?
$_GET[
"sort"] :
"title";
2095 $sortorder = (
$_GET[
"sortorder"]) ?
$_GET[
"sortorder"] :
"ASC";
2096 $this->ctrl->setParameter($this,
"sort", $sort);
2097 $this->ctrl->setParameter($this,
"sortorder", $sortorder);
2098 if (strlen($filter_text) && strlen($filter_type)) $textfilters[$filter_type] = $filter_text;
2099 $table = $this->
object->getQuestionsTable($sort, $sortorder, $textfilters, $startrow, 1, $filter_question_type, $filter_questionpool);
2101 $colors = array(
"tblrow1",
"tblrow2");
2103 $existing_questions =& $this->
object->getExistingQuestions();
2104 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
2105 if ((is_array($table[
"rows"])) && (count($table[
"rows"])))
2107 foreach ($table[
"rows"] as
$data)
2109 if (!in_array($data[
"question_id"], $existing_questions))
2111 if ($data[
"complete"])
2114 $this->tpl->setCurrentBlock(
"checkable");
2115 $this->tpl->setVariable(
"QUESTION_ID", $data[
"question_id"]);
2116 $this->tpl->parseCurrentBlock();
2118 $this->tpl->setCurrentBlock(
"QTab");
2119 $this->tpl->setVariable(
"QUESTION_ID", $data[
"question_id"]);
2120 $this->tpl->setVariable(
"QUESTION_TITLE",
"<strong>" . $data[
"title"] .
"</strong>");
2121 $this->tpl->setVariable(
"PREVIEW",
"[<a href=\"" . $this->ctrl->getLinkTarget($this,
"questions") .
"&preview=" . $data[
"question_id"] .
"\">" . $this->lng->txt(
"preview") .
"</a>]");
2122 $this->tpl->setVariable(
"QUESTION_COMMENT", $data[
"comment"]);
2124 $this->tpl->setVariable(
"QUESTION_AUTHOR", $data[
"author"]);
2127 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
2128 $this->tpl->setVariable(
"QUESTION_POOL", $questionpools[$data[
"obj_fi"]][
"title"]);
2129 $this->tpl->parseCurrentBlock();
2134 if ($table[
"rowcount"] > count($table[
"rows"]))
2136 $nextstep = $table[
"nextrow"] + $table[
"step"];
2137 if ($nextstep > $table[
"rowcount"])
2139 $nextstep = $table[
"rowcount"];
2142 for ($i = 0; $i < $table[
"rowcount"]; $i += $table[
"step"])
2144 $this->tpl->setCurrentBlock(
"pages");
2145 if ($table[
"startrow"] == $i)
2147 $this->tpl->setVariable(
"PAGE_NUMBER",
"<span class=\"inactivepage\">$counter</span>");
2151 $this->tpl->setVariable(
"PAGE_NUMBER",
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"browseForQuestions") .
"&nextrow=$i" .
"\">$counter</a>");
2153 $this->tpl->parseCurrentBlock();
2156 $this->tpl->setCurrentBlock(
"navigation_bottom");
2157 $this->tpl->setVariable(
"TEXT_ITEM", $this->lng->txt(
"item"));
2158 $this->tpl->setVariable(
"TEXT_ITEM_START", $table[
"startrow"] + 1);
2159 $end = $table[
"startrow"] + $table[
"step"];
2160 if ($end > $table[
"rowcount"])
2162 $end = $table[
"rowcount"];
2164 $this->tpl->setVariable(
"TEXT_ITEM_END", $end);
2165 $this->tpl->setVariable(
"TEXT_OF", strtolower($this->lng->txt(
"of")));
2166 $this->tpl->setVariable(
"TEXT_ITEM_COUNT", $table[
"rowcount"]);
2167 $this->tpl->setVariable(
"TEXT_PREVIOUS", $this->lng->txt(
"previous"));
2168 $this->tpl->setVariable(
"TEXT_NEXT", $this->lng->txt(
"next"));
2169 $this->tpl->setVariable(
"HREF_PREV_ROWS", $this->ctrl->getLinkTarget($this,
"browseForQuestions") .
"&prevrow=" . $table[
"prevrow"]);
2170 $this->tpl->setVariable(
"HREF_NEXT_ROWS", $this->ctrl->getLinkTarget($this,
"browseForQuestions") .
"&nextrow=" . $table[
"nextrow"]);
2171 $this->tpl->parseCurrentBlock();
2176 if (!((is_array($table[
"rows"])) && (count($table[
"rows"]))))
2178 $this->tpl->setCurrentBlock(
"Emptytable");
2179 $this->tpl->setVariable(
"TEXT_EMPTYTABLE", $this->lng->txt(
"no_questions_available"));
2180 $this->tpl->parseCurrentBlock();
2185 $this->tpl->setCurrentBlock(
"selection");
2186 $this->tpl->setVariable(
"INSERT", $this->lng->txt(
"insert"));
2187 $this->tpl->parseCurrentBlock();
2189 $this->tpl->setCurrentBlock(
"selectall");
2190 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
2192 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
2193 $this->tpl->parseCurrentBlock();
2195 $this->tpl->setCurrentBlock(
"Footer");
2196 $this->tpl->setVariable(
"ARROW",
"<img src=\"" .
ilUtil::getImagePath(
"arrow_downright.gif") .
"\" alt=\"".$this->lng->txt(
"arrow_downright").
"\"/>");
2197 $this->tpl->parseCurrentBlock();
2201 "title" => (strcmp($sort,
"title") == 0) ? $sortorder :
"",
2202 "comment" => (strcmp($sort,
"comment") == 0) ? $sortorder :
"",
2203 "type" => (strcmp($sort,
"type") == 0) ? $sortorder :
"",
2204 "author" => (strcmp($sort,
"author") == 0) ? $sortorder :
"",
2205 "created" => (strcmp($sort,
"created") == 0) ? $sortorder :
"",
2206 "updated" => (strcmp($sort,
"updated") == 0) ? $sortorder :
"",
2207 "qpl" => (strcmp($sort,
"qpl") == 0) ? $sortorder :
""
2209 foreach ($sortarray as $key => $value)
2211 if (strcmp($value,
"ASC") == 0)
2213 $sortarray[$key] =
"DESC";
2217 $sortarray[$key] =
"ASC";
2222 include_once
"./Services/YUI/classes/class.ilYuiUtil.php";
2227 $titlefilter =
new ilTemplate(
"tpl.text_filter.js", TRUE, TRUE,
"Modules/TestQuestionPool");
2228 $titlefilter->setVariable(
"FILTERELEMENTID",
"titlefilter");
2229 $titlefilter->setVariable(
"OVERLAY_WIDTH",
"500px");
2230 $titlefilter->setVariable(
"OVERLAY_HEIGHT",
"5em");
2231 $titlefilter->setVariable(
"TEXTFIELD_NAME",
"filter_title");
2233 $titlefilter->setVariable(
"ALT_CLOSE", $this->lng->txt(
"close"));
2234 $titlefilter->setVariable(
"TITLE_CLOSE", $this->lng->txt(
"close"));
2235 $titlefilter->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"filter"));
2236 $titlefilter->setVariable(
"VALUE_FILTER_TEXT", $filter_title);
2237 $titlefilter->setVariable(
"VALUE_SUBMIT_FILTER", $this->lng->txt(
"set_filter"));
2238 $titlefilter->setVariable(
"VALUE_RESET_FILTER", $this->lng->txt(
"reset_filter"));
2239 $this->tpl->setCurrentBlock(
"HeadContent");
2240 $this->tpl->setVariable(
"CONTENT_BLOCK", $titlefilter->get());
2241 $this->tpl->parseCurrentBlock();
2244 $filtermenu =
new ilTemplate(
"tpl.question_type_menu.js", TRUE, TRUE,
"Modules/TestQuestionPool");
2245 if (strcmp($filter_question_type,
"") == 0)
2247 $filtermenu->setCurrentBlock(
"selected");
2248 $filtermenu->touchBlock(
"selected");
2249 $filtermenu->parseCurrentBlock();
2251 $filtermenu->setCurrentBlock(
"menuitem");
2252 $filtermenu->setVariable(
"ITEM_TEXT", $this->lng->txt(
"filter_all_question_types"));
2253 $this->ctrl->setParameter($this,
"sel_question_type",
"");
2254 $this->ctrl->setParameter($this,
"sort", $sort);
2255 $this->ctrl->setParameter($this,
"sortorder", $sortorder);
2256 $filtermenu->setVariable(
"ITEM_URL", $this->ctrl->getLinkTarget($this,
"browseForQuestions"));
2257 $filtermenu->parseCurrentBlock();
2258 foreach ($questiontypes as $key => $value)
2260 if (strcmp($filter_question_type, $value[
"type_tag"]) == 0)
2262 $filtermenu->setCurrentBlock(
"selected");
2263 $filtermenu->touchBlock(
"selected");
2264 $filtermenu->parseCurrentBlock();
2266 $filtermenu->setCurrentBlock(
"menuitem");
2267 $filtermenu->setVariable(
"VALUE_QUESTION_TYPE", $value[
"type_tag"]);
2268 $filtermenu->setVariable(
"ITEM_TEXT", $key);
2269 $this->ctrl->setParameter($this,
"sel_question_type", $value[
"type_tag"]);
2270 $filtermenu->setVariable(
"ITEM_URL", $this->ctrl->getLinkTarget($this,
"browseForQuestions"));
2271 $filtermenu->parseCurrentBlock();
2273 $this->ctrl->setParameter($this,
"sel_question_type", $filter_question_type);
2274 $this->tpl->setCurrentBlock(
"HeadContent");
2275 $this->tpl->setVariable(
"CONTENT_BLOCK", $filtermenu->get());
2276 $this->tpl->parseCurrentBlock();
2279 $commenttextfilter =
new ilTemplate(
"tpl.text_filter.js", TRUE, TRUE,
"Modules/TestQuestionPool");
2280 $commenttextfilter->setVariable(
"FILTERELEMENTID",
"commenttextfilter");
2281 $commenttextfilter->setVariable(
"OVERLAY_WIDTH",
"500px");
2282 $commenttextfilter->setVariable(
"OVERLAY_HEIGHT",
"8em");
2283 $commenttextfilter->setVariable(
"TEXTFIELD_NAME",
"filter_comment");
2285 $commenttextfilter->setVariable(
"ALT_CLOSE", $this->lng->txt(
"close"));
2286 $commenttextfilter->setVariable(
"TITLE_CLOSE", $this->lng->txt(
"close"));
2287 $commenttextfilter->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"filter"));
2288 $commenttextfilter->setVariable(
"VALUE_FILTER_TEXT", $filter_comment);
2289 $commenttextfilter->setVariable(
"VALUE_SUBMIT_FILTER", $this->lng->txt(
"set_filter"));
2290 $commenttextfilter->setVariable(
"VALUE_RESET_FILTER", $this->lng->txt(
"reset_filter"));
2291 $this->tpl->setCurrentBlock(
"HeadContent");
2292 $this->tpl->setVariable(
"CONTENT_BLOCK", $commenttextfilter->get());
2293 $this->tpl->parseCurrentBlock();
2296 $authortextfilter =
new ilTemplate(
"tpl.text_filter.js", TRUE, TRUE,
"Modules/TestQuestionPool");
2297 $authortextfilter->setVariable(
"FILTERELEMENTID",
"authortextfilter");
2298 $authortextfilter->setVariable(
"OVERLAY_WIDTH",
"500px");
2299 $authortextfilter->setVariable(
"OVERLAY_HEIGHT",
"5em");
2300 $authortextfilter->setVariable(
"TEXTFIELD_NAME",
"filter_author");
2302 $authortextfilter->setVariable(
"ALT_CLOSE", $this->lng->txt(
"close"));
2303 $authortextfilter->setVariable(
"TITLE_CLOSE", $this->lng->txt(
"close"));
2304 $authortextfilter->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"filter"));
2305 $authortextfilter->setVariable(
"VALUE_FILTER_TEXT", $filter_author);
2306 $authortextfilter->setVariable(
"VALUE_SUBMIT_FILTER", $this->lng->txt(
"set_filter"));
2307 $authortextfilter->setVariable(
"VALUE_RESET_FILTER", $this->lng->txt(
"reset_filter"));
2308 $this->tpl->setCurrentBlock(
"HeadContent");
2309 $this->tpl->setVariable(
"CONTENT_BLOCK", $authortextfilter->get());
2310 $this->tpl->parseCurrentBlock();
2313 $qpltextfilter =
new ilTemplate(
"tpl.text_filter.js", TRUE, TRUE,
"Modules/TestQuestionPool");
2314 $qpltextfilter->setVariable(
"FILTERELEMENTID",
"qpltextfilter");
2315 $qpltextfilter->setVariable(
"OVERLAY_WIDTH",
"500px");
2316 $qpltextfilter->setVariable(
"OVERLAY_HEIGHT",
"5em");
2317 $qpltextfilter->setVariable(
"TEXTFIELD_NAME",
"filter_qpl");
2319 $qpltextfilter->setVariable(
"ALT_CLOSE", $this->lng->txt(
"close"));
2320 $qpltextfilter->setVariable(
"TITLE_CLOSE", $this->lng->txt(
"close"));
2321 $qpltextfilter->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"filter"));
2322 $qpltextfilter->setVariable(
"VALUE_FILTER_TEXT", $filter_qpl);
2323 $qpltextfilter->setVariable(
"VALUE_SUBMIT_FILTER", $this->lng->txt(
"set_filter"));
2324 $qpltextfilter->setVariable(
"VALUE_RESET_FILTER", $this->lng->txt(
"reset_filter"));
2325 $this->tpl->setCurrentBlock(
"HeadContent");
2326 $this->tpl->setVariable(
"CONTENT_BLOCK", $qpltextfilter->get());
2327 $this->tpl->parseCurrentBlock();
2329 $this->tpl->setCurrentBlock(
"adm_content");
2330 $this->ctrl->setCmd(
"questionBrowser");
2331 $this->ctrl->setParameterByClass(get_class($this),
"startrow", $table[
"startrow"]);
2332 $template =
new ilTemplate(
"tpl.image.html",
true,
true);
2333 if (strlen($filter_title))
2341 $template->setVariable(
"IMAGE_TITLE", $this->lng->txt(
"filter"));
2342 $template->setVariable(
"IMAGE_ALT", $this->lng->txt(
"filter"));
2343 $template->setVariable(
"ID",
"titlefilter");
2344 $template->setVariable(
"STYLE",
"visibility: hidden; cursor: pointer");
2345 $this->ctrl->setParameter($this,
"sort",
"title");
2346 $this->ctrl->setParameter($this,
"sortorder", $sortarray[
"title"]);
2347 $questiontitle =
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"browseForQuestions") .
"\">" . $this->lng->txt(
"title") .
"</a>";
2348 $questiontitle .= $template->get();
2349 $questiontitle .= $table[
"images"][
"title"];
2350 $this->tpl->setVariable(
"QUESTION_TITLE", $questiontitle);
2351 $this->ctrl->setParameter($this,
"sort",
"comment");
2352 $this->ctrl->setParameter($this,
"sortorder", $sortarray[
"comment"]);
2353 $template =
new ilTemplate(
"tpl.image.html",
true,
true);
2354 if (strlen($filter_comment))
2362 $template->setVariable(
"IMAGE_TITLE", $this->lng->txt(
"filter"));
2363 $template->setVariable(
"IMAGE_ALT", $this->lng->txt(
"filter"));
2364 $template->setVariable(
"ID",
"commenttextfilter");
2365 $template->setVariable(
"STYLE",
"visibility: hidden; cursor: pointer");
2366 $this->ctrl->setParameter($this,
"sort",
"comment");
2367 $this->ctrl->setParameter($this,
"sortorder", $sortarray[
"comment"]);
2368 $questiontype =
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"browseForQuestions") .
"\">" . $this->lng->txt(
"description") .
"</a>";
2369 $questiontype .= $template->get();
2370 $questiontype .= $table[
"images"][
"comment"];
2371 $this->tpl->setVariable(
"QUESTION_COMMENT", $questiontype);
2372 $template =
new ilTemplate(
"tpl.image.html",
true,
true);
2373 if (strlen($filter_question_type))
2381 $template->setVariable(
"IMAGE_TITLE", $this->lng->txt(
"filter"));
2382 $template->setVariable(
"IMAGE_ALT", $this->lng->txt(
"filter"));
2383 $template->setVariable(
"ID",
"filter");
2384 $template->setVariable(
"STYLE",
"visibility: hidden; cursor: pointer");
2385 $this->ctrl->setParameter($this,
"sort",
"type");
2386 $this->ctrl->setParameter($this,
"sortorder", $sortarray[
"type"]);
2387 $questiontype =
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"browseForQuestions") .
"\">" . $this->lng->txt(
"question_type") .
"</a>";
2388 $questiontype .= $template->get();
2389 $questiontype .= $table[
"images"][
"type"];
2390 $this->tpl->setVariable(
"QUESTION_TYPE", $questiontype);
2391 $template =
new ilTemplate(
"tpl.image.html",
true,
true);
2392 if (strlen($filter_author))
2400 $template->setVariable(
"IMAGE_TITLE", $this->lng->txt(
"filter"));
2401 $template->setVariable(
"IMAGE_ALT", $this->lng->txt(
"filter"));
2402 $template->setVariable(
"ID",
"authortextfilter");
2403 $template->setVariable(
"STYLE",
"visibility: hidden; cursor: pointer;");
2404 $this->ctrl->setParameter($this,
"sort",
"author");
2405 $this->ctrl->setParameter($this,
"sortorder", $sortarray[
"author"]);
2406 $questiontype =
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"browseForQuestions") .
"\">" . $this->lng->txt(
"author") .
"</a>";
2407 $questiontype .= $template->get();
2408 $questiontype .= $table[
"images"][
"author"];
2409 $this->tpl->setVariable(
"QUESTION_AUTHOR", $questiontype);
2410 $this->ctrl->setParameter($this,
"sort",
"created");
2411 $this->ctrl->setParameter($this,
"sortorder", $sortarray[
"created"]);
2412 $this->tpl->setVariable(
"QUESTION_CREATED",
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"browseForQuestions") .
"\">" . $this->lng->txt(
"create_date") .
"</a>" . $table[
"images"][
"created"]);
2413 $this->ctrl->setParameter($this,
"sort",
"updated");
2414 $this->ctrl->setParameter($this,
"sortorder", $sortarray[
"updated"]);
2415 $this->tpl->setVariable(
"QUESTION_UPDATED",
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"browseForQuestions") .
"\">" . $this->lng->txt(
"last_update") .
"</a>" . $table[
"images"][
"updated"]);
2416 $template =
new ilTemplate(
"tpl.image.html",
true,
true);
2417 if (strlen($filter_qpl))
2425 $template->setVariable(
"IMAGE_TITLE", $this->lng->txt(
"filter"));
2426 $template->setVariable(
"IMAGE_ALT", $this->lng->txt(
"filter"));
2427 $template->setVariable(
"ID",
"qpltextfilter");
2428 $template->setVariable(
"STYLE",
"visibility: hidden; cursor: pointer");
2429 $this->ctrl->setParameter($this,
"sort",
"qpl");
2430 $this->ctrl->setParameter($this,
"sortorder", $sortarray[
"qpl"]);
2431 $qpfilter =
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"browseForQuestions") .
"\">" . $this->lng->txt(
"obj_qpl") .
"</a>";
2432 $qpfilter .= $template->get();
2433 $qpfilter .= $table[
"images"][
"qpl"];
2434 $this->tpl->setVariable(
"QUESTION_POOL", $qpfilter);
2435 $this->tpl->setVariable(
"BUTTON_BACK", $this->lng->txt(
"back"));
2436 $this->ctrl->setParameter($this,
"sort", $sort);
2437 $this->ctrl->setParameter($this,
"sortorder", $sortorder);
2438 $this->tpl->setVariable(
"ACTION_QUESTION_FORM", $this->ctrl->getFormAction($this));
2439 $this->tpl->parseCurrentBlock();
2453 $parent_ref = $tree->getParentId($this->object->getRefId());
2454 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
2456 $qpl->setType(
"qpl");
2457 $qpl->setTitle($name);
2458 $qpl->setDescription(
"");
2460 $qpl->createReference();
2461 $qpl->putInTree($parent_ref);
2462 $qpl->setPermissions($parent_ref);
2465 return $qpl->getRefId();
2479 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_random_select.html",
"Modules/Test");
2480 $questionpools =& $this->
object->getAvailableQuestionpools(FALSE, FALSE, FALSE, TRUE);
2481 $this->tpl->setCurrentBlock(
"option");
2482 $this->tpl->setVariable(
"VALUE_OPTION",
"0");
2483 $this->tpl->setVariable(
"TEXT_OPTION", $this->lng->txt(
"all_available_question_pools"));
2484 $this->tpl->parseCurrentBlock();
2485 foreach ($questionpools as $key => $value)
2487 $this->tpl->setCurrentBlock(
"option");
2488 $this->tpl->setVariable(
"VALUE_OPTION", $key);
2489 $this->tpl->setVariable(
"TEXT_OPTION", $value[
"title"]);
2490 $this->tpl->parseCurrentBlock();
2492 $this->tpl->setCurrentBlock(
"hidden");
2493 $this->tpl->setVariable(
"HIDDEN_NAME",
"sel_question_types");
2494 $this->tpl->setVariable(
"HIDDEN_VALUE", $_POST[
"sel_question_types"]);
2495 $this->tpl->parseCurrentBlock();
2496 $this->tpl->setCurrentBlock(
"adm_content");
2497 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
2498 $this->tpl->setVariable(
"TXT_QPL_SELECT", $this->lng->txt(
"tst_random_select_questionpool"));
2499 $this->tpl->setVariable(
"TXT_NR_OF_QUESTIONS", $this->lng->txt(
"tst_random_nr_of_questions"));
2500 $this->tpl->setVariable(
"BTN_SUBMIT", $this->lng->txt(
"submit"));
2501 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
2502 $this->tpl->parseCurrentBlock();
2514 $this->ctrl->redirect($this,
"questions");
2527 $question_array = $this->
object->randomSelectQuestions($_POST[
"nr_of_questions"], $_POST[
"sel_qpl"]);
2528 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_random_question_offer.html",
"Modules/Test");
2529 $color_class = array(
"tblrow1",
"tblrow2");
2531 $questionpools =& $this->
object->getAvailableQuestionpools(
true);
2532 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
2533 foreach ($question_array as $question_id)
2535 $dataset = $this->
object->getQuestionDataset($question_id);
2536 $this->tpl->setCurrentBlock(
"QTab");
2537 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
2538 $this->tpl->setVariable(
"QUESTION_TITLE", $dataset->title);
2539 $this->tpl->setVariable(
"QUESTION_COMMENT", $dataset->comment);
2541 $this->tpl->setVariable(
"QUESTION_AUTHOR", $dataset->author);
2542 $this->tpl->setVariable(
"QUESTION_POOL", $questionpools[$dataset->obj_fi][
"title"]);
2543 $this->tpl->parseCurrentBlock();
2546 if (count($question_array) == 0)
2548 $this->tpl->setCurrentBlock(
"Emptytable");
2549 $this->tpl->setVariable(
"TEXT_NO_QUESTIONS_AVAILABLE", $this->lng->txt(
"no_questions_available"));
2550 $this->tpl->parseCurrentBlock();
2554 $this->tpl->setCurrentBlock(
"Selectionbuttons");
2555 $this->tpl->setVariable(
"BTN_YES", $this->lng->txt(
"random_accept_sample"));
2556 $this->tpl->setVariable(
"BTN_NO", $this->lng->txt(
"random_another_sample"));
2557 $this->tpl->parseCurrentBlock();
2559 $chosen_questions = join($question_array,
",");
2560 $this->tpl->setCurrentBlock(
"adm_content");
2561 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
2562 $this->tpl->setVariable(
"QUESTION_TITLE", $this->lng->txt(
"tst_question_title"));
2563 $this->tpl->setVariable(
"QUESTION_COMMENT", $this->lng->txt(
"description"));
2564 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"tst_question_type"));
2565 $this->tpl->setVariable(
"QUESTION_AUTHOR", $this->lng->txt(
"author"));
2566 $this->tpl->setVariable(
"QUESTION_POOL", $this->lng->txt(
"qpl"));
2567 $this->tpl->setVariable(
"VALUE_CHOSEN_QUESTIONS", $chosen_questions);
2568 $this->tpl->setVariable(
"VALUE_QUESTIONPOOL_SELECTION", $_POST[
"sel_qpl"]);
2569 $this->tpl->setVariable(
"VALUE_NR_OF_QUESTIONS", $_POST[
"nr_of_questions"]);
2570 $this->tpl->setVariable(
"TEXT_QUESTION_OFFER", $this->lng->txt(
"tst_question_offer"));
2571 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
2572 $this->tpl->parseCurrentBlock();
2584 $selected_array = split(
",", $_POST[
"chosen_questions"]);
2585 if (!count($selected_array))
2591 $total = $this->
object->evalTotalPersons();
2601 foreach ($selected_array as $key => $value)
2603 $this->
object->insertQuestion($value);
2605 $this->
object->saveCompleteStatus();
2607 $this->ctrl->redirect($this,
"questions");
2625 $selection_mode = $ilUser->getPref(
"tst_question_selection_mode_equal");
2626 $total = $this->
object->evalTotalPersons();
2627 $available_qpl =& $this->
object->getAvailableQuestionpools(TRUE, $selection_mode, FALSE, TRUE, TRUE);
2628 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
2629 $qpl_question_count = array();
2630 foreach ($available_qpl as $key => $value)
2632 if ($value[
"count"] > 0)
2634 $qpl_question_count[$key] = $value[
"count"];
2638 unset($available_qpl[$key]);
2641 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_random_questions.html",
"Modules/Test");
2642 $found_qpls = array();
2643 if (count($_POST) == 0)
2645 $found_qpls = $this->
object->getRandomQuestionpools();
2647 $qpl_unselected = 0;
2648 foreach ($_POST as $key => $value)
2650 if (preg_match(
"/countqpl_(\d+)/", $key, $matches))
2652 $questioncount = $qpl_question_count[$_POST[
"qpl_" . $matches[1]]];
2653 if ((strlen($questioncount) > 0) && ($value > $questioncount))
2655 $value = $questioncount;
2656 ilUtil::sendInfo($this->lng->txt(
"tst_random_selection_question_count_too_high"));
2658 $found_qpls[$matches[1]] = array(
2659 "index" => $matches[1],
2660 "count" => sprintf(
"%d", $value),
2661 "qpl" => $_POST[
"qpl_" . $matches[1]],
2662 "title" => $available_qpl[$_POST[
"qpl_" . $matches[1]]][
"title"]
2664 if ($_POST[
"qpl_" . $matches[1]] == -1)
2666 $qpl_unselected = 1;
2670 $commands = $_POST[
"cmd"];
2671 if (is_array($commands))
2673 foreach ($commands as $key => $value)
2675 if (preg_match(
"/deleteqpl_(\d+)/", $key, $matches))
2677 unset($found_qpls[$matches[1]]);
2682 $found_qpls = array_values($found_qpls);
2683 if (count($found_qpls) == 0)
2685 foreach ($available_qpl as $key => $value)
2687 $this->tpl->setCurrentBlock(
"qpl_value");
2688 $this->tpl->setVariable(
"QPL_ID", $key);
2689 $this->tpl->setVariable(
"QPL_TEXT", $value[
"title"]);
2690 $this->tpl->parseCurrentBlock();
2692 $this->tpl->setCurrentBlock(
"questionpool_row");
2693 $this->tpl->setVariable(
"COUNTQPL",
"0");
2694 $this->tpl->setVariable(
"VALUE_COUNTQPL", $_POST[
"countqpl_0"]);
2695 $this->tpl->setVariable(
"TEXT_SELECT_QUESTIONPOOL", $this->lng->txt(
"select_questionpool_option"));
2696 $this->tpl->setVariable(
"TEXT_QUESTIONS_FROM", $this->lng->txt(
"questions_from"));
2697 $this->tpl->setVariable(
"BTNCOUNTQPL", 0);
2698 $this->tpl->setVariable(
"BTN_DELETE", $this->lng->txt(
"delete"));
2699 $this->tpl->parseCurrentBlock();
2702 foreach ($found_qpls as $key => $value)
2704 $pools = $available_qpl;
2705 foreach ($found_qpls as $pkey => $pvalue)
2707 if ($pvalue[
"qpl"] != $value[
"qpl"])
2709 unset($pools[$pvalue[
"qpl"]]);
2713 foreach ($pools as $pkey => $pvalue)
2715 $this->tpl->setCurrentBlock(
"qpl_value");
2716 $this->tpl->setVariable(
"QPL_ID", $pkey);
2717 $this->tpl->setVariable(
"QPL_TEXT", $pvalue[
"title"]);
2718 if ($pkey == $value[
"qpl"])
2720 $this->tpl->setVariable(
"SELECTED_QPL",
" selected=\"selected\"");
2722 $this->tpl->parseCurrentBlock();
2724 $this->tpl->setCurrentBlock(
"questionpool_row");
2725 $this->tpl->setVariable(
"COUNTQPL", $counter);
2726 $this->tpl->setVariable(
"VALUE_COUNTQPL", $value[
"count"]);
2727 $this->tpl->setVariable(
"TEXT_SELECT_QUESTIONPOOL", $this->lng->txt(
"select_questionpool_option"));
2728 $this->tpl->setVariable(
"TEXT_QUESTIONS_FROM", $this->lng->txt(
"questions_from"));
2729 $this->tpl->setVariable(
"BTNCOUNTQPL", $counter);
2730 $this->tpl->setVariable(
"BTN_DELETE", $this->lng->txt(
"delete"));
2731 $this->tpl->parseCurrentBlock();
2734 if ($_POST[
"cmd"][
"addQuestionpool"])
2736 if ($qpl_unselected)
2742 $pools = $available_qpl;
2743 foreach ($found_qpls as $pkey => $pvalue)
2745 unset($pools[$pvalue[
"qpl"]]);
2747 if (count($pools) == 0)
2753 foreach ($pools as $key => $value)
2755 $this->tpl->setCurrentBlock(
"qpl_value");
2756 $this->tpl->setVariable(
"QPL_ID", $key);
2757 $this->tpl->setVariable(
"QPL_TEXT", $value[
"title"]);
2758 $this->tpl->parseCurrentBlock();
2760 $this->tpl->setCurrentBlock(
"questionpool_row");
2761 $this->tpl->setVariable(
"COUNTQPL",
"$counter");
2762 $this->tpl->setVariable(
"TEXT_SELECT_QUESTIONPOOL", $this->lng->txt(
"select_questionpool_option"));
2763 $this->tpl->setVariable(
"TEXT_QUESTIONS_FROM", $this->lng->txt(
"questions_from"));
2764 $this->tpl->setVariable(
"BTNCOUNTQPL", $counter);
2765 $this->tpl->setVariable(
"BTN_DELETE", $this->lng->txt(
"delete"));
2766 $this->tpl->parseCurrentBlock();
2770 if ($_POST[
"cmd"][
"saveRandomQuestions"])
2772 $this->
object->saveRandomQuestionCount($_POST[
"total_questions"]);
2773 $this->
object->saveRandomQuestionpools($found_qpls);
2774 $this->
object->saveCompleteStatus();
2776 $this->tpl->setCurrentBlock(
"adm_content");
2777 $this->tpl->setVariable(
"TEXT_SELECT_RANDOM_QUESTIONS", $this->lng->txt(
"tst_select_random_questions"));
2778 $this->tpl->setVariable(
"TEXT_TOTAL_QUESTIONS", $this->lng->txt(
"tst_total_questions"));
2779 $this->tpl->setVariable(
"TEXT_TOTAL_QUESTIONS_DESCRIPTION", $this->lng->txt(
"tst_total_questions_description"));
2780 $total_questions = $this->
object->getRandomQuestionCount();
2781 if (array_key_exists(
"total_questions", $_POST))
2783 $total_questions = $_POST[
"total_questions"];
2785 if ($total_questions > 0)
2788 foreach ($found_qpls as $key => $value)
2790 $sum += $qpl_question_count[$value[
"qpl"]];
2792 if ($total_questions > $sum)
2794 $total_questions = $sum;
2795 if ($_POST[
"cmd"][
"saveRandomQuestions"])
2797 $this->
object->saveRandomQuestionCount($total_questions);
2799 ilUtil::sendInfo($this->lng->txt(
"tst_random_selection_question_total_count_too_high"));
2802 $this->tpl->setVariable(
"VALUE_TOTAL_QUESTIONS", $total_questions);
2803 $this->tpl->setVariable(
"TEXT_QUESTIONPOOLS", $this->lng->txt(
"tst_random_questionpools"));
2806 $this->tpl->setVariable(
"BTN_SAVE", $this->lng->txt(
"save"));
2807 $this->tpl->setVariable(
"BTN_ADD_QUESTIONPOOL", $this->lng->txt(
"add_questionpool"));
2809 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
2811 $this->tpl->setVariable(
"TEXT_QUESTION_SELECTION", $this->lng->txt(
"tst_question_selection"));
2812 $this->tpl->setVariable(
"VALUE_QUESTION_SELECTION", $this->lng->txt(
"tst_question_selection_equal"));
2813 $this->tpl->setVariable(
"CMD_QUESTION_SELECTION",
"setEqualQplSelection");
2814 $this->tpl->setVariable(
"TEXT_QUESTION_SELECTION_DESCRIPTION", $this->lng->txt(
"tst_question_selection_description"));
2815 $this->tpl->setVariable(
"BUTTON_SAVE", $this->lng->txt(
"change"));
2816 if ($selection_mode == 1)
2818 $this->tpl->setVariable(
"CHECKED_QUESTION_SELECTION_MODE",
" checked=\"checked\"");
2820 $this->tpl->parseCurrentBlock();
2826 if ($_POST[
"chbQuestionSelectionMode"])
2828 $ilUser->setPref(
"tst_question_selection_mode_equal", 1);
2829 $ilUser->writePref(
"tst_question_selection_mode_equal", 1);
2833 $ilUser->setPref(
"tst_question_selection_mode_equal", 0);
2834 $ilUser->writePref(
"tst_question_selection_mode_equal", 0);
2853 $qpl_ref_id = $_POST[
"sel_qpl"];
2854 if ((strcmp($_POST[
"txt_qpl"],
"") == 0) && (strcmp($qpl_ref_id,
"") == 0))
2862 $_SESSION[
"test_id"] = $this->
object->getRefId();
2863 if (strcmp($_POST[
"txt_qpl"],
"") != 0)
2868 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPoolGUI.php";
2869 ilUtil::redirect(
"ilias.php?baseClass=ilObjQuestionPoolGUI&ref_id=" . $qpl_ref_id .
"&cmd=createQuestionForTest&test_ref_id=".
$_GET[
"ref_id"].
"&sel_question_types=" . $_POST[
"sel_question_types"]);
2883 $this->ctrl->redirect($this,
"questions");
2897 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_qpl_select.html",
"Modules/Test");
2898 $questionpools =& $this->
object->getAvailableQuestionpools(FALSE, FALSE, FALSE, TRUE, FALSE,
"write");
2899 if (count($questionpools) == 0)
2901 $this->tpl->setCurrentBlock(
"option");
2902 $this->tpl->setVariable(
"VALUE_QPL",
"");
2903 $this->tpl->parseCurrentBlock();
2907 foreach ($questionpools as $key => $value)
2909 $this->tpl->setCurrentBlock(
"option");
2910 $this->tpl->setVariable(
"VALUE_OPTION", $key);
2911 $this->tpl->setVariable(
"TEXT_OPTION", $value[
"title"]);
2912 $this->tpl->parseCurrentBlock();
2915 $this->tpl->setCurrentBlock(
"hidden");
2916 $this->tpl->setVariable(
"HIDDEN_NAME",
"sel_question_types");
2917 $this->tpl->setVariable(
"HIDDEN_VALUE", $_POST[
"sel_question_types"]);
2918 $this->tpl->parseCurrentBlock();
2919 $this->tpl->setCurrentBlock(
"adm_content");
2920 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
2922 if (count($questionpools) == 0)
2924 $this->tpl->setVariable(
"TXT_QPL_SELECT", $this->lng->txt(
"tst_enter_questionpool"));
2928 $this->tpl->setVariable(
"TXT_QPL_SELECT", $this->lng->txt(
"tst_select_questionpool"));
2930 $this->tpl->setVariable(
"BTN_SUBMIT", $this->lng->txt(
"submit"));
2931 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
2932 $this->tpl->parseCurrentBlock();
2945 $checked_questions = array();
2946 foreach ($_POST as $key => $value) {
2947 if (preg_match(
"/id_(\d+)/", $key, $matches)) {
2948 array_push($checked_questions, $matches[1]);
2951 foreach ($checked_questions as $key => $value) {
2952 $this->
object->removeQuestion($value);
2954 $this->
object->saveCompleteStatus();
2955 $this->ctrl->redirect($this,
"questions");
2967 $this->ctrl->redirect($this,
"questions");
2980 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_remove_questions.html",
"Modules/Test");
2981 $removablequestions =& $this->
object->getTestQuestions();
2982 $colors = array(
"tblrow1",
"tblrow2");
2984 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
2985 if (count($removablequestions))
2987 foreach ($removablequestions as
$data)
2989 if (in_array($data[
"question_id"], $checked_questions))
2991 $this->tpl->setCurrentBlock(
"row");
2992 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
2993 $this->tpl->setVariable(
"TXT_TITLE", $data[
"title"]);
2994 $this->tpl->setVariable(
"TXT_DESCRIPTION", $data[
"comment"]);
2996 $this->tpl->parseCurrentBlock();
3001 foreach ($checked_questions as $id)
3003 $this->tpl->setCurrentBlock(
"hidden");
3004 $this->tpl->setVariable(
"HIDDEN_NAME",
"id_$id");
3005 $this->tpl->setVariable(
"HIDDEN_VALUE",
"1");
3006 $this->tpl->parseCurrentBlock();
3009 $this->tpl->setCurrentBlock(
"adm_content");
3010 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"tst_question_title"));
3011 $this->tpl->setVariable(
"TXT_DESCRIPTION", $this->lng->txt(
"description"));
3012 $this->tpl->setVariable(
"TXT_TYPE", $this->lng->txt(
"tst_question_type"));
3013 $this->tpl->setVariable(
"BTN_CONFIRM", $this->lng->txt(
"confirm"));
3014 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
3015 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
3016 $this->tpl->parseCurrentBlock();
3029 $checked_questions = array();
3030 foreach ($_POST as $key => $value) {
3031 if (preg_match(
"/cb_(\d+)/", $key, $matches)) {
3032 array_push($checked_questions, $matches[1]);
3035 if (count($checked_questions) > 0) {
3036 $total = $this->
object->evalTotalPersons();
3045 } elseif (count($checked_questions) == 0) {
3046 ilUtil::sendInfo($this->lng->txt(
"tst_no_question_selected_for_removal"),
true);
3047 $this->ctrl->redirect($this,
"questions");
3073 $move_questions = array();
3074 foreach ($_POST as $key => $value)
3076 if (preg_match(
"/^move_(\d+)$/", $key, $matches))
3078 array_push($move_questions, $value);
3083 foreach ($_POST as $key => $value)
3085 if (preg_match(
"/^cb_(\d+)$/", $key, $matches))
3089 $insert_id = $matches[1];
3093 if ($insert_id <= 0)
3100 $this->
object->moveQuestions($move_questions, $insert_id, $insert_mode);
3102 $this->ctrl->redirect($this,
"questions");
3115 $move_questions = array();
3116 foreach ($_POST as $key => $value)
3118 if (preg_match(
"/^move_(\d+)$/", $key, $matches))
3120 array_push($move_questions, $value);
3125 foreach ($_POST as $key => $value)
3127 if (preg_match(
"/^cb_(\d+)$/", $key, $matches))
3131 $insert_id = $matches[1];
3135 if ($insert_id <= 0)
3142 $this->
object->moveQuestions($move_questions, $insert_id, $insert_mode);
3144 $this->ctrl->redirect($this,
"questions");
3150 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
3154 $this->ctrl->redirect($this,
"infoScreen");
3158 if ($this->object->isRandomTest())
3166 ilUtil::redirect(
"ilias.php?baseClass=ilObjQuestionPoolGUI&ref_id=" . $_GET[
"eqpl"] .
"&cmd=editQuestionForTest&calling_test=".$_GET[
"ref_id"].
"&q_id=" . $_GET[
"eqid"]);
3169 if ($_GET[
"up"] > 0)
3171 $this->
object->questionMoveUp($_GET[
"up"]);
3173 if ($_GET[
"down"] > 0)
3175 $this->
object->questionMoveDown($_GET[
"down"]);
3180 $selected_array = array();
3181 array_push($selected_array, $_GET[
"add"]);
3182 $total = $this->
object->evalTotalPersons();
3192 $this->insertQuestions($selected_array);
3196 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_questions.html",
"Modules/Test");
3197 $this->tpl->addBlockFile(
"A_BUTTONS",
"question_buttons",
"tpl.il_as_tst_question_buttons.html",
"Modules/Test");
3199 if (strcmp($this->ctrl->getCmd(),
"moveQuestions") == 0)
3202 foreach ($_POST as $key => $value)
3204 if (preg_match(
"/cb_(\d+)/", $key, $matches))
3207 $this->tpl->setCurrentBlock(
"move");
3208 $this->tpl->setVariable(
"MOVE_COUNTER", $matches[1]);
3209 $this->tpl->setVariable(
"MOVE_VALUE", $matches[1]);
3210 $this->tpl->parseCurrentBlock();
3215 ilUtil::sendInfo($this->lng->txt(
"select_target_position_for_move_question"));
3216 $this->tpl->setCurrentBlock(
"move_buttons");
3217 $this->tpl->setVariable(
"INSERT_BEFORE", $this->lng->txt(
"insert_before"));
3218 $this->tpl->setVariable(
"INSERT_AFTER", $this->lng->txt(
"insert_after"));
3219 $this->tpl->parseCurrentBlock();
3227 $testquestions =& $this->
object->getTestQuestions();
3228 $colors = array(
"tblrow1",
"tblrow2");
3230 $questionpools = array();
3232 $total = $this->
object->evalTotalPersons();
3233 if (count($testquestions) > 0)
3235 foreach ($testquestions as
$data)
3237 if (!array_key_exists($data->obj_fi, $questionpools))
3239 $pooltitle = $this->
object->_lookupTitle($data[
"obj_fi"]);
3240 $questionpools[$data[
"obj_fi"]] = $pooltitle;
3242 $this->tpl->setCurrentBlock(
"QTab");
3243 $this->tpl->setVariable(
"QUESTION_ID", $data[
"question_id"]);
3244 if (($ilAccess->checkAccess(
"write",
"", $this->ref_id) and (
$total == 0)))
3246 $q_id = $data[
"question_id"];
3247 $qpl_ref_id = $this->
object->_getRefIdFromObjId($data[
"obj_fi"]);
3248 $this->tpl->setVariable(
"QUESTION_TITLE",
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"questions") .
"&eqid=$q_id&eqpl=$qpl_ref_id" .
"\">" . $data[
"title"] .
"</a>");
3250 $this->tpl->setVariable(
"QUESTION_TITLE", $data[
"title"]);
3252 $this->tpl->setVariable(
"QUESTION_SEQUENCE", $this->lng->txt(
"tst_sequence"));
3254 if (($ilAccess->checkAccess(
"write",
"", $this->ref_id) and (
$total == 0)))
3256 if ($data[
"question_id"] != $this->object->questions[1])
3258 $this->tpl->setVariable(
"BUTTON_UP",
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"questions") .
"&up=".$data[
"question_id"].
"\"><img src=\"" .
ilUtil::getImagePath(
"a_up.gif") .
"\" alt=\"" . $this->lng->txt(
"up") .
"\" border=\"0\" /></a>");
3260 if ($data[
"question_id"] != $this->object->questions[count($this->object->questions)])
3262 $this->tpl->setVariable(
"BUTTON_DOWN",
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"questions") .
"&down=".$data[
"question_id"].
"\"><img src=\"" .
ilUtil::getImagePath(
"a_down.gif") .
"\" alt=\"" . $this->lng->txt(
"down") .
"\" border=\"0\" /></a>");
3265 $this->tpl->setVariable(
"QUESTION_COMMENT", $data[
"comment"]);
3266 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
3268 $this->tpl->setVariable(
"QUESTION_POINTS", $data[
"points"]);
3269 $total_points += $data[
"points"];
3270 $this->tpl->setVariable(
"QUESTION_AUTHOR", $data[
"author"]);
3271 $this->tpl->setVariable(
"QUESTION_POOL", $questionpools[$data[
"obj_fi"]]);
3272 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
3273 $this->tpl->parseCurrentBlock();
3279 $this->tpl->setCurrentBlock(
"Emptytable");
3280 $this->tpl->setVariable(
"TEXT_EMPTYTABLE", $this->lng->txt(
"tst_no_questions_available"));
3281 $this->tpl->parseCurrentBlock();
3285 if (($ilAccess->checkAccess(
"write",
"", $this->ref_id) and (
$total == 0)))
3287 $this->tpl->setCurrentBlock(
"selectall");
3288 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
3290 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
3291 $this->tpl->setVariable(
"TOTAL_POINTS", $total_points);
3292 $this->tpl->parseCurrentBlock();
3293 $this->tpl->setCurrentBlock(
"QFooter");
3294 $this->tpl->setVariable(
"ARROW",
"<img src=\"" .
ilUtil::getImagePath(
"arrow_downright.gif") .
"\" alt=\"".$this->lng->txt(
"arrow_downright").
"\"/>");
3295 $this->tpl->setVariable(
"REMOVE", $this->lng->txt(
"remove_question"));
3296 $this->tpl->setVariable(
"MOVE", $this->lng->txt(
"move"));
3297 $this->tpl->parseCurrentBlock();
3301 if (($ilAccess->checkAccess(
"write",
"", $this->ref_id) and (
$total == 0)))
3304 $lastquestiontype = $ilUser->getPref(
"tst_lastquestiontype");
3305 $this->tpl->setCurrentBlock(
"QTypes");
3306 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
3308 foreach ($question_types as $trans =>
$data)
3310 if (
$data[
"type_tag"] == $lastquestiontype)
3312 $this->tpl->setVariable(
"QUESTION_TYPE_SELECTED",
" selected=\"selected\"");
3314 $this->tpl->setVariable(
"QUESTION_TYPE_ID",
$data[
"type_tag"]);
3315 $this->tpl->setVariable(
"QUESTION_TYPE", $trans);
3316 $this->tpl->parseCurrentBlock();
3318 $this->tpl->parseCurrentBlock();
3320 $this->tpl->setCurrentBlock(
"adm_content");
3321 $this->tpl->setVariable(
"ACTION_QUESTION_FORM", $this->ctrl->getFormAction($this));
3322 $this->tpl->setVariable(
"QUESTION_TITLE", $this->lng->txt(
"tst_question_title"));
3323 $this->tpl->setVariable(
"QUESTION_COMMENT", $this->lng->txt(
"description"));
3324 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"tst_question_type"));
3325 $this->tpl->setVariable(
"QUESTION_POINTS", $this->lng->txt(
"points"));
3326 $this->tpl->setVariable(
"QUESTION_AUTHOR", $this->lng->txt(
"author"));
3327 $this->tpl->setVariable(
"QUESTION_POOL", $this->lng->txt(
"qpl"));
3329 if (($ilAccess->checkAccess(
"write",
"", $this->ref_id) and (
$total == 0)))
3331 $this->tpl->setVariable(
"BUTTON_INSERT_QUESTION", $this->lng->txt(
"tst_browse_for_questions"));
3332 $this->tpl->setVariable(
"TEXT_CREATE_NEW",
" " . strtolower($this->lng->txt(
"or")) .
" " . $this->lng->txt(
"create_new"));
3333 $this->tpl->setVariable(
"BUTTON_CREATE_QUESTION", $this->lng->txt(
"create"));
3334 $this->tpl->setVariable(
"TXT_OR", $this->lng->txt(
"or"));
3335 $this->tpl->setVariable(
"TEXT_RANDOM_SELECT", $this->lng->txt(
"random_selection"));
3338 $this->tpl->parseCurrentBlock();
3354 $this->
object->mark_schema->addMarkStep();
3367 $this->
object->mark_schema->flush();
3368 foreach ($_POST as $key => $value) {
3369 if (preg_match(
"/mark_short_(\d+)/", $key, $matches))
3371 $this->
object->mark_schema->addMarkStep($_POST[
"mark_short_$matches[1]"], $_POST[
"mark_official_$matches[1]"], $_POST[
"mark_percentage_$matches[1]"], $_POST[
"passed_$matches[1]"]);
3374 $this->
object->ects_grades[
"A"] = $_POST[
"ects_grade_a"];
3375 $this->
object->ects_grades[
"B"] = $_POST[
"ects_grade_b"];
3376 $this->
object->ects_grades[
"C"] = $_POST[
"ects_grade_c"];
3377 $this->
object->ects_grades[
"D"] = $_POST[
"ects_grade_d"];
3378 $this->
object->ects_grades[
"E"] = $_POST[
"ects_grade_e"];
3379 if ($_POST[
"chbUseFX"])
3381 $this->
object->ects_fx = $_POST[
"percentFX"];
3385 $this->
object->ects_fx =
"";
3387 $this->
object->ects_output = $_POST[
"chbECTS"];
3399 $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);
3413 $delete_mark_steps = array();
3414 foreach ($_POST as $key => $value) {
3415 if (preg_match(
"/cb_(\d+)/", $key, $matches)) {
3416 array_push($delete_mark_steps, $matches[1]);
3419 if (count($delete_mark_steps)) {
3420 $this->
object->mark_schema->deleteMarkSteps($delete_mark_steps);
3437 $this->ctrl->redirect($this,
"marks");
3451 $mark_check = $this->
object->checkMarks();
3452 if ($mark_check !==
true)
3456 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)))
3460 elseif (($_POST[
"ects_grade_a"] > 100) or ($_POST[
"ects_grade_a"] < 0))
3464 elseif (($_POST[
"ects_grade_b"] > 100) or ($_POST[
"ects_grade_b"] < 0))
3468 elseif (($_POST[
"ects_grade_c"] > 100) or ($_POST[
"ects_grade_c"] < 0))
3472 elseif (($_POST[
"ects_grade_d"] > 100) or ($_POST[
"ects_grade_d"] < 0))
3476 elseif (($_POST[
"ects_grade_e"] > 100) or ($_POST[
"ects_grade_e"] < 0))
3482 $this->
object->mark_schema->saveToDb($this->object->getTestId());
3483 $this->
object->saveCompleteStatus();
3484 if ($this->object->getReportingDate())
3487 if ($_POST[
"chbUseFX"])
3491 $this->
object->saveECTSStatus($_POST[
"chbECTS"], $fxpercent, $this->object->ects_grades[
"A"], $this->object->ects_grades[
"B"], $this->object->ects_grades[
"C"], $this->object->ects_grades[
"D"], $this->object->ects_grades[
"E"]);
3501 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
3505 $this->ctrl->redirect($this,
"infoScreen");
3508 if (!$this->object->canEditMarks())
3513 $this->
object->mark_schema->sort();
3515 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_marks.html",
"Modules/Test");
3516 $marks = $this->
object->mark_schema->mark_steps;
3517 $rows = array(
"tblrow1",
"tblrow2");
3519 foreach ($marks as $key => $value) {
3520 $this->tpl->setCurrentBlock(
"markrow");
3521 $this->tpl->setVariable(
"MARK_SHORT", $value->getShortName());
3522 $this->tpl->setVariable(
"MARK_OFFICIAL", $value->getOfficialName());
3523 $this->tpl->setVariable(
"MARK_PERCENTAGE", sprintf(
"%.2f", $value->getMinimumLevel()));
3524 $this->tpl->setVariable(
"MARK_PASSED", strtolower($this->lng->txt(
"tst_mark_passed")));
3525 $this->tpl->setVariable(
"MARK_ID",
"$key");
3526 $this->tpl->setVariable(
"ROW_CLASS", $rows[$counter % 2]);
3527 if ($value->getPassed()) {
3528 $this->tpl->setVariable(
"MARK_PASSED_CHECKED",
" checked=\"checked\"");
3530 $this->tpl->parseCurrentBlock();
3533 if (count($marks) == 0)
3535 $this->tpl->setCurrentBlock(
"Emptyrow");
3536 $this->tpl->setVariable(
"EMPTY_ROW", $this->lng->txt(
"tst_no_marks_defined"));
3537 $this->tpl->setVariable(
"ROW_CLASS", $rows[$counter % 2]);
3538 $this->tpl->parseCurrentBlock();
3542 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) && $this->
object->canEditMarks())
3544 $this->tpl->setCurrentBlock(
"selectall");
3546 $this->tpl->setVariable(
"ROW_CLASS", $rows[$counter % 2]);
3547 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
3548 $this->tpl->parseCurrentBlock();
3549 $this->tpl->setCurrentBlock(
"Footer");
3550 $this->tpl->setVariable(
"ARROW",
"<img src=\"" .
ilUtil::getImagePath(
"arrow_downright.gif") .
"\" alt=\"".$this->lng->txt(
"arrow_downright").
"\"/>");
3551 $this->tpl->setVariable(
"BUTTON_EDIT", $this->lng->txt(
"edit"));
3552 $this->tpl->setVariable(
"BUTTON_DELETE", $this->lng->txt(
"delete"));
3553 $this->tpl->parseCurrentBlock();
3557 if ($this->object->getReportingDate())
3559 $this->tpl->setCurrentBlock(
"ects");
3560 if ($this->object->ects_output)
3562 $this->tpl->setVariable(
"CHECKED_ECTS",
" checked=\"checked\"");
3564 $this->tpl->setVariable(
"TEXT_OUTPUT_ECTS_GRADES", $this->lng->txt(
"ects_output_of_ects_grades"));
3565 $this->tpl->setVariable(
"TEXT_ALLOW_ECTS_GRADES", $this->lng->txt(
"ects_allow_ects_grades"));
3566 $this->tpl->setVariable(
"TEXT_USE_FX", $this->lng->txt(
"ects_use_fx_grade"));
3567 if (preg_match(
"/\d+/", $this->object->ects_fx))
3569 $this->tpl->setVariable(
"CHECKED_FX",
" checked=\"checked\"");
3570 $this->tpl->setVariable(
"VALUE_PERCENT_FX", sprintf(
"value=\"%s\" ", $this->object->ects_fx));
3572 $this->tpl->setVariable(
"TEXT_PERCENT", $this->lng->txt(
"ects_use_fx_grade_part2"));
3573 $this->tpl->setVariable(
"ECTS_GRADE", $this->lng->txt(
"ects_grade"));
3574 $this->tpl->setVariable(
"PERCENTILE", $this->lng->txt(
"percentile"));
3575 $this->tpl->setVariable(
"ECTS_GRADE_A",
"A - " . $this->lng->txt(
"ects_grade_a_short"));
3576 $this->tpl->setVariable(
"VALUE_GRADE_A", $this->object->ects_grades[
"A"]);
3577 $this->tpl->setVariable(
"ECTS_GRADE_B",
"B - " . $this->lng->txt(
"ects_grade_b_short"));
3578 $this->tpl->setVariable(
"VALUE_GRADE_B", $this->object->ects_grades[
"B"]);
3579 $this->tpl->setVariable(
"ECTS_GRADE_C",
"C - " . $this->lng->txt(
"ects_grade_c_short"));
3580 $this->tpl->setVariable(
"VALUE_GRADE_C", $this->object->ects_grades[
"C"]);
3581 $this->tpl->setVariable(
"ECTS_GRADE_D",
"D - " . $this->lng->txt(
"ects_grade_d_short"));
3582 $this->tpl->setVariable(
"VALUE_GRADE_D", $this->object->ects_grades[
"D"]);
3583 $this->tpl->setVariable(
"ECTS_GRADE_E",
"E - " . $this->lng->txt(
"ects_grade_e_short"));
3584 $this->tpl->setVariable(
"VALUE_GRADE_E", $this->object->ects_grades[
"E"]);
3586 $this->tpl->parseCurrentBlock();
3589 $this->tpl->setCurrentBlock(
"adm_content");
3590 $this->tpl->setVariable(
"ACTION_MARKS", $this->ctrl->getFormAction($this));
3591 $this->tpl->setVariable(
"HEADER_SHORT", $this->lng->txt(
"tst_mark_short_form"));
3592 $this->tpl->setVariable(
"HEADER_OFFICIAL", $this->lng->txt(
"tst_mark_official_form"));
3593 $this->tpl->setVariable(
"HEADER_PERCENTAGE", $this->lng->txt(
"tst_mark_minimum_level"));
3594 $this->tpl->setVariable(
"HEADER_PASSED", $this->lng->txt(
"tst_mark_passed"));
3595 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) && $this->
object->canEditMarks())
3597 $this->tpl->setVariable(
"BUTTON_NEW", $this->lng->txt(
"tst_mark_create_new_mark_step"));
3598 $this->tpl->setVariable(
"BUTTON_NEW_SIMPLE", $this->lng->txt(
"tst_mark_create_simple_mark_schema"));
3599 $this->tpl->setVariable(
"SAVE", $this->lng->txt(
"save"));
3600 $this->tpl->setVariable(
"CANCEL", $this->lng->txt(
"cancel"));
3602 $this->tpl->parseCurrentBlock();
3614 $this->
object->removeAllTestEditings();
3616 $this->ctrl->redirect($this,
"participants");
3628 $active_ids = array();
3629 foreach ($_POST[
"chbUser"] as $active_id)
3631 if ($this->object->getFixedParticipants())
3633 array_push($active_ids, $this->object->getActiveIdOfUser($active_id));
3637 array_push($active_ids, $active_id);
3640 $this->
object->removeSelectedTestResults($active_ids);
3642 $this->ctrl->redirect($this,
"participants");
3654 $this->ctrl->redirect($this,
"participants");
3667 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_maintenance.html",
"Modules/Test");
3669 $this->tpl->setCurrentBlock(
"confirm_delete");
3670 $this->tpl->setVariable(
"BTN_CONFIRM_DELETE_ALL", $this->lng->txt(
"confirm"));
3671 $this->tpl->setVariable(
"BTN_CANCEL_DELETE_ALL", $this->lng->txt(
"cancel"));
3672 $this->tpl->parseCurrentBlock();
3674 $this->tpl->setCurrentBlock(
"adm_content");
3675 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
3676 $this->tpl->parseCurrentBlock();
3688 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html",
"Modules/Test");
3689 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"participants"));
3690 $this->tpl->setCurrentBlock(
"table_header");
3691 $this->tpl->setVariable(
"TEXT", $this->lng->txt(
"delete_all_user_data"));
3692 $this->tpl->parseCurrentBlock();
3694 $this->tpl->setCurrentBlock(
"table_row");
3695 $this->tpl->setVariable(
"CSS_ROW",
"tblrow1");
3696 $this->tpl->setVariable(
"TEXT_CONTENT", $this->lng->txt(
"delete_all_user_data_confirmation"));
3697 $this->tpl->parseCurrentBlock();
3700 $buttons = array(
"confirmDeleteAllUserResults" => $this->lng->txt(
"proceed"),
3701 "participants" => $this->lng->txt(
"cancel"));
3702 foreach ($buttons as $name => $value)
3704 $this->tpl->setCurrentBlock(
"operation_btn");
3705 $this->tpl->setVariable(
"BTN_NAME",$name);
3706 $this->tpl->setVariable(
"BTN_VALUE",$value);
3707 $this->tpl->parseCurrentBlock();
3720 if (count($_POST[
"chbUser"]) == 0)
3723 $this->ctrl->redirect($this,
"participants");
3726 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_maintenance.html",
"Modules/Test");
3728 foreach ($_POST[
"chbUser"] as $key => $value)
3730 $this->tpl->setCurrentBlock(
"hidden");
3731 $this->tpl->setVariable(
"USER_ID", $value);
3732 $this->tpl->parseCurrentBlock();
3735 include_once
'./Services/User/classes/class.ilObjUser.php';
3736 $color_class = array(
"tblrow1",
"tblrow2");
3738 foreach ($_POST[
"chbUser"] as $key => $active_id)
3740 if ($this->object->getFixedParticipants())
3742 $user_id = $active_id;
3746 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
3749 $this->tpl->setCurrentBlock(
"row");
3751 $this->tpl->setVariable(
"USER_ALT", $this->lng->txt(
"usr"));
3752 $this->tpl->setVariable(
"USER_TITLE", $this->lng->txt(
"usr"));
3753 if ($this->object->getAnonymity())
3755 $this->tpl->setVariable(
"TXT_FIRSTNAME",
"");
3756 $this->tpl->setVariable(
"TXT_LASTNAME", $this->lng->txt(
"unknown"));
3757 $this->tpl->setVariable(
"TXT_LOGIN",
"");
3761 $this->tpl->setVariable(
"TXT_FIRSTNAME",
$user[
"firstname"]);
3762 if (strlen(
$user[
"lastname"]))
3764 $this->tpl->setVariable(
"TXT_LASTNAME",
$user[
"lastname"]);
3768 $this->tpl->setVariable(
"TXT_LASTNAME", $this->lng->txt(
"deleted_user"));
3772 $this->tpl->setVariable(
"ROW_CLASS", $color_class[$counter % 2]);
3773 $this->tpl->parseCurrentBlock();
3776 $this->tpl->setCurrentBlock(
"selectedusers");
3777 $this->tpl->setVariable(
"HEADER_TXT_FIRSTNAME", $this->lng->txt(
"firstname"));
3778 $this->tpl->setVariable(
"HEADER_TXT_LASTNAME", $this->lng->txt(
"lastname"));
3779 $this->tpl->setVariable(
"HEADER_TXT_LOGIN", $this->lng->txt(
"login"));
3780 $this->tpl->setVariable(
"BTN_CONFIRM_DELETE_SELECTED", $this->lng->txt(
"confirm"));
3781 $this->tpl->setVariable(
"BTN_CANCEL_DELETE_SELECTED", $this->lng->txt(
"cancel"));
3782 $this->tpl->parseCurrentBlock();
3784 $this->tpl->setCurrentBlock(
"adm_content");
3785 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
3786 $this->tpl->parseCurrentBlock();
3799 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
3803 $this->ctrl->redirect($this,
"infoScreen");
3806 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_status.html",
"Modules/Test");
3807 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
3809 include_once
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
3813 $tblrow = array(
"tblrow1",
"tblrow2");
3815 include_once
'./Services/User/classes/class.ilObjUser.php';
3816 foreach (
$log as $entry)
3818 $this->tpl->setCurrentBlock(
"changelog_row");
3819 $this->tpl->setVariable(
"ROW_CLASS", $tblrow[$counter % 2]);
3820 $username = $this->
object->userLookupFullName($entry[
"user_fi"], TRUE);
3821 $this->tpl->setVariable(
"TXT_USER", $username);
3823 if (strlen($entry[
"ref_id"]) && strlen($entry[
"href"]))
3825 $this->tpl->setVariable(
"TXT_TEST_REFERENCE", $this->lng->txt(
"perma_link"));
3826 $this->tpl->setVariable(
"HREF_REFERENCE", $entry[
"href"]);
3829 $this->tpl->parseCurrentBlock();
3832 $this->tpl->setCurrentBlock(
"changelog");
3833 $this->tpl->setVariable(
"HEADER_DATETIME", $this->lng->txt(
"assessment_log_datetime"));
3834 $this->tpl->setVariable(
"HEADER_USER", $this->lng->txt(
"user"));
3835 $this->tpl->setVariable(
"HEADER_LOGTEXT", $this->lng->txt(
"assessment_log_text"));
3836 $this->tpl->setVariable(
"HEADER_TEST_REFERENCE", $this->lng->txt(
"location"));
3837 $this->tpl->setVariable(
"HEADING_CHANGELOG", $this->lng->txt(
"changelog_heading"));
3838 $this->tpl->setVariable(
"DESCRIPTION_CHANGELOG", $this->lng->txt(
"changelog_description"));
3839 $this->tpl->parseCurrentBlock();
3843 $this->tpl->setCurrentBlock(
"adm_content");
3844 $this->tpl->parseCurrentBlock();
3853 $new_type = $_POST[
"new_type"] ? $_POST[
"new_type"] :
$_GET[
"new_type"];
3854 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"], $new_type))
3856 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
3862 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
3864 $questionpools =& $tst->getAvailableQuestionpools(TRUE, FALSE, TRUE, TRUE);
3865 if (count($questionpools) == 0)
3870 foreach ($questionpools as $key => $value)
3872 $this->tpl->setCurrentBlock(
"option_qpl");
3873 $this->tpl->setVariable(
"OPTION_VALUE", $key);
3874 $this->tpl->setVariable(
"TXT_OPTION", $value[
"title"]);
3875 if ($_POST[
"qpl"] == $key)
3877 $this->tpl->setVariable(
"OPTION_SELECTED",
" selected=\"selected\"");
3879 $this->tpl->parseCurrentBlock();
3883 $defaults =& $tst->getAvailableDefaults();
3884 if (count($defaults))
3886 foreach ($defaults as $row)
3888 $this->tpl->setCurrentBlock(
"defaults_row");
3889 $this->tpl->setVariable(
"DEFAULTS_VALUE", $row[
"test_defaults_id"]);
3891 $this->tpl->parseCurrentBlock();
3893 $this->tpl->setCurrentBlock(
"defaults");
3894 $this->tpl->setVariable(
"TXT_DEFAULTS", $this->lng->txt(
"defaults"));
3895 $this->tpl->setVariable(
"TEXT_NO_DEFAULTS", $this->lng->txt(
"tst_defaults_dont_use"));
3896 $this->tpl->parseCurrentBlock();
3900 $this->tpl->setCurrentBlock(
"adm_content");
3904 $data[
"fields"] = array();
3907 foreach (
$data[
"fields"] as $key => $val)
3909 $this->tpl->setVariable(
"TXT_".strtoupper($key), $this->lng->txt($key));
3910 $this->tpl->setVariable(strtoupper($key), $val);
3912 if ($this->prepare_output)
3914 $this->tpl->parseCurrentBlock();
3917 $this->ctrl->setParameter($this,
"new_type", $this->type);
3918 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
3919 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt($new_type.
"_new"));
3920 $this->tpl->setVariable(
"TXT_SELECT_QUESTIONPOOL", $this->lng->txt(
"select_questionpool"));
3921 $this->tpl->setVariable(
"OPTION_SELECT_QUESTIONPOOL", $this->lng->txt(
"select_questionpool_option"));
3922 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
3923 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt($new_type.
"_add"));
3924 $this->tpl->setVariable(
"CMD_SUBMIT",
"save");
3926 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
3928 $this->tpl->setVariable(
"TXT_IMPORT_TST", $this->lng->txt(
"import_tst"));
3929 $this->tpl->setVariable(
"TXT_TST_FILE", $this->lng->txt(
"tst_upload_file"));
3930 $this->tpl->setVariable(
"TXT_IMPORT", $this->lng->txt(
"import"));
3933 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
"obj_tst"));
3935 $this->tpl->setVariable(
"ALT_IMG2",$this->lng->txt(
"obj_tst"));
3936 $this->tpl->setVariable(
"NEW_TYPE", $this->type);
3937 $this->tpl->parseCurrentBlock();
3951 $this->ctrl->redirect($this,
"inviteParticipants");
3963 $fixed_participants = 0;
3964 $invited_users = $this->
object->getInvitedUsers();
3965 foreach ($invited_users as $user_object)
3967 $this->
object->disinviteUser($user_object->usr_id);
3969 $this->
object->setFixedParticipants($fixed_participants);
3970 $this->
object->saveToDb();
3971 $this->ctrl->redirect($this,
"inviteParticipants");
3983 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html",
"Modules/Test");
3985 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
3987 $this->tpl->setCurrentBlock(
"table_header");
3988 $this->tpl->setVariable(
"TEXT", $this->lng->txt(
"tst_fixed_participants_disable"));
3989 $this->tpl->parseCurrentBlock();
3991 $this->tpl->setCurrentBlock(
"table_row");
3992 $this->tpl->setVariable(
"CSS_ROW",
"tblrow1");
3993 $this->tpl->setVariable(
"TEXT_CONTENT", $this->lng->txt(
"tst_fixed_participants_disable_description"));
3994 $this->tpl->parseCurrentBlock();
3997 $buttons = array(
"confirmFixedParticipantsStatusChange" => $this->lng->txt(
"proceed"),
3998 "cancelFixedParticipantsStatusChange" => $this->lng->txt(
"cancel"));
3999 foreach ($buttons as $name => $value)
4001 $this->tpl->setCurrentBlock(
"operation_btn");
4002 $this->tpl->setVariable(
"BTN_NAME",$name);
4003 $this->tpl->setVariable(
"BTN_VALUE",$value);
4004 $this->tpl->parseCurrentBlock();
4017 $fixed_participants = 0;
4018 if (array_key_exists(
"chb_fixed_participants", $_POST))
4020 if ($_POST[
"chb_fixed_participants"])
4022 $fixed_participants = 1;
4025 $invited_users = $this->
object->getInvitedUsers();
4026 if ($this->object->getFixedParticipants() && !$fixed_participants && count($invited_users))
4032 $this->
object->setFixedParticipants($fixed_participants);
4033 $this->
object->saveToDb();
4034 $this->ctrl->redirect($this,
"inviteParticipants");
4048 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
4052 $this->ctrl->redirect($this,
"infoScreen");
4055 $total = $this->
object->evalTotalPersons();
4056 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_fixed_users.html",
"Modules/Test");
4058 if ($_POST[
"cmd"][
"cancel"])
4063 if (strcmp($this->ctrl->getCmd(),
"searchParticipants") == 0)
4065 if (is_array($_POST[
"search_for"]))
4067 $this->tpl->setCurrentBlock(
"search_results_title");
4068 $this->tpl->setVariable(
"TEXT_SEARCH_RESULTS", $this->lng->txt(
"search_results"));
4069 $this->tpl->parseCurrentBlock();
4070 if (in_array(
"usr", $_POST[
"search_for"]) or in_array(
"grp", $_POST[
"search_for"]) or in_array(
"role", $_POST[
"search_for"]))
4072 include_once
'./classes/class.ilSearch.php';
4073 $search =&
new ilSearch($ilUser->id);
4074 $search->setSearchString($_POST[
"search_term"]);
4075 $search->setCombination($_POST[
"concatenation"]);
4076 $search->setSearchFor($_POST[
"search_for"]);
4077 $search->setSearchType(
"new");
4078 if($search->validate($message))
4080 $search->performSearch();
4087 if(!$search->getNumberOfResults() && $search->getSearchFor())
4091 $buttons = array(
"add");
4093 $invited_users =& $this->
object->getInvitedUsers();
4095 if ($searchresult = $search->getResultByType(
"usr"))
4098 foreach ($searchresult as $result_array)
4100 if (!array_key_exists($result_array[
"id"], $invited_users))
4102 array_push($users, $result_array[
"id"]);
4106 $users = $this->
object->getUserData($users);
4109 $this->
outUserGroupTable(
"usr", $users,
"user_result",
"user_row", $this->lng->txt(
"search_user"),
"TEXT_USER_TITLE", $buttons);
4112 $searchresult = array();
4114 if ($searchresult = $search->getResultByType(
"grp"))
4118 foreach ($searchresult as $result_array)
4120 array_push($groups, $result_array[
"id"]);
4122 $groups = $this->
object->getGroupData ($groups);
4124 if (count ($groups))
4125 $this->
outUserGroupTable(
"grp", $groups,
"group_result",
"group_row", $this->lng->txt(
"search_group"),
"TEXT_GROUP_TITLE", $buttons);
4128 $searchresult = array();
4130 if ($searchresult = $search->getResultByType(
"role"))
4134 foreach ($searchresult as $result_array)
4136 array_push($roles, $result_array[
"id"]);
4139 $roles = $this->
object->getRoleData ($roles);
4142 $this->
outUserGroupTable(
"role", $roles,
"role_result",
"role_row", $this->lng->txt(
"role"),
"TEXT_ROLE_TITLE", $buttons);
4154 if ($_POST[
"cmd"][
"save"])
4156 $this->
object->saveToDb();
4158 $invited_users = $this->
object->getInvitedUsers();
4160 $buttons = array(
"save",
"remove");
4162 if ($this->object->getFixedParticipants())
4164 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
4166 $this->tpl->setCurrentBlock(
"invitation");
4167 $this->tpl->setVariable(
"SEARCH_INVITATION", $this->lng->txt(
"search"));
4168 $this->tpl->setVariable(
"SEARCH_TERM", $this->lng->txt(
"search_term"));
4169 $this->tpl->setVariable(
"SEARCH_FOR", $this->lng->txt(
"search_for"));
4170 $this->tpl->setVariable(
"SEARCH_USERS", $this->lng->txt(
"search_users"));
4171 $this->tpl->setVariable(
"SEARCH_GROUPS", $this->lng->txt(
"search_groups"));
4172 $this->tpl->setVariable(
"SEARCH_ROLES", $this->lng->txt(
"search_roles"));
4173 $this->tpl->setVariable(
"TEXT_CONCATENATION", $this->lng->txt(
"concatenation"));
4174 $this->tpl->setVariable(
"TEXT_AND", $this->lng->txt(
"and"));
4175 $this->tpl->setVariable(
"TEXT_OR", $this->lng->txt(
"or"));
4176 $this->tpl->setVariable(
"VALUE_SEARCH_TERM", $_POST[
"search_term"]);
4177 if (is_array($_POST[
"search_for"]))
4179 if (in_array(
"usr", $_POST[
"search_for"]))
4181 $this->tpl->setVariable(
"CHECKED_USERS",
" checked=\"checked\"");
4183 if (in_array(
"grp", $_POST[
"search_for"]))
4185 $this->tpl->setVariable(
"CHECKED_GROUPS",
" checked=\"checked\"");
4187 if (in_array(
"role", $_POST[
"search_for"]))
4189 $this->tpl->setVariable(
"CHECKED_ROLES",
" checked=\"checked\"");
4194 $this->tpl->setVariable(
"CHECKED_USERS",
" checked=\"checked\"");
4196 if (strcmp($_POST[
"concatenation"],
"and") == 0)
4198 $this->tpl->setVariable(
"CHECKED_AND",
" checked=\"checked\"");
4202 $this->tpl->setVariable(
"CHECKED_OR",
" checked=\"checked\"");
4204 $this->tpl->setVariable(
"SEARCH", $this->lng->txt(
"search"));
4205 $this->tpl->setVariable(
"SEARCH_INTRODUCTION", $this->lng->txt(
"participants_invitation_search_introduction"));
4206 $this->tpl->setVariable(
"TEXT_INVITATION", $this->lng->txt(
"invitation"));
4207 $this->tpl->setVariable(
"VALUE_ON", $this->lng->txt(
"on"));
4208 $this->tpl->setVariable(
"VALUE_OFF", $this->lng->txt(
"off"));
4209 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
4210 $this->tpl->parseCurrentBlock();
4214 $this->tpl->setCurrentBlock(
"adm_content");
4215 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
4216 $this->tpl->setVariable(
"TEXT_ALLOW_FIXED_PARTICIPANTS", $this->lng->txt(
"tst_allow_fixed_participants"));
4217 $this->tpl->setVariable(
"BUTTON_SAVE", $this->lng->txt(
"save"));
4218 $this->tpl->setVariable(
"TEXT_FIXED_PARTICIPANTS", $this->lng->txt(
"participants_invitation"));
4219 $this->tpl->setVariable(
"TEXT_FIXED_PARTICIPANTS_DESCRIPTION", $this->lng->txt(
"participants_invitation_description"));
4220 if ($this->object->getFixedParticipants())
4222 $this->tpl->setVariable(
"CHECKED_FIXED_PARTICIPANTS",
" checked=\"checked\"");
4224 if (
$total && (count($invited_users) == 0))
4227 $this->tpl->setVariable(
"DISABLED_FIXED_PARTICIPANTS",
" disabled=\"disabled\"");
4230 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
4232 $this->tpl->setVariable(
"SAVE", $this->lng->txt(
"save"));
4233 $this->tpl->setVariable(
"CANCEL", $this->lng->txt(
"cancel"));
4235 $this->tpl->parseCurrentBlock();
4251 if (method_exists($this, $method))
4257 $this->ctrl->redirect($this,
"participants");
4270 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
4274 $this->ctrl->redirect($this,
"infoScreen");
4277 if ($this->object->getFixedParticipants())
4279 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_invite.html",
"Modules/Test");
4283 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_participants.html",
"Modules/Test");
4285 include_once
"./Services/YUI/classes/class.ilYuiUtil.php";
4287 "deleteAllUserResults",
4288 $this->lng->txt(
"delete_all_user_data"),
4289 $this->lng->txt(
"confirm_delete_all_user_data"),
4290 "location.href='" . $this->ctrl->getLinkTarget($this,
"confirmDeleteAllUserResults") .
"';",
4295 if ($_POST[
"cmd"][
"cancel"])
4300 if ($_POST[
"cmd"][
"save"])
4302 $this->
object->saveToDb();
4305 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
4307 if ($this->tpl->blockExists(
"invitation"))
4309 $this->tpl->setCurrentBlock(
"invitation");
4310 $this->tpl->setVariable(
"SEARCH_INVITATION", $this->lng->txt(
"search"));
4311 $this->tpl->setVariable(
"SEARCH_TERM", $this->lng->txt(
"search_term"));
4312 $this->tpl->setVariable(
"SEARCH_FOR", $this->lng->txt(
"search_for"));
4313 $this->tpl->setVariable(
"SEARCH_USERS", $this->lng->txt(
"search_users"));
4314 $this->tpl->setVariable(
"SEARCH_GROUPS", $this->lng->txt(
"search_groups"));
4315 $this->tpl->setVariable(
"SEARCH_ROLES", $this->lng->txt(
"search_roles"));
4316 $this->tpl->setVariable(
"TEXT_CONCATENATION", $this->lng->txt(
"concatenation"));
4317 $this->tpl->setVariable(
"TEXT_AND", $this->lng->txt(
"and"));
4318 $this->tpl->setVariable(
"TEXT_OR", $this->lng->txt(
"or"));
4319 $this->tpl->setVariable(
"VALUE_SEARCH_TERM", $_POST[
"search_term"]);
4320 if (is_array($_POST[
"search_for"]))
4322 if (in_array(
"usr", $_POST[
"search_for"]))
4324 $this->tpl->setVariable(
"CHECKED_USERS",
" checked=\"checked\"");
4326 if (in_array(
"grp", $_POST[
"search_for"]))
4328 $this->tpl->setVariable(
"CHECKED_GROUPS",
" checked=\"checked\"");
4330 if (in_array(
"role", $_POST[
"search_for"]))
4332 $this->tpl->setVariable(
"CHECKED_ROLES",
" checked=\"checked\"");
4336 if (strcmp($_POST[
"concatenation"],
"and") == 0)
4338 $this->tpl->setVariable(
"CHECKED_AND",
" checked=\"checked\"");
4340 else if (strcmp($_POST[
"concatenation"],
"or") == 0)
4342 $this->tpl->setVariable(
"CHECKED_OR",
" checked=\"checked\"");
4344 $this->tpl->setVariable(
"SEARCH", $this->lng->txt(
"search"));
4345 $this->tpl->parseCurrentBlock();
4349 if ($this->object->getFixedParticipants())
4351 $invited_users =& $this->
object->getInvitedUsers();
4352 if (count($invited_users) == 0)
4358 $this->tpl->setCurrentBlock(
"delete_all");
4359 $this->tpl->setVariable(
"VALUE_DELETE_ALL_USER_DATA", $this->lng->txt(
"delete_all_user_data"));
4360 $this->tpl->setVariable(
"FORMACTION_DELETEALL", $this->ctrl->getFormAction($this,
"deleteAllUserResults"));
4361 $this->tpl->parseCurrentBlock();
4363 $buttons = array(array(
"saveClientIP" =>
"save"),array(
"removeParticipant" =>
"remove_as_participant"));
4364 if (!$this->object->getAnonymity())
4366 array_push($buttons, array(
"showPassOverview" =>
"show_pass_overview"));
4367 array_push($buttons, array(
"showUserAnswers" =>
"show_user_answers"));
4368 array_push($buttons, array(
"showDetailedResults" =>
"show_detailed_results"));
4370 array_push($buttons, array(
"deleteSingleUserResults" =>
"delete_user_data"));
4371 if (count($invited_users))
4373 $this->
outUserGroupTable(
"iv_usr", $invited_users,
"invited_user_result",
"invited_user_row", $this->lng->txt(
"tst_fixed_participating_users"),
"TEXT_INVITED_USER_TITLE",$buttons);
4378 $invited_users =& $this->
object->getTestParticipants();
4379 if (count($invited_users) == 0)
4385 $this->tpl->setCurrentBlock(
"delete_all");
4386 $this->tpl->setVariable(
"VALUE_DELETE_ALL_USER_DATA", $this->lng->txt(
"delete_all_user_data"));
4387 $this->tpl->setVariable(
"FORMACTION_DELETEALL", $this->ctrl->getFormAction($this,
"deleteAllUserResults"));
4388 $this->tpl->parseCurrentBlock();
4391 if (!$this->object->getAnonymity())
4393 array_push($buttons, array(
"showPassOverview" =>
"show_pass_overview"));
4394 array_push($buttons, array(
"showUserAnswers" =>
"show_user_answers"));
4395 array_push($buttons, array(
"showDetailedResults" =>
"show_detailed_results"));
4397 array_push($buttons, array(
"deleteSingleUserResults" =>
"delete_user_data"));
4398 if (count($invited_users))
4400 $this->
outUserGroupTable(
"iv_participants", $invited_users,
"invited_user_result",
"invited_user_row", $this->lng->txt(
"tst_participating_users"),
"TEXT_INVITED_USER_TITLE",$buttons);
4404 if ($this->object->getFixedParticipants())
4406 $this->tpl->setCurrentBlock(
"fixed_participants_hint");
4407 $this->tpl->setVariable(
"FIXED_PARTICIPANTS_HINT", sprintf($this->lng->txt(
"fixed_participants_hint"), $this->lng->txt(
"participants_invitation")));
4408 $this->tpl->parseCurrentBlock();
4411 $this->tpl->setCurrentBlock(
"adm_content");
4412 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
4413 $this->tpl->setVariable(
"TEXT_INVITATION", $this->lng->txt(
"invitation"));
4414 $this->tpl->setVariable(
"VALUE_ON", $this->lng->txt(
"on"));
4415 $this->tpl->setVariable(
"VALUE_OFF", $this->lng->txt(
"off"));
4416 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
4418 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
4420 $this->tpl->setVariable(
"SAVE", $this->lng->txt(
"save"));
4421 $this->tpl->setVariable(
"CANCEL", $this->lng->txt(
"cancel"));
4423 $this->tpl->parseCurrentBlock();
4437 $_SESSION[
"show_user_results"] = $_POST[
"chbUser"];
4439 $this->
showUserResults($show_pass_details = TRUE, $show_answers = TRUE, $show_reached_points = TRUE);
4453 $_SESSION[
"show_user_results"] = $_POST[
"chbUser"];
4455 $this->
showUserResults($show_pass_details = FALSE, $show_answers = TRUE);
4469 $_SESSION[
"show_user_results"] = $_POST[
"chbUser"];
4471 $this->
showUserResults($show_pass_details = TRUE, $show_answers = FALSE);
4483 $template =
new ilTemplate(
"tpl.il_as_tst_participants_result_output.html", TRUE, TRUE,
"Modules/Test");
4485 if (count(
$_SESSION[
"show_user_results"]) == 0)
4488 $this->ctrl->redirect($this,
"participants");
4491 include_once
"./Modules/Test/classes/class.ilTestServiceGUI.php";
4494 foreach (
$_SESSION[
"show_user_results"] as $key => $active_id)
4498 if ($this->object->getFixedParticipants())
4500 $active_id = $this->
object->getActiveIdOfUser($active_id);
4504 $results = $serviceGUI->getResultsOfUserOutput($active_id, $this->object->_getResultPass($active_id), $show_pass_details, $show_answers, FALSE, $show_reached_points);
4506 if ($count < count(
$_SESSION[
"show_user_results"]))
4508 $template->touchBlock(
"break");
4510 $template->setCurrentBlock(
"user_result");
4511 $template->setVariable(
"USER_RESULT",
$results);
4512 $template->parseCurrentBlock();
4514 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"back"));
4515 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"participants"));
4516 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
4517 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
4519 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
4521 if ($this->object->getShowSolutionAnswersOnly())
4529 if (is_array($_POST[
"chbUser"]))
4531 foreach ($_POST[
"chbUser"] as $user_id)
4533 $this->
object->disinviteUser($user_id);
4540 $this->ctrl->redirect($this,
"participants");
4545 if (is_array($_POST[
"chbUser"]))
4547 foreach ($_POST[
"chbUser"] as $user_id)
4549 $this->
object->setClientIP($user_id, $_POST[
"clientip_".$user_id]);
4556 $this->ctrl->redirect($this,
"participants");
4568 global $ilAccess,
$ilias;
4569 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
4573 $this->ctrl->redirect($this,
"infoScreen");
4576 $template =
new ilTemplate(
"tpl.il_as_tst_print_test_confirm.html", TRUE, TRUE,
"Modules/Test");
4578 if ((strlen($ilias->getSetting(
"rpc_server_host"))) && (strlen($ilias->getSetting(
"rpc_server_port"))))
4580 $this->ctrl->setParameter($this,
"pdf",
"1");
4581 $template->setCurrentBlock(
"pdf_export");
4582 $template->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this,
"print"));
4583 $this->ctrl->setParameter($this,
"pdf",
"");
4584 $template->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
4585 $template->setVariable(
"PDF_IMG_ALT", $this->lng->txt(
"pdf_export"));
4587 $template->parseCurrentBlock();
4593 $print_date = mktime(date(
"H"), date(
"i"), date(
"s"), date(
"m") , date(
"d"), date(
"Y"));
4597 foreach ($this->object->questions as $question)
4599 $template->setCurrentBlock(
"question");
4600 $question_gui = $this->
object->createQuestionGUI(
"", $question);
4601 $template->setVariable(
"COUNTER_QUESTION", $counter.
".");
4603 if ($question_gui->object->getMaximumPoints() == 1)
4605 $template->setVariable(
"QUESTION_POINTS", $question_gui->object->getMaximumPoints() .
" " . $this->lng->txt(
"point"));
4609 $template->setVariable(
"QUESTION_POINTS", $question_gui->object->getMaximumPoints() .
" " . $this->lng->txt(
"points"));
4611 $result_output = $question_gui->getSolutionOutput(
"", NULL, FALSE, TRUE, FALSE, $this->object->getShowSolutionFeedback());
4612 if (strlen($result_output) == 0) $result_output = $question_gui->getPreview(FALSE);
4613 $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
4614 $template->parseCurrentBlock(
"question");
4616 $max_points += $question_gui->object->getMaximumPoints();
4619 $template->setCurrentBlock(
"navigation_buttons");
4620 $template->setVariable(
"BUTTON_PRINT", $this->lng->txt(
"print"));
4621 $template->parseCurrentBlock();
4630 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1))
4632 $printbody =
new ilTemplate(
"tpl.il_as_tst_print_body.html", TRUE, TRUE,
"Modules/Test");
4634 $printbody->setVariable(
"ADM_CONTENT", $template->get());
4635 $printoutput = $printbody->get();
4636 $printoutput = preg_replace(
"/href=\".*?\"/",
"", $printoutput);
4637 $fo = $this->
object->processPrintoutput2FO($printoutput);
4638 $this->
object->deliverPDFfromFO($fo);
4642 $this->tpl->setVariable(
"PRINT_CONTENT", $template->get());
4654 function outUserGroupTable($a_type, $data_array, $block_result, $block_row, $title_text, $title_label, $buttons)
4657 $rowclass = array(
"tblrow1",
"tblrow2");
4661 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
4663 foreach ($buttons as $arr)
4665 foreach ($arr as $val => $cat)
4667 $this->tpl->setCurrentBlock(
"commandoption");
4668 $this->tpl->setVariable(
"OPTION_NAME", $this->lng->txt($cat));
4669 $this->tpl->setVariable(
"OPTION_VALUE", $val);
4670 $this->tpl->parseCurrentBlock();
4673 $this->tpl->setCurrentBlock(
"user_action_buttons");
4674 $this->tpl->setVariable(
"ARROW",
"<img src=\"" .
ilUtil::getImagePath(
"arrow_downright.gif") .
"\" alt=\"".$this->lng->txt(
"arrow_downright").
"\"/>");
4675 $this->tpl->setVariable(
"VALUE_SUBMIT", $this->lng->txt(
"submit"));
4676 $this->tpl->parseCurrentBlock();
4679 $finished =
"<img border=\"0\" align=\"middle\" src=\"".ilUtil::getImagePath(
"icon_ok.gif") .
"\" alt=\"".$this->lng->txt(
"checkbox_checked").
"\" />";
4680 $started =
"<img border=\"0\" align=\"middle\" src=\"".ilUtil::getImagePath(
"icon_ok.gif") .
"\" alt=\"".$this->lng->txt(
"checkbox_checked").
"\" />" ;
4682 foreach ($data_array as
$data)
4684 $maxpass = $this->
object->_getMaxPass($data->active_id);
4685 if (!is_null($maxpass))
4689 $passes = ($maxpass) ? (($maxpass == 1) ? sprintf($this->lng->txt(
"pass_finished"), $maxpass) : sprintf($this->lng->txt(
"passes_finished"), $maxpass)) :
" ";
4690 $this->tpl->setCurrentBlock($block_row);
4691 $this->tpl->setVariable(
"COLOR_CLASS", $rowclass[$counter % 2]);
4692 $this->tpl->setVariable(
"COUNTER", $data->usr_id);
4693 $this->tpl->setVariable(
"VALUE_IV_USR_ID", $data->usr_id);
4694 $this->tpl->setVariable(
"VALUE_IV_LOGIN", $data->login);
4695 $this->tpl->setVariable(
"VALUE_IV_FIRSTNAME", $data->firstname);
4696 $this->tpl->setVariable(
"VALUE_IV_LASTNAME", $data->lastname);
4697 $this->tpl->setVariable(
"VALUE_IV_CLIENT_IP", $data->clientip);
4698 $this->tpl->setVariable(
"VALUE_IV_TEST_FINISHED", ($data->test_finished==1)?$finished.$passes:$passes);
4699 $this->tpl->setVariable(
"VALUE_IV_TEST_STARTED", ($data->test_started==1)?$started:
" ");
4700 if (strlen($data->usr_id))
4702 $last_access = $this->
object->_getLastAccess($data->active_id);
4703 if (!strlen($last_access))
4705 $this->tpl->setVariable(
"VALUE_IV_LAST_ACCESS", $this->lng->txt(
"not_yet_accessed"));
4714 $last_access = $this->lng->txt(
"not_yet_accessed");
4715 $this->tpl->setVariable(
"VALUE_IV_LAST_ACCESS", $last_access);
4717 $this->ctrl->setParameter($this,
"active_id", $data->active_id);
4718 if ($data->test_started)
4720 $this->tpl->setVariable(
"VALUE_TST_SHOW_RESULTS", $this->lng->txt(
"tst_show_results"));
4721 $this->ctrl->setParameterByClass(
"iltestevaluationgui",
"active_id", $data->active_id);
4722 $this->tpl->setVariable(
"URL_TST_SHOW_RESULTS", $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"outParticipantsResultsOverview"));
4725 $this->tpl->parseCurrentBlock();
4727 if (count($data_array))
4729 $this->tpl->setCurrentBlock(
"selectall");
4730 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
4732 $this->tpl->setVariable(
"COLOR_CLASS", $rowclass[$counter % 2]);
4733 $this->tpl->parseCurrentBlock();
4735 $this->tpl->setCurrentBlock($block_result);
4736 $this->tpl->setVariable(
"$title_label",
"<img src=\"" .
ilUtil::getImagePath(
"icon_usr_b.gif") .
"\" alt=\"".$this->lng->txt(
"objs_usr").
"\" align=\"middle\" /> " . $title_text);
4737 $this->tpl->setVariable(
"TEXT_IV_LOGIN", $this->lng->txt(
"login"));
4738 $this->tpl->setVariable(
"TEXT_IV_FIRSTNAME", $this->lng->txt(
"firstname"));
4739 $this->tpl->setVariable(
"TEXT_IV_LASTNAME", $this->lng->txt(
"lastname"));
4740 $this->tpl->setVariable(
"TEXT_IV_CLIENT_IP", $this->lng->txt(
"clientip"));
4741 $this->tpl->setVariable(
"TEXT_IV_TEST_FINISHED", $this->lng->txt(
"tst_finished"));
4742 $this->tpl->setVariable(
"TEXT_IV_TEST_STARTED", $this->lng->txt(
"tst_started"));
4743 $this->tpl->setVariable(
"TEXT_IV_LAST_ACCESS", $this->lng->txt(
"last_access"));
4744 $this->tpl->parseCurrentBlock();
4746 case "iv_participants":
4747 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
4749 foreach ($buttons as $arr)
4751 foreach ($arr as $val => $cat)
4753 $this->tpl->setCurrentBlock(
"commandoption");
4754 $this->tpl->setVariable(
"OPTION_NAME", $this->lng->txt($cat));
4755 $this->tpl->setVariable(
"OPTION_VALUE", $val);
4756 $this->tpl->parseCurrentBlock();
4759 $this->tpl->setCurrentBlock(
"user_action_buttons");
4760 $this->tpl->setVariable(
"ARROW",
"<img src=\"" .
ilUtil::getImagePath(
"arrow_downright.gif") .
"\" alt=\"".$this->lng->txt(
"arrow_downright").
"\"/>");
4761 $this->tpl->setVariable(
"VALUE_SUBMIT", $this->lng->txt(
"submit"));
4762 $this->tpl->parseCurrentBlock();
4764 $finished =
"<img border=\"0\" align=\"middle\" src=\"".ilUtil::getImagePath(
"icon_ok.gif") .
"\" alt=\"".$this->lng->txt(
"checkbox_checked").
"\" />";
4765 $started =
"<img border=\"0\" align=\"middle\" src=\"".ilUtil::getImagePath(
"icon_ok.gif") .
"\" alt=\"".$this->lng->txt(
"checkbox_checked").
"\" />" ;
4767 foreach ($data_array as $data)
4769 $maxpass = $this->
object->_getMaxPass($data->active_id);
4770 if (!is_null($maxpass))
4774 $passes = ($maxpass) ? (($maxpass == 1) ? sprintf($this->lng->txt(
"pass_finished"), $maxpass) : sprintf($this->lng->txt(
"passes_finished"), $maxpass)) :
" ";
4775 $this->tpl->setCurrentBlock($block_row);
4776 $this->tpl->setVariable(
"COLOR_CLASS", $rowclass[$counter % 2]);
4777 $this->tpl->setVariable(
"COUNTER", $data->active_id);
4778 $this->tpl->setVariable(
"VALUE_IV_USR_ID", $data->active_id);
4779 $this->tpl->setVariable(
"VALUE_IV_LOGIN", $data->login);
4780 $this->tpl->setVariable(
"VALUE_IV_FIRSTNAME", $data->firstname);
4781 $this->tpl->setVariable(
"VALUE_IV_LASTNAME", $data->lastname);
4782 $this->tpl->setVariable(
"VALUE_IV_TEST_FINISHED", ($data->test_finished==1)?$finished.$passes:$passes);
4783 $this->tpl->setVariable(
"VALUE_IV_TEST_STARTED", ($data->test_started==1)?$started:
" ");
4784 if (strlen($data->active_id))
4786 $last_access = $this->
object->_getLastAccess($data->active_id);
4792 $last_access = $this->lng->txt(
"not_yet_accessed");
4793 $this->tpl->setVariable(
"VALUE_IV_LAST_ACCESS", $last_access);
4795 $this->ctrl->setParameter($this,
"active_id", $data->active_id);
4796 if ($data->test_started)
4798 $this->tpl->setVariable(
"VALUE_TST_SHOW_RESULTS", $this->lng->txt(
"tst_show_results"));
4799 $this->ctrl->setParameterByClass(
"iltestevaluationgui",
"active_id", $data->active_id);
4800 $this->tpl->setVariable(
"URL_TST_SHOW_RESULTS", $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"outParticipantsResultsOverview"));
4803 $this->tpl->parseCurrentBlock();
4805 if (count($data_array))
4807 $this->tpl->setCurrentBlock(
"selectall");
4808 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
4810 $this->tpl->setVariable(
"COLOR_CLASS", $rowclass[$counter % 2]);
4811 $this->tpl->parseCurrentBlock();
4813 $this->tpl->setCurrentBlock($block_result);
4814 $this->tpl->setVariable(
"$title_label",
"<img src=\"" .
ilUtil::getImagePath(
"icon_usr_b.gif") .
"\" alt=\"".$this->lng->txt(
"objs_usr").
"\" align=\"middle\" /> " . $title_text);
4815 $this->tpl->setVariable(
"TEXT_IV_LOGIN", $this->lng->txt(
"login"));
4816 $this->tpl->setVariable(
"TEXT_IV_FIRSTNAME", $this->lng->txt(
"firstname"));
4817 $this->tpl->setVariable(
"TEXT_IV_LASTNAME", $this->lng->txt(
"lastname"));
4818 $this->tpl->setVariable(
"TEXT_IV_TEST_FINISHED", $this->lng->txt(
"tst_finished"));
4819 $this->tpl->setVariable(
"TEXT_IV_TEST_STARTED", $this->lng->txt(
"tst_started"));
4820 $this->tpl->setVariable(
"TEXT_IV_LAST_ACCESS", $this->lng->txt(
"last_access"));
4821 $this->tpl->parseCurrentBlock();
4825 foreach ($data_array as $data)
4827 $this->tpl->setCurrentBlock($block_row);
4828 $this->tpl->setVariable(
"COLOR_CLASS", $rowclass[$counter % 2]);
4829 $this->tpl->setVariable(
"COUNTER", $data->usr_id);
4830 $this->tpl->setVariable(
"VALUE_LOGIN", $data->login);
4831 $this->tpl->setVariable(
"VALUE_FIRSTNAME", $data->firstname);
4832 $this->tpl->setVariable(
"VALUE_LASTNAME", $data->lastname);
4833 $this->tpl->setVariable(
"VALUE_CLIENT_IP", $data->clientip);
4835 $this->tpl->parseCurrentBlock();
4837 if (count($data_array))
4839 $this->tpl->setCurrentBlock(
"selectall_user_row");
4840 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
4842 $this->tpl->setVariable(
"COLOR_CLASS", $rowclass[$counter % 2]);
4843 $this->tpl->parseCurrentBlock();
4845 $this->tpl->setCurrentBlock($block_result);
4846 $this->tpl->setVariable(
"$title_label",
"<img src=\"" .
ilUtil::getImagePath(
"icon_usr_b.gif") .
"\" alt=\"".$this->lng->txt(
"objs_usr").
"\" align=\"middle\" /> " . $title_text);
4847 $this->tpl->setVariable(
"TEXT_LOGIN", $this->lng->txt(
"login"));
4848 $this->tpl->setVariable(
"TEXT_FIRSTNAME", $this->lng->txt(
"firstname"));
4849 $this->tpl->setVariable(
"TEXT_LASTNAME", $this->lng->txt(
"lastname"));
4850 $this->tpl->setVariable(
"TEXT_CLIENT_IP", $this->lng->txt(
"clientip"));
4852 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
4854 foreach ($buttons as $cat)
4856 $this->tpl->setVariable(
"VALUE_" . strtoupper($cat), $this->lng->txt($cat));
4858 $this->tpl->setVariable(
"ARROW",
"<img src=\"" .
ilUtil::getImagePath(
"arrow_downright.gif") .
"\" alt=\"".$this->lng->txt(
"arrow_downright").
"\"/>");
4860 $this->tpl->parseCurrentBlock();
4866 foreach ($data_array as $key => $data)
4868 $this->tpl->setCurrentBlock($block_row);
4869 $this->tpl->setVariable(
"COLOR_CLASS", $rowclass[$counter % 2]);
4870 $this->tpl->setVariable(
"COUNTER", $key);
4871 $this->tpl->setVariable(
"VALUE_TITLE", $data->title);
4872 $this->tpl->setVariable(
"VALUE_DESCRIPTION", $data->description);
4874 $this->tpl->parseCurrentBlock();
4876 if (count($data_array))
4878 $this->tpl->setCurrentBlock(
"selectall_" . $a_type .
"_row");
4879 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
4881 $this->tpl->setVariable(
"COLOR_CLASS", $rowclass[$counter % 2]);
4882 $this->tpl->parseCurrentBlock();
4884 $this->tpl->setCurrentBlock($block_result);
4885 $this->tpl->setVariable(
"$title_label",
"<img src=\"" .
ilUtil::getImagePath(
"icon_".$a_type.
"_b.gif") .
"\" align=\"middle\" alt=\"".$this->lng->txt(
"objs_".$a_type).
"\" /> " . $title_text);
4886 $this->tpl->setVariable(
"TEXT_TITLE", $this->lng->txt(
"title"));
4887 $this->tpl->setVariable(
"TEXT_DESCRIPTION", $this->lng->txt(
"description"));
4888 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
4890 foreach ($buttons as $cat)
4892 $this->tpl->setVariable(
"VALUE_" . strtoupper($cat), $this->lng->txt($cat));
4894 $this->tpl->setVariable(
"ARROW",
"<img src=\"" .
ilUtil::getImagePath(
"arrow_downright.gif") .
"\" alt=\"".$this->lng->txt(
"arrow_downright").
"\"/>");
4896 $this->tpl->parseCurrentBlock();
4907 if (is_array($_POST[
"user_select"]))
4910 foreach ($_POST[
"user_select"] as $user_id)
4912 $client_ip = $_POST[
"client_ip"][$i];
4913 $this->
object->inviteUser($user_id, $client_ip);
4919 if (is_array($_POST[
"group_select"]))
4921 foreach ($_POST[
"group_select"] as $group_id)
4923 $this->
object->inviteGroup($group_id);
4928 if (is_array($_POST[
"role_select"]))
4930 foreach ($_POST[
"role_select"] as $role_id)
4932 $this->
object->inviteRole($role_id);
4939 $message = $this->lng->txt(
"tst_invited_selected_users");
4943 if (strlen($message)) $message .=
"<br />";
4944 $message = $this->lng->txt(
"tst_invited_selected_groups");
4948 if (strlen($message)) $message .=
"<br />";
4949 $message = $this->lng->txt(
"tst_invited_selected_roles");
4951 if (strlen($message))
4960 $this->ctrl->redirect($this,
"inviteParticipants");
4979 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_defaults.html",
"Modules/Test");
4981 $maxentries = $ilUser->getPref(
"hits_per_page");
4982 if ($maxentries < 1)
4987 $offset =
$_GET[
"offset"] ?
$_GET[
"offset"] : 0;
4988 $sortby =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"name";
4989 $sortorder =
$_GET[
"sort_order"] ?
$_GET[
"sort_order"] :
"asc";
4991 $defaults =& $this->
object->getAvailableDefaults($sortby, $sortorder);
4992 if (count($defaults) > 0)
4994 $tablerows = array();
4995 foreach ($defaults as $row)
4997 array_push($tablerows, array(
"checkbox" =>
"<input type=\"checkbox\" name=\"chb_defaults[]\" value=\"" . $row[
"test_defaults_id"] .
"\"/>",
"name" => $row[
"name"]));
4999 $headervars = array(
"",
"name");
5001 include_once
"./Services/Table/classes/class.ilTableGUI.php";
5003 $tbl->setTitle($this->lng->txt(
"tst_defaults_available"));
5004 $header_names = array(
5006 $this->lng->txt(
"title")
5008 $tbl->setHeaderNames($header_names);
5010 $tbl->disable(
"sort");
5011 $tbl->disable(
"auto_sort");
5012 $tbl->enable(
"title");
5013 $tbl->enable(
"action");
5014 $tbl->enable(
"select_all");
5015 $tbl->setLimit($maxentries);
5016 $tbl->setOffset($offset);
5017 $tbl->setData($tablerows);
5018 $tbl->setMaxCount(count($tablerows));
5019 $tbl->setOrderDirection($sortorder);
5020 $tbl->setSelectAllCheckbox(
"chb_defaults");
5021 $tbl->setFormName(
"formDefaults");
5022 $tbl->addActionButton(
"deleteDefaults", $this->lng->txt(
"delete"));
5023 $tbl->addActionButton(
"applyDefaults", $this->lng->txt(
"apply"));
5025 $header_params = $this->ctrl->getParameterArray($this,
"defaults");
5026 $tbl->setHeaderVars($headervars, $header_params);
5029 $tbl->setFooter(
"tblfooter", $this->lng->txt(
"previous"), $this->lng->txt(
"next"));
5031 $tableoutput = $tbl->render();
5032 $this->tpl->setVariable(
"TEST_DEFAULTS_TABLE", $tableoutput);
5036 $this->tpl->setVariable(
"TEST_DEFAULTS_TABLE", $this->lng->txt(
"tst_defaults_not_defined"));
5038 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"addDefaults"));
5039 $this->tpl->setVariable(
"BUTTON_ADD", $this->lng->txt(
"add"));
5040 $this->tpl->setVariable(
"TEXT_DEFAULTS_OF_TEST", $this->lng->txt(
"tst_defaults_defaults_of_test"));
5048 if (count($_POST[
"chb_defaults"]))
5050 foreach ($_POST[
"chb_defaults"] as $test_default_id)
5052 $this->
object->deleteDefaults($test_default_id);
5063 if (count($_POST[
"chb_defaults"]) == 1)
5065 foreach ($_POST[
"chb_defaults"] as $test_default_id)
5067 $result = $this->
object->applyDefaults($test_default_id);
5090 if (strlen($_POST[
"name"]) > 0)
5092 $this->
object->addDefaults($_POST[
'name']);
5108 $this->ctrl->setCmd(
"showSummary");
5109 $this->ctrl->setCmdClass(
"ilinfoscreengui");
5115 $this->ctrl->setCmd(
"showSummary");
5116 $this->ctrl->setCmdClass(
"ilinfoscreengui");
5137 if ($this->object->getTestSequence()->hasHiddenQuestions())
5139 $this->
object->getTestSequence()->clearHiddenQuestions();
5140 $this->
object->getTestSequence()->saveToDb();
5144 if (!$ilAccess->checkAccess(
"visible",
"", $this->ref_id))
5146 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
5149 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
5152 $seq = $this->
object->getTestSession()->getLastSequence();
5154 include_once
"./Modules/Test/classes/class.ilTestOutputGUI.php";
5156 $this->ctrl->setParameter($output_gui,
"sequence", $seq);
5157 $info->setFormAction($this->ctrl->getFormAction($output_gui));
5158 if (strlen($session_lock))
5160 $info->addHiddenElement(
"lock", $session_lock);
5164 $info->addHiddenElement(
"lock", md5(
$_COOKIE[
'PHPSESSID'] . time()));
5166 $online_access =
false;
5167 if ($this->object->getFixedParticipants())
5169 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
5171 if ($online_access_result ===
true)
5173 $online_access =
true;
5180 if ($this->object->isComplete())
5182 if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess(
"read",
"", $this->ref_id))
5184 $executable = $this->
object->isExecutable($ilUser->getId(), $allowPassIncrease = TRUE);
5185 if ($executable[
"executable"])
5187 if ($this->object->getTestSession()->getActiveId() > 0)
5190 $resume_text = $this->lng->txt(
"tst_resume_test");
5191 if (($seq < 1) || ($seq == $this->object->getTestSequence()->getFirstSequence()))
5193 $resume_text = $this->
object->getStartTestLabel($this->object->getTestSession()->getActiveId());
5196 #if(!$_GET['crs_show_result'] or $this->object->getTestSequence()->getFirstSequence())
5198 $info->addFormButton(
"resume", $resume_text);
5204 $info->addFormButton(
"start", $this->object->getStartTestLabel($this->object->getTestSession()->getActiveId()));
5211 if ($this->object->getTestSession()->getActiveId() > 0)
5214 if ($this->object->canShowTestResults($ilUser->getId()))
5216 $info->addFormButton(
"outUserResultsOverview", $this->lng->txt(
"tst_show_results"));
5220 if ($this->object->getTestSession()->getActiveId() > 0)
5222 if ($this->object->canShowSolutionPrintview($ilUser->getId()))
5224 $info->addFormButton(
"outUserListOfAnswerPasses", $this->lng->txt(
"tst_list_of_answers_show"));
5229 if ($this->object->getShowInfo())
5231 $info->enablePrivateNotes();
5234 if (strlen($this->object->getIntroduction()))
5236 $info->addSection($this->lng->txt(
"tst_introduction"));
5237 $info->addProperty(
"", $this->object->prepareTextareaOutput($this->object->getIntroduction()));
5240 $info->addSection($this->lng->txt(
"tst_general_properties"));
5241 if ($this->object->getShowInfo())
5243 $info->addProperty($this->lng->txt(
"author"), $this->
object->getAuthor());
5244 $info->addProperty($this->lng->txt(
"title"), $this->
object->getTitle());
5246 if ($this->object->isComplete())
5248 if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess(
"read",
"", $this->ref_id))
5250 if ($this->object->getShowInfo() || !$this->
object->getForceJS())
5253 $checked_javascript =
false;
5254 if ($this->object->getJavaScriptOutput())
5256 $checked_javascript =
true;
5258 if ($this->object->getForceJS())
5260 $info->addProperty($this->lng->txt(
"tst_test_output"), $this->lng->txt(
"tst_use_javascript"));
5264 $info->addPropertyCheckbox($this->lng->txt(
"tst_test_output"),
"chb_javascript", 1, $this->lng->txt(
"tst_use_javascript"), $checked_javascript);
5268 if (!$this->object->isRandomTest())
5270 if ($this->object->getNrOfTries() != 1)
5272 if ($this->object->getUsePreviousAnswers() == 0)
5274 if ($this->object->getShowInfo())
5276 $info->addProperty($this->lng->txt(
"tst_use_previous_answers"), $this->lng->txt(
"tst_dont_use_previous_answers"));
5281 $use_previous_answers = FALSE;
5282 if ($ilUser->prefs[
"tst_use_previous_answers"])
5284 $checked_previous_answers = TRUE;
5286 $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);
5290 if (
$_SESSION[
"AccountId"] == ANONYMOUS_USER_ID)
5292 $info->addPropertyTextinput($this->lng->txt(
"enter_anonymous_code"),
"anonymous_id",
"", 8,
"setAnonymousId", $this->lng->txt(
"submit"));
5297 if ($this->object->getShowInfo())
5299 $info->addSection($this->lng->txt(
"tst_sequence_properties"));
5300 $info->addProperty($this->lng->txt(
"tst_sequence"), $this->lng->txt(($this->object->getSequenceSettings() ==
TEST_FIXED_SEQUENCE)?
"tst_sequence_fixed":
"tst_sequence_postpone"));
5302 $info->addSection($this->lng->txt(
"tst_heading_scoring"));
5303 $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"));
5304 $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"));
5305 if ($this->object->isRandomTest())
5307 $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"));
5310 $info->addSection($this->lng->txt(
"tst_score_reporting"));
5311 $score_reporting_text =
"";
5312 switch ($this->object->getScoreReporting())
5315 $score_reporting_text = $this->lng->txt(
"tst_report_after_test");
5318 $score_reporting_text = $this->lng->txt(
"tst_report_after_first_question");
5321 $score_reporting_text = $this->lng->txt(
"tst_report_after_date");
5324 $info->addProperty($this->lng->txt(
"tst_score_reporting"), $score_reporting_text);
5325 $reporting_date = $this->
object->getReportingDate();
5326 if ($reporting_date)
5328 #preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $reporting_date, $matches);
5329 #$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]));
5330 #$info->addProperty($this->lng->txt("tst_score_reporting_date"), $txt_reporting_date);
5331 $info->addProperty($this->lng->txt(
'tst_score_reporting_date'),
5335 $info->addSection($this->lng->txt(
"tst_session_settings"));
5336 $info->addProperty($this->lng->txt(
"tst_nr_of_tries"), ($this->
object->getNrOfTries() == 0)?$this->lng->txt(
"unlimited"):$this->
object->getNrOfTries());
5337 if ($this->object->getNrOfTries() != 1)
5339 $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());
5342 if ($this->object->getEnableProcessingTime())
5344 $info->addProperty($this->lng->txt(
"tst_processing_time"), $this->
object->getProcessingTime());
5346 if (strlen($this->object->getAllowedUsers()) && ($this->object->getAllowedUsersTimeGap()))
5348 $info->addProperty($this->lng->txt(
"tst_allowed_users"), $this->
object->getAllowedUsers());
5351 $starting_time = $this->
object->getStartingTime();
5354 $info->addProperty($this->lng->txt(
"tst_starting_time"),
5357 $ending_time = $this->
object->getEndingTime();
5360 $info->addProperty($this->lng->txt(
"tst_ending_time"),
5363 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
5366 if(
$_GET[
'crs_show_result'] and !$this->object->getTestSequence()->getFirstSequence())
5368 #ilUtil::sendInfo($this->lng->txt('crs_all_questions_answered_successfully'));
5372 $this->ctrl->forwardCommand($info);
5378 switch ($this->ctrl->getCmd())
5382 case "redirectToInfoScreen":
5389 case "outCorrectSolution":
5391 case "showAnswersOfUser":
5392 case "outUserResultsOverview":
5393 case "backFromSummary":
5394 case "show_answers":
5397 case "outTestSummary":
5398 case "outQuestionSummary":
5399 case "gotoQuestion":
5400 case "selectImagemapRegion":
5401 case "confirmSubmitAnswers":
5402 case "finalSubmission":
5404 case "redirectQuestion":
5405 case "outUserPassDetails":
5406 case "checkPassword":
5407 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
5410 case "evalAllUsers":
5411 case "evalUserDetail":
5412 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"eval_stat"),
"",
$_GET[
"ref_id"]);
5419 case "importVerifiedFile":
5420 case "cancelImport":
5423 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"",
$_GET[
"ref_id"]);
5431 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
5434 $tabs_gui->setBackTarget($this->lng->txt(
"backtocallingtest"), $this->ctrl->getLinkTarget($this,
"questions"));
5435 $tabs_gui->addTarget(
"tst_browse_for_questions",
5436 $this->ctrl->getLinkTarget($this,
"browseForQuestions"),
5437 array(
"browseForQuestions",
"filter",
"resetFilter",
"resetTextFilter",
"insertQuestions"),
5446 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
5449 $tabs_gui->setBackTarget($this->lng->txt(
"backtocallingtest"), $this->ctrl->getLinkTarget($this,
"questions"));
5450 $tabs_gui->addTarget(
"random_selection",
5451 $this->ctrl->getLinkTarget($this,
"randomQuestions"),
5452 array(
"randomQuestions"),
5467 include_once
"./Modules/Test/classes/class.ilTestCertificateGUI.php";
5469 $output_gui->certificateEditor();
5477 $ilTabs->addSubTabTarget(
"edit_test_questions",
5478 $this->ctrl->getLinkTarget($this,
'questions'),
5479 array(
"questions",
"browseForQuestions",
"questionBrowser",
"createQuestion",
5480 "randomselect",
"filter",
"resetFilter",
"insertQuestions",
5481 "back",
"createRandomSelection",
"cancelRandomSelect",
5482 "insertRandomSelection",
"removeQuestions",
"moveQuestions",
5483 "insertQuestionsBefore",
"insertQuestionsAfter",
"confirmRemoveQuestions",
5484 "cancelRemoveQuestions",
"executeCreateQuestion",
"cancelCreateQuestion",
5485 "addQuestionpool",
"saveRandomQuestions",
"saveQuestionSelectionMode"),
5489 if (!$this->object->isRandomTest())
5491 $ilTabs->addSubTabTarget(
"print_view",
5492 $this->ctrl->getLinkTarget($this,
'print'),
5503 $ilTabs->addSubTabTarget(
"eval_all_users",
5504 $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"outEvaluation"),
5505 array(
"outEvaluation",
"detailedEvaluation",
"exportEvaluation",
"evalUserDetail",
"passDetails",
5506 "outStatisticsResultsOverview",
"statisticsPassDetails")
5510 $ilTabs->addSubTabTarget(
"tst_results_aggregated",
5511 $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"eval_a"),
5515 if ($this->object->hasPDFProcessing())
5518 $ilTabs->addSubTabTarget(
"tst_single_results",
5519 $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"singleResults"),
5520 array(
"singleResults"),
5525 $ilTabs->addSubTabTarget(
"settings",
5526 $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"evalSettings"),
5527 array(
"evalSettings",
"saveEvalSettings"),
5537 $ilTabs->addSubTabTarget(
"participants_data",
5538 $this->ctrl->getLinkTarget($this,
'participants'),
5539 array(
"participants",
"saveFixedParticipantsStatus",
5540 "showParticipantAnswersForAuthor",
"showResults",
5541 "confirmDeleteAllUserData",
5542 "deleteAllUserResults",
5543 "cancelDeleteAllUserData",
"deleteSingleUserResults",
5544 "outParticipantsResultsOverview",
"outParticipantsPassDetails",
5545 "showPassOverview",
"showUserAnswers",
"participantsAction"
5550 $ilTabs->addSubTabTarget(
"participants_invitation",
5551 $this->ctrl->getLinkTarget($this,
"inviteParticipants"),
5552 array(
"inviteParticipants",
"searchParticipants"),
5562 $force_active = ($this->ctrl->getCmd() ==
"")
5565 $ilTabs->addSubTabTarget(
"general",
5566 $this->ctrl->getLinkTarget($this,
'properties'),
5567 array(
"properties",
"saveProperties",
"cancelProperties"),
5568 array(
"",
"ilobjtestgui",
"iltestcertificategui"),
5572 $ilTabs->addSubTabTarget(
5574 $this->ctrl->getLinkTarget($this,
'scoring'),
5576 array(
"",
"ilobjtestgui",
"iltestcertificategui")
5580 $ilTabs->addSubTabTarget(
5582 $this->ctrl->getLinkTarget($this,
'marks'),
5583 array(
"marks",
"addMarkStep",
"deleteMarkSteps",
"addSimpleMarkSchema",
5584 "saveMarks",
"cancelMarks"),
5585 array(
"",
"ilobjtestgui",
"iltestcertificategui")
5588 if ((strlen($ilias->getSetting(
"rpc_server_host"))) && (strlen($ilias->getSetting(
"rpc_server_port"))))
5591 $ilTabs->addSubTabTarget(
5593 $this->ctrl->getLinkTarget($this,
'certificate'),
5594 array(
"certificate",
"certificateEditor",
"certificateRemoveBackground",
"certificateSave",
5595 "certificatePreview",
"certificateDelete",
"certificateUpload",
"certificateImport"),
5596 array(
"",
"ilobjtestgui",
"iltestcertificategui")
5601 $ilTabs->addSubTabTarget(
5603 $this->ctrl->getLinkTarget($this,
"defaults"),
5604 array(
"defaults",
"deleteDefaults",
"addDefaults",
"applyDefaults"),
5605 array(
"",
"ilobjtestgui",
"iltestcertificategui")
5616 global $ilAccess,$ilUser;
5618 switch ($this->ctrl->getCmd())
5625 case "directfeedback":
5627 case "outCorrectSolution":
5629 case "showAnswersOfUser":
5630 case "outUserResultsOverview":
5631 case "backFromSummary":
5632 case "show_answers":
5635 case "confirmFinish":
5636 case "outTestSummary":
5637 case "outQuestionSummary":
5638 case "gotoQuestion":
5639 case "selectImagemapRegion":
5640 case "confirmSubmitAnswers":
5641 case "finalSubmission":
5643 case "redirectQuestion":
5644 case "outUserPassDetails":
5645 case "checkPassword":
5646 case "exportCertificate":
5647 case "finishListOfAnswers":
5648 case "backConfirmFinish":
5649 case "showFinalStatement":
5652 case "browseForQuestions":
5655 case "resetTextFilter":
5656 case "insertQuestions":
5659 case "showParticipantAnswersForAuthor":
5660 case "inviteParticipants":
5661 case "participants":
5662 case "outParticipantsPassDetails":
5663 case "outParticipantsResultsOverview":
5664 case "deleteAllUserResults":
5665 case "confirmDeleteAllUserData":
5666 case "cancelDeleteAllUserData":
5667 case "deleteSingleUserResults":
5668 case "searchParticipants":
5669 case "showPassOverview":
5670 case "showUserAnswers":
5679 case "deleteMarkSteps":
5680 case "addSimpleMarkSchema":
5682 case "certificateImport":
5683 case "certificateUpload":
5684 case "certificateEditor":
5685 case "certificateSave":
5687 case "deleteDefaults":
5689 case "applyDefaults":
5691 if (($ilAccess->checkAccess(
"write",
"", $this->ref_id)) && ((strcmp($this->ctrl->getCmdClass(),
"ilobjtestgui") == 0) || (strcmp($this->ctrl->getCmdClass(),
"iltestcertificategui") == 0) || (strlen($this->ctrl->getCmdClass()) == 0)))
5701 case "evalSettings":
5702 case "saveEvalSettings":
5703 case "detailedEvaluation":
5704 case "outEvaluation":
5705 case "singleResults":
5706 case "exportEvaluation":
5707 case "evalUserDetail":
5709 case "outStatisticsResultsOverview":
5710 case "statisticsPassDetails":
5715 if (strcmp(strtolower(get_class($this->
object)),
"ilobjtest") == 0)
5718 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
5720 $force_active = (
$_GET[
"up"] !=
"" ||
$_GET[
"down"] !=
"")
5725 if (
$_GET[
"browse"] == 1) $force_active =
true;
5726 if (preg_match(
"/deleteqpl_\d+/", $this->ctrl->getCmd()))
5728 $force_active =
true;
5731 $tabs_gui->addTarget(
"assQuestions",
5732 $this->ctrl->getLinkTarget($this,
'questions'),
5733 array(
"questions",
"browseForQuestions",
"questionBrowser",
"createQuestion",
5734 "randomselect",
"filter",
"resetFilter",
"insertQuestions",
5735 "back",
"createRandomSelection",
"cancelRandomSelect",
5736 "insertRandomSelection",
"removeQuestions",
"moveQuestions",
5737 "insertQuestionsBefore",
"insertQuestionsAfter",
"confirmRemoveQuestions",
5738 "cancelRemoveQuestions",
"executeCreateQuestion",
"cancelCreateQuestion",
5739 "addQuestionpool",
"saveRandomQuestions",
"saveQuestionSelectionMode",
"print"),
5740 "",
"", $force_active);
5744 if ($ilAccess->checkAccess(
"visible",
"", $this->ref_id))
5746 $tabs_gui->addTarget(
"info_short",
5747 $this->ctrl->getLinkTarget($this,
'infoScreen'),
5748 array(
"infoScreen",
"outIntroductionPage",
"showSummary",
5749 "setAnonymousId",
"outUserListOfAnswerPasses",
"redirectToInfoScreen"));
5753 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
5755 $tabs_gui->addTarget(
"settings",
5756 $this->ctrl->getLinkTarget($this,
'properties'),
5757 array(
"properties",
"saveProperties",
"cancelProperties",
5758 "marks",
"addMarkStep",
"deleteMarkSteps",
"addSimpleMarkSchema",
5759 "saveMarks",
"cancelMarks",
5760 "certificate",
"certificateEditor",
"certificateRemoveBackground",
5761 "certificateSave",
"certificatePreview",
"certificateDelete",
"certificateUpload",
5762 "certificateImport",
"scoring",
"defaults",
"addDefaults",
"deleteDefaults",
"applyDefaults",
5765 array(
"",
"ilobjtestgui",
"iltestcertificategui")
5769 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
5772 $tabs_gui->addTarget(
"meta_data",
5773 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
'listSection'),
5774 "",
"ilmdeditorgui");
5777 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
5780 $tabs_gui->addTarget(
"participants",
5781 $this->ctrl->getLinkTarget($this,
'participants'),
5782 array(
"participants",
"searchParticipants",
"addParticipants",
"saveClientIP",
5783 "removeParticipant",
"inviteParticipants",
5784 "saveFixedParticipantsStatus",
"showParticipantAnswersForAuthor",
5785 "deleteAllUserResults",
5786 "cancelDeleteAllUserData",
"deleteSingleUserResults",
5787 "outParticipantsResultsOverview",
"outParticipantsPassDetails",
5788 "showPassOverview",
"showUserAnswers",
"participantsAction"),
5792 $tabs_gui->addTarget(
"export",
5793 $this->ctrl->getLinkTarget($this,
'export'),
5794 array(
"export",
"createExportFile",
"confirmDeleteExportFile",
5795 "downloadExportFile",
"deleteExportFile",
"cancelDeleteExportFile"),
5798 include_once
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
5800 if (count($scoring))
5803 $tabs_gui->addTarget(
"manscoring",
5804 $this->ctrl->getLinkTargetByClass(
"iltestscoringgui",
"manscoring"),
5805 array(
"manscoring",
"selectParticipant",
"setPointsManual",
"setFeedbackManual"),
5810 if (($ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) || ($ilAccess->checkAccess(
"write",
"", $this->ref_id)))
5813 $tabs_gui->addTarget(
"statistics",
5814 $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"outEvaluation"),
5815 array(
"statistics",
"outEvaluation",
"exportEvaluation",
"detailedEvaluation",
"eval_a",
"evalSettings",
"saveEvalSettings",
"evalUserDetail",
5816 "passDetails",
"outStatisticsResultsOverview",
"statisticsPassDetails")
5820 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
5823 $tabs_gui->addTarget(
'learning_progress',
5824 $this->ctrl->getLinkTargetByClass(array(
'illearningprogressgui'),
''),
5826 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui'));
5829 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
5832 $tabs_gui->addTarget(
"history",
5833 $this->ctrl->getLinkTarget($this,
'history'),
5836 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->ref_id))
5838 $tabs_gui->addTarget(
"perm_settings",
5839 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
5857 if ($ilAccess->checkAccess(
"visible",
"", $a_target))
5860 $_GET[
"baseClass"] =
"ilObjTestGUI";
5861 $_GET[
"cmd"] =
"infoScreen";
5862 $_GET[
"ref_id"] = $a_target;
5863 include_once(
"ilias.php");
5867 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
5869 $_GET[
"cmd"] =
"frameset";
5870 $_GET[
"target"] =
"";
5871 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
5874 include(
"repository.php");
5878 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);