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,
$ilCtrl;
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(
"Services/AccessControl/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 "ilcertificategui":
161 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
163 include_once
"./Modules/Test/classes/class.ilTestCertificateAdapter.php";
165 $this->ctrl->forwardCommand($output_gui);
168 case "iltestscoringgui":
169 include_once
"./Modules/Test/classes/class.ilTestScoringGUI.php";
172 $this->ctrl->forwardCommand($output_gui);
175 case 'ilobjectcopygui':
177 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
180 $this->ctrl->forwardCommand($cp);
186 if (preg_match(
"/deleteqpl_\d+/",
$cmd))
188 $cmd =
"randomQuestions";
190 if ((strcmp(
$cmd,
"properties") == 0) && (
$_GET[
"browse"]))
195 if ((strcmp(
$cmd,
"properties") == 0) && (
$_GET[
"up"] ||
$_GET[
"down"]))
204 if (strtolower(
$_GET[
"baseClass"]) !=
"iladministrationgui" &&
213 $this->ctrl->redirect($this,
"infoScreen");
218 $this->ctrl->redirectByClass(
"iltestevaluationgui",
"outEvaluation");
226 if (strcmp($_FILES[
"xmldoc"][
"tmp_name"],
"") == 0)
232 $this->ctrl->setParameter($this,
"new_type", $this->type);
244 if (!strlen(
$_POST[
'Fobject'][
'title']))
247 $this->ctrl->setParameter($this,
'new_type',
$_GET[
'new_type']);
248 $this->ctrl->redirect($this,
'create');
252 if (
$_POST[
"defaults"] > 0)
254 $newObj->applyDefaults(
$_POST[
"defaults"]);
259 ilUtil::redirect(
"ilias.php?baseClass=ilObjTestGUI&ref_id=".$newObj->getRefId().
"&cmd=properties");
264 include_once
"./Services/Utilities/classes/class.ilUtil.php";
265 $path = $this->tree->getPathFull($this->object->getRefID());
271 include_once
"./Services/Utilities/classes/class.ilUtil.php";
282 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
286 $this->ctrl->redirect($this,
"infoScreen");
289 $export_dir = $this->
object->getExportDirectory();
290 $export_files = $this->
object->getExportFiles($export_dir);
292 if(count($export_files) > 0)
294 foreach($export_files as $exp_file)
296 $file_arr = explode(
"__", $exp_file);
298 array_push(
$data, array(
300 'size' => filesize($export_dir.
"/".$exp_file),
306 include_once
"./Modules/Test/classes/tables/class.ilTestExportTableGUI.php";
308 $table_gui->setData(
$data);
309 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
319 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
321 include_once(
"./Modules/Test/classes/class.ilTestExport.php");
323 $test_exp->buildExportFile();
329 $this->ctrl->redirect($this,
"export");
339 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
341 include_once(
"./Modules/Test/classes/class.ilTestExport.php");
343 $test_exp->buildExportFile();
349 $this->ctrl->redirect($this,
"export");
358 if(!isset(
$_POST[
"file"]))
361 $this->ctrl->redirect($this,
"export");
364 if (count(
$_POST[
"file"]) > 1)
367 $this->ctrl->redirect($this,
"export");
371 $export_dir = $this->
object->getExportDirectory();
381 if (!isset(
$_POST[
"file"]))
384 $this->ctrl->redirect($this,
"export");
389 $export_dir = $this->
object->getExportDirectory();
390 $export_files = $this->
object->getExportFiles($export_dir);
392 if (count(
$_POST[
"file"]) > 0)
394 foreach (
$_POST[
"file"] as $exp_file)
396 $file_arr = explode(
"__", $exp_file);
398 array_push(
$data, array(
400 'size' => filesize($export_dir.
"/".$exp_file),
406 include_once
"./Modules/Test/classes/tables/class.ilTestExportTableGUI.php";
408 $table_gui->setData(
$data);
409 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
428 $this->ctrl->redirect($this,
"export");
437 $export_dir = $this->
object->getExportDirectory();
440 $exp_file = $export_dir.
"/".
$file;
441 $exp_dir = $export_dir.
"/".substr($file, 0, strlen($file) - 4);
442 if (@is_file($exp_file))
446 if (@is_dir($exp_dir))
452 $this->ctrl->redirect($this,
"export");
460 if ($_FILES[
"xmldoc"][
"error"] > UPLOAD_ERR_OK)
466 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
471 $file = pathinfo($_FILES[
"xmldoc"][
"name"]);
479 $subdir = basename(
$file[
"basename"],
".".
$file[
"extension"]);
483 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
485 $result = $qtiParser->startParsing();
486 $founditems =& $qtiParser->getFoundItems();
488 if (count($founditems) == 0)
502 foreach ($founditems as $item)
504 if (strlen($item[
"type"]))
524 $_SESSION[
"tst_import_xml_file"] = $xml_file;
525 $_SESSION[
"tst_import_qti_file"] = $qti_file;
526 $_SESSION[
"tst_import_subdir"] = $subdir;
528 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.tst_import_verification.html");
529 $row_class = array(
"tblrow1",
"tblrow2");
531 foreach ($founditems as $item)
533 $this->tpl->setCurrentBlock(
"verification_row");
534 $this->tpl->setVariable(
"ROW_CLASS", $row_class[$counter++ % 2]);
535 $this->tpl->setVariable(
"QUESTION_TITLE", $item[
"title"]);
536 $this->tpl->setVariable(
"QUESTION_IDENT", $item[
"ident"]);
537 include_once
"./Services/QTI/classes/class.ilQTIItem.php";
538 switch ($item[
"type"])
540 case "MULTIPLE CHOICE QUESTION":
542 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"qt_multiple_choice"));
544 case "SINGLE CHOICE QUESTION":
546 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assSingleChoice"));
548 case "NUMERIC QUESTION":
550 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assNumeric"));
552 case "TEXTSUBSET QUESTION":
554 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assTextSubset"));
556 case "CLOZE QUESTION":
558 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assClozeTest"));
560 case "IMAGE MAP QUESTION":
562 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assImagemapQuestion"));
564 case "JAVA APPLET QUESTION":
566 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assJavaApplet"));
568 case "MATCHING QUESTION":
570 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assMatchingQuestion"));
572 case "ORDERING QUESTION":
574 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assOrderingQuestion"));
576 case "TEXT QUESTION":
578 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assTextQuestion"));
581 $this->tpl->parseCurrentBlock();
583 $this->tpl->setCurrentBlock(
"adm_content");
584 $this->tpl->setVariable(
"TEXT_TYPE", $this->lng->txt(
"question_type"));
585 $this->tpl->setVariable(
"TEXT_TITLE", $this->lng->txt(
"question_title"));
586 $this->tpl->setVariable(
"FOUND_QUESTIONS_INTRODUCTION", $this->lng->txt(
"tst_import_verify_found_questions"));
587 $this->tpl->setVariable(
"VERIFICATION_HEADING", $this->lng->txt(
"import_tst"));
588 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
590 $this->tpl->setVariable(
"QUESTIONPOOL_ID",
$_POST[
"qpl"]);
591 $this->tpl->setVariable(
"VALUE_IMPORT", $this->lng->txt(
"import"));
592 $this->tpl->setVariable(
"VALUE_CANCEL", $this->lng->txt(
"cancel"));
593 $this->tpl->parseCurrentBlock();
601 include_once
"./Modules/Test/classes/class.ilObjTest.php";
605 $newObj->setType(
$_GET[
"new_type"]);
607 $newObj->setTitle(
"dummy");
609 $newObj->setDescription(
"test import");
611 $newObj->create(
true);
613 $newObj->createReference();
615 $newObj->putInTree(
$_GET[
"ref_id"]);
617 $newObj->setPermissions(
$_GET[
"ref_id"]);
619 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
621 $newObj->mark_schema->flush();
624 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
626 $qtiParser->setTestObject($newObj);
627 $result = $qtiParser->startParsing();
633 include_once (
"./Modules/LearningModule/classes/class.ilContObjParser.php");
635 $contParser->setQuestionMapping($qtiParser->getImportMapping());
636 $contParser->startParsing();
642 "&baseClass=ilObjTestGUI");
667 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_properties_save_confirmation.html",
"Modules/Test");
672 $information = $this->lng->txt(
"change_properties_from_random_to_standard");
675 $information = $this->lng->txt(
"change_properties_from_standard_to_random");
680 if (strcmp(
$key,
"cmd") != 0)
682 if (is_array($value))
684 foreach ($value as $k => $v)
686 $this->tpl->setCurrentBlock(
"hidden_variable");
687 $this->tpl->setVariable(
"HIDDEN_KEY",
$key .
"[" . $k .
"]");
688 $this->tpl->setVariable(
"HIDDEN_VALUE", $v);
689 $this->tpl->parseCurrentBlock();
694 $this->tpl->setCurrentBlock(
"hidden_variable");
695 $this->tpl->setVariable(
"HIDDEN_KEY",
$key);
696 $this->tpl->setVariable(
"HIDDEN_VALUE", $value);
697 $this->tpl->parseCurrentBlock();
701 $this->tpl->setCurrentBlock(
"hidden_variable");
702 $this->tpl->setVariable(
"HIDDEN_KEY",
"tst_properties_confirmation");
703 $this->tpl->setVariable(
"HIDDEN_VALUE",
"1");
704 $this->tpl->parseCurrentBlock();
705 $this->tpl->setCurrentBlock(
"adm_content");
706 $this->tpl->setVariable(
"TXT_CONFIRMATION", $this->lng->txt(
"confirmation"));
707 $this->tpl->setVariable(
"TXT_INFORMATION", $information);
708 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
709 $this->tpl->setVariable(
"BTN_CONFIRM", $this->lng->txt(
"confirm"));
710 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
711 $this->tpl->parseCurrentBlock();
724 $total = $this->
object->evalTotalPersons();
728 $this->
object->setCountSystem(
$_POST[
"count_system"]);
729 $this->
object->setMCScoring(
$_POST[
"mc_scoring"]);
730 $this->
object->setScoreCutting(
$_POST[
"score_cutting"]);
731 $this->
object->setPassScoring(
$_POST[
"pass_scoring"]);
734 $this->
object->setAnswerFeedback((is_array(
$_POST[
'instant_feedback']) && in_array(
'instant_feedback_answer',
$_POST[
'instant_feedback'])) ? 1 : 0);
735 $this->
object->setAnswerFeedbackPoints((is_array(
$_POST[
'instant_feedback']) && in_array(
'instant_feedback_points',
$_POST[
'instant_feedback'])) ? 1 : 0);
736 $this->
object->setInstantFeedbackSolution((is_array(
$_POST[
'instant_feedback']) && in_array(
'instant_feedback_solution',
$_POST[
'instant_feedback'])) ? 1 : 0);
738 $this->
object->setScoreReporting(
$_POST[
"results_access"]);
741 $this->
object->setReportingDate(sprintf(
"%04d%02d%02d%02d%02d%02d",
742 $_POST[
"reporting_date"][
'date'][
"y"],
743 $_POST[
"reporting_date"][
'date'][
"m"],
744 $_POST[
"reporting_date"][
'date'][
"d"],
745 $_POST[
"reporting_date"][
'time'][
"h"],
746 $_POST[
"reporting_date"][
'time'][
"m"],
747 $_POST[
"reporting_date"][
'time'][
"s"]
752 $this->
object->setReportingDate(
'');
755 $this->
object->setShowPassDetails((is_array(
$_POST[
'results_presentation']) && in_array(
'pass_details',
$_POST[
'results_presentation'])) ? 1 : 0);
756 $this->
object->setShowSolutionDetails((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_details',
$_POST[
'results_presentation'])) ? 1 : 0);
757 $this->
object->setShowSolutionPrintview((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_printview',
$_POST[
'results_presentation'])) ? 1 : 0);
758 $this->
object->setShowSolutionFeedback((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_feedback',
$_POST[
'results_presentation'])) ? 1 : 0);
759 $this->
object->setShowSolutionAnswersOnly((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_answers_only',
$_POST[
'results_presentation'])) ? 1 : 0);
760 $this->
object->setShowSolutionSignature((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_signature',
$_POST[
'results_presentation'])) ? 1 : 0);
761 $this->
object->setShowSolutionSuggested((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_suggested',
$_POST[
'results_presentation'])) ? 1 : 0);
763 $this->
object->saveToDb(
true);
765 $this->ctrl->redirect($this,
"scoring");
777 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
781 $this->ctrl->redirect($this,
"infoScreen");
784 $save = (strcmp($this->ctrl->getCmd(),
"saveScoring") == 0) ? TRUE : FALSE;
785 $total = $this->
object->evalTotalPersons();
786 $this->tpl->addJavascript(
"./Services/JavaScript/js/Basic.js");
788 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
790 $form->setFormAction($this->ctrl->getFormAction($this));
791 $form->setTableWidth(
"100%");
792 $form->setId(
"test_properties_scoring");
796 $header->setTitle($this->lng->txt(
"scoring"));
797 $form->addItem($header);
800 $count_system =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_text_count_system"),
"count_system");
802 $count_system->addOption(
new ilRadioOption($this->lng->txt(
"tst_count_correct_solutions"), 1,
''));
803 $count_system->setValue($this->object->getCountSystem());
804 $count_system->setInfo($this->lng->txt(
"tst_count_system_description"));
807 $count_system->setDisabled(
true);
809 $form->addItem($count_system);
812 $mc_scoring =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_score_mcmr_questions"),
"mc_scoring");
813 $mc_scoring->
addOption(
new ilRadioOption($this->lng->txt(
"tst_score_mcmr_zero_points_when_unanswered"), 0,
''));
814 $mc_scoring->addOption(
new ilRadioOption($this->lng->txt(
"tst_score_mcmr_use_scoring_system"), 1,
''));
815 $mc_scoring->setValue($this->object->getMCScoring());
816 $mc_scoring->setInfo($this->lng->txt(
"tst_score_mcmr_questions_description"));
819 $mc_scoring->setDisabled(
true);
821 $form->addItem($mc_scoring);
824 $score_cutting =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_score_cutting"),
"score_cutting");
826 $score_cutting->addOption(
new ilRadioOption($this->lng->txt(
"tst_score_cut_test"), 1,
''));
827 $score_cutting->setValue($this->object->getScoreCutting());
828 $score_cutting->setInfo($this->lng->txt(
"tst_score_cutting_description"));
831 $score_cutting->setDisabled(
true);
833 $form->addItem($score_cutting);
838 $pass_scoring->addOption(
new ilRadioOption($this->lng->txt(
"tst_pass_best_pass"), 1,
''));
839 $pass_scoring->setValue($this->object->getPassScoring());
840 $pass_scoring->setInfo($this->lng->txt(
"tst_pass_scoring_description"));
843 $pass_scoring->setDisabled(
true);
845 $form->addItem($pass_scoring);
849 $instant_feedback->
addOption(
new ilCheckboxOption($this->lng->txt(
"tst_instant_feedback_answer_specific"),
'instant_feedback_answer',
''));
850 $instant_feedback->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_instant_feedback_results"),
'instant_feedback_points',
''));
851 $instant_feedback->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_instant_feedback_solution"),
'instant_feedback_solution',
''));
853 if ($this->object->getAnswerFeedback()) array_push($values,
'instant_feedback_answer');
854 if ($this->object->getAnswerFeedbackPoints()) array_push($values,
'instant_feedback_points');
855 if ($this->object->getInstantFeedbackSolution()) array_push($values,
'instant_feedback_solution');
856 $instant_feedback->setValue($values);
857 $instant_feedback->setInfo($this->lng->txt(
"tst_instant_feedback_description"));
858 $form->addItem($instant_feedback);
861 $results_access =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_results_access"),
"results_access");
863 $results_access->addOption(
new ilRadioOption($this->lng->txt(
"tst_results_access_always"), 2,
''));
864 $results_access->addOption(
new ilRadioOption($this->lng->txt(
"tst_results_access_never"), 4,
''));
865 $results_access->addOption(
new ilRadioOption($this->lng->txt(
"tst_results_access_date"), 3,
''));
866 $results_access->setValue($this->object->getScoreReporting());
867 $results_access->setInfo($this->lng->txt(
"tst_results_access_description"));
871 $reporting_date->setShowDate(
true);
872 $reporting_date->setShowTime(
true);
873 if (strlen($this->object->getReportingDate()))
881 $results_access->addSubItem($reporting_date);
882 $form->addItem($results_access);
885 $results_presentation =
new ilCheckboxGroupInputGUI($this->lng->txt(
"tst_results_presentation"),
"results_presentation");
887 $results_presentation->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_details"),
'solution_details',
''));
888 $results_presentation->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_printview"),
'solution_printview',
''));
889 $results_presentation->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_feedback"),
'solution_feedback',
''));
890 $results_presentation->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_answers_only"),
'solution_answers_only',
''));
891 $signatureOption =
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_signature"),
'solution_signature',
'');
892 $results_presentation->addOption($signatureOption);
893 $results_presentation->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_suggested"),
'solution_suggested',
''));
895 if ($this->object->getShowPassDetails()) array_push($values,
'pass_details');
896 if ($this->object->getShowSolutionDetails()) array_push($values,
'solution_details');
897 if ($this->object->getShowSolutionPrintview()) array_push($values,
'solution_printview');
898 if ($this->object->getShowSolutionFeedback()) array_push($values,
'solution_feedback');
899 if ($this->object->getShowSolutionAnswersOnly()) array_push($values,
'solution_answers_only');
900 if ($this->object->getShowSolutionSignature()) array_push($values,
'solution_signature');
901 if ($this->object->getShowSolutionSuggested()) array_push($values,
'solution_suggested');
902 $results_presentation->setValue($values);
903 $results_presentation->setInfo($this->lng->txt(
"tst_results_presentation_description"));
904 if ($this->object->getAnonymity())
906 $signatureOption->setDisabled(
true);
908 $form->addItem($results_presentation);
910 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])) $form->addCommandButton(
"saveScoring", $this->lng->txt(
"save"));
915 $errors = !$form->checkInput();
916 $form->setValuesByPost();
917 if (
$errors) $checkonly =
false;
919 if (!$checkonly) $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
931 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
935 $this->ctrl->redirect($this,
"infoScreen");
938 $save = (strcmp($this->ctrl->getCmd(),
"saveProperties") == 0) ? TRUE : FALSE;
939 $total = $this->
object->evalTotalPersons();
940 $this->tpl->addJavascript(
"./Services/JavaScript/js/Basic.js");
942 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
944 $form->setFormAction($this->ctrl->getFormAction($this));
945 $form->setTableWidth(
"100%");
946 $form->setId(
"test_properties");
950 $header->setTitle($this->lng->txt(
"tst_general_properties"));
951 $form->addItem($header);
956 if (
$total) $anonymity->setDisabled(
true);
957 $anonymity->setChecked($this->object->getAnonymity());
958 $anonymity->setInfo($this->lng->txt(
"tst_anonymity_description"));
959 $form->addItem($anonymity);
962 $random =
new ilCheckboxInputGUI($this->lng->txt(
"tst_random_selection"),
"random_test");
964 if (
$total) $random->setDisabled(
true);
965 $random->setChecked($this->object->isRandomTest());
966 $random->setInfo($this->lng->txt(
"tst_random_test_description"));
967 $form->addItem($random);
971 $intro->
setValue($this->object->prepareTextareaOutput($this->object->getIntroduction()));
974 $intro->setUseRte(TRUE);
975 $intro->addPlugin(
"latex");
976 $intro->addButton(
"latex");
977 $intro->setRTESupport($this->object->getId(),
"tst",
"assessment");
978 $intro->setRteTagSet(
'full');
981 $showinfo->setValue(1);
982 $showinfo->setChecked($this->object->getShowInfo());
983 $showinfo->setOptionTitle($this->lng->txt(
"showinfo"));
984 $showinfo->setInfo($this->lng->txt(
"showinfo_desc"));
985 $intro->addSubItem($showinfo);
986 $form->addItem($intro);
989 $finalstatement =
new ilTextAreaInputGUI($this->lng->txt(
"final_statement"),
"finalstatement");
990 $finalstatement->
setValue($this->object->prepareTextareaOutput($this->object->getFinalStatement()));
991 $finalstatement->setRows(10);
992 $finalstatement->setCols(80);
993 $finalstatement->setUseRte(TRUE);
994 $finalstatement->addPlugin(
"latex");
995 $finalstatement->addButton(
"latex");
996 $finalstatement->setRTESupport($this->object->getId(),
"tst",
"assessment");
997 $finalstatement->setRteTagSet(
'full');
1000 $showfinal->setValue(1);
1001 $showfinal->setChecked($this->object->getShowFinalStatement());
1002 $showfinal->setOptionTitle($this->lng->txt(
"final_statement_show"));
1003 $showfinal->setInfo($this->lng->txt(
"final_statement_show_desc"));
1004 $finalstatement->addSubItem($showfinal);
1005 $form->addItem($finalstatement);
1009 $seqheader->setTitle($this->lng->txt(
"tst_sequence_properties"));
1010 $form->addItem($seqheader);
1015 $postpone->setChecked($this->object->getSequenceSettings());
1016 $postpone->setInfo($this->lng->txt(
"tst_postpone_description"));
1017 $form->addItem($postpone);
1020 $shuffle =
new ilCheckboxInputGUI($this->lng->txt(
"tst_shuffle_questions"),
"chb_shuffle_questions");
1022 $shuffle->setChecked($this->object->getShuffleQuestions());
1023 $shuffle->setInfo($this->lng->txt(
"tst_shuffle_questions_description"));
1024 $form->addItem($shuffle);
1027 $list_of_questions =
new ilCheckboxInputGUI($this->lng->txt(
"tst_show_summary"),
"list_of_questions");
1028 $list_of_questions->
setOptionTitle($this->lng->txt(
"tst_show_summary"));
1029 $list_of_questions->setValue(1);
1030 $list_of_questions->setChecked($this->object->getListOfQuestions());
1031 $list_of_questions->setInfo($this->lng->txt(
"tst_show_summary_description"));
1034 $list_of_questions_options->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_list_of_questions_start"),
'chb_list_of_questions_start',
''));
1035 $list_of_questions_options->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_list_of_questions_end"),
'chb_list_of_questions_end',
''));
1036 $list_of_questions_options->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_list_of_questions_with_description"),
'chb_list_of_questions_with_description',
''));
1038 if ($this->object->getListOfQuestionsStart()) array_push($values,
'chb_list_of_questions_start');
1039 if ($this->object->getListOfQuestionsEnd()) array_push($values,
'chb_list_of_questions_end');
1040 if ($this->object->getListOfQuestionsDescription()) array_push($values,
'chb_list_of_questions_with_description');
1041 $list_of_questions_options->setValue($values);
1043 $list_of_questions->addSubItem($list_of_questions_options);
1044 $form->addItem($list_of_questions);
1047 $marking =
new ilCheckboxInputGUI($this->lng->txt(
"question_marking"),
"chb_show_marker");
1049 $marking->setChecked($this->object->getShowMarker());
1050 $marking->setInfo($this->lng->txt(
"question_marking_description"));
1051 $form->addItem($marking);
1054 $cancel =
new ilCheckboxInputGUI($this->lng->txt(
"tst_show_cancel"),
"chb_show_cancel");
1056 $cancel->setChecked($this->object->getShowCancel());
1057 $cancel->setInfo($this->lng->txt(
"tst_show_cancel_description"));
1058 $form->addItem($cancel);
1062 $kioskheader->setTitle($this->lng->txt(
"kiosk"));
1063 $form->addItem($kioskheader);
1068 $kiosk->setChecked($this->object->getKioskMode());
1069 $kiosk->setInfo($this->lng->txt(
"kiosk_description"));
1074 $kiosktitle->addOption(
new ilCheckboxOption($this->lng->txt(
"kiosk_show_participant"),
'kiosk_participant',
''));
1076 if ($this->object->getShowKioskModeTitle()) array_push($values,
'kiosk_title');
1077 if ($this->object->getShowKioskModeParticipant()) array_push($values,
'kiosk_participant');
1078 $kiosktitle->setValue($values);
1079 $kiosktitle->setInfo($this->lng->txt(
"kiosk_options_desc"));
1080 $kiosk->addSubItem($kiosktitle);
1082 $form->addItem($kiosk);
1086 $sessionheader->setTitle($this->lng->txt(
"tst_session_settings"));
1087 $form->addItem($sessionheader);
1090 $nr_of_tries =
new ilTextInputGUI($this->lng->txt(
"tst_nr_of_tries"),
"nr_of_tries");
1092 $nr_of_tries->setValue($this->object->getNrOfTries());
1093 $nr_of_tries->setRequired(
true);
1094 $nr_of_tries->setSuffix($this->lng->txt(
"0_unlimited"));
1095 if (
$total) $nr_of_tries->setDisabled(
true);
1096 $form->addItem($nr_of_tries);
1099 $processing =
new ilCheckboxInputGUI($this->lng->txt(
"tst_processing_time"),
"chb_processing_time");
1101 $processing->setOptionTitle($this->lng->txt(
"enabled"));
1102 $processing->setChecked($this->object->getEnableProcessingTime());
1106 $ptime = $this->
object->getProcessingTimeAsArray();
1107 $processingtime->setHours($ptime[
'hh']);
1108 $processingtime->setMinutes($ptime[
'mm']);
1109 $processingtime->setSeconds($ptime[
'ss']);
1110 $processingtime->setShowMonths(
false);
1111 $processingtime->setShowDays(
false);
1112 $processingtime->setShowHours(
true);
1113 $processingtime->setShowMinutes(
true);
1114 $processingtime->setShowSeconds(
true);
1115 $processingtime->setInfo($this->lng->txt(
"tst_processing_time_desc"));
1116 $processing->addSubItem($processingtime);
1120 $resetprocessing->setValue(1);
1121 $resetprocessing->setOptionTitle($this->lng->txt(
"tst_reset_processing_time"));
1122 $resetprocessing->setChecked($this->object->getResetProcessingTime());
1123 $resetprocessing->setInfo($this->lng->txt(
"tst_reset_processing_time_desc"));
1124 $processing->addSubItem($resetprocessing);
1125 $form->addItem($processing);
1128 $enablestartingtime =
new ilCheckboxInputGUI($this->lng->txt(
"tst_starting_time"),
"chb_starting_time");
1130 $enablestartingtime->setOptionTitle($this->lng->txt(
"enabled"));
1131 $enablestartingtime->setChecked(strlen($this->object->getStartingTime()));
1134 $startingtime->setShowDate(
true);
1135 $startingtime->setShowTime(
true);
1136 if (strlen($this->object->getStartingTime()))
1144 $enablestartingtime->addSubItem($startingtime);
1145 if (
$total) $enablestartingtime->setDisabled(
true);
1146 if (
$total) $startingtime->setDisabled(
true);
1147 $form->addItem($enablestartingtime);
1150 $enableendingtime =
new ilCheckboxInputGUI($this->lng->txt(
"tst_ending_time"),
"chb_ending_time");
1152 $enableendingtime->setOptionTitle($this->lng->txt(
"enabled"));
1153 $enableendingtime->setChecked(strlen($this->object->getEndingTime()));
1156 $endingtime->setShowDate(
true);
1157 $endingtime->setShowTime(
true);
1158 if (strlen($this->object->getEndingTime()))
1166 $enableendingtime->addSubItem($endingtime);
1167 $form->addItem($enableendingtime);
1170 $prevanswers =
new ilCheckboxInputGUI($this->lng->txt(
"tst_use_previous_answers"),
"chb_use_previous_answers");
1172 $prevanswers->setChecked($this->object->getUsePreviousAnswers());
1173 $prevanswers->setInfo($this->lng->txt(
"tst_use_previous_answers_description"));
1174 $form->addItem($prevanswers);
1179 $forcejs->setChecked($this->object->getForceJS());
1180 $forcejs->setOptionTitle($this->lng->txt(
"forcejs"));
1181 $forcejs->setInfo($this->lng->txt(
"forcejs_desc"));
1182 $form->addItem($forcejs);
1187 $title_output->addOption(
new ilRadioOption($this->lng->txt(
"tst_title_output_hide_points"), 1,
''));
1188 $title_output->addOption(
new ilRadioOption($this->lng->txt(
"tst_title_output_no_title"), 2,
''));
1189 $title_output->setValue($this->object->getTitleOutput());
1190 $title_output->setInfo($this->lng->txt(
"tst_title_output_description"));
1191 $form->addItem($title_output);
1196 $password->setValue($this->object->getPassword());
1197 $password->setInfo($this->lng->txt(
"tst_password_details"));
1202 $restrictions->setTitle($this->lng->txt(
"tst_max_allowed_users"));
1203 $form->addItem($restrictions);
1206 $simul =
new ilTextInputGUI($this->lng->txt(
"tst_allowed_users"),
"allowedUsers");
1208 $simul->setValue(($this->object->getAllowedUsers()) ? $this->object->getAllowedUsers() :
'');
1209 $form->addItem($simul);
1212 $idle =
new ilTextInputGUI($this->lng->txt(
"tst_allowed_users_time_gap"),
"allowedUsersTimeGap");
1214 $idle->setSuffix($this->lng->txt(
"seconds"));
1215 $idle->setValue(($this->object->getAllowedUsersTimeGap()) ? $this->object->getAllowedUsersTimeGap() :
'');
1216 $form->addItem($idle);
1220 $notifications->setTitle($this->lng->txt(
"notifications"));
1221 $form->addItem($notifications);
1224 $mailnotification =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_finish_notification"),
"mailnotification");
1226 $mailnotification->addOption(
new ilRadioOption($this->lng->txt(
"tst_finish_notification_simple"), 1,
''));
1227 $mailnotification->addOption(
new ilRadioOption($this->lng->txt(
"tst_finish_notification_advanced"), 2,
''));
1228 $mailnotification->setValue($this->object->getMailNotification());
1229 $form->addItem($mailnotification);
1231 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])) $form->addCommandButton(
"saveProperties", $this->lng->txt(
"save"));
1236 $errors = !$form->checkInput();
1237 $form->setValuesByPost();
1238 if (
$errors) $checkonly =
false;
1240 if (!$checkonly) $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
1251 if (!array_key_exists(
"tst_properties_confirmation",
$_POST))
1261 $total = $this->
object->evalTotalPersons();
1262 $randomtest_switch =
false;
1266 if (!array_key_exists(
"tst_properties_confirmation",
$_POST))
1268 if (($this->object->isRandomTest()) && (count($this->object->getRandomQuestionpools()) > 0))
1270 if (!
$_POST[
"random_test"])
1277 if ((!$this->object->isRandomTest()) && (count($this->object->questions) > 0))
1279 if (
$_POST[
"random_test"])
1288 if (!strlen(
$_POST[
"random_test"]))
1294 $random_test =
$_POST[
"random_test"];
1299 $random_test = $this->
object->isRandomTest();
1301 if ($random_test != $this->object->isRandomTest())
1303 $randomtest_switch =
true;
1308 $this->
object->setAnonymity(
$_POST[
"anonymity"]);
1309 $this->
object->setRandomTest($random_test);
1310 $this->
object->setNrOfTries(
$_POST[
"nr_of_tries"]);
1311 if (
$_POST[
'chb_starting_time'])
1317 $this->
object->setStartingTime(
'');
1320 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
1322 $this->
object->setShowInfo((
$_POST[
"showinfo"]) ? 1 : 0);
1324 $this->
object->setShowFinalStatement((
$_POST[
"showfinalstatement"]) ? 1 : 0);
1325 $this->
object->setSequenceSettings((
$_POST[
"chb_postpone"]) ? 1 : 0);
1326 $this->
object->setShuffleQuestions((
$_POST[
"chb_shuffle_questions"]) ? 1 : 0);
1327 $this->
object->setListOfQuestions(
$_POST[
"list_of_questions"]);
1328 if (is_array(
$_POST[
"list_of_questions_options"]))
1330 $this->
object->setListOfQuestionsStart((in_array(
'chb_list_of_questions_start',
$_POST[
"list_of_questions_options"])) ? 1 : 0);
1331 $this->
object->setListOfQuestionsEnd((in_array(
'chb_list_of_questions_end',
$_POST[
"list_of_questions_options"])) ? 1 : 0);
1332 $this->
object->setListOfQuestionsDescription((in_array(
'chb_list_of_questions_with_description',
$_POST[
"list_of_questions_options"])) ? 1 : 0);
1336 $this->
object->setListOfQuestionsStart(0);
1337 $this->
object->setListOfQuestionsEnd(0);
1338 $this->
object->setListOfQuestionsDescription(0);
1340 $this->
object->setMailNotification(
$_POST[
"mailnotification"]);
1341 $this->
object->setShowMarker((
$_POST[
"chb_show_marker"]) ? 1 : 0);
1342 $this->
object->setShowCancel((
$_POST[
"chb_show_cancel"]) ? 1 : 0);
1343 $this->
object->setKioskMode((
$_POST[
"kiosk"]) ? 1 : 0);
1344 $this->
object->setShowKioskModeTitle((is_array(
$_POST[
"kiosk_options"]) && in_array(
'kiosk_title',
$_POST[
"kiosk_options"])) ? 1 : 0);
1345 $this->
object->setShowKioskModeParticipant((is_array(
$_POST[
"kiosk_options"]) && in_array(
'kiosk_participant',
$_POST[
"kiosk_options"])) ? 1 : 0);
1346 $this->
object->setEnableProcessingTime((
$_POST[
"chb_processing_time"]) ? 1 : 0);
1347 if ($this->object->getEnableProcessingTime())
1349 $this->
object->setProcessingTime(sprintf(
"%02d:%02d:%02d",
1350 $_POST[
"processing_time"][
"hh"],
1351 $_POST[
"processing_time"][
"mm"],
1352 $_POST[
"processing_time"][
"ss"]
1357 $this->
object->setProcessingTime(
'');
1359 $this->
object->setResetProcessingTime((
$_POST[
"chb_reset_processing_time"]) ? 1 : 0);
1360 if (
$_POST[
'chb_ending_time'])
1366 $this->
object->setEndingTime(
'');
1368 $this->
object->setUsePreviousAnswers((
$_POST[
"chb_use_previous_answers"]) ? 1 : 0);
1369 $this->
object->setForceJS((
$_POST[
"forcejs"]) ? 1 : 0);
1370 $this->
object->setTitleOutput(
$_POST[
"title_output"]);
1371 $this->
object->setPassword(
$_POST[
"password"]);
1372 $this->
object->setAllowedUsers(
$_POST[
"allowedUsers"]);
1373 $this->
object->setAllowedUsersTimeGap(
$_POST[
"allowedUsersTimeGap"]);
1375 if ($this->object->isRandomTest())
1377 $this->
object->setUsePreviousAnswers(0);
1380 $this->
object->saveToDb(
true);
1383 if ($randomtest_switch)
1385 if ($this->object->isRandomTest())
1387 $this->
object->removeNonRandomTestData();
1391 $this->
object->removeRandomTestData();
1394 $this->ctrl->redirect($this,
'properties');
1404 include_once(
"./Modules/File/classes/class.ilObjFile.php");
1406 $fileObj->sendFile();
1415 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
1418 $page_gui->showMediaFullscreen();
1427 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
1429 $pg_obj->send_paragraph (
$_GET[
"par_id"],
$_GET[
"downloadtitle"]);
1466 $this->ctrl->redirect($this,
"questions");
1480 $parent_ref = $tree->getParentId($this->object->getRefId());
1481 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
1483 $qpl->setType(
"qpl");
1484 $qpl->setTitle(
$name);
1485 $qpl->setDescription(
"");
1487 $qpl->createReference();
1488 $qpl->putInTree($parent_ref);
1489 $qpl->setPermissions($parent_ref);
1492 return $qpl->getRefId();
1502 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_random_select.html",
"Modules/Test");
1503 $questionpools =& $this->
object->getAvailableQuestionpools(FALSE, FALSE, FALSE, TRUE);
1504 $this->tpl->setCurrentBlock(
"option");
1505 $this->tpl->setVariable(
"VALUE_OPTION",
"0");
1506 $this->tpl->setVariable(
"TEXT_OPTION", $this->lng->txt(
"all_available_question_pools"));
1507 $this->tpl->parseCurrentBlock();
1508 foreach ($questionpools as
$key => $value)
1510 $this->tpl->setCurrentBlock(
"option");
1511 $this->tpl->setVariable(
"VALUE_OPTION",
$key);
1512 $this->tpl->setVariable(
"TEXT_OPTION", $value[
"title"]);
1513 $this->tpl->parseCurrentBlock();
1515 $this->tpl->setCurrentBlock(
"hidden");
1516 $this->tpl->setVariable(
"HIDDEN_NAME",
"sel_question_types");
1517 $this->tpl->setVariable(
"HIDDEN_VALUE",
$_POST[
"sel_question_types"]);
1518 $this->tpl->parseCurrentBlock();
1519 $this->tpl->setCurrentBlock(
"adm_content");
1520 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
1521 $this->tpl->setVariable(
"TXT_QPL_SELECT", $this->lng->txt(
"tst_random_select_questionpool"));
1522 $this->tpl->setVariable(
"TXT_NR_OF_QUESTIONS", $this->lng->txt(
"tst_random_nr_of_questions"));
1523 $this->tpl->setVariable(
"BTN_SUBMIT", $this->lng->txt(
"submit"));
1524 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
1525 $this->tpl->parseCurrentBlock();
1537 $this->ctrl->redirect($this,
"questions");
1550 $question_array = $this->
object->randomSelectQuestions(
$_POST[
"nr_of_questions"],
$_POST[
"sel_qpl"]);
1551 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_random_question_offer.html",
"Modules/Test");
1552 $color_class = array(
"tblrow1",
"tblrow2");
1554 $questionpools =& $this->
object->getAvailableQuestionpools(
true);
1555 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1556 foreach ($question_array as $question_id)
1558 $dataset = $this->
object->getQuestionDataset($question_id);
1559 $this->tpl->setCurrentBlock(
"QTab");
1560 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
1561 $this->tpl->setVariable(
"QUESTION_TITLE", $dataset->title);
1562 $this->tpl->setVariable(
"QUESTION_COMMENT", $dataset->description);
1564 $this->tpl->setVariable(
"QUESTION_AUTHOR", $dataset->author);
1565 $this->tpl->setVariable(
"QUESTION_POOL", $questionpools[$dataset->obj_fi][
"title"]);
1566 $this->tpl->parseCurrentBlock();
1569 if (count($question_array) == 0)
1571 $this->tpl->setCurrentBlock(
"Emptytable");
1572 $this->tpl->setVariable(
"TEXT_NO_QUESTIONS_AVAILABLE", $this->lng->txt(
"no_questions_available"));
1573 $this->tpl->parseCurrentBlock();
1577 $this->tpl->setCurrentBlock(
"Selectionbuttons");
1578 $this->tpl->setVariable(
"BTN_YES", $this->lng->txt(
"random_accept_sample"));
1579 $this->tpl->setVariable(
"BTN_NO", $this->lng->txt(
"random_another_sample"));
1580 $this->tpl->parseCurrentBlock();
1582 $chosen_questions = join($question_array,
",");
1583 $this->tpl->setCurrentBlock(
"adm_content");
1584 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
1585 $this->tpl->setVariable(
"QUESTION_TITLE", $this->lng->txt(
"tst_question_title"));
1586 $this->tpl->setVariable(
"QUESTION_COMMENT", $this->lng->txt(
"description"));
1587 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"tst_question_type"));
1588 $this->tpl->setVariable(
"QUESTION_AUTHOR", $this->lng->txt(
"author"));
1589 $this->tpl->setVariable(
"QUESTION_POOL", $this->lng->txt(
"qpl"));
1590 $this->tpl->setVariable(
"VALUE_CHOSEN_QUESTIONS", $chosen_questions);
1591 $this->tpl->setVariable(
"VALUE_QUESTIONPOOL_SELECTION",
$_POST[
"sel_qpl"]);
1592 $this->tpl->setVariable(
"VALUE_NR_OF_QUESTIONS",
$_POST[
"nr_of_questions"]);
1593 $this->tpl->setVariable(
"TEXT_QUESTION_OFFER", $this->lng->txt(
"tst_question_offer"));
1594 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
1595 $this->tpl->parseCurrentBlock();
1607 $selected_array = split(
",",
$_POST[
"chosen_questions"]);
1608 if (!count($selected_array))
1614 $total = $this->
object->evalTotalPersons();
1624 foreach ($selected_array as
$key => $value)
1626 $this->
object->insertQuestion($value);
1628 $this->
object->saveCompleteStatus();
1630 $this->ctrl->redirect($this,
"questions");
1652 $ilUser->setPref(
"tst_question_selection_mode_equal", (
$_POST[
'chbQuestionSelectionMode']) ? 1 : 0);
1653 $ilUser->writePref(
"tst_question_selection_mode_equal", (
$_POST[
'chbQuestionSelectionMode']) ? 1 : 0);
1654 $this->
object->setRandomQuestionCount(
$_POST[
'total_questions']);
1655 if (is_array(
$_POST[
'source'][
'qpl']))
1658 include_once
"./Modules/Test/classes/class.ilRandomTestData.php";
1659 foreach (
$_POST[
'source'][
'qpl'] as $idx => $qpl)
1663 $this->
object->setRandomQuestionpoolData(
$data);
1674 $this->
object->saveRandomQuestionCount($this->object->getRandomQuestionCount());
1675 $this->
object->saveRandomQuestionpools();
1676 $this->
object->saveCompleteStatus();
1678 $this->ctrl->redirect($this,
'randomQuestions');
1685 $position = key(
$_POST[
'cmd'][
'addsource']);
1686 $this->
object->addRandomQuestionpoolData(0, 0, $position+1);
1693 $position = key(
$_POST[
'cmd'][
'removesource']);
1694 $this->
object->removeRandomQuestionpoolData($position);
1702 $total = $this->
object->evalTotalPersons();
1703 $save = (strcmp($this->ctrl->getCmd(),
"saveRandomQuestions") == 0) ? TRUE : FALSE;
1705 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1707 $form->setFormAction($this->ctrl->getFormAction($this,
'randomQuestions'));
1708 $form->setTitle($this->lng->txt(
'random_selection'));
1709 $form->setDescription($this->lng->txt(
'tst_select_random_questions'));
1710 $form->setMultipart(FALSE);
1711 $form->setTableWidth(
"100%");
1712 $form->setId(
"randomSelectionForm");
1715 $selection_mode = ($save) ?
$_POST[
'chbQuestionSelectionMode'] : $ilUser->getPref(
"tst_question_selection_mode_equal");
1716 $question_selection =
new ilCheckboxInputGUI($this->lng->txt(
"tst_question_selection"),
"chbQuestionSelectionMode");
1718 $question_selection->setChecked($selection_mode);
1719 $question_selection->setOptionTitle($this->lng->txt(
'tst_question_selection_equal'));
1720 $question_selection->setInfo($this->lng->txt(
'tst_question_selection_description'));
1721 $question_selection->setRequired(
false);
1722 $form->addItem($question_selection);
1725 $total_questions =
new ilNumberInputGUI($this->lng->txt(
'tst_total_questions'),
'total_questions');
1726 $total_questions->
setValue($this->object->getRandomQuestionCount());
1727 $total_questions->setSize(3);
1728 $total_questions->setInfo($this->lng->txt(
'tst_total_questions_description'));
1729 $total_questions->setRequired(
false);
1730 $form->addItem($total_questions);
1734 $found_qpls = $this->
object->getRandomQuestionpoolData();
1735 include_once
"./Modules/Test/classes/class.ilRandomTestData.php";
1736 if (count($found_qpls) == 0)
1740 $available_qpl =& $this->
object->getAvailableQuestionpools(TRUE, $selection_mode, FALSE, TRUE, TRUE);
1741 include_once
'./Modules/Test/classes/class.ilRandomTestInputGUI.php';
1744 $source->setRandomQuestionPools($available_qpl);
1745 $source->setUseQuestionCount((array_key_exists(
'total_questions',
$_POST)) ? (
$_POST[
'total_questions'] < 1) : ($this->object->getRandomQuestionCount() < 1));
1746 $source->setValues($found_qpls);
1747 $form->addItem($source);
1751 $qpls = $this->
object->getUsedRandomQuestionpools();
1752 include_once
'./Modules/Test/classes/class.ilRandomTestROInputGUI.php';
1755 $form->addItem($source);
1758 if (
$total == 0) $form->addCommandButton(
"saveRandomQuestions", $this->lng->txt(
"save"));
1764 $form->setValuesByPost();
1765 $errors = !$form->checkInput();
1769 if (
$_POST[
'total_questions'] > 0)
1772 foreach (
$_POST[
'source'][
'qpl'] as $idx => $qpl)
1774 $totalcount += $available_qpl[$qpl][
'count'];
1776 if (
$_POST[
'total_questions'] > $totalcount)
1778 $total_questions->setAlert($this->lng->txt(
'msg_total_questions_too_high'));
1783 if (
$errors) $checkonly =
false;
1786 if (!$checkonly) $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
1793 if (
$_POST[
"chbQuestionSelectionMode"])
1795 $ilUser->setPref(
"tst_question_selection_mode_equal", 1);
1796 $ilUser->writePref(
"tst_question_selection_mode_equal", 1);
1800 $ilUser->setPref(
"tst_question_selection_mode_equal", 0);
1801 $ilUser->writePref(
"tst_question_selection_mode_equal", 0);
1820 $qpl_ref_id =
$_POST[
"sel_qpl"];
1821 if ((strcmp(
$_POST[
"txt_qpl"],
"") == 0) && (strcmp($qpl_ref_id,
"") == 0))
1829 $_SESSION[
"test_id"] = $this->
object->getRefId();
1830 if (strcmp(
$_POST[
"txt_qpl"],
"") != 0)
1835 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPoolGUI.php";
1836 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"]);
1850 $this->ctrl->redirect($this,
"questions");
1864 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_qpl_select.html",
"Modules/Test");
1865 $questionpools =& $this->
object->getAvailableQuestionpools(FALSE, FALSE, FALSE, TRUE, FALSE,
"write");
1866 if (count($questionpools) == 0)
1868 $this->tpl->setCurrentBlock(
"option");
1869 $this->tpl->setVariable(
"VALUE_QPL",
"");
1870 $this->tpl->parseCurrentBlock();
1874 foreach ($questionpools as
$key => $value)
1876 $this->tpl->setCurrentBlock(
"option");
1877 $this->tpl->setVariable(
"VALUE_OPTION",
$key);
1878 $this->tpl->setVariable(
"TEXT_OPTION", $value[
"title"]);
1879 $this->tpl->parseCurrentBlock();
1882 $this->tpl->setCurrentBlock(
"hidden");
1883 $this->tpl->setVariable(
"HIDDEN_NAME",
"sel_question_types");
1884 $this->tpl->setVariable(
"HIDDEN_VALUE",
$_POST[
"sel_question_types"]);
1885 $this->tpl->parseCurrentBlock();
1886 $this->tpl->setCurrentBlock(
"adm_content");
1887 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
1889 if (count($questionpools) == 0)
1891 $this->tpl->setVariable(
"TXT_QPL_SELECT", $this->lng->txt(
"tst_enter_questionpool"));
1895 $this->tpl->setVariable(
"TXT_QPL_SELECT", $this->lng->txt(
"tst_select_questionpool"));
1897 $this->tpl->setVariable(
"BTN_SUBMIT", $this->lng->txt(
"submit"));
1898 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
1899 $this->tpl->parseCurrentBlock();
1912 $checked_questions = array();
1914 if (preg_match(
"/id_(\d+)/",
$key, $matches)) {
1915 array_push($checked_questions, $matches[1]);
1918 foreach ($checked_questions as
$key => $value) {
1919 $this->
object->removeQuestion($value);
1921 $this->
object->saveCompleteStatus();
1922 $this->ctrl->redirect($this,
"questions");
1934 $this->ctrl->redirect($this,
"questions");
1947 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_remove_questions.html",
"Modules/Test");
1948 $removablequestions =& $this->
object->getTestQuestions();
1949 $colors = array(
"tblrow1",
"tblrow2");
1951 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1952 if (count($removablequestions))
1954 foreach ($removablequestions as
$data)
1956 if (in_array($data[
"question_id"], $checked_questions))
1958 $this->tpl->setCurrentBlock(
"row");
1959 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
1960 $this->tpl->setVariable(
"TXT_TITLE", $data[
"title"]);
1961 $this->tpl->setVariable(
"TXT_DESCRIPTION", $data[
"description"]);
1963 $this->tpl->parseCurrentBlock();
1968 foreach ($checked_questions as $id)
1970 $this->tpl->setCurrentBlock(
"hidden");
1971 $this->tpl->setVariable(
"HIDDEN_NAME",
"id_$id");
1972 $this->tpl->setVariable(
"HIDDEN_VALUE",
"1");
1973 $this->tpl->parseCurrentBlock();
1976 $this->tpl->setCurrentBlock(
"adm_content");
1977 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"tst_question_title"));
1978 $this->tpl->setVariable(
"TXT_DESCRIPTION", $this->lng->txt(
"description"));
1979 $this->tpl->setVariable(
"TXT_TYPE", $this->lng->txt(
"tst_question_type"));
1980 $this->tpl->setVariable(
"BTN_CONFIRM", $this->lng->txt(
"confirm"));
1981 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
1982 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
1983 $this->tpl->parseCurrentBlock();
1996 $checked_questions =
$_POST[
"q_id"];
1997 if (count($checked_questions) > 0)
1999 $total = $this->
object->evalTotalPersons();
2012 elseif (count($checked_questions) == 0)
2014 ilUtil::sendInfo($this->lng->txt(
"tst_no_question_selected_for_removal"),
true);
2015 $this->ctrl->redirect($this,
"questions");
2024 $_SESSION[
'tst_qst_move_' . $this->
object->getTestId()] =
$_POST[
'q_id'];
2026 $this->ctrl->redirect($this,
'questions');
2035 $move_questions =
$_SESSION[
'tst_qst_move_' . $this->
object->getTestId()];
2037 if (count(
$_POST[
'q_id']) == 0)
2040 $this->ctrl->redirect($this,
'questions');
2042 if (count(
$_POST[
'q_id']) > 1)
2045 $this->ctrl->redirect($this,
'questions');
2048 $this->
object->moveQuestions(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()],
$_POST[
'q_id'][0], $insert_mode);
2050 unset(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()]);
2051 $this->ctrl->redirect($this,
"questions");
2060 $move_questions =
$_SESSION[
'tst_qst_move_' . $this->
object->getTestId()];
2061 if (count(
$_POST[
'q_id']) == 0)
2064 $this->ctrl->redirect($this,
'questions');
2066 if (count(
$_POST[
'q_id']) > 1)
2069 $this->ctrl->redirect($this,
'questions');
2072 $this->
object->moveQuestions(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()],
$_POST[
'q_id'][0], $insert_mode);
2074 unset(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()]);
2075 $this->ctrl->redirect($this,
"questions");
2085 $selected_array = (is_array(
$_POST[
'q_id'])) ?
$_POST[
'q_id'] : array();
2086 if (!count($selected_array))
2089 $this->ctrl->redirect($this,
"browseForQuestions");
2093 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
2094 $manscoring = FALSE;
2095 foreach ($selected_array as
$key => $value)
2097 $this->
object->insertQuestion($value);
2103 $this->
object->saveCompleteStatus();
2112 $this->ctrl->redirect($this,
"questions");
2119 include_once
"./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
2121 $table_gui->writeFilterToSession();
2122 $this->ctrl->redirect($this,
"browseForQuestions");
2127 include_once
"./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
2129 $table_gui->resetFilter();
2130 $this->ctrl->redirect($this,
"browseForQuestions");
2142 $this->ctrl->setParameterByClass(get_class($this),
"browse",
"1");
2144 include_once
"./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
2145 $table_gui =
new ilTestQuestionBrowserTableGUI($this,
'browseForQuestions', (($ilAccess->checkAccess(
"write",
"", $this->ref_id) ?
true :
false)));
2146 $arrFilter = array();
2147 foreach ($table_gui->getFilterItems() as $item)
2149 if ($item->getValue() !==
false)
2151 $arrFilter[$item->getPostVar()] = $item->getValue();
2154 $data = $this->
object->getAvailableQuestions($arrFilter, 1);
2155 $table_gui->setData(
$data);
2156 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
2162 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
2166 $this->ctrl->redirect($this,
"infoScreen");
2168 if (
$_GET[
'browse'])
2170 return $this->questionbrowser();
2174 if ($this->object->isRandomTest())
2182 ilUtil::redirect(
"ilias.php?baseClass=ilObjQuestionPoolGUI&ref_id=" .
$_GET[
"eqpl"] .
"&cmd=editQuestionForTest&calling_test=".
$_GET[
"ref_id"].
"&q_id=" .
$_GET[
"eqid"]);
2185 if (
$_GET[
"up"] > 0)
2187 $this->
object->questionMoveUp(
$_GET[
"up"]);
2189 if (
$_GET[
"down"] > 0)
2191 $this->
object->questionMoveDown(
$_GET[
"down"]);
2196 $selected_array = array();
2197 array_push($selected_array,
$_GET[
"add"]);
2198 $total = $this->
object->evalTotalPersons();
2208 $this->insertQuestions($selected_array);
2212 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_questions.html",
"Modules/Test");
2214 $total = $this->
object->evalTotalPersons();
2215 if (($ilAccess->checkAccess(
"write",
"", $this->ref_id) and (
$total == 0)))
2218 $lastquestiontype = $ilUser->getPref(
"tst_lastquestiontype");
2219 $this->tpl->setCurrentBlock(
"QTypes");
2220 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
2222 foreach ($question_types as $trans =>
$data)
2224 if (
$data[
"type_tag"] == $lastquestiontype)
2226 $this->tpl->setVariable(
"QUESTION_TYPE_SELECTED",
" selected=\"selected\"");
2228 $this->tpl->setVariable(
"QUESTION_TYPE_ID",
$data[
"type_tag"]);
2229 $this->tpl->setVariable(
"QUESTION_TYPE", $trans);
2230 $this->tpl->parseCurrentBlock();
2232 $this->tpl->parseCurrentBlock();
2235 if (($ilAccess->checkAccess(
"write",
"", $this->ref_id) and (
$total == 0)))
2237 $this->tpl->setVariable(
"BUTTON_INSERT_QUESTION", $this->lng->txt(
"tst_browse_for_questions"));
2238 $this->tpl->setVariable(
"TEXT_CREATE_NEW",
" " . strtolower($this->lng->txt(
"or")) .
" " . $this->lng->txt(
"create_new"));
2239 $this->tpl->setVariable(
"BUTTON_CREATE_QUESTION", $this->lng->txt(
"create"));
2240 $this->tpl->setVariable(
"TXT_OR", $this->lng->txt(
"or"));
2241 $this->tpl->setVariable(
"TEXT_RANDOM_SELECT", $this->lng->txt(
"random_selection"));
2244 $this->tpl->setCurrentBlock(
"adm_content");
2245 include_once
"./Modules/Test/classes/tables/class.ilTestQuestionsTableGUI.php";
2246 $checked_move = is_array(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()]) && (count(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()]));
2247 $table_gui =
new ilTestQuestionsTableGUI($this,
'questions', (($ilAccess->checkAccess(
"write",
"", $this->ref_id) ?
true :
false)), $checked_move,
$total);
2248 $data = $this->
object->getTestQuestions();
2249 $table_gui->setData($data);
2250 $this->tpl->setVariable(
'QUESTIONBROWSER', $table_gui->getHTML());
2251 $this->tpl->setVariable(
"ACTION_QUESTION_FORM", $this->ctrl->getFormAction($this));
2252 $this->tpl->parseCurrentBlock();
2268 $this->
object->mark_schema->addMarkStep();
2281 $this->
object->mark_schema->flush();
2283 if (preg_match(
"/mark_short_(\d+)/",
$key, $matches))
2288 $this->
object->ects_grades[
"A"] =
$_POST[
"ects_grade_a"];
2289 $this->
object->ects_grades[
"B"] =
$_POST[
"ects_grade_b"];
2290 $this->
object->ects_grades[
"C"] =
$_POST[
"ects_grade_c"];
2291 $this->
object->ects_grades[
"D"] =
$_POST[
"ects_grade_d"];
2292 $this->
object->ects_grades[
"E"] =
$_POST[
"ects_grade_e"];
2295 $this->
object->ects_fx =
$_POST[
"percentFX"];
2299 $this->
object->ects_fx =
"";
2301 $this->
object->ects_output =
$_POST[
"chbECTS"];
2313 $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);
2327 $delete_mark_steps = array();
2329 if (preg_match(
"/cb_(\d+)/",
$key, $matches)) {
2330 array_push($delete_mark_steps, $matches[1]);
2333 if (count($delete_mark_steps)) {
2334 $this->
object->mark_schema->deleteMarkSteps($delete_mark_steps);
2350 $this->ctrl->redirect($this,
"marks");
2364 $mark_check = $this->
object->checkMarks();
2365 if ($mark_check !==
true)
2369 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)))
2395 $this->
object->mark_schema->saveToDb($this->object->getTestId());
2396 $this->
object->saveCompleteStatus();
2397 if ($this->object->getReportingDate())
2414 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
2418 $this->ctrl->redirect($this,
"infoScreen");
2421 if (!$this->object->canEditMarks())
2426 $this->
object->mark_schema->sort();
2428 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_marks.html",
"Modules/Test");
2429 $marks = $this->
object->mark_schema->mark_steps;
2430 $rows = array(
"tblrow1",
"tblrow2");
2432 foreach ($marks as
$key => $value) {
2433 $this->tpl->setCurrentBlock(
"markrow");
2434 $this->tpl->setVariable(
"MARK_SHORT", $value->getShortName());
2435 $this->tpl->setVariable(
"MARK_OFFICIAL", $value->getOfficialName());
2436 $this->tpl->setVariable(
"MARK_PERCENTAGE", sprintf(
"%.2f", $value->getMinimumLevel()));
2437 $this->tpl->setVariable(
"MARK_PASSED", strtolower($this->lng->txt(
"tst_mark_passed")));
2438 $this->tpl->setVariable(
"MARK_ID",
"$key");
2439 $this->tpl->setVariable(
"ROW_CLASS", $rows[$counter % 2]);
2440 if ($value->getPassed()) {
2441 $this->tpl->setVariable(
"MARK_PASSED_CHECKED",
" checked=\"checked\"");
2443 $this->tpl->parseCurrentBlock();
2446 if (count($marks) == 0)
2448 $this->tpl->setCurrentBlock(
"Emptyrow");
2449 $this->tpl->setVariable(
"EMPTY_ROW", $this->lng->txt(
"tst_no_marks_defined"));
2450 $this->tpl->setVariable(
"ROW_CLASS", $rows[$counter % 2]);
2451 $this->tpl->parseCurrentBlock();
2455 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) && $this->
object->canEditMarks())
2457 $this->tpl->setCurrentBlock(
"selectall");
2459 $this->tpl->setVariable(
"ROW_CLASS", $rows[$counter % 2]);
2460 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
2461 $this->tpl->parseCurrentBlock();
2462 $this->tpl->setCurrentBlock(
"Footer");
2463 $this->tpl->setVariable(
"ARROW",
"<img src=\"" .
ilUtil::getImagePath(
"arrow_downright.gif") .
"\" alt=\"".$this->lng->txt(
"arrow_downright").
"\"/>");
2464 $this->tpl->setVariable(
"BUTTON_EDIT", $this->lng->txt(
"edit"));
2465 $this->tpl->setVariable(
"BUTTON_DELETE", $this->lng->txt(
"delete"));
2466 $this->tpl->parseCurrentBlock();
2470 if ($this->object->getReportingDate())
2472 $this->tpl->setCurrentBlock(
"ects");
2473 if ($this->object->ects_output)
2475 $this->tpl->setVariable(
"CHECKED_ECTS",
" checked=\"checked\"");
2477 $this->tpl->setVariable(
"TEXT_OUTPUT_ECTS_GRADES", $this->lng->txt(
"ects_output_of_ects_grades"));
2478 $this->tpl->setVariable(
"TEXT_ALLOW_ECTS_GRADES", $this->lng->txt(
"ects_allow_ects_grades"));
2479 $this->tpl->setVariable(
"TEXT_USE_FX", $this->lng->txt(
"ects_use_fx_grade"));
2480 if (preg_match(
"/\d+/", $this->object->ects_fx))
2482 $this->tpl->setVariable(
"CHECKED_FX",
" checked=\"checked\"");
2483 $this->tpl->setVariable(
"VALUE_PERCENT_FX", sprintf(
"value=\"%s\" ", $this->object->ects_fx));
2485 $this->tpl->setVariable(
"TEXT_PERCENT", $this->lng->txt(
"ects_use_fx_grade_part2"));
2486 $this->tpl->setVariable(
"ECTS_GRADE", $this->lng->txt(
"ects_grade"));
2487 $this->tpl->setVariable(
"PERCENTILE", $this->lng->txt(
"percentile"));
2488 $this->tpl->setVariable(
"ECTS_GRADE_A",
"A - " . $this->lng->txt(
"ects_grade_a_short"));
2489 $this->tpl->setVariable(
"VALUE_GRADE_A", $this->object->ects_grades[
"A"]);
2490 $this->tpl->setVariable(
"ECTS_GRADE_B",
"B - " . $this->lng->txt(
"ects_grade_b_short"));
2491 $this->tpl->setVariable(
"VALUE_GRADE_B", $this->object->ects_grades[
"B"]);
2492 $this->tpl->setVariable(
"ECTS_GRADE_C",
"C - " . $this->lng->txt(
"ects_grade_c_short"));
2493 $this->tpl->setVariable(
"VALUE_GRADE_C", $this->object->ects_grades[
"C"]);
2494 $this->tpl->setVariable(
"ECTS_GRADE_D",
"D - " . $this->lng->txt(
"ects_grade_d_short"));
2495 $this->tpl->setVariable(
"VALUE_GRADE_D", $this->object->ects_grades[
"D"]);
2496 $this->tpl->setVariable(
"ECTS_GRADE_E",
"E - " . $this->lng->txt(
"ects_grade_e_short"));
2497 $this->tpl->setVariable(
"VALUE_GRADE_E", $this->object->ects_grades[
"E"]);
2499 $this->tpl->parseCurrentBlock();
2502 $this->tpl->setCurrentBlock(
"adm_content");
2503 $this->tpl->setVariable(
"ACTION_MARKS", $this->ctrl->getFormAction($this));
2504 $this->tpl->setVariable(
"HEADER_SHORT", $this->lng->txt(
"tst_mark_short_form"));
2505 $this->tpl->setVariable(
"HEADER_OFFICIAL", $this->lng->txt(
"tst_mark_official_form"));
2506 $this->tpl->setVariable(
"HEADER_PERCENTAGE", $this->lng->txt(
"tst_mark_minimum_level"));
2507 $this->tpl->setVariable(
"HEADER_PASSED", $this->lng->txt(
"tst_mark_passed"));
2508 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) && $this->
object->canEditMarks())
2510 $this->tpl->setVariable(
"BUTTON_NEW", $this->lng->txt(
"tst_mark_create_new_mark_step"));
2511 $this->tpl->setVariable(
"BUTTON_NEW_SIMPLE", $this->lng->txt(
"tst_mark_create_simple_mark_schema"));
2512 $this->tpl->setVariable(
"SAVE", $this->lng->txt(
"save"));
2513 $this->tpl->setVariable(
"CANCEL", $this->lng->txt(
"cancel"));
2515 $this->tpl->parseCurrentBlock();
2527 $this->
object->removeAllTestEditings();
2529 $this->ctrl->redirect($this,
"participants");
2541 $active_ids = array();
2542 foreach (
$_POST[
"chbUser"] as $active_id)
2544 if ($this->object->getFixedParticipants())
2546 array_push($active_ids, $this->object->getActiveIdOfUser($active_id));
2550 array_push($active_ids, $active_id);
2553 $this->
object->removeSelectedTestResults($active_ids);
2555 $this->ctrl->redirect($this,
"participants");
2567 $this->ctrl->redirect($this,
"participants");
2580 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_maintenance.html",
"Modules/Test");
2582 $this->tpl->setCurrentBlock(
"confirm_delete");
2583 $this->tpl->setVariable(
"BTN_CONFIRM_DELETE_ALL", $this->lng->txt(
"confirm"));
2584 $this->tpl->setVariable(
"BTN_CANCEL_DELETE_ALL", $this->lng->txt(
"cancel"));
2585 $this->tpl->parseCurrentBlock();
2587 $this->tpl->setCurrentBlock(
"adm_content");
2588 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
2589 $this->tpl->parseCurrentBlock();
2598 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html",
"Modules/Test");
2599 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"participants"));
2602 $buttons = array(
"confirmDeleteAllUserResults" => $this->lng->txt(
"proceed"),
2603 "participants" => $this->lng->txt(
"cancel"));
2604 foreach ($buttons as
$name => $value)
2606 $this->tpl->setCurrentBlock(
"operation_btn");
2607 $this->tpl->setVariable(
"BTN_NAME",
$name);
2608 $this->tpl->setVariable(
"BTN_VALUE",$value);
2609 $this->tpl->parseCurrentBlock();
2622 if (count(
$_POST[
"chbUser"]) == 0)
2625 $this->ctrl->redirect($this,
"participants");
2628 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_maintenance.html",
"Modules/Test");
2630 foreach (
$_POST[
"chbUser"] as
$key => $value)
2632 $this->tpl->setCurrentBlock(
"hidden");
2633 $this->tpl->setVariable(
"USER_ID", $value);
2634 $this->tpl->parseCurrentBlock();
2637 include_once
'./Services/User/classes/class.ilObjUser.php';
2638 $color_class = array(
"tblrow1",
"tblrow2");
2640 foreach (
$_POST[
"chbUser"] as
$key => $active_id)
2642 if ($this->object->getFixedParticipants())
2644 $user_id = $active_id;
2648 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
2651 $this->tpl->setCurrentBlock(
"row");
2653 $this->tpl->setVariable(
"USER_ALT", $this->lng->txt(
"usr"));
2654 $this->tpl->setVariable(
"USER_TITLE", $this->lng->txt(
"usr"));
2655 if ($this->object->getAnonymity())
2657 $this->tpl->setVariable(
"TXT_FIRSTNAME",
"");
2658 $this->tpl->setVariable(
"TXT_LASTNAME", $this->lng->txt(
"unknown"));
2659 $this->tpl->setVariable(
"TXT_LOGIN",
"");
2663 $this->tpl->setVariable(
"TXT_FIRSTNAME",
$user[
"firstname"]);
2664 if (strlen(
$user[
"lastname"]))
2666 $this->tpl->setVariable(
"TXT_LASTNAME",
$user[
"lastname"]);
2670 $this->tpl->setVariable(
"TXT_LASTNAME", $this->lng->txt(
"deleted_user"));
2674 $this->tpl->setVariable(
"ROW_CLASS", $color_class[$counter % 2]);
2675 $this->tpl->parseCurrentBlock();
2678 $this->tpl->setCurrentBlock(
"selectedusers");
2679 $this->tpl->setVariable(
"HEADER_TXT_FIRSTNAME", $this->lng->txt(
"firstname"));
2680 $this->tpl->setVariable(
"HEADER_TXT_LASTNAME", $this->lng->txt(
"lastname"));
2681 $this->tpl->setVariable(
"HEADER_TXT_LOGIN", $this->lng->txt(
"login"));
2682 $this->tpl->setVariable(
"BTN_CONFIRM_DELETE_SELECTED", $this->lng->txt(
"confirm"));
2683 $this->tpl->setVariable(
"BTN_CANCEL_DELETE_SELECTED", $this->lng->txt(
"cancel"));
2684 $this->tpl->parseCurrentBlock();
2686 $this->tpl->setCurrentBlock(
"adm_content");
2687 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
2688 $this->tpl->parseCurrentBlock();
2700 include_once
"./Modules/Test/classes/tables/class.ilTestHistoryTableGUI.php";
2702 $table_gui->setTestObject($this->
object);
2703 include_once
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
2705 $table_gui->setData(
$log);
2706 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
2716 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"], $new_type))
2718 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
2724 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
2726 $questionpools =& $tst->getAvailableQuestionpools(TRUE, FALSE, TRUE, TRUE);
2727 if (count($questionpools) == 0)
2732 foreach ($questionpools as
$key => $value)
2734 $this->tpl->setCurrentBlock(
"option_qpl");
2735 $this->tpl->setVariable(
"OPTION_VALUE",
$key);
2736 $this->tpl->setVariable(
"TXT_OPTION", $value[
"title"]);
2739 $this->tpl->setVariable(
"OPTION_SELECTED",
" selected=\"selected\"");
2741 $this->tpl->parseCurrentBlock();
2745 $defaults =& $tst->getAvailableDefaults();
2746 if (count($defaults))
2748 foreach ($defaults as
$row)
2750 $this->tpl->setCurrentBlock(
"defaults_row");
2751 $this->tpl->setVariable(
"DEFAULTS_VALUE", $row[
"test_defaults_id"]);
2753 $this->tpl->parseCurrentBlock();
2755 $this->tpl->setCurrentBlock(
"defaults");
2756 $this->tpl->setVariable(
"TXT_DEFAULTS", $this->lng->txt(
"defaults"));
2757 $this->tpl->setVariable(
"TEXT_NO_DEFAULTS", $this->lng->txt(
"tst_defaults_dont_use"));
2758 $this->tpl->parseCurrentBlock();
2763 $this->tpl->setCurrentBlock(
"adm_content");
2767 $data[
"fields"] = array();
2769 $data[
"fields"][
"desc"] =
$_SESSION[
"error_post_vars"][
"Fobject"][
"desc"];
2770 foreach (
$data[
"fields"] as
$key => $val)
2772 $this->tpl->setVariable(
"TXT_".strtoupper(
$key), $this->lng->txt(
$key));
2773 $this->tpl->setVariable(strtoupper(
$key), $val);
2775 if ($this->prepare_output)
2777 $this->tpl->parseCurrentBlock();
2780 $this->ctrl->setParameter($this,
"new_type", $new_type);
2781 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
'save'));
2782 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt($new_type.
"_new"));
2783 $this->tpl->setVariable(
"TXT_SELECT_QUESTIONPOOL", $this->lng->txt(
"select_questionpool"));
2784 $this->tpl->setVariable(
"OPTION_SELECT_QUESTIONPOOL", $this->lng->txt(
"dont_use_questionpool"));
2785 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
2786 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt($new_type.
"_add"));
2787 $this->tpl->setVariable(
"CMD_SUBMIT",
"save");
2789 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
2791 $this->tpl->setVariable(
"TXT_IMPORT_TST", $this->lng->txt(
"import_tst"));
2792 $this->tpl->setVariable(
"TXT_TST_FILE", $this->lng->txt(
"tst_upload_file"));
2793 $this->tpl->setVariable(
"TXT_IMPORT", $this->lng->txt(
"import"));
2796 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
"obj_tst"));
2798 $this->tpl->setVariable(
"ALT_IMG2",$this->lng->txt(
"obj_tst"));
2799 $this->tpl->setVariable(
"NEW_TYPE", $new_type);
2800 $this->tpl->parseCurrentBlock();
2810 $this->ctrl->redirect($this,
"inviteParticipants");
2818 $fixed_participants = 0;
2819 $invited_users = $this->
object->getInvitedUsers();
2820 foreach ($invited_users as $user_object)
2822 $this->
object->disinviteUser($user_object[
"usr_id"]);
2824 $this->
object->setFixedParticipants($fixed_participants);
2825 $this->
object->saveToDb();
2826 $this->ctrl->redirect($this,
"inviteParticipants");
2835 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html",
"Modules/Test");
2836 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
'confirmFixedParticipantsStatusChange'));
2839 $buttons = array(
"confirmFixedParticipantsStatusChange" => $this->lng->txt(
"proceed"),
2840 "cancelFixedParticipantsStatusChange" => $this->lng->txt(
"cancel"));
2841 foreach ($buttons as
$name => $value)
2843 $this->tpl->setCurrentBlock(
"operation_btn");
2844 $this->tpl->setVariable(
"BTN_NAME",
$name);
2845 $this->tpl->setVariable(
"BTN_VALUE",$value);
2846 $this->tpl->parseCurrentBlock();
2855 $fixed_participants = 0;
2856 if (array_key_exists(
"chb_fixed_participants",
$_POST))
2858 if (
$_POST[
"chb_fixed_participants"])
2860 $fixed_participants = 1;
2863 $invited_users = $this->
object->getInvitedUsers();
2864 if ($this->object->getFixedParticipants() && !$fixed_participants && count($invited_users))
2870 $this->
object->setFixedParticipants($fixed_participants);
2871 $this->
object->saveToDb();
2872 $this->ctrl->redirect($this,
"inviteParticipants");
2882 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
2886 $this->ctrl->redirect($this,
"infoScreen");
2889 $total = $this->
object->evalTotalPersons();
2890 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_fixed_users.html",
"Modules/Test");
2891 $search_for = array();
2892 $search_term = strlen(
$_POST[
"search_term"]) ?
$_POST[
"search_term"] :
$_GET[
"search_term"];
2893 $concatenation = strlen(
$_POST[
"concatenation"]) ?
$_POST[
"concatenation"] :
$_GET[
"concatenation"];
2894 if (is_array(
$_POST[
'search_for']))
2896 $search_for =
$_POST[
'search_for'];
2900 if (
$_GET[
'search_for_usr']) array_push($search_for,
'usr');
2901 if (
$_GET[
'search_for_grp']) array_push($search_for,
'grp');
2902 if (
$_GET[
'search_for_role']) array_push($search_for,
'role');
2904 $this->ctrl->setParameter($this,
'concatenation', $concatenation);
2905 $this->ctrl->setParameter($this,
'search_term', $search_term);
2906 foreach ($search_for as
$type)
2908 $this->ctrl->setParameter($this,
'search_for_' . $type, $type);
2911 if (
$_POST[
"cmd"][
"cancel"])
2916 if (count($search_for))
2918 $this->tpl->setCurrentBlock(
"search_results_title");
2919 $this->tpl->setVariable(
"TEXT_SEARCH_RESULTS", $this->lng->txt(
"search_results"));
2920 $this->tpl->parseCurrentBlock();
2921 if (in_array(
"usr", $search_for) or in_array(
"grp", $search_for) or in_array(
"role", $search_for))
2923 include_once
'./classes/class.ilSearch.php';
2924 $search =&
new ilSearch($ilUser->id);
2925 $search->setSearchString($search_term);
2926 $search->setCombination($concatenation);
2927 $search->setSearchFor($search_for);
2928 $search->setSearchType(
"new");
2929 if($search->validate($message))
2931 $search->performSearch();
2938 if(!$search->getNumberOfResults() && $search->getSearchFor())
2942 $buttons = array(
"add");
2944 $invited_users =& $this->
object->getInvitedUsers();
2946 if ($searchresult = $search->getResultByType(
"usr"))
2949 foreach ($searchresult as $result_array)
2951 if (!array_key_exists($result_array[
"id"], $invited_users))
2953 array_push($users, $result_array[
"id"]);
2957 $users = $this->
object->getUserData($users);
2961 include_once
"./Modules/Test/classes/tables/class.ilTestInviteUsersTableGUI.php";
2963 $table_gui->setData($users);
2964 $this->tpl->setVariable(
'TBL_USER_RESULT', $table_gui->getHTML());
2968 $searchresult = array();
2970 if ($searchresult = $search->getResultByType(
"grp"))
2974 foreach ($searchresult as $result_array)
2976 array_push($groups, $result_array[
"id"]);
2978 $groups = $this->
object->getGroupData ($groups);
2980 if (count ($groups))
2982 include_once
"./Modules/Test/classes/tables/class.ilTestInviteGroupsTableGUI.php";
2984 $table_gui->setData($groups);
2985 $this->tpl->setVariable(
'TBL_GROUP_RESULT', $table_gui->getHTML());
2989 $searchresult = array();
2991 if ($searchresult = $search->getResultByType(
"role"))
2995 foreach ($searchresult as $result_array)
2997 array_push($roles, $result_array[
"id"]);
3000 $roles = $this->
object->getRoleData($roles);
3004 include_once
"./Modules/Test/classes/tables/class.ilTestInviteRolesTableGUI.php";
3006 $table_gui->setData($roles);
3007 $this->tpl->setVariable(
'TBL_ROLE_RESULT', $table_gui->getHTML());
3019 if (
$_POST[
"cmd"][
"save"])
3021 $this->
object->saveToDb();
3023 $invited_users = $this->
object->getInvitedUsers();
3025 $buttons = array(
"save",
"remove");
3027 if ($this->object->getFixedParticipants())
3029 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
3031 $this->tpl->setCurrentBlock(
"invitation");
3032 $this->tpl->setVariable(
"FORM_ACTION_INVITATION", $this->ctrl->getFormAction($this));
3033 $this->tpl->setVariable(
"SEARCH_INVITATION", $this->lng->txt(
"search"));
3034 $this->tpl->setVariable(
"SEARCH_TERM", $this->lng->txt(
"search_term"));
3035 $this->tpl->setVariable(
"SEARCH_FOR", $this->lng->txt(
"search_for"));
3036 $this->tpl->setVariable(
"SEARCH_USERS", $this->lng->txt(
"search_users"));
3037 $this->tpl->setVariable(
"SEARCH_GROUPS", $this->lng->txt(
"search_groups"));
3038 $this->tpl->setVariable(
"SEARCH_ROLES", $this->lng->txt(
"search_roles"));
3039 $this->tpl->setVariable(
"TEXT_CONCATENATION", $this->lng->txt(
"concatenation"));
3040 $this->tpl->setVariable(
"TEXT_AND", $this->lng->txt(
"and"));
3041 $this->tpl->setVariable(
"TEXT_OR", $this->lng->txt(
"or"));
3042 $this->tpl->setVariable(
"VALUE_SEARCH_TERM", $search_term);
3043 if (is_array($search_for))
3045 if (in_array(
"usr", $search_for))
3047 $this->tpl->setVariable(
"CHECKED_USERS",
" checked=\"checked\"");
3049 if (in_array(
"grp", $search_for))
3051 $this->tpl->setVariable(
"CHECKED_GROUPS",
" checked=\"checked\"");
3053 if (in_array(
"role", $search_for))
3055 $this->tpl->setVariable(
"CHECKED_ROLES",
" checked=\"checked\"");
3060 $this->tpl->setVariable(
"CHECKED_USERS",
" checked=\"checked\"");
3062 if (strcmp($concatenation,
"and") == 0)
3064 $this->tpl->setVariable(
"CHECKED_AND",
" checked=\"checked\"");
3068 $this->tpl->setVariable(
"CHECKED_OR",
" checked=\"checked\"");
3070 $this->tpl->setVariable(
"SEARCH", $this->lng->txt(
"search"));
3071 $this->tpl->setVariable(
"SEARCH_INTRODUCTION", $this->lng->txt(
"participants_invitation_search_introduction"));
3072 $this->tpl->setVariable(
"TEXT_INVITATION", $this->lng->txt(
"invitation"));
3073 $this->tpl->setVariable(
"VALUE_ON", $this->lng->txt(
"on"));
3074 $this->tpl->setVariable(
"VALUE_OFF", $this->lng->txt(
"off"));
3075 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
3076 $this->tpl->parseCurrentBlock();
3080 $this->tpl->setCurrentBlock(
"adm_content");
3081 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
3082 $this->tpl->setVariable(
"TEXT_ALLOW_FIXED_PARTICIPANTS", $this->lng->txt(
"tst_allow_fixed_participants"));
3083 $this->tpl->setVariable(
"BUTTON_SAVE", $this->lng->txt(
"save"));
3084 $this->tpl->setVariable(
"TEXT_FIXED_PARTICIPANTS", $this->lng->txt(
"participants_invitation"));
3085 $this->tpl->setVariable(
"TEXT_FIXED_PARTICIPANTS_DESCRIPTION", $this->lng->txt(
"participants_invitation_description"));
3086 if ($this->object->getFixedParticipants())
3088 $this->tpl->setVariable(
"CHECKED_FIXED_PARTICIPANTS",
" checked=\"checked\"");
3090 if (
$total && (count($invited_users) == 0))
3093 $this->tpl->setVariable(
"DISABLED_FIXED_PARTICIPANTS",
" disabled=\"disabled\"");
3096 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
3098 $this->tpl->setVariable(
"SAVE", $this->lng->txt(
"save"));
3099 $this->tpl->setVariable(
"CANCEL", $this->lng->txt(
"cancel"));
3101 $this->tpl->parseCurrentBlock();
3115 if (method_exists($this,
$method))
3121 $this->ctrl->redirect($this,
"participants");
3132 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
3136 $this->ctrl->redirect($this,
"infoScreen");
3139 if ($this->object->getFixedParticipants())
3141 $participants =& $this->
object->getInvitedUsers();
3143 foreach ($participants as
$data)
3145 $maxpass = $this->
object->_getMaxPass($data[
"active_id"]);
3146 if (!is_null($maxpass))
3151 if (strlen($data[
"active_id"]))
3153 $last_access = $this->
object->_getLastAccess($data[
"active_id"]);
3156 $this->ctrl->setParameterByClass(
'iltestevaluationgui',
'active_id', $data[
'active_id']);
3157 array_push($rows, array(
3158 'usr_id' => $data[
"usr_id"],
3159 'active_id' => $data[
'active_id'],
3160 'login' => $data[
"login"],
3161 'clientip' => $data[
"clientip"],
3162 'firstname' => $data[
"firstname"],
3163 'lastname' => $data[
"lastname"],
3164 'started' => ($data[
"active_id"] > 0) ? 1 : 0,
3165 'finished' => ($data[
"test_finished"] == 1) ? 1 : 0,
3166 'access' => $access,
3167 'maxpass' => $maxpass,
3168 'result' => $this->ctrl->getLinkTargetByClass(
'iltestevaluationgui',
'outParticipantsResultsOverview')
3171 include_once
"./Modules/Test/classes/tables/class.ilTestFixedParticipantsTableGUI.php";
3174 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
3178 $participants =& $this->
object->getTestParticipants();
3180 foreach ($participants as
$data)
3182 $maxpass = $this->
object->_getMaxPass($data[
"active_id"]);
3183 if (!is_null($maxpass))
3188 if (strlen($data[
"active_id"]))
3190 $last_access = $this->
object->_getLastAccess($data[
"active_id"]);
3193 $this->ctrl->setParameterByClass(
'iltestevaluationgui',
'active_id', $data[
'active_id']);
3194 array_push($rows, array(
3195 'usr_id' => $data[
"active_id"],
3196 'active_id' => $data[
'active_id'],
3197 'login' => $data[
"login"],
3198 'firstname' => $data[
"firstname"],
3199 'lastname' => $data[
"lastname"],
3200 'started' => ($data[
"active_id"] > 0) ? 1 : 0,
3201 'finished' => ($data[
"test_finished"] == 1) ? 1 : 0,
3202 'access' => $access,
3203 'maxpass' => $maxpass,
3204 'result' => $this->ctrl->getLinkTargetByClass(
'iltestevaluationgui',
'outParticipantsResultsOverview')
3207 include_once
"./Modules/Test/classes/tables/class.ilTestParticipantsTableGUI.php";
3210 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
3225 $this->
showUserResults($show_pass_details = TRUE, $show_answers = TRUE, $show_reached_points = TRUE);
3239 $this->
showUserResults($show_pass_details = FALSE, $show_answers = TRUE);
3253 $this->
showUserResults($show_pass_details = TRUE, $show_answers = FALSE);
3263 $template =
new ilTemplate(
"tpl.il_as_tst_participants_result_output.html", TRUE, TRUE,
"Modules/Test");
3265 if (count(
$_SESSION[
"show_user_results"]) == 0)
3268 $this->ctrl->redirect($this,
"participants");
3271 include_once
"./Modules/Test/classes/class.ilTestServiceGUI.php";
3274 foreach (
$_SESSION[
"show_user_results"] as
$key => $active_id)
3278 if ($this->object->getFixedParticipants())
3280 $active_id = $this->
object->getActiveIdOfUser($active_id);
3284 $results = $serviceGUI->getResultsOfUserOutput($active_id, $this->object->_getResultPass($active_id), $show_pass_details, $show_answers, FALSE, $show_reached_points);
3286 if ($count < count(
$_SESSION[
"show_user_results"]))
3288 $template->touchBlock(
"break");
3290 $template->setCurrentBlock(
"user_result");
3291 $template->setVariable(
"USER_RESULT",
$results);
3292 $template->parseCurrentBlock();
3294 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"back"));
3295 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"participants"));
3296 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
3297 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
3299 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
3301 if ($this->object->getShowSolutionAnswersOnly())
3309 if (is_array(
$_POST[
"chbUser"]))
3311 foreach (
$_POST[
"chbUser"] as $user_id)
3313 $this->
object->disinviteUser($user_id);
3320 $this->ctrl->redirect($this,
"participants");
3325 if (is_array(
$_POST[
"chbUser"]))
3327 foreach (
$_POST[
"chbUser"] as $user_id)
3329 $this->
object->setClientIP($user_id,
$_POST[
"clientip_".$user_id]);
3336 $this->ctrl->redirect($this,
"participants");
3348 global $ilAccess,
$ilias;
3349 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
3353 $this->ctrl->redirect($this,
"infoScreen");
3356 $template =
new ilTemplate(
"tpl.il_as_tst_print_test_confirm.html", TRUE, TRUE,
"Modules/Test");
3358 include_once
'./Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
3361 $this->ctrl->setParameter($this,
"pdf",
"1");
3362 $template->setCurrentBlock(
"pdf_export");
3363 $template->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this,
"print"));
3364 $this->ctrl->setParameter($this,
"pdf",
"");
3365 $template->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
3366 $template->setVariable(
"PDF_IMG_ALT", $this->lng->txt(
"pdf_export"));
3368 $template->parseCurrentBlock();
3374 $print_date = mktime(date(
"H"), date(
"i"), date(
"s"), date(
"m") , date(
"d"), date(
"Y"));
3378 foreach ($this->object->questions as $question)
3380 $template->setCurrentBlock(
"question");
3381 $question_gui = $this->
object->createQuestionGUI(
"", $question);
3382 $template->setVariable(
"COUNTER_QUESTION", $counter.
".");
3384 if ($question_gui->object->getMaximumPoints() == 1)
3386 $template->setVariable(
"QUESTION_POINTS", $question_gui->object->getMaximumPoints() .
" " . $this->lng->txt(
"point"));
3390 $template->setVariable(
"QUESTION_POINTS", $question_gui->object->getMaximumPoints() .
" " . $this->lng->txt(
"points"));
3392 $result_output = $question_gui->getSolutionOutput(
"", NULL, FALSE, TRUE, FALSE, $this->object->getShowSolutionFeedback());
3393 if (strlen($result_output) == 0) $result_output = $question_gui->getPreview(FALSE);
3394 $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
3395 $template->parseCurrentBlock(
"question");
3397 $max_points += $question_gui->object->getMaximumPoints();
3400 $template->setCurrentBlock(
"navigation_buttons");
3401 $template->setVariable(
"BUTTON_PRINT", $this->lng->txt(
"print"));
3402 $template->parseCurrentBlock();
3411 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1))
3413 $this->
object->deliverPDFfromHTML($template->get(), $this->
object->getTitle());
3417 $this->tpl->setVariable(
"PRINT_CONTENT", $template->get());
3427 if (is_array(
$_POST[
"user_select"]))
3430 foreach (
$_POST[
"user_select"] as $user_id)
3432 $client_ip =
$_POST[
"client_ip"][$i];
3433 $this->
object->inviteUser($user_id, $client_ip);
3439 if (is_array(
$_POST[
"group_select"]))
3441 foreach (
$_POST[
"group_select"] as $group_id)
3443 $this->
object->inviteGroup($group_id);
3448 if (is_array(
$_POST[
"role_select"]))
3450 foreach (
$_POST[
"role_select"] as $role_id)
3452 $this->
object->inviteRole($role_id);
3459 $message = $this->lng->txt(
"tst_invited_selected_users");
3463 if (strlen($message)) $message .=
"<br />";
3464 $message = $this->lng->txt(
"tst_invited_selected_groups");
3468 if (strlen($message)) $message .=
"<br />";
3469 $message = $this->lng->txt(
"tst_invited_selected_roles");
3471 if (strlen($message))
3480 $this->ctrl->redirect($this,
"inviteParticipants");
3500 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
3504 $this->ctrl->redirect($this,
"infoScreen");
3507 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_defaults.html",
"Modules/Test");
3509 $maxentries = $ilUser->getPref(
"hits_per_page");
3510 if ($maxentries < 1)
3515 $offset =
$_GET[
"offset"] ?
$_GET[
"offset"] : 0;
3516 $sortby =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"name";
3517 $sortorder =
$_GET[
"sort_order"] ?
$_GET[
"sort_order"] :
"asc";
3519 $defaults =& $this->
object->getAvailableDefaults($sortby, $sortorder);
3520 if (count($defaults) > 0)
3522 $tablerows = array();
3523 foreach ($defaults as
$row)
3525 array_push($tablerows, array(
"checkbox" =>
"<input type=\"checkbox\" name=\"chb_defaults[]\" value=\"" . $row[
"test_defaults_id"] .
"\"/>",
"name" => $row[
"name"]));
3527 $headervars = array(
"",
"name");
3529 include_once
"./Services/Table/classes/class.ilTableGUI.php";
3531 $tbl->setTitle($this->lng->txt(
"tst_defaults_available"));
3532 $header_names = array(
3534 $this->lng->txt(
"title")
3536 $tbl->setHeaderNames($header_names);
3538 $tbl->disable(
"sort");
3539 $tbl->disable(
"auto_sort");
3540 $tbl->enable(
"title");
3541 $tbl->enable(
"action");
3542 $tbl->enable(
"select_all");
3543 $tbl->setLimit($maxentries);
3544 $tbl->setOffset($offset);
3545 $tbl->setData($tablerows);
3546 $tbl->setMaxCount(count($tablerows));
3547 $tbl->setOrderDirection($sortorder);
3548 $tbl->setSelectAllCheckbox(
"chb_defaults");
3549 $tbl->setFormName(
"formDefaults");
3550 $tbl->addActionButton(
"deleteDefaults", $this->lng->txt(
"delete"));
3551 $tbl->addActionButton(
"applyDefaults", $this->lng->txt(
"apply"));
3553 $header_params = $this->ctrl->getParameterArray($this,
"defaults");
3554 $tbl->setHeaderVars($headervars, $header_params);
3557 $tbl->setFooter(
"tblfooter", $this->lng->txt(
"previous"), $this->lng->txt(
"next"));
3559 $tableoutput = $tbl->render();
3560 $this->tpl->setVariable(
"TEST_DEFAULTS_TABLE", $tableoutput);
3564 $this->tpl->setVariable(
"TEST_DEFAULTS_TABLE", $this->lng->txt(
"tst_defaults_not_defined"));
3566 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"addDefaults"));
3567 $this->tpl->setVariable(
"BUTTON_ADD", $this->lng->txt(
"add"));
3568 $this->tpl->setVariable(
"TEXT_DEFAULTS_OF_TEST", $this->lng->txt(
"tst_defaults_defaults_of_test"));
3576 if (count(
$_POST[
"chb_defaults"]))
3578 foreach (
$_POST[
"chb_defaults"] as $test_default_id)
3580 $this->
object->deleteDefaults($test_default_id);
3591 if (count(
$_POST[
"chb_defaults"]) == 1)
3593 foreach (
$_POST[
"chb_defaults"] as $test_default_id)
3595 $result = $this->
object->applyDefaults($test_default_id);
3618 if (strlen(
$_POST[
"name"]) > 0)
3620 $this->
object->addDefaults(
$_POST[
'name']);
3636 $this->ctrl->setCmd(
"showSummary");
3637 $this->ctrl->setCmdClass(
"ilinfoscreengui");
3643 $this->ctrl->setCmd(
"showSummary");
3644 $this->ctrl->setCmdClass(
"ilinfoscreengui");
3657 if (
$_GET[
'crs_show_result'])
3659 $this->
object->hideCorrectAnsweredQuestions();
3663 if ($this->object->getTestSequence()->hasHiddenQuestions())
3665 $this->
object->getTestSequence()->clearHiddenQuestions();
3666 $this->
object->getTestSequence()->saveToDb();
3670 if (
$_GET[
'createRandomSolutions'])
3672 $this->
object->createRandomSolutions(
$_GET[
'createRandomSolutions']);
3675 if (!$ilAccess->checkAccess(
"visible",
"", $this->ref_id))
3677 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
3680 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
3683 $seq = $this->
object->getTestSession()->getLastSequence();
3685 include_once
"./Modules/Test/classes/class.ilTestOutputGUI.php";
3687 $this->ctrl->setParameter($output_gui,
"sequence", $seq);
3688 $info->setFormAction($this->ctrl->getFormAction($output_gui));
3689 if (strlen($session_lock))
3691 $info->addHiddenElement(
"lock", $session_lock);
3695 $info->addHiddenElement(
"lock", md5(
$_COOKIE[
'PHPSESSID'] . time()));
3697 $online_access =
false;
3698 if ($this->object->getFixedParticipants())
3700 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
3702 if ($online_access_result ===
true)
3704 $online_access =
true;
3711 if ($this->object->isComplete())
3713 if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess(
"read",
"", $this->ref_id))
3715 $executable = $this->
object->isExecutable($ilUser->getId(), $allowPassIncrease = TRUE);
3716 if ($executable[
"executable"])
3718 if ($this->object->getTestSession()->getActiveId() > 0)
3721 $resume_text = $this->lng->txt(
"tst_resume_test");
3722 if (($seq < 1) || ($seq == $this->object->getTestSequence()->getFirstSequence()))
3724 $resume_text = $this->
object->getStartTestLabel($this->object->getTestSession()->getActiveId());
3727 #if(!$_GET['crs_show_result'] or $this->object->getTestSequence()->getFirstSequence())
3729 $info->addFormButton(
"resume", $resume_text);
3735 $info->addFormButton(
"start", $this->object->getStartTestLabel($this->object->getTestSession()->getActiveId()));
3742 if ($this->object->getTestSession()->getActiveId() > 0)
3745 if ($this->object->canShowTestResults($ilUser->getId()))
3747 $info->addFormButton(
"outUserResultsOverview", $this->lng->txt(
"tst_show_results"));
3751 if ($this->object->getTestSession()->getActiveId() > 0)
3753 if ($this->object->canShowSolutionPrintview($ilUser->getId()))
3755 $info->addFormButton(
"outUserListOfAnswerPasses", $this->lng->txt(
"tst_list_of_answers_show"));
3760 if ($this->object->getShowInfo())
3762 $info->enablePrivateNotes();
3765 if (strlen($this->object->getIntroduction()))
3767 $info->addSection($this->lng->txt(
"tst_introduction"));
3768 $info->addProperty(
"", $this->object->prepareTextareaOutput($this->object->getIntroduction()));
3771 $info->addSection($this->lng->txt(
"tst_general_properties"));
3772 if ($this->object->getShowInfo())
3774 $info->addProperty($this->lng->txt(
"author"), $this->
object->getAuthor());
3775 $info->addProperty($this->lng->txt(
"title"), $this->
object->getTitle());
3777 if ($this->object->isComplete())
3779 if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess(
"read",
"", $this->ref_id))
3781 if ($this->object->getShowInfo() || !$this->
object->getForceJS())
3784 $checked_javascript =
false;
3785 if ($this->object->getJavaScriptOutput())
3787 $checked_javascript =
true;
3789 if ($this->object->getForceJS())
3791 $info->addProperty($this->lng->txt(
"tst_test_output"), $this->lng->txt(
"tst_use_javascript"));
3795 $info->addPropertyCheckbox($this->lng->txt(
"tst_test_output"),
"chb_javascript", 1, $this->lng->txt(
"tst_use_javascript"), $checked_javascript);
3799 if (!$this->object->isRandomTest())
3801 if ($this->object->getNrOfTries() != 1)
3803 if ($this->object->getUsePreviousAnswers() == 0)
3805 if ($this->object->getShowInfo())
3807 $info->addProperty($this->lng->txt(
"tst_use_previous_answers"), $this->lng->txt(
"tst_dont_use_previous_answers"));
3812 $use_previous_answers = FALSE;
3813 if ($ilUser->prefs[
"tst_use_previous_answers"])
3815 $checked_previous_answers = TRUE;
3817 $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);
3821 if (
$_SESSION[
"AccountId"] == ANONYMOUS_USER_ID)
3823 $info->addPropertyTextinput($this->lng->txt(
"enter_anonymous_code"),
"anonymous_id",
"", 8,
"setAnonymousId", $this->lng->txt(
"submit"));
3828 if ($this->object->getShowInfo())
3830 $info->addSection($this->lng->txt(
"tst_sequence_properties"));
3831 $info->addProperty($this->lng->txt(
"tst_sequence"), $this->lng->txt(($this->object->getSequenceSettings() ==
TEST_FIXED_SEQUENCE)?
"tst_sequence_fixed":
"tst_sequence_postpone"));
3833 $info->addSection($this->lng->txt(
"tst_heading_scoring"));
3834 $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"));
3835 $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"));
3836 if ($this->object->isRandomTest())
3838 $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"));
3841 $info->addSection($this->lng->txt(
"tst_score_reporting"));
3842 $score_reporting_text =
"";
3843 switch ($this->object->getScoreReporting())
3846 $score_reporting_text = $this->lng->txt(
"tst_report_after_test");
3849 $score_reporting_text = $this->lng->txt(
"tst_report_after_first_question");
3852 $score_reporting_text = $this->lng->txt(
"tst_report_after_date");
3855 $score_reporting_text = $this->lng->txt(
"tst_report_after_never");
3858 $info->addProperty($this->lng->txt(
"tst_score_reporting"), $score_reporting_text);
3859 $reporting_date = $this->
object->getReportingDate();
3860 if ($reporting_date)
3862 #preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $reporting_date, $matches);
3863 #$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]));
3864 #$info->addProperty($this->lng->txt("tst_score_reporting_date"), $txt_reporting_date);
3865 $info->addProperty($this->lng->txt(
'tst_score_reporting_date'),
3869 $info->addSection($this->lng->txt(
"tst_session_settings"));
3870 $info->addProperty($this->lng->txt(
"tst_nr_of_tries"), ($this->
object->getNrOfTries() == 0)?$this->lng->txt(
"unlimited"):$this->
object->getNrOfTries());
3871 if ($this->object->getNrOfTries() != 1)
3873 $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());
3876 if ($this->object->getEnableProcessingTime())
3878 $info->addProperty($this->lng->txt(
"tst_processing_time"), $this->
object->getProcessingTime());
3880 if (strlen($this->object->getAllowedUsers()) && ($this->object->getAllowedUsersTimeGap()))
3882 $info->addProperty($this->lng->txt(
"tst_allowed_users"), $this->
object->getAllowedUsers());
3885 $starting_time = $this->
object->getStartingTime();
3888 $info->addProperty($this->lng->txt(
"tst_starting_time"),
3891 $ending_time = $this->
object->getEndingTime();
3894 $info->addProperty($this->lng->txt(
"tst_ending_time"),
3897 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
3900 if(
$_GET[
'crs_show_result'] and !$this->object->getTestSequence()->getFirstSequence())
3902 #ilUtil::sendInfo($this->lng->txt('crs_all_questions_answered_successfully'));
3906 $this->ctrl->forwardCommand($info);
3912 switch ($this->ctrl->getCmd())
3916 case "redirectToInfoScreen":
3923 case "outCorrectSolution":
3925 case "showAnswersOfUser":
3926 case "outUserResultsOverview":
3927 case "backFromSummary":
3928 case "show_answers":
3931 case "outTestSummary":
3932 case "outQuestionSummary":
3933 case "gotoQuestion":
3934 case "selectImagemapRegion":
3935 case "confirmSubmitAnswers":
3936 case "finalSubmission":
3938 case "redirectQuestion":
3939 case "outUserPassDetails":
3940 case "checkPassword":
3941 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
3944 case "evalAllUsers":
3945 case "evalUserDetail":
3946 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"eval_stat"),
"",
$_GET[
"ref_id"]);
3953 case "importVerifiedFile":
3954 case "cancelImport":
3957 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"",
$_GET[
"ref_id"]);
3965 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
3968 $tabs_gui->setBackTarget($this->lng->txt(
"backtocallingtest"), $this->ctrl->getLinkTarget($this,
"questions"));
3969 $tabs_gui->addTarget(
"tst_browse_for_questions",
3970 $this->ctrl->getLinkTarget($this,
"browseForQuestions"),
3971 array(
"browseForQuestions",
"filter",
"resetFilter",
"resetTextFilter",
"insertQuestions"),
3980 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
3983 $tabs_gui->setBackTarget($this->lng->txt(
"backtocallingtest"), $this->ctrl->getLinkTarget($this,
"questions"));
3984 $tabs_gui->addTarget(
"random_selection",
3985 $this->ctrl->getLinkTarget($this,
"randomQuestions"),
3986 array(
"randomQuestions"),
4001 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
4002 include_once
"./Modules/Test/classes/class.ilTestCertificateAdapter.php";
4004 $output_gui->certificateEditor();
4012 $ilTabs->addSubTabTarget(
"edit_test_questions",
4013 $this->ctrl->getLinkTarget($this,
'questions'),
4014 array(
"questions",
"browseForQuestions",
"questionBrowser",
"createQuestion",
4015 "randomselect",
"filter",
"resetFilter",
"insertQuestions",
4016 "back",
"createRandomSelection",
"cancelRandomSelect",
4017 "insertRandomSelection",
"removeQuestions",
"moveQuestions",
4018 "insertQuestionsBefore",
"insertQuestionsAfter",
"confirmRemoveQuestions",
4019 "cancelRemoveQuestions",
"executeCreateQuestion",
"cancelCreateQuestion",
4020 "addQuestionpool",
"saveRandomQuestions",
"saveQuestionSelectionMode"),
4024 if (!$this->object->isRandomTest())
4026 $ilTabs->addSubTabTarget(
"print_view",
4027 $this->ctrl->getLinkTarget($this,
'print'),
4038 $ilTabs->addSubTabTarget(
"eval_all_users",
4039 $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"outEvaluation"),
4040 array(
"outEvaluation",
"detailedEvaluation",
"exportEvaluation",
"evalUserDetail",
"passDetails",
4041 "outStatisticsResultsOverview",
"statisticsPassDetails")
4045 $ilTabs->addSubTabTarget(
"tst_results_aggregated",
4046 $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"eval_a"),
4051 $ilTabs->addSubTabTarget(
"tst_single_results",
4052 $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"singleResults"),
4053 array(
"singleResults"),
4057 $ilTabs->addSubTabTarget(
"settings",
4058 $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"evalSettings"),
4059 array(
"evalSettings",
"saveEvalSettings"),
4069 $force_active = ($this->ctrl->getCmd() ==
"")
4072 $ilTabs->addSubTabTarget(
"general",
4073 $this->ctrl->getLinkTarget($this,
'properties'),
4074 array(
"properties",
"saveProperties",
"cancelProperties"),
4075 array(
"",
"ilobjtestgui",
"ilcertificategui"),
4079 $ilTabs->addSubTabTarget(
4081 $this->ctrl->getLinkTarget($this,
'scoring'),
4083 array(
"",
"ilobjtestgui",
"ilcertificategui")
4087 $ilTabs->addSubTabTarget(
4089 $this->ctrl->getLinkTarget($this,
'marks'),
4090 array(
"marks",
"addMarkStep",
"deleteMarkSteps",
"addSimpleMarkSchema",
4091 "saveMarks",
"cancelMarks"),
4092 array(
"",
"ilobjtestgui",
"ilcertificategui")
4095 include_once
'./Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
4099 $ilTabs->addSubTabTarget(
4101 $this->ctrl->getLinkTarget($this,
'certificate'),
4102 array(
"certificate",
"certificateEditor",
"certificateRemoveBackground",
"certificateSave",
4103 "certificatePreview",
"certificateDelete",
"certificateUpload",
"certificateImport"),
4104 array(
"",
"ilobjtestgui",
"ilcertificategui")
4109 $ilTabs->addSubTabTarget(
"participants_invitation",
4110 $this->ctrl->getLinkTarget($this,
"inviteParticipants"),
4111 array(
"inviteParticipants",
"searchParticipants"),
4115 $ilTabs->addSubTabTarget(
4117 $this->ctrl->getLinkTarget($this,
"defaults"),
4118 array(
"defaults",
"deleteDefaults",
"addDefaults",
"applyDefaults"),
4119 array(
"",
"ilobjtestgui",
"ilcertificategui")
4130 global $ilAccess,$ilUser;
4132 switch ($this->ctrl->getCmd())
4139 case "directfeedback":
4141 case "outCorrectSolution":
4143 case "showAnswersOfUser":
4144 case "outUserResultsOverview":
4145 case "backFromSummary":
4146 case "show_answers":
4149 case "confirmFinish":
4150 case "outTestSummary":
4151 case "outQuestionSummary":
4152 case "gotoQuestion":
4153 case "selectImagemapRegion":
4154 case "confirmSubmitAnswers":
4155 case "finalSubmission":
4157 case "redirectQuestion":
4158 case "outUserPassDetails":
4159 case "checkPassword":
4160 case "exportCertificate":
4161 case "finishListOfAnswers":
4162 case "backConfirmFinish":
4163 case "showFinalStatement":
4166 case "browseForQuestions":
4169 case "resetTextFilter":
4170 case "insertQuestions":
4179 case "deleteMarkSteps":
4180 case "addSimpleMarkSchema":
4182 case "certificateservice":
4183 case "certificateImport":
4184 case "certificateUpload":
4185 case "certificateEditor":
4186 case "certificateDelete":
4187 case "certificateSave":
4189 case "deleteDefaults":
4191 case "applyDefaults":
4192 case "inviteParticipants":
4193 case "searchParticipants":
4195 if (($ilAccess->checkAccess(
"write",
"", $this->ref_id)) && ((strcmp($this->ctrl->getCmdClass(),
"ilobjtestgui") == 0) || (strcmp($this->ctrl->getCmdClass(),
"ilcertificategui") == 0) || (strlen($this->ctrl->getCmdClass()) == 0)))
4205 case "evalSettings":
4206 case "saveEvalSettings":
4207 case "detailedEvaluation":
4208 case "outEvaluation":
4209 case "singleResults":
4210 case "exportEvaluation":
4211 case "evalUserDetail":
4213 case "outStatisticsResultsOverview":
4214 case "statisticsPassDetails":
4219 if (strcmp(strtolower(get_class($this->
object)),
"ilobjtest") == 0)
4222 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
4224 $force_active = (
$_GET[
"up"] !=
"" ||
$_GET[
"down"] !=
"")
4229 if (
$_GET[
"browse"] == 1) $force_active =
true;
4230 if (preg_match(
"/deleteqpl_\d+/", $this->ctrl->getCmd()))
4232 $force_active =
true;
4235 $tabs_gui->addTarget(
"assQuestions",
4236 $this->ctrl->getLinkTarget($this,
'questions'),
4237 array(
"questions",
"browseForQuestions",
"questionBrowser",
"createQuestion",
4238 "randomselect",
"filter",
"resetFilter",
"insertQuestions",
4239 "back",
"createRandomSelection",
"cancelRandomSelect",
4240 "insertRandomSelection",
"removeQuestions",
"moveQuestions",
4241 "insertQuestionsBefore",
"insertQuestionsAfter",
"confirmRemoveQuestions",
4242 "cancelRemoveQuestions",
"executeCreateQuestion",
"cancelCreateQuestion",
4243 "addQuestionpool",
"saveRandomQuestions",
"saveQuestionSelectionMode",
"print",
4244 "addsource",
"removesource",
"randomQuestions"),
4245 "",
"", $force_active);
4249 if ($ilAccess->checkAccess(
"visible",
"", $this->ref_id))
4251 $tabs_gui->addTarget(
"info_short",
4252 $this->ctrl->getLinkTarget($this,
'infoScreen'),
4253 array(
"infoScreen",
"outIntroductionPage",
"showSummary",
4254 "setAnonymousId",
"outUserListOfAnswerPasses",
"redirectToInfoScreen"));
4258 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
4260 $tabs_gui->addTarget(
"settings",
4261 $this->ctrl->getLinkTarget($this,
'properties'),
4262 array(
"properties",
"saveProperties",
"cancelProperties",
4263 "marks",
"addMarkStep",
"deleteMarkSteps",
"addSimpleMarkSchema",
4264 "saveMarks",
"cancelMarks",
4265 "certificate",
"certificateEditor",
"certificateRemoveBackground",
4266 "certificateSave",
"certificatePreview",
"certificateDelete",
"certificateUpload",
4267 "certificateImport",
"scoring",
"defaults",
"addDefaults",
"deleteDefaults",
"applyDefaults",
4268 "inviteParticipants",
"saveFixedParticipantsStatus",
"searchParticipants",
"addParticipants",
4271 array(
"",
"ilobjtestgui",
"ilcertificategui")
4275 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
4278 $tabs_gui->addTarget(
"meta_data",
4279 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
'listSection'),
4280 "",
"ilmdeditorgui");
4283 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
4286 $tabs_gui->addTarget(
"participants",
4287 $this->ctrl->getLinkTarget($this,
'participants'),
4288 array(
"participants",
"saveClientIP",
4289 "removeParticipant",
4290 "showParticipantAnswersForAuthor",
4291 "deleteAllUserResults",
4292 "cancelDeleteAllUserData",
"deleteSingleUserResults",
4293 "outParticipantsResultsOverview",
"outParticipantsPassDetails",
4294 "showPassOverview",
"showUserAnswers",
"participantsAction",
4295 "showDetailedResults"),
4299 $tabs_gui->addTarget(
"export",
4300 $this->ctrl->getLinkTarget($this,
'export'),
4301 array(
"export",
"createExportFile",
"confirmDeleteExportFile",
4302 "downloadExportFile",
"deleteExportFile",
"cancelDeleteExportFile"),
4305 include_once
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
4307 if (count($scoring))
4310 $tabs_gui->addTarget(
"manscoring",
4311 $this->ctrl->getLinkTargetByClass(
"iltestscoringgui",
"manscoring"),
4312 array(
"manscoring",
"scoringfilter",
"scoringfilterreset",
"setPointsManual",
"setFeedbackManual",
"setManscoringDone"),
4317 if (($ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) || ($ilAccess->checkAccess(
"write",
"", $this->ref_id)))
4320 $tabs_gui->addTarget(
"statistics",
4321 $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"outEvaluation"),
4322 array(
"statistics",
"outEvaluation",
"exportEvaluation",
"detailedEvaluation",
"eval_a",
"evalSettings",
"saveEvalSettings",
"evalUserDetail",
4323 "passDetails",
"outStatisticsResultsOverview",
"statisticsPassDetails",
"singleResults")
4327 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
4330 $tabs_gui->addTarget(
'learning_progress',
4331 $this->ctrl->getLinkTargetByClass(array(
'illearningprogressgui'),
''),
4333 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui'));
4336 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
4339 $tabs_gui->addTarget(
"history",
4340 $this->ctrl->getLinkTarget($this,
'history'),
4343 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->ref_id))
4345 $tabs_gui->addTarget(
"perm_settings",
4346 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
4364 if ($ilAccess->checkAccess(
"visible",
"", $a_target))
4367 $_GET[
"baseClass"] =
"ilObjTestGUI";
4368 $_GET[
"cmd"] =
"infoScreen";
4369 $_GET[
"ref_id"] = $a_target;
4370 include_once(
"ilias.php");
4374 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
4376 $_GET[
"cmd"] =
"frameset";
4377 $_GET[
"target"] =
"";
4378 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
4381 include(
"repository.php");
4385 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);