24 include_once
"./classes/class.ilObjectGUI.php";
25 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
36 $lng->loadLanguageModule(
"assessment");
39 $this->ctrl->saveParameter($this,
"ref_id");
41 $this->safe_commands = array(
"printTest",
"saveTest",
"resetTest",
"savePDF",
"showPaperVersion");
43 if((
int)
$_GET[
'crs_show_result'])
45 $this->ctrl->saveParameter($this,
'crs_show_result',(
int) $_GET[
'crs_show_result']);
54 global $ilAccess, $ilNavigationHistory,
$ilCtrl;
56 if ((!$ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"])) && (!$ilAccess->checkAccess(
"visible",
"",
$_GET[
"ref_id"])))
59 $ilias->raiseError($this->lng->txt(
"permission_denied"), $ilias->error_obj->MESSAGE);
61 $cmd = $this->ctrl->getCmd(
"properties");
63 $next_class = $this->ctrl->getNextClass($this);
64 $this->ctrl->setReturn($this,
"properties");
65 if (method_exists($this->
object,
"getTestStyleLocation")) $this->tpl->addCss($this->object->getTestStyleLocation(
"output"),
"screen");
69 $ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
71 $ilNavigationHistory->addItem(
$_GET[
"ref_id"],
72 "ilias.php?baseClass=ilObjTestGUI&cmd=infoScreen&ref_id=".
$_GET[
"ref_id"],
"tst");
77 if(IS_PAYMENT_ENABLED)
79 include_once
'Services/Payment/classes/class.ilPaymentObject.php';
84 $this->tpl->getStandardTemplate();
86 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
88 $ret = $this->ctrl->forwardCommand($pp);
97 case "ilinfoscreengui":
101 case 'ilmdeditorgui':
102 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
105 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
106 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
108 $this->ctrl->forwardCommand($md_gui);
110 case "iltestoutputgui":
111 include_once
"./Modules/Test/classes/class.ilTestOutputGUI.php";
112 if (!($this->object->getKioskMode() || KIOSK_MODE) || in_array(
$cmd,$this->safe_commands)) $this->
prepareOutput();
114 $this->ctrl->forwardCommand($output_gui);
117 case "iltestevaluationgui":
118 include_once
"./Modules/Test/classes/class.ilTestEvaluationGUI.php";
121 $this->ctrl->forwardCommand($evaluation_gui);
124 case "iltestservicegui":
125 include_once
"./Modules/Test/classes/class.ilTestServiceGUI.php";
128 $this->ctrl->forwardCommand($serviceGUI);
131 case 'ilpermissiongui':
132 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
135 $ret =& $this->ctrl->forwardCommand($perm_gui);
138 case "illearningprogressgui":
139 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
143 $this->ctrl->forwardCommand($new_gui);
147 case "ilcertificategui":
148 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
150 include_once
"./Modules/Test/classes/class.ilTestCertificateAdapter.php";
152 $this->ctrl->forwardCommand($output_gui);
155 case "iltestscoringgui":
156 include_once
"./Modules/Test/classes/class.ilTestScoringGUI.php";
159 $this->ctrl->forwardCommand($output_gui);
162 case 'ilobjectcopygui':
164 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
167 $this->ctrl->forwardCommand($cp);
170 case 'ilrepositorysearchgui':
172 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
174 $rep_search->setCallback($this,
175 'addParticipantsObject',
181 $this->ctrl->setReturn($this,
'participants');
182 $ret =& $this->ctrl->forwardCommand($rep_search);
183 $this->tabs_gui->setTabActive(
'participants');
186 ######### scoreQuestion ######
187 case "iltestnewscoringgui":
188 include_once
"./Modules/Test/classes/class.ilTestNewScoringGUI.php";
191 $this->ctrl->forwardCommand($output_gui);
198 if (preg_match(
"/deleteqpl_\d+/",
$cmd))
200 $cmd =
"randomQuestions";
202 if ((strcmp(
$cmd,
"properties") == 0) && (
$_GET[
"browse"]))
207 if ((strcmp(
$cmd,
"properties") == 0) && (
$_GET[
"up"] ||
$_GET[
"down"]))
216 if (strtolower(
$_GET[
"baseClass"]) !=
"iladministrationgui" &&
225 $this->ctrl->redirect($this,
"infoScreen");
230 $this->ctrl->redirectByClass(
"iltestevaluationgui",
"outEvaluation");
238 if (strcmp($_FILES[
"xmldoc"][
"tmp_name"],
"") == 0)
244 $this->ctrl->setParameter($this,
"new_type", $this->type);
256 if (!strlen(
$_POST[
'Fobject'][
'title']))
259 $this->ctrl->setParameter($this,
'new_type',
$_GET[
'new_type']);
260 $this->ctrl->redirect($this,
'create');
264 if (
$_POST[
"defaults"] > 0)
266 $newObj->applyDefaults(
$_POST[
"defaults"]);
271 ilUtil::redirect(
"ilias.php?baseClass=ilObjTestGUI&ref_id=".$newObj->getRefId().
"&cmd=properties");
276 include_once
"./Services/Utilities/classes/class.ilUtil.php";
277 $path = $this->tree->getPathFull($this->object->getRefID());
283 include_once
"./Services/Utilities/classes/class.ilUtil.php";
294 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
298 $this->ctrl->redirect($this,
"infoScreen");
301 $export_dir = $this->
object->getExportDirectory();
302 $export_files = $this->
object->getExportFiles($export_dir);
304 if(count($export_files) > 0)
306 foreach($export_files as $exp_file)
308 $file_arr = explode(
"__", $exp_file);
310 array_push(
$data, array(
312 'size' => filesize($export_dir.
"/".$exp_file),
318 include_once
"./Modules/Test/classes/tables/class.ilTestExportTableGUI.php";
320 $table_gui->setData(
$data);
321 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
331 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
333 include_once(
"./Modules/Test/classes/class.ilTestExport.php");
335 $test_exp->buildExportFile();
341 $this->ctrl->redirect($this,
"export");
351 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
353 include_once(
"./Modules/Test/classes/class.ilTestExport.php");
355 $test_exp->buildExportFile();
361 $this->ctrl->redirect($this,
"export");
370 if(!isset(
$_POST[
"file"]))
373 $this->ctrl->redirect($this,
"export");
376 if (count(
$_POST[
"file"]) > 1)
379 $this->ctrl->redirect($this,
"export");
383 $export_dir = $this->
object->getExportDirectory();
393 if (!isset(
$_POST[
"file"]))
396 $this->ctrl->redirect($this,
"export");
401 $export_dir = $this->
object->getExportDirectory();
402 $export_files = $this->
object->getExportFiles($export_dir);
404 if (count(
$_POST[
"file"]) > 0)
406 foreach (
$_POST[
"file"] as $exp_file)
408 $file_arr = explode(
"__", $exp_file);
410 array_push(
$data, array(
412 'size' => filesize($export_dir.
"/".$exp_file),
418 include_once
"./Modules/Test/classes/tables/class.ilTestExportTableGUI.php";
420 $table_gui->setData(
$data);
421 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
440 $this->ctrl->redirect($this,
"export");
449 $export_dir = $this->
object->getExportDirectory();
452 $exp_file = $export_dir.
"/".
$file;
453 $exp_dir = $export_dir.
"/".substr($file, 0, strlen($file) - 4);
454 if (@is_file($exp_file))
458 if (@is_dir($exp_dir))
464 $this->ctrl->redirect($this,
"export");
472 if ($_FILES[
"xmldoc"][
"error"] > UPLOAD_ERR_OK)
478 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
483 $file = pathinfo($_FILES[
"xmldoc"][
"name"]);
484 $full_path = $basedir.
"/".$_FILES[
"xmldoc"][
"name"];
491 $subdir = basename(
$file[
"basename"],
".".
$file[
"extension"]);
498 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
500 $result = $qtiParser->startParsing();
501 $founditems =& $qtiParser->getFoundItems();
503 if (count($founditems) == 0)
517 foreach ($founditems as $item)
519 if (strlen($item[
"type"]))
539 $_SESSION[
"tst_import_results_file"] = $results_file;
540 $_SESSION[
"tst_import_xml_file"] = $xml_file;
541 $_SESSION[
"tst_import_qti_file"] = $qti_file;
542 $_SESSION[
"tst_import_subdir"] = $subdir;
544 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.tst_import_verification.html");
545 $row_class = array(
"tblrow1",
"tblrow2");
547 foreach ($founditems as $item)
549 $this->tpl->setCurrentBlock(
"verification_row");
550 $this->tpl->setVariable(
"ROW_CLASS", $row_class[$counter++ % 2]);
551 $this->tpl->setVariable(
"QUESTION_TITLE", $item[
"title"]);
552 $this->tpl->setVariable(
"QUESTION_IDENT", $item[
"ident"]);
553 include_once
"./Services/QTI/classes/class.ilQTIItem.php";
554 switch ($item[
"type"])
556 case "MULTIPLE CHOICE QUESTION":
558 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"qt_multiple_choice"));
560 case "SINGLE CHOICE QUESTION":
562 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assSingleChoice"));
564 case "NUMERIC QUESTION":
566 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assNumeric"));
568 case "TEXTSUBSET QUESTION":
570 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assTextSubset"));
572 case "CLOZE QUESTION":
574 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assClozeTest"));
576 case "IMAGE MAP QUESTION":
578 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assImagemapQuestion"));
580 case "JAVA APPLET QUESTION":
582 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assJavaApplet"));
584 case "MATCHING QUESTION":
586 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assMatchingQuestion"));
588 case "ORDERING QUESTION":
590 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assOrderingQuestion"));
592 case "TEXT QUESTION":
594 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assTextQuestion"));
597 $this->tpl->parseCurrentBlock();
599 $this->tpl->setCurrentBlock(
"adm_content");
600 $this->tpl->setVariable(
"TEXT_TYPE", $this->lng->txt(
"question_type"));
601 $this->tpl->setVariable(
"TEXT_TITLE", $this->lng->txt(
"question_title"));
602 $this->tpl->setVariable(
"FOUND_QUESTIONS_INTRODUCTION", $this->lng->txt(
"tst_import_verify_found_questions"));
603 $this->tpl->setVariable(
"VERIFICATION_HEADING", $this->lng->txt(
"import_tst"));
604 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
606 $this->tpl->setVariable(
"QUESTIONPOOL_ID",
$_POST[
"qpl"]);
607 $this->tpl->setVariable(
"VALUE_IMPORT", $this->lng->txt(
"import"));
608 $this->tpl->setVariable(
"VALUE_CANCEL", $this->lng->txt(
"cancel"));
609 $this->tpl->parseCurrentBlock();
617 include_once
"./Modules/Test/classes/class.ilObjTest.php";
621 $newObj->setType(
$_GET[
"new_type"]);
623 $newObj->setTitle(
"dummy");
625 $newObj->setDescription(
"test import");
627 $newObj->create(
true);
629 $newObj->createReference();
631 $newObj->putInTree(
$_GET[
"ref_id"]);
633 $newObj->setPermissions(
$_GET[
"ref_id"]);
635 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
637 $newObj->mark_schema->flush();
640 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
642 $qtiParser->setTestObject($newObj);
643 $result = $qtiParser->startParsing();
647 include_once (
"./Modules/LearningModule/classes/class.ilContObjParser.php");
649 $contParser->setQuestionMapping($qtiParser->getImportMapping());
650 $contParser->startParsing();
653 if (@file_exists(
$_SESSION[
"tst_import_results_file"]))
655 include_once (
"./Modules/Test/classes/class.ilTestResultsImportParser.php");
664 "&baseClass=ilObjTestGUI");
671 $this->ctrl->redirect($this,
"cancel");
697 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_properties_save_confirmation.html",
"Modules/Test");
702 $information = $this->lng->txt(
"change_properties_from_random_to_standard");
705 $information = $this->lng->txt(
"change_properties_from_standard_to_random");
708 foreach (
$_POST as $key => $value)
710 if (strcmp($key,
"cmd") != 0)
712 if (is_array($value))
714 foreach ($value as $k => $v)
716 $this->tpl->setCurrentBlock(
"hidden_variable");
717 $this->tpl->setVariable(
"HIDDEN_KEY", $key .
"[" . $k .
"]");
718 $this->tpl->setVariable(
"HIDDEN_VALUE", $v);
719 $this->tpl->parseCurrentBlock();
724 $this->tpl->setCurrentBlock(
"hidden_variable");
725 $this->tpl->setVariable(
"HIDDEN_KEY", $key);
726 $this->tpl->setVariable(
"HIDDEN_VALUE", $value);
727 $this->tpl->parseCurrentBlock();
731 $this->tpl->setCurrentBlock(
"hidden_variable");
732 $this->tpl->setVariable(
"HIDDEN_KEY",
"tst_properties_confirmation");
733 $this->tpl->setVariable(
"HIDDEN_VALUE",
"1");
734 $this->tpl->parseCurrentBlock();
735 $this->tpl->setCurrentBlock(
"adm_content");
736 $this->tpl->setVariable(
"TXT_CONFIRMATION", $this->lng->txt(
"confirmation"));
737 $this->tpl->setVariable(
"TXT_INFORMATION", $information);
738 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
739 $this->tpl->setVariable(
"BTN_CONFIRM", $this->lng->txt(
"confirm"));
740 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
741 $this->tpl->parseCurrentBlock();
754 $total = $this->
object->evalTotalPersons();
758 $this->
object->setCountSystem(
$_POST[
"count_system"]);
759 $this->
object->setMCScoring(
$_POST[
"mc_scoring"]);
760 $this->
object->setScoreCutting(
$_POST[
"score_cutting"]);
761 $this->
object->setPassScoring(
$_POST[
"pass_scoring"]);
764 $this->
object->setAnswerFeedback((is_array(
$_POST[
'instant_feedback']) && in_array(
'instant_feedback_answer',
$_POST[
'instant_feedback'])) ? 1 : 0);
765 $this->
object->setAnswerFeedbackPoints((is_array(
$_POST[
'instant_feedback']) && in_array(
'instant_feedback_points',
$_POST[
'instant_feedback'])) ? 1 : 0);
766 $this->
object->setInstantFeedbackSolution((is_array(
$_POST[
'instant_feedback']) && in_array(
'instant_feedback_solution',
$_POST[
'instant_feedback'])) ? 1 : 0);
768 $this->
object->setScoreReporting(
$_POST[
"results_access"]);
771 $this->
object->setReportingDate(sprintf(
"%04d%02d%02d%02d%02d%02d",
772 $_POST[
"reporting_date"][
'date'][
"y"],
773 $_POST[
"reporting_date"][
'date'][
"m"],
774 $_POST[
"reporting_date"][
'date'][
"d"],
775 $_POST[
"reporting_date"][
'time'][
"h"],
776 $_POST[
"reporting_date"][
'time'][
"m"],
777 $_POST[
"reporting_date"][
'time'][
"s"]
782 $this->
object->setReportingDate(
'');
785 $this->
object->setShowPassDetails((is_array(
$_POST[
'results_presentation']) && in_array(
'pass_details',
$_POST[
'results_presentation'])) ? 1 : 0);
786 $this->
object->setShowSolutionDetails((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_details',
$_POST[
'results_presentation'])) ? 1 : 0);
787 $this->
object->setShowSolutionPrintview((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_printview',
$_POST[
'results_presentation'])) ? 1 : 0);
788 $this->
object->setShowSolutionFeedback((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_feedback',
$_POST[
'results_presentation'])) ? 1 : 0);
789 $this->
object->setShowSolutionAnswersOnly((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_answers_only',
$_POST[
'results_presentation'])) ? 1 : 0);
790 $this->
object->setShowSolutionSignature((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_signature',
$_POST[
'results_presentation'])) ? 1 : 0);
791 $this->
object->setShowSolutionSuggested((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_suggested',
$_POST[
'results_presentation'])) ? 1 : 0);
792 $this->
object->setShowSolutionListComparison((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_compare',
$_POST[
'results_presentation'])) ? 1 : 0);
793 $this->
object->setShowSolutionAnwersBeforeFinish((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_answers_before_finish',
$_POST[
'results_presentation'])) ? 1 : 0);
795 $this->
object->setExportSettingsSingleChoiceShort((is_array(
$_POST[
'export_settings']) && in_array(
'exp_sc_short',
$_POST[
'export_settings'])) ? 1 : 0);
796 $this->
object->setExportSettingsRespectShuffle((is_array(
$_POST[
'export_settings']) && in_array(
'exp_respect_shuffle',
$_POST[
'export_settings'])) ? 1 : 0);
798 $this->
object->saveToDb(
true);
800 $this->ctrl->redirect($this,
"scoring");
812 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
816 $this->ctrl->redirect($this,
"infoScreen");
819 $save = (strcmp($this->ctrl->getCmd(),
"saveScoring") == 0) ? TRUE : FALSE;
820 $total = $this->
object->evalTotalPersons();
821 $this->tpl->addJavascript(
"./Services/JavaScript/js/Basic.js");
823 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
825 $form->setFormAction($this->ctrl->getFormAction($this));
826 $form->setTableWidth(
"100%");
827 $form->setId(
"test_properties_scoring");
831 $header->setTitle($this->lng->txt(
"scoring"));
832 $form->addItem($header);
835 $count_system =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_text_count_system"),
"count_system");
837 $count_system->addOption(
new ilRadioOption($this->lng->txt(
"tst_count_correct_solutions"), 1,
''));
838 $count_system->setValue($this->object->getCountSystem());
839 $count_system->setInfo($this->lng->txt(
"tst_count_system_description"));
842 $count_system->setDisabled(
true);
844 $form->addItem($count_system);
847 $mc_scoring =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_score_mcmr_questions"),
"mc_scoring");
848 $mc_scoring->
addOption(
new ilRadioOption($this->lng->txt(
"tst_score_mcmr_zero_points_when_unanswered"), 0,
''));
849 $mc_scoring->addOption(
new ilRadioOption($this->lng->txt(
"tst_score_mcmr_use_scoring_system"), 1,
''));
850 $mc_scoring->setValue($this->object->getMCScoring());
851 $mc_scoring->setInfo($this->lng->txt(
"tst_score_mcmr_questions_description"));
854 $mc_scoring->setDisabled(
true);
856 $form->addItem($mc_scoring);
859 $score_cutting =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_score_cutting"),
"score_cutting");
861 $score_cutting->addOption(
new ilRadioOption($this->lng->txt(
"tst_score_cut_test"), 1,
''));
862 $score_cutting->setValue($this->object->getScoreCutting());
863 $score_cutting->setInfo($this->lng->txt(
"tst_score_cutting_description"));
866 $score_cutting->setDisabled(
true);
868 $form->addItem($score_cutting);
873 $pass_scoring->addOption(
new ilRadioOption($this->lng->txt(
"tst_pass_best_pass"), 1,
''));
874 $pass_scoring->setValue($this->object->getPassScoring());
875 $pass_scoring->setInfo($this->lng->txt(
"tst_pass_scoring_description"));
878 $pass_scoring->setDisabled(
true);
880 $form->addItem($pass_scoring);
884 $instant_feedback->
addOption(
new ilCheckboxOption($this->lng->txt(
"tst_instant_feedback_answer_specific"),
'instant_feedback_answer',
''));
885 $instant_feedback->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_instant_feedback_results"),
'instant_feedback_points',
''));
886 $instant_feedback->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_instant_feedback_solution"),
'instant_feedback_solution',
''));
888 if ($this->object->getAnswerFeedback()) array_push($values,
'instant_feedback_answer');
889 if ($this->object->getAnswerFeedbackPoints()) array_push($values,
'instant_feedback_points');
890 if ($this->object->getInstantFeedbackSolution()) array_push($values,
'instant_feedback_solution');
891 $instant_feedback->setValue($values);
892 $instant_feedback->setInfo($this->lng->txt(
"tst_instant_feedback_description"));
893 $form->addItem($instant_feedback);
896 $results_access =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_results_access"),
"results_access");
898 $results_access->addOption(
new ilRadioOption($this->lng->txt(
"tst_results_access_always"), 2,
''));
899 $results_access->addOption(
new ilRadioOption($this->lng->txt(
"tst_results_access_never"), 4,
''));
900 $results_access->addOption(
new ilRadioOption($this->lng->txt(
"tst_results_access_date"), 3,
''));
901 $results_access->setValue($this->object->getScoreReporting());
902 $results_access->setInfo($this->lng->txt(
"tst_results_access_description"));
906 $reporting_date->setShowDate(
true);
907 $reporting_date->setShowTime(
true);
908 if (strlen($this->object->getReportingDate()))
916 $results_access->addSubItem($reporting_date);
917 $form->addItem($results_access);
920 $results_presentation =
new ilCheckboxGroupInputGUI($this->lng->txt(
"tst_results_presentation"),
"results_presentation");
922 $results_presentation->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_details"),
'solution_details',
''));
923 $results_presentation->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_answers_before_finish"),
'solution_answers_before_finish',
''));
924 $results_presentation->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_printview"),
'solution_printview',
''));
925 $results_presentation->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_compare"),
'solution_compare',
''));
926 $results_presentation->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_feedback"),
'solution_feedback',
''));
927 $results_presentation->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_answers_only"),
'solution_answers_only',
''));
928 $signatureOption =
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_signature"),
'solution_signature',
'');
929 $results_presentation->addOption($signatureOption);
930 $results_presentation->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_suggested"),
'solution_suggested',
''));
932 if ($this->object->getShowPassDetails()) array_push($values,
'pass_details');
933 if ($this->object->getShowSolutionDetails()) array_push($values,
'solution_details');
934 if ($this->object->getShowSolutionPrintview()) array_push($values,
'solution_printview');
935 if ($this->object->getShowSolutionFeedback()) array_push($values,
'solution_feedback');
936 if ($this->object->getShowSolutionAnswersOnly()) array_push($values,
'solution_answers_only');
937 if ($this->object->getShowSolutionSignature()) array_push($values,
'solution_signature');
938 if ($this->object->getShowSolutionSuggested()) array_push($values,
'solution_suggested');
939 if ($this->object->getShowSolutionListComparison()) array_push($values,
'solution_compare');
940 if ($this->object->getShowSolutionAnwersBeforeFinish()) array_push($values,
'solution_answers_before_finish');
941 $results_presentation->setValue($values);
942 $results_presentation->setInfo($this->lng->txt(
"tst_results_presentation_description"));
943 if ($this->object->getAnonymity())
945 $signatureOption->setDisabled(
true);
947 $form->addItem($results_presentation);
953 $checkbox =
new ilCheckboxOption($this->lng->txt(
"tst_exp_respect_shuffle"),
'exp_respect_shuffle',
'');
954 $checkbox->
setInfo($this->lng->txt(
"tst_exp_respect_shuffle_description"));
955 $export_settings->addOption($checkbox);
958 if ($this->object->getExportSettingsSingleChoiceShort()) array_push($values,
'exp_sc_short');
959 if ($this->object->getExportSettingsRespectShuffle()) array_push($values,
'exp_respect_shuffle');
960 $export_settings->setValue($values);
961 $form->addItem($export_settings);
963 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])) $form->addCommandButton(
"saveScoring", $this->lng->txt(
"save"));
968 $errors = !$form->checkInput();
969 $form->setValuesByPost();
970 if (
$errors) $checkonly =
false;
972 if (!$checkonly) $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
984 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
988 $this->ctrl->redirect($this,
"infoScreen");
991 $save = (strcmp($this->ctrl->getCmd(),
"saveProperties") == 0) ? TRUE : FALSE;
992 $total = $this->
object->evalTotalPersons();
993 $this->tpl->addJavascript(
"./Services/JavaScript/js/Basic.js");
995 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
997 $form->setFormAction($this->ctrl->getFormAction($this));
998 $form->setTableWidth(
"100%");
999 $form->setId(
"test_properties");
1003 $header->setTitle($this->lng->txt(
"tst_general_properties"));
1004 $form->addItem($header);
1009 if (
$total) $anonymity->setDisabled(
true);
1010 $anonymity->setChecked($this->object->getAnonymity());
1011 $anonymity->setInfo($this->lng->txt(
"tst_anonymity_description"));
1012 $form->addItem($anonymity);
1015 $random =
new ilCheckboxInputGUI($this->lng->txt(
"tst_random_selection"),
"random_test");
1017 if (
$total) $random->setDisabled(
true);
1018 $random->setChecked($this->object->isRandomTest());
1019 $random->setInfo($this->lng->txt(
"tst_random_test_description"));
1020 $form->addItem($random);
1023 $intro =
new ilTextAreaInputGUI($this->lng->txt(
"tst_introduction"),
"introduction");
1024 $intro->
setValue($this->object->prepareTextareaOutput($this->object->getIntroduction()));
1025 $intro->setRows(10);
1026 $intro->setCols(80);
1027 $intro->setUseRte(TRUE);
1028 $intro->addPlugin(
"latex");
1029 $intro->addButton(
"latex");
1030 $intro->setRTESupport($this->object->getId(),
"tst",
"assessment");
1031 $intro->setRteTagSet(
'full');
1034 $showinfo->setValue(1);
1035 $showinfo->setChecked($this->object->getShowInfo());
1036 $showinfo->setOptionTitle($this->lng->txt(
"showinfo"));
1037 $showinfo->setInfo($this->lng->txt(
"showinfo_desc"));
1038 $intro->addSubItem($showinfo);
1039 $form->addItem($intro);
1042 $finalstatement =
new ilTextAreaInputGUI($this->lng->txt(
"final_statement"),
"finalstatement");
1043 $finalstatement->
setValue($this->object->prepareTextareaOutput($this->object->getFinalStatement()));
1044 $finalstatement->setRows(10);
1045 $finalstatement->setCols(80);
1046 $finalstatement->setUseRte(TRUE);
1047 $finalstatement->addPlugin(
"latex");
1048 $finalstatement->addButton(
"latex");
1049 $finalstatement->setRTESupport($this->object->getId(),
"tst",
"assessment");
1050 $finalstatement->setRteTagSet(
'full');
1053 $showfinal->setValue(1);
1054 $showfinal->setChecked($this->object->getShowFinalStatement());
1055 $showfinal->setOptionTitle($this->lng->txt(
"final_statement_show"));
1056 $showfinal->setInfo($this->lng->txt(
"final_statement_show_desc"));
1057 $finalstatement->addSubItem($showfinal);
1058 $form->addItem($finalstatement);
1062 $redirect_after_exam =
new ilTextInputGUI($this->lng->txt(
"redirect_after_exam"),
"redirect_after_exam");
1063 $redirect_after_exam->
setSize(100);
1064 $redirect_after_exam->setValue($this->object->getRedirectAfterExam());
1065 $redirect_after_exam->setInfo($this->lng->txt(
"info_redirect_after_exam"));
1066 $form->addItem($redirect_after_exam);
1069 $redirect_only_kiosk_mode =
new ilCheckboxInputGUI($this->lng->txt(
"redirect_only_kiosk_mode"),
"redirect_only_kiosk_mode");
1070 $redirect_only_kiosk_mode->
setValue(1);
1071 $redirect_only_kiosk_mode->setChecked($this->object->getRedirectOnlyKioskMode());
1072 $redirect_only_kiosk_mode->setInfo($this->lng->txt(
"info_redirect_only_kiosk_mode"));
1073 $form->addItem($redirect_only_kiosk_mode);
1078 $exam_pdf->setChecked($this->object->getExamPdf());
1079 $exam_pdf->setInfo($this->lng->txt(
"info_exam_pdf"));
1080 $form->addItem($exam_pdf);
1085 $seqheader->setTitle($this->lng->txt(
"tst_sequence_properties"));
1086 $form->addItem($seqheader);
1091 $postpone->setChecked($this->object->getSequenceSettings());
1092 $postpone->setInfo($this->lng->txt(
"tst_postpone_description"));
1093 $form->addItem($postpone);
1096 $shuffle =
new ilCheckboxInputGUI($this->lng->txt(
"tst_shuffle_questions"),
"chb_shuffle_questions");
1098 $shuffle->setChecked($this->object->getShuffleQuestions());
1099 $shuffle->setInfo($this->lng->txt(
"tst_shuffle_questions_description"));
1100 $form->addItem($shuffle);
1103 $list_of_questions =
new ilCheckboxInputGUI($this->lng->txt(
"tst_show_summary"),
"list_of_questions");
1104 $list_of_questions->
setOptionTitle($this->lng->txt(
"tst_show_summary"));
1105 $list_of_questions->setValue(1);
1106 $list_of_questions->setChecked($this->object->getListOfQuestions());
1107 $list_of_questions->setInfo($this->lng->txt(
"tst_show_summary_description"));
1110 $list_of_questions_options->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_list_of_questions_start"),
'chb_list_of_questions_start',
''));
1111 $list_of_questions_options->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_list_of_questions_end"),
'chb_list_of_questions_end',
''));
1112 $list_of_questions_options->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_list_of_questions_with_description"),
'chb_list_of_questions_with_description',
''));
1114 if ($this->object->getListOfQuestionsStart()) array_push($values,
'chb_list_of_questions_start');
1115 if ($this->object->getListOfQuestionsEnd()) array_push($values,
'chb_list_of_questions_end');
1116 if ($this->object->getListOfQuestionsDescription()) array_push($values,
'chb_list_of_questions_with_description');
1117 $list_of_questions_options->setValue($values);
1119 $list_of_questions->addSubItem($list_of_questions_options);
1120 $form->addItem($list_of_questions);
1123 $marking =
new ilCheckboxInputGUI($this->lng->txt(
"question_marking"),
"chb_show_marker");
1125 $marking->setChecked($this->object->getShowMarker());
1126 $marking->setInfo($this->lng->txt(
"question_marking_description"));
1127 $form->addItem($marking);
1130 $cancel =
new ilCheckboxInputGUI($this->lng->txt(
"tst_show_cancel"),
"chb_show_cancel");
1132 $cancel->setChecked($this->object->getShowCancel());
1133 $cancel->setInfo($this->lng->txt(
"tst_show_cancel_description"));
1134 $form->addItem($cancel);
1139 $autosave->setChecked($this->object->getAutosave());
1140 $autosave->setInfo($this->lng->txt(
"tst_autosave_description"));
1141 $form->addItem($autosave);
1145 $kioskheader->setTitle($this->lng->txt(
"kiosk"));
1146 $form->addItem($kioskheader);
1151 $kiosk->setChecked($this->object->getKioskMode());
1152 $kiosk->setInfo($this->lng->txt(
"kiosk_description"));
1157 $kiosktitle->addOption(
new ilCheckboxOption($this->lng->txt(
"kiosk_show_participant"),
'kiosk_participant',
''));
1159 if ($this->object->getShowKioskModeTitle()) array_push($values,
'kiosk_title');
1160 if ($this->object->getShowKioskModeParticipant()) array_push($values,
'kiosk_participant');
1161 $kiosktitle->setValue($values);
1162 $kiosktitle->setInfo($this->lng->txt(
"kiosk_options_desc"));
1163 $kiosk->addSubItem($kiosktitle);
1165 $form->addItem($kiosk);
1169 $sessionheader->setTitle($this->lng->txt(
"tst_session_settings"));
1170 $form->addItem($sessionheader);
1173 $nr_of_tries =
new ilTextInputGUI($this->lng->txt(
"tst_nr_of_tries"),
"nr_of_tries");
1175 $nr_of_tries->setValue($this->object->getNrOfTries());
1176 $nr_of_tries->setRequired(
true);
1177 $nr_of_tries->setSuffix($this->lng->txt(
"0_unlimited"));
1178 if (
$total) $nr_of_tries->setDisabled(
true);
1179 $form->addItem($nr_of_tries);
1182 $processing =
new ilCheckboxInputGUI($this->lng->txt(
"tst_processing_time"),
"chb_processing_time");
1184 $processing->setOptionTitle($this->lng->txt(
"enabled"));
1185 $processing->setChecked($this->object->getEnableProcessingTime());
1189 $ptime = $this->
object->getProcessingTimeAsArray();
1190 $processingtime->setHours($ptime[
'hh']);
1191 $processingtime->setMinutes($ptime[
'mm']);
1192 $processingtime->setSeconds($ptime[
'ss']);
1193 $processingtime->setShowMonths(
false);
1194 $processingtime->setShowDays(
false);
1195 $processingtime->setShowHours(
true);
1196 $processingtime->setShowMinutes(
true);
1197 $processingtime->setShowSeconds(
true);
1198 $processingtime->setInfo($this->lng->txt(
"tst_processing_time_desc"));
1199 $processing->addSubItem($processingtime);
1203 $resetprocessing->setValue(1);
1204 $resetprocessing->setOptionTitle($this->lng->txt(
"tst_reset_processing_time"));
1205 $resetprocessing->setChecked($this->object->getResetProcessingTime());
1206 $resetprocessing->setInfo($this->lng->txt(
"tst_reset_processing_time_desc"));
1207 $processing->addSubItem($resetprocessing);
1208 $form->addItem($processing);
1211 $enablestartingtime =
new ilCheckboxInputGUI($this->lng->txt(
"tst_starting_time"),
"chb_starting_time");
1213 $enablestartingtime->setOptionTitle($this->lng->txt(
"enabled"));
1214 $enablestartingtime->setChecked(strlen($this->object->getStartingTime()));
1217 $startingtime->setShowDate(
true);
1218 $startingtime->setShowTime(
true);
1219 if (strlen($this->object->getStartingTime()))
1227 $enablestartingtime->addSubItem($startingtime);
1228 if (
$total) $enablestartingtime->setDisabled(
true);
1229 if (
$total) $startingtime->setDisabled(
true);
1230 $form->addItem($enablestartingtime);
1233 $enableendingtime =
new ilCheckboxInputGUI($this->lng->txt(
"tst_ending_time"),
"chb_ending_time");
1235 $enableendingtime->setOptionTitle($this->lng->txt(
"enabled"));
1236 $enableendingtime->setChecked(strlen($this->object->getEndingTime()));
1239 $endingtime->setShowDate(
true);
1240 $endingtime->setShowTime(
true);
1241 if (strlen($this->object->getEndingTime()))
1249 $enableendingtime->addSubItem($endingtime);
1250 $form->addItem($enableendingtime);
1253 $prevanswers =
new ilCheckboxInputGUI($this->lng->txt(
"tst_use_previous_answers"),
"chb_use_previous_answers");
1255 $prevanswers->setChecked($this->object->getUsePreviousAnswers());
1256 $prevanswers->setInfo($this->lng->txt(
"tst_use_previous_answers_description"));
1257 $form->addItem($prevanswers);
1262 $forcejs->setChecked($this->object->getForceJS());
1263 $forcejs->setOptionTitle($this->lng->txt(
"forcejs"));
1264 $forcejs->setInfo($this->lng->txt(
"forcejs_desc"));
1265 $form->addItem($forcejs);
1270 $title_output->addOption(
new ilRadioOption($this->lng->txt(
"tst_title_output_hide_points"), 1,
''));
1271 $title_output->addOption(
new ilRadioOption($this->lng->txt(
"tst_title_output_no_title"), 2,
''));
1272 $title_output->setValue($this->object->getTitleOutput());
1273 $title_output->setInfo($this->lng->txt(
"tst_title_output_description"));
1274 $form->addItem($title_output);
1277 $password =
new ilTextInputGUI($this->lng->txt(
"tst_password"),
"password");
1279 $password->setValue($this->object->getPassword());
1280 $password->setInfo($this->lng->txt(
"tst_password_details"));
1281 $form->addItem($password);
1286 $showserial->setChecked($this->object->getShowSerial());
1287 $showserial->setOptionTitle($this->lng->txt(
"tst_showserial"));
1288 $showserial->setInfo($this->lng->txt(
"tst_showserial_desc"));
1289 $form->addItem($showserial);
1293 $restrictions->setTitle($this->lng->txt(
"tst_max_allowed_users"));
1294 $form->addItem($restrictions);
1296 $fixedparticipants =
new ilCheckboxInputGUI($this->lng->txt(
'participants_invitation'),
"fixedparticipants");
1298 $fixedparticipants->setChecked($this->object->getFixedParticipants());
1299 $fixedparticipants->setOptionTitle($this->lng->txt(
"tst_allow_fixed_participants"));
1300 $fixedparticipants->setInfo($this->lng->txt(
"participants_invitation_description"));
1301 $invited_users = $this->
object->getInvitedUsers();
1302 if (
$total && (count($invited_users) == 0))
1304 $fixedparticipants->setDisabled(
true);
1306 $form->addItem($fixedparticipants);
1310 $simul =
new ilTextInputGUI($this->lng->txt(
"tst_allowed_users"),
"allowedUsers");
1312 $simul->setValue(($this->object->getAllowedUsers()) ? $this->object->getAllowedUsers() :
'');
1313 $form->addItem($simul);
1316 $idle =
new ilTextInputGUI($this->lng->txt(
"tst_allowed_users_time_gap"),
"allowedUsersTimeGap");
1318 $idle->setSuffix($this->lng->txt(
"seconds"));
1319 $idle->setValue(($this->object->getAllowedUsersTimeGap()) ? $this->object->getAllowedUsersTimeGap() :
'');
1320 $form->addItem($idle);
1324 $notifications->setTitle($this->lng->txt(
"notifications"));
1325 $form->addItem($notifications);
1328 $mailnotification =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_finish_notification"),
"mailnotification");
1330 $mailnotification->addOption(
new ilRadioOption($this->lng->txt(
"tst_finish_notification_simple"), 1,
''));
1331 $mailnotification->addOption(
new ilRadioOption($this->lng->txt(
"tst_finish_notification_advanced"), 2,
''));
1332 $mailnotification->setValue($this->object->getMailNotification());
1333 $form->addItem($mailnotification);
1336 $mailnottype->setValue(1);
1337 $mailnottype->setOptionTitle($this->lng->txt(
"mailnottype"));
1338 $mailnottype->setChecked($this->object->getMailNotificationType());
1339 $form->addItem($mailnottype);
1341 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])) $form->addCommandButton(
"saveProperties", $this->lng->txt(
"save"));
1346 $errors = !$form->checkInput();
1347 $form->setValuesByPost();
1348 if (
$errors) $checkonly =
false;
1350 if (!$checkonly) $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
1361 if (!array_key_exists(
"tst_properties_confirmation",
$_POST))
1371 $total = $this->
object->evalTotalPersons();
1372 $randomtest_switch =
false;
1376 if (!array_key_exists(
"tst_properties_confirmation",
$_POST))
1378 if (($this->object->isRandomTest()) && (count($this->object->getRandomQuestionpools()) > 0))
1380 if (!
$_POST[
"random_test"])
1387 if ((!$this->object->isRandomTest()) && (count($this->object->questions) > 0))
1389 if (
$_POST[
"random_test"])
1398 if (!strlen(
$_POST[
"random_test"]))
1404 $random_test =
$_POST[
"random_test"];
1409 $random_test = $this->
object->isRandomTest();
1411 if ($random_test != $this->object->isRandomTest())
1413 $randomtest_switch =
true;
1418 $this->
object->setAnonymity(
$_POST[
"anonymity"]);
1419 $this->
object->setRandomTest($random_test);
1420 $this->
object->setNrOfTries(
$_POST[
"nr_of_tries"]);
1421 if (
$_POST[
'chb_starting_time'])
1427 $this->
object->setStartingTime(
'');
1430 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
1432 $this->
object->setShowInfo((
$_POST[
"showinfo"]) ? 1 : 0);
1435 $this->
object->setRedirectAfterExam(
$_POST[
"redirect_after_exam"]);
1436 $this->
object->setRedirectOnlyKioskMode((
$_POST[
"redirect_only_kiosk_mode"] ? 1 : 0));
1437 $this->
object->setExamPdf((
$_POST[
"exam_pdf"] ? 1 : 0));
1440 $this->
object->setShowFinalStatement((
$_POST[
"showfinalstatement"]) ? 1 : 0);
1441 $this->
object->setSequenceSettings((
$_POST[
"chb_postpone"]) ? 1 : 0);
1442 $this->
object->setShuffleQuestions((
$_POST[
"chb_shuffle_questions"]) ? 1 : 0);
1443 $this->
object->setListOfQuestions(
$_POST[
"list_of_questions"]);
1444 if (is_array(
$_POST[
"list_of_questions_options"]))
1446 $this->
object->setListOfQuestionsStart((in_array(
'chb_list_of_questions_start',
$_POST[
"list_of_questions_options"])) ? 1 : 0);
1447 $this->
object->setListOfQuestionsEnd((in_array(
'chb_list_of_questions_end',
$_POST[
"list_of_questions_options"])) ? 1 : 0);
1448 $this->
object->setListOfQuestionsDescription((in_array(
'chb_list_of_questions_with_description',
$_POST[
"list_of_questions_options"])) ? 1 : 0);
1452 $this->
object->setListOfQuestionsStart(0);
1453 $this->
object->setListOfQuestionsEnd(0);
1454 $this->
object->setListOfQuestionsDescription(0);
1456 $this->
object->setMailNotification(
$_POST[
"mailnotification"]);
1457 $this->
object->setMailNotificationType(
$_POST[
"mailnottype"]);
1458 $this->
object->setShowMarker((
$_POST[
"chb_show_marker"]) ? 1 : 0);
1459 $this->
object->setShowCancel((
$_POST[
"chb_show_cancel"]) ? 1 : 0);
1460 $this->
object->setAutosave((
$_POST[
"chb_autosave"]) ? 1 : 0);
1461 $this->
object->setKioskMode((
$_POST[
"kiosk"]) ? 1 : 0);
1462 $this->
object->setShowKioskModeTitle((is_array(
$_POST[
"kiosk_options"]) && in_array(
'kiosk_title',
$_POST[
"kiosk_options"])) ? 1 : 0);
1463 $this->
object->setShowKioskModeParticipant((is_array(
$_POST[
"kiosk_options"]) && in_array(
'kiosk_participant',
$_POST[
"kiosk_options"])) ? 1 : 0);
1464 $this->
object->setEnableProcessingTime((
$_POST[
"chb_processing_time"]) ? 1 : 0);
1465 if ($this->object->getEnableProcessingTime())
1467 $this->
object->setProcessingTime(sprintf(
"%02d:%02d:%02d",
1468 $_POST[
"processing_time"][
"hh"],
1469 $_POST[
"processing_time"][
"mm"],
1470 $_POST[
"processing_time"][
"ss"]
1475 $this->
object->setProcessingTime(
'');
1477 $this->
object->setResetProcessingTime((
$_POST[
"chb_reset_processing_time"]) ? 1 : 0);
1478 if (
$_POST[
'chb_ending_time'])
1484 $this->
object->setEndingTime(
'');
1486 $this->
object->setUsePreviousAnswers((
$_POST[
"chb_use_previous_answers"]) ? 1 : 0);
1487 $this->
object->setForceJS((
$_POST[
"forcejs"]) ? 1 : 0);
1488 $this->
object->setShowSerial((
$_POST[
"showserial"]) ? 1 : 0);
1489 $this->
object->setTitleOutput(
$_POST[
"title_output"]);
1490 $this->
object->setPassword(
$_POST[
"password"]);
1491 $this->
object->setAllowedUsers(
$_POST[
"allowedUsers"]);
1492 $this->
object->setAllowedUsersTimeGap(
$_POST[
"allowedUsersTimeGap"]);
1494 if ($this->object->isRandomTest())
1496 $this->
object->setUsePreviousAnswers(0);
1499 $invited_users = $this->
object->getInvitedUsers();
1500 if (!(
$total && (count($invited_users) == 0)))
1502 $fixed_participants = 0;
1503 if (array_key_exists(
"fixedparticipants",
$_POST))
1505 if (
$_POST[
"fixedparticipants"])
1507 $fixed_participants = 1;
1510 $this->
object->setFixedParticipants($fixed_participants);
1511 if (!$fixed_participants)
1513 $invited_users = $this->
object->getInvitedUsers();
1514 foreach ($invited_users as $user_object)
1516 $this->
object->disinviteUser($user_object[
"usr_id"]);
1521 $this->
object->saveToDb(
true);
1524 if ($randomtest_switch)
1526 if ($this->object->isRandomTest())
1528 $this->
object->removeNonRandomTestData();
1532 $this->
object->removeRandomTestData();
1536 $this->ctrl->redirect($this,
'properties');
1546 include_once(
"./Modules/File/classes/class.ilObjFile.php");
1548 $fileObj->sendFile();
1557 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
1560 $page_gui->showMediaFullscreen();
1569 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
1571 $pg_obj->send_paragraph (
$_GET[
"par_id"],
$_GET[
"downloadtitle"]);
1608 $this->ctrl->redirect($this,
"questions");
1622 $parent_ref = $tree->getParentId($this->object->getRefId());
1623 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
1625 $qpl->setType(
"qpl");
1626 $qpl->setTitle(
$name);
1627 $qpl->setDescription(
"");
1629 $qpl->createReference();
1630 $qpl->putInTree($parent_ref);
1631 $qpl->setPermissions($parent_ref);
1634 return $qpl->getRefId();
1644 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_random_select.html",
"Modules/Test");
1645 $questionpools =& $this->
object->getAvailableQuestionpools(FALSE, FALSE, FALSE, TRUE);
1646 $this->tpl->setCurrentBlock(
"option");
1647 $this->tpl->setVariable(
"VALUE_OPTION",
"0");
1648 $this->tpl->setVariable(
"TEXT_OPTION", $this->lng->txt(
"all_available_question_pools"));
1649 $this->tpl->parseCurrentBlock();
1650 foreach ($questionpools as $key => $value)
1652 $this->tpl->setCurrentBlock(
"option");
1653 $this->tpl->setVariable(
"VALUE_OPTION", $key);
1654 $this->tpl->setVariable(
"TEXT_OPTION", $value[
"title"]);
1655 $this->tpl->parseCurrentBlock();
1657 $this->tpl->setCurrentBlock(
"hidden");
1658 $this->tpl->setVariable(
"HIDDEN_NAME",
"sel_question_types");
1659 $this->tpl->setVariable(
"HIDDEN_VALUE",
$_POST[
"sel_question_types"]);
1660 $this->tpl->parseCurrentBlock();
1661 $this->tpl->setCurrentBlock(
"adm_content");
1662 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
1663 $this->tpl->setVariable(
"TXT_QPL_SELECT", $this->lng->txt(
"tst_random_select_questionpool"));
1664 $this->tpl->setVariable(
"TXT_NR_OF_QUESTIONS", $this->lng->txt(
"tst_random_nr_of_questions"));
1665 $this->tpl->setVariable(
"BTN_SUBMIT", $this->lng->txt(
"submit"));
1666 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
1667 $this->tpl->parseCurrentBlock();
1679 $this->ctrl->redirect($this,
"questions");
1692 $question_array = $this->
object->randomSelectQuestions(
$_POST[
"nr_of_questions"],
$_POST[
"sel_qpl"]);
1693 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_random_question_offer.html",
"Modules/Test");
1694 $color_class = array(
"tblrow1",
"tblrow2");
1696 $questionpools =& $this->
object->getAvailableQuestionpools(
true);
1697 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1698 foreach ($question_array as $question_id)
1700 $dataset = $this->
object->getQuestionDataset($question_id);
1701 $this->tpl->setCurrentBlock(
"QTab");
1702 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
1703 $this->tpl->setVariable(
"QUESTION_TITLE", $dataset->title);
1704 $this->tpl->setVariable(
"QUESTION_COMMENT", $dataset->description);
1706 $this->tpl->setVariable(
"QUESTION_AUTHOR", $dataset->author);
1707 $this->tpl->setVariable(
"QUESTION_POOL", $questionpools[$dataset->obj_fi][
"title"]);
1708 $this->tpl->parseCurrentBlock();
1711 if (count($question_array) == 0)
1713 $this->tpl->setCurrentBlock(
"Emptytable");
1714 $this->tpl->setVariable(
"TEXT_NO_QUESTIONS_AVAILABLE", $this->lng->txt(
"no_questions_available"));
1715 $this->tpl->parseCurrentBlock();
1719 $this->tpl->setCurrentBlock(
"Selectionbuttons");
1720 $this->tpl->setVariable(
"BTN_YES", $this->lng->txt(
"random_accept_sample"));
1721 $this->tpl->setVariable(
"BTN_NO", $this->lng->txt(
"random_another_sample"));
1722 $this->tpl->parseCurrentBlock();
1724 $chosen_questions = join($question_array,
",");
1725 $this->tpl->setCurrentBlock(
"adm_content");
1726 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
1727 $this->tpl->setVariable(
"QUESTION_TITLE", $this->lng->txt(
"tst_question_title"));
1728 $this->tpl->setVariable(
"QUESTION_COMMENT", $this->lng->txt(
"description"));
1729 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"tst_question_type"));
1730 $this->tpl->setVariable(
"QUESTION_AUTHOR", $this->lng->txt(
"author"));
1731 $this->tpl->setVariable(
"QUESTION_POOL", $this->lng->txt(
"qpl"));
1732 $this->tpl->setVariable(
"VALUE_CHOSEN_QUESTIONS", $chosen_questions);
1733 $this->tpl->setVariable(
"VALUE_QUESTIONPOOL_SELECTION",
$_POST[
"sel_qpl"]);
1734 $this->tpl->setVariable(
"VALUE_NR_OF_QUESTIONS",
$_POST[
"nr_of_questions"]);
1735 $this->tpl->setVariable(
"TEXT_QUESTION_OFFER", $this->lng->txt(
"tst_question_offer"));
1736 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
1737 $this->tpl->parseCurrentBlock();
1749 $selected_array = split(
",",
$_POST[
"chosen_questions"]);
1750 if (!count($selected_array))
1756 $total = $this->
object->evalTotalPersons();
1766 foreach ($selected_array as $key => $value)
1768 $this->
object->insertQuestion($value);
1770 $this->
object->saveCompleteStatus();
1772 $this->ctrl->redirect($this,
"questions");
1794 $ilUser->setPref(
"tst_question_selection_mode_equal", (
$_POST[
'chbQuestionSelectionMode']) ? 1 : 0);
1795 $ilUser->writePref(
"tst_question_selection_mode_equal", (
$_POST[
'chbQuestionSelectionMode']) ? 1 : 0);
1796 $this->
object->setRandomQuestionCount(
$_POST[
'total_questions']);
1797 if (is_array(
$_POST[
'source'][
'qpl']) && count(array_unique(
$_POST[
'source'][
'qpl'])) == count(
$_POST[
'source'][
'qpl']))
1800 include_once
"./Modules/Test/classes/class.ilRandomTestData.php";
1801 foreach (
$_POST[
'source'][
'qpl'] as $idx => $qpl)
1805 $this->
object->setRandomQuestionpoolData(
$data);
1816 $this->
object->saveRandomQuestionCount($this->object->getRandomQuestionCount());
1817 $this->
object->saveRandomQuestionpools();
1818 $this->
object->saveCompleteStatus();
1820 $this->ctrl->redirect($this,
'randomQuestions');
1827 $position = key(
$_POST[
'cmd'][
'addsource']);
1828 $this->
object->addRandomQuestionpoolData(0, 0, $position+1);
1835 $position = key(
$_POST[
'cmd'][
'removesource']);
1836 $this->
object->removeRandomQuestionpoolData($position);
1844 $total = $this->
object->evalTotalPersons();
1845 $save = (strcmp($this->ctrl->getCmd(),
"saveRandomQuestions") == 0) ? TRUE : FALSE;
1847 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1849 $form->setFormAction($this->ctrl->getFormAction($this,
'randomQuestions'));
1850 $form->setTitle($this->lng->txt(
'random_selection'));
1851 $form->setDescription($this->lng->txt(
'tst_select_random_questions'));
1852 $form->setMultipart(FALSE);
1853 $form->setTableWidth(
"100%");
1854 $form->setId(
"randomSelectionForm");
1857 $selection_mode = ($save) ?
$_POST[
'chbQuestionSelectionMode'] : $ilUser->getPref(
"tst_question_selection_mode_equal");
1858 $question_selection =
new ilCheckboxInputGUI($this->lng->txt(
"tst_question_selection"),
"chbQuestionSelectionMode");
1860 $question_selection->setChecked($selection_mode);
1861 $question_selection->setOptionTitle($this->lng->txt(
'tst_question_selection_equal'));
1862 $question_selection->setInfo($this->lng->txt(
'tst_question_selection_description'));
1863 $question_selection->setRequired(
false);
1864 $form->addItem($question_selection);
1867 $total_questions =
new ilNumberInputGUI($this->lng->txt(
'tst_total_questions'),
'total_questions');
1868 $total_questions->
setValue($this->object->getRandomQuestionCount());
1869 $total_questions->setSize(3);
1870 $total_questions->setInfo($this->lng->txt(
'tst_total_questions_description'));
1871 $total_questions->setRequired(
false);
1872 $form->addItem($total_questions);
1876 $found_qpls = $this->
object->getRandomQuestionpoolData();
1877 include_once
"./Modules/Test/classes/class.ilRandomTestData.php";
1878 if (count($found_qpls) == 0)
1882 $available_qpl =& $this->
object->getAvailableQuestionpools(TRUE, $selection_mode, FALSE, TRUE, TRUE);
1883 include_once
'./Modules/Test/classes/class.ilRandomTestInputGUI.php';
1886 $source->setRandomQuestionPools($available_qpl);
1887 $source->setUseQuestionCount((array_key_exists(
'total_questions',
$_POST)) ? (
$_POST[
'total_questions'] < 1) : ($this->object->getRandomQuestionCount() < 1));
1888 $source->setValues($found_qpls);
1889 $form->addItem($source);
1893 $qpls = $this->
object->getUsedRandomQuestionpools();
1894 include_once
'./Modules/Test/classes/class.ilRandomTestROInputGUI.php';
1897 $form->addItem($source);
1900 if (
$total == 0) $form->addCommandButton(
"saveRandomQuestions", $this->lng->txt(
"save"));
1906 $form->setValuesByPost();
1907 $errors = !$form->checkInput();
1911 if (
$_POST[
'total_questions'] > 0)
1914 foreach (
$_POST[
'source'][
'qpl'] as $idx => $qpl)
1916 $totalcount += $available_qpl[$qpl][
'count'];
1918 if (
$_POST[
'total_questions'] > $totalcount)
1920 $total_questions->setAlert($this->lng->txt(
'msg_total_questions_too_high'));
1925 if (
$errors) $checkonly =
false;
1928 if (!$checkonly) $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
1935 if (
$_POST[
"chbQuestionSelectionMode"])
1937 $ilUser->setPref(
"tst_question_selection_mode_equal", 1);
1938 $ilUser->writePref(
"tst_question_selection_mode_equal", 1);
1942 $ilUser->setPref(
"tst_question_selection_mode_equal", 0);
1943 $ilUser->writePref(
"tst_question_selection_mode_equal", 0);
1962 $qpl_ref_id =
$_POST[
"sel_qpl"];
1963 if ((strcmp(
$_POST[
"txt_qpl"],
"") == 0) && (strcmp($qpl_ref_id,
"") == 0))
1971 $_SESSION[
"test_id"] = $this->
object->getRefId();
1972 if (strcmp(
$_POST[
"txt_qpl"],
"") != 0)
1977 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPoolGUI.php";
1978 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"]);
1992 $this->ctrl->redirect($this,
"questions");
2006 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_qpl_select.html",
"Modules/Test");
2007 $questionpools =& $this->
object->getAvailableQuestionpools(FALSE, FALSE, FALSE, TRUE, FALSE,
"write");
2008 if (count($questionpools) == 0)
2010 $this->tpl->setCurrentBlock(
"option");
2011 $this->tpl->setVariable(
"VALUE_QPL",
"");
2012 $this->tpl->parseCurrentBlock();
2016 foreach ($questionpools as $key => $value)
2018 $this->tpl->setCurrentBlock(
"option");
2019 $this->tpl->setVariable(
"VALUE_OPTION", $key);
2020 $this->tpl->setVariable(
"TEXT_OPTION", $value[
"title"]);
2021 $this->tpl->parseCurrentBlock();
2024 $this->tpl->setCurrentBlock(
"hidden");
2025 $this->tpl->setVariable(
"HIDDEN_NAME",
"sel_question_types");
2026 $this->tpl->setVariable(
"HIDDEN_VALUE",
$_POST[
"sel_question_types"]);
2027 $this->tpl->parseCurrentBlock();
2028 $this->tpl->setCurrentBlock(
"adm_content");
2029 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
2031 if (count($questionpools) == 0)
2033 $this->tpl->setVariable(
"TXT_QPL_SELECT", $this->lng->txt(
"tst_enter_questionpool"));
2037 $this->tpl->setVariable(
"TXT_QPL_SELECT", $this->lng->txt(
"tst_select_questionpool"));
2039 $this->tpl->setVariable(
"BTN_SUBMIT", $this->lng->txt(
"submit"));
2040 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
2041 $this->tpl->parseCurrentBlock();
2054 $checked_questions = array();
2055 foreach (
$_POST as $key => $value) {
2056 if (preg_match(
"/id_(\d+)/", $key, $matches)) {
2057 array_push($checked_questions, $matches[1]);
2060 foreach ($checked_questions as $key => $value) {
2061 $this->
object->removeQuestion($value);
2063 $this->
object->saveCompleteStatus();
2064 $this->ctrl->redirect($this,
"questions");
2076 $this->ctrl->redirect($this,
"questions");
2089 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_remove_questions.html",
"Modules/Test");
2090 $removablequestions =& $this->
object->getTestQuestions();
2091 $colors = array(
"tblrow1",
"tblrow2");
2093 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
2094 if (count($removablequestions))
2096 foreach ($removablequestions as
$data)
2098 if (in_array($data[
"question_id"], $checked_questions))
2100 $this->tpl->setCurrentBlock(
"row");
2101 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
2102 $this->tpl->setVariable(
"TXT_TITLE", $data[
"title"]);
2103 $this->tpl->setVariable(
"TXT_DESCRIPTION", $data[
"description"]);
2105 $this->tpl->parseCurrentBlock();
2110 foreach ($checked_questions as $id)
2112 $this->tpl->setCurrentBlock(
"hidden");
2113 $this->tpl->setVariable(
"HIDDEN_NAME",
"id_$id");
2114 $this->tpl->setVariable(
"HIDDEN_VALUE",
"1");
2115 $this->tpl->parseCurrentBlock();
2118 $this->tpl->setCurrentBlock(
"adm_content");
2119 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"tst_question_title"));
2120 $this->tpl->setVariable(
"TXT_DESCRIPTION", $this->lng->txt(
"description"));
2121 $this->tpl->setVariable(
"TXT_TYPE", $this->lng->txt(
"tst_question_type"));
2122 $this->tpl->setVariable(
"BTN_CONFIRM", $this->lng->txt(
"confirm"));
2123 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
2124 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
2125 $this->tpl->parseCurrentBlock();
2138 $checked_questions =
$_POST[
"q_id"];
2139 if (count($checked_questions) > 0)
2141 $total = $this->
object->evalTotalPersons();
2154 elseif (count($checked_questions) == 0)
2156 ilUtil::sendInfo($this->lng->txt(
"tst_no_question_selected_for_removal"),
true);
2157 $this->ctrl->redirect($this,
"questions");
2166 $_SESSION[
'tst_qst_move_' . $this->
object->getTestId()] =
$_POST[
'q_id'];
2168 $this->ctrl->redirect($this,
'questions');
2177 $move_questions =
$_SESSION[
'tst_qst_move_' . $this->
object->getTestId()];
2179 if (count(
$_POST[
'q_id']) == 0)
2182 $this->ctrl->redirect($this,
'questions');
2184 if (count(
$_POST[
'q_id']) > 1)
2187 $this->ctrl->redirect($this,
'questions');
2190 $this->
object->moveQuestions(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()],
$_POST[
'q_id'][0], $insert_mode);
2192 unset(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()]);
2193 $this->ctrl->redirect($this,
"questions");
2202 $move_questions =
$_SESSION[
'tst_qst_move_' . $this->
object->getTestId()];
2203 if (count(
$_POST[
'q_id']) == 0)
2206 $this->ctrl->redirect($this,
'questions');
2208 if (count(
$_POST[
'q_id']) > 1)
2211 $this->ctrl->redirect($this,
'questions');
2214 $this->
object->moveQuestions(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()],
$_POST[
'q_id'][0], $insert_mode);
2216 unset(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()]);
2217 $this->ctrl->redirect($this,
"questions");
2227 $selected_array = (is_array(
$_POST[
'q_id'])) ?
$_POST[
'q_id'] : array();
2228 if (!count($selected_array))
2231 $this->ctrl->redirect($this,
"browseForQuestions");
2235 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
2236 $manscoring = FALSE;
2237 foreach ($selected_array as $key => $value)
2239 $this->
object->insertQuestion($value);
2245 $this->
object->saveCompleteStatus();
2254 $this->ctrl->redirect($this,
"questions");
2261 include_once
"./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
2263 $table_gui->writeFilterToSession();
2264 $this->ctrl->redirect($this,
"browseForQuestions");
2269 include_once
"./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
2271 $table_gui->resetFilter();
2272 $this->ctrl->redirect($this,
"browseForQuestions");
2284 $this->ctrl->setParameterByClass(get_class($this),
"browse",
"1");
2286 include_once
"./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
2287 $table_gui =
new ilTestQuestionBrowserTableGUI($this,
'browseForQuestions', (($ilAccess->checkAccess(
"write",
"", $this->ref_id) ?
true :
false)));
2288 $arrFilter = array();
2289 foreach ($table_gui->getFilterItems() as $item)
2291 if ($item->getValue() !==
false)
2293 $arrFilter[$item->getPostVar()] = $item->getValue();
2296 $data = $this->
object->getAvailableQuestions($arrFilter, 1);
2297 $table_gui->setData(
$data);
2298 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
2304 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
2308 $this->ctrl->redirect($this,
"infoScreen");
2310 if (
$_GET[
'browse'])
2312 return $this->questionbrowser();
2316 if ($this->object->isRandomTest())
2324 ilUtil::redirect(
"ilias.php?baseClass=ilObjQuestionPoolGUI&ref_id=" .
$_GET[
"eqpl"] .
"&cmd=editQuestionForTest&calling_test=".
$_GET[
"ref_id"].
"&q_id=" .
$_GET[
"eqid"]);
2327 if (
$_GET[
"up"] > 0)
2329 $this->
object->questionMoveUp(
$_GET[
"up"]);
2331 if (
$_GET[
"down"] > 0)
2333 $this->
object->questionMoveDown(
$_GET[
"down"]);
2338 $selected_array = array();
2339 array_push($selected_array,
$_GET[
"add"]);
2340 $total = $this->
object->evalTotalPersons();
2350 $this->insertQuestions($selected_array);
2354 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_questions.html",
"Modules/Test");
2356 $total = $this->
object->evalTotalPersons();
2357 if (($ilAccess->checkAccess(
"write",
"", $this->ref_id) and (
$total == 0)))
2360 $lastquestiontype = $ilUser->getPref(
"tst_lastquestiontype");
2361 $this->tpl->setCurrentBlock(
"QTypes");
2362 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
2364 foreach ($question_types as $trans =>
$data)
2366 if (
$data[
"type_tag"] == $lastquestiontype)
2368 $this->tpl->setVariable(
"QUESTION_TYPE_SELECTED",
" selected=\"selected\"");
2370 $this->tpl->setVariable(
"QUESTION_TYPE_ID",
$data[
"type_tag"]);
2371 $this->tpl->setVariable(
"QUESTION_TYPE", $trans);
2372 $this->tpl->parseCurrentBlock();
2374 $this->tpl->parseCurrentBlock();
2377 if (($ilAccess->checkAccess(
"write",
"", $this->ref_id) and (
$total == 0)))
2379 $this->tpl->setVariable(
"BUTTON_INSERT_QUESTION", $this->lng->txt(
"tst_browse_for_questions"));
2380 $this->tpl->setVariable(
"TEXT_CREATE_NEW",
" " . strtolower($this->lng->txt(
"or")) .
" " . $this->lng->txt(
"create_new"));
2381 $this->tpl->setVariable(
"BUTTON_CREATE_QUESTION", $this->lng->txt(
"create"));
2382 $this->tpl->setVariable(
"TXT_OR", $this->lng->txt(
"or"));
2383 $this->tpl->setVariable(
"TEXT_RANDOM_SELECT", $this->lng->txt(
"random_selection"));
2386 $this->tpl->setCurrentBlock(
"adm_content");
2387 include_once
"./Modules/Test/classes/tables/class.ilTestQuestionsTableGUI.php";
2388 $checked_move = is_array(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()]) && (count(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()]));
2389 $table_gui =
new ilTestQuestionsTableGUI($this,
'questions', (($ilAccess->checkAccess(
"write",
"", $this->ref_id) ?
true :
false)), $checked_move,
$total);
2390 $data = $this->
object->getTestQuestions();
2391 $table_gui->setData($data);
2392 $this->tpl->setVariable(
'QUESTIONBROWSER', $table_gui->getHTML());
2393 $this->tpl->setVariable(
"ACTION_QUESTION_FORM", $this->ctrl->getFormAction($this));
2394 $this->tpl->parseCurrentBlock();
2410 $this->
object->mark_schema->addMarkStep();
2423 $this->
object->mark_schema->flush();
2424 foreach (
$_POST as $key => $value) {
2425 if (preg_match(
"/mark_short_(\d+)/", $key, $matches))
2430 $this->
object->ects_grades[
"A"] =
$_POST[
"ects_grade_a"];
2431 $this->
object->ects_grades[
"B"] =
$_POST[
"ects_grade_b"];
2432 $this->
object->ects_grades[
"C"] =
$_POST[
"ects_grade_c"];
2433 $this->
object->ects_grades[
"D"] =
$_POST[
"ects_grade_d"];
2434 $this->
object->ects_grades[
"E"] =
$_POST[
"ects_grade_e"];
2437 $this->
object->ects_fx =
$_POST[
"percentFX"];
2441 $this->
object->ects_fx =
"";
2443 $this->
object->ects_output =
$_POST[
"chbECTS"];
2455 $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);
2469 $delete_mark_steps = array();
2470 foreach (
$_POST as $key => $value) {
2471 if (preg_match(
"/cb_(\d+)/", $key, $matches)) {
2472 array_push($delete_mark_steps, $matches[1]);
2475 if (count($delete_mark_steps)) {
2476 $this->
object->mark_schema->deleteMarkSteps($delete_mark_steps);
2492 $this->ctrl->redirect($this,
"marks");
2506 $mark_check = $this->
object->checkMarks();
2507 if ($mark_check !==
true)
2511 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)))
2515 elseif ((
$_POST[
"ects_grade_a"] > 100) or (
$_POST[
"ects_grade_a"] < 0))
2519 elseif ((
$_POST[
"ects_grade_b"] > 100) or (
$_POST[
"ects_grade_b"] < 0))
2523 elseif ((
$_POST[
"ects_grade_c"] > 100) or (
$_POST[
"ects_grade_c"] < 0))
2527 elseif ((
$_POST[
"ects_grade_d"] > 100) or (
$_POST[
"ects_grade_d"] < 0))
2531 elseif ((
$_POST[
"ects_grade_e"] > 100) or (
$_POST[
"ects_grade_e"] < 0))
2537 $this->
object->mark_schema->saveToDb($this->object->getTestId());
2538 $this->
object->saveCompleteStatus();
2539 if ($this->object->getReportingDate())
2556 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
2560 $this->ctrl->redirect($this,
"infoScreen");
2563 if (!$this->object->canEditMarks())
2568 $this->
object->mark_schema->sort();
2570 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_marks.html",
"Modules/Test");
2571 $marks = $this->
object->mark_schema->mark_steps;
2572 $rows = array(
"tblrow1",
"tblrow2");
2574 foreach ($marks as $key => $value) {
2575 $this->tpl->setCurrentBlock(
"markrow");
2576 $this->tpl->setVariable(
"MARK_SHORT", $value->getShortName());
2577 $this->tpl->setVariable(
"MARK_OFFICIAL", $value->getOfficialName());
2578 $this->tpl->setVariable(
"MARK_PERCENTAGE", sprintf(
"%.2f", $value->getMinimumLevel()));
2579 $this->tpl->setVariable(
"MARK_PASSED", strtolower($this->lng->txt(
"tst_mark_passed")));
2580 $this->tpl->setVariable(
"MARK_ID",
"$key");
2581 $this->tpl->setVariable(
"ROW_CLASS", $rows[$counter % 2]);
2582 if ($value->getPassed()) {
2583 $this->tpl->setVariable(
"MARK_PASSED_CHECKED",
" checked=\"checked\"");
2585 $this->tpl->parseCurrentBlock();
2588 if (count($marks) == 0)
2590 $this->tpl->setCurrentBlock(
"Emptyrow");
2591 $this->tpl->setVariable(
"EMPTY_ROW", $this->lng->txt(
"tst_no_marks_defined"));
2592 $this->tpl->setVariable(
"ROW_CLASS", $rows[$counter % 2]);
2593 $this->tpl->parseCurrentBlock();
2597 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) && $this->
object->canEditMarks())
2599 $this->tpl->setCurrentBlock(
"selectall");
2601 $this->tpl->setVariable(
"ROW_CLASS", $rows[$counter % 2]);
2602 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
2603 $this->tpl->parseCurrentBlock();
2604 $this->tpl->setCurrentBlock(
"Footer");
2605 $this->tpl->setVariable(
"ARROW",
"<img src=\"" .
ilUtil::getImagePath(
"arrow_downright.gif") .
"\" alt=\"".$this->lng->txt(
"arrow_downright").
"\"/>");
2606 $this->tpl->setVariable(
"BUTTON_EDIT", $this->lng->txt(
"edit"));
2607 $this->tpl->setVariable(
"BUTTON_DELETE", $this->lng->txt(
"delete"));
2608 $this->tpl->parseCurrentBlock();
2612 if ($this->object->getReportingDate())
2614 $this->tpl->setCurrentBlock(
"ects");
2615 if ($this->object->ects_output)
2617 $this->tpl->setVariable(
"CHECKED_ECTS",
" checked=\"checked\"");
2619 $this->tpl->setVariable(
"TEXT_OUTPUT_ECTS_GRADES", $this->lng->txt(
"ects_output_of_ects_grades"));
2620 $this->tpl->setVariable(
"TEXT_ALLOW_ECTS_GRADES", $this->lng->txt(
"ects_allow_ects_grades"));
2621 $this->tpl->setVariable(
"TEXT_USE_FX", $this->lng->txt(
"ects_use_fx_grade"));
2622 if (preg_match(
"/\d+/", $this->object->ects_fx))
2624 $this->tpl->setVariable(
"CHECKED_FX",
" checked=\"checked\"");
2625 $this->tpl->setVariable(
"VALUE_PERCENT_FX", sprintf(
"value=\"%s\" ", $this->object->ects_fx));
2627 $this->tpl->setVariable(
"TEXT_PERCENT", $this->lng->txt(
"ects_use_fx_grade_part2"));
2628 $this->tpl->setVariable(
"ECTS_GRADE", $this->lng->txt(
"ects_grade"));
2629 $this->tpl->setVariable(
"PERCENTILE", $this->lng->txt(
"percentile"));
2630 $this->tpl->setVariable(
"ECTS_GRADE_A",
"A - " . $this->lng->txt(
"ects_grade_a_short"));
2631 $this->tpl->setVariable(
"VALUE_GRADE_A", $this->object->ects_grades[
"A"]);
2632 $this->tpl->setVariable(
"ECTS_GRADE_B",
"B - " . $this->lng->txt(
"ects_grade_b_short"));
2633 $this->tpl->setVariable(
"VALUE_GRADE_B", $this->object->ects_grades[
"B"]);
2634 $this->tpl->setVariable(
"ECTS_GRADE_C",
"C - " . $this->lng->txt(
"ects_grade_c_short"));
2635 $this->tpl->setVariable(
"VALUE_GRADE_C", $this->object->ects_grades[
"C"]);
2636 $this->tpl->setVariable(
"ECTS_GRADE_D",
"D - " . $this->lng->txt(
"ects_grade_d_short"));
2637 $this->tpl->setVariable(
"VALUE_GRADE_D", $this->object->ects_grades[
"D"]);
2638 $this->tpl->setVariable(
"ECTS_GRADE_E",
"E - " . $this->lng->txt(
"ects_grade_e_short"));
2639 $this->tpl->setVariable(
"VALUE_GRADE_E", $this->object->ects_grades[
"E"]);
2641 $this->tpl->parseCurrentBlock();
2644 $this->tpl->setCurrentBlock(
"adm_content");
2645 $this->tpl->setVariable(
"ACTION_MARKS", $this->ctrl->getFormAction($this));
2646 $this->tpl->setVariable(
"HEADER_SHORT", $this->lng->txt(
"tst_mark_short_form"));
2647 $this->tpl->setVariable(
"HEADER_OFFICIAL", $this->lng->txt(
"tst_mark_official_form"));
2648 $this->tpl->setVariable(
"HEADER_PERCENTAGE", $this->lng->txt(
"tst_mark_minimum_level"));
2649 $this->tpl->setVariable(
"HEADER_PASSED", $this->lng->txt(
"tst_mark_passed"));
2650 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) && $this->
object->canEditMarks())
2652 $this->tpl->setVariable(
"BUTTON_NEW", $this->lng->txt(
"tst_mark_create_new_mark_step"));
2653 $this->tpl->setVariable(
"BUTTON_NEW_SIMPLE", $this->lng->txt(
"tst_mark_create_simple_mark_schema"));
2654 $this->tpl->setVariable(
"SAVE", $this->lng->txt(
"save"));
2655 $this->tpl->setVariable(
"CANCEL", $this->lng->txt(
"cancel"));
2657 $this->tpl->parseCurrentBlock();
2669 $this->
object->removeAllTestEditings();
2671 $this->ctrl->redirect($this,
"participants");
2683 $active_ids = array();
2684 foreach (
$_POST[
"chbUser"] as $active_id)
2686 if ($this->object->getFixedParticipants())
2688 array_push($active_ids, $this->object->getActiveIdOfUser($active_id));
2692 array_push($active_ids, $active_id);
2695 $this->
object->removeSelectedTestResults($active_ids);
2697 $this->ctrl->redirect($this,
"participants");
2709 $this->ctrl->redirect($this,
"participants");
2722 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_maintenance.html",
"Modules/Test");
2724 $this->tpl->setCurrentBlock(
"confirm_delete");
2725 $this->tpl->setVariable(
"BTN_CONFIRM_DELETE_ALL", $this->lng->txt(
"confirm"));
2726 $this->tpl->setVariable(
"BTN_CANCEL_DELETE_ALL", $this->lng->txt(
"cancel"));
2727 $this->tpl->parseCurrentBlock();
2729 $this->tpl->setCurrentBlock(
"adm_content");
2730 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
2731 $this->tpl->parseCurrentBlock();
2740 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html",
"Modules/Test");
2741 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"participants"));
2744 $buttons = array(
"confirmDeleteAllUserResults" => $this->lng->txt(
"proceed"),
2745 "participants" => $this->lng->txt(
"cancel"));
2746 foreach ($buttons as
$name => $value)
2748 $this->tpl->setCurrentBlock(
"operation_btn");
2749 $this->tpl->setVariable(
"BTN_NAME",
$name);
2750 $this->tpl->setVariable(
"BTN_VALUE",$value);
2751 $this->tpl->parseCurrentBlock();
2764 if (count(
$_POST[
"chbUser"]) == 0)
2767 $this->ctrl->redirect($this,
"participants");
2770 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_maintenance.html",
"Modules/Test");
2772 foreach (
$_POST[
"chbUser"] as $key => $value)
2774 $this->tpl->setCurrentBlock(
"hidden");
2775 $this->tpl->setVariable(
"USER_ID", $value);
2776 $this->tpl->parseCurrentBlock();
2779 include_once
'./Services/User/classes/class.ilObjUser.php';
2780 $color_class = array(
"tblrow1",
"tblrow2");
2782 foreach (
$_POST[
"chbUser"] as $key => $active_id)
2784 if ($this->object->getFixedParticipants())
2786 $user_id = $active_id;
2790 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
2793 $this->tpl->setCurrentBlock(
"row");
2795 $this->tpl->setVariable(
"USER_ALT", $this->lng->txt(
"usr"));
2796 $this->tpl->setVariable(
"USER_TITLE", $this->lng->txt(
"usr"));
2797 if ($this->object->getAnonymity())
2799 $this->tpl->setVariable(
"TXT_FIRSTNAME",
"");
2800 $this->tpl->setVariable(
"TXT_LASTNAME", $this->lng->txt(
"unknown"));
2801 $this->tpl->setVariable(
"TXT_LOGIN",
"");
2805 $this->tpl->setVariable(
"TXT_FIRSTNAME", $user[
"firstname"]);
2806 if (strlen($user[
"lastname"]))
2808 $this->tpl->setVariable(
"TXT_LASTNAME", $user[
"lastname"]);
2812 $this->tpl->setVariable(
"TXT_LASTNAME", $this->lng->txt(
"deleted_user"));
2816 $this->tpl->setVariable(
"ROW_CLASS", $color_class[$counter % 2]);
2817 $this->tpl->parseCurrentBlock();
2820 $this->tpl->setCurrentBlock(
"selectedusers");
2821 $this->tpl->setVariable(
"HEADER_TXT_FIRSTNAME", $this->lng->txt(
"firstname"));
2822 $this->tpl->setVariable(
"HEADER_TXT_LASTNAME", $this->lng->txt(
"lastname"));
2823 $this->tpl->setVariable(
"HEADER_TXT_LOGIN", $this->lng->txt(
"login"));
2824 $this->tpl->setVariable(
"BTN_CONFIRM_DELETE_SELECTED", $this->lng->txt(
"confirm"));
2825 $this->tpl->setVariable(
"BTN_CANCEL_DELETE_SELECTED", $this->lng->txt(
"cancel"));
2826 $this->tpl->parseCurrentBlock();
2828 $this->tpl->setCurrentBlock(
"adm_content");
2829 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
2830 $this->tpl->parseCurrentBlock();
2842 include_once
"./Modules/Test/classes/tables/class.ilTestHistoryTableGUI.php";
2844 $table_gui->setTestObject($this->
object);
2845 include_once
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
2847 $table_gui->setData(
$log);
2848 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
2858 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"], $new_type))
2860 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
2866 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
2868 $questionpools =& $tst->getAvailableQuestionpools(TRUE, FALSE, TRUE, TRUE);
2869 if (count($questionpools) == 0)
2874 foreach ($questionpools as $key => $value)
2876 $this->tpl->setCurrentBlock(
"option_qpl");
2877 $this->tpl->setVariable(
"OPTION_VALUE", $key);
2878 $this->tpl->setVariable(
"TXT_OPTION", $value[
"title"]);
2879 if (
$_POST[
"qpl"] == $key)
2881 $this->tpl->setVariable(
"OPTION_SELECTED",
" selected=\"selected\"");
2883 $this->tpl->parseCurrentBlock();
2887 $defaults =& $tst->getAvailableDefaults();
2888 if (count($defaults))
2890 foreach ($defaults as
$row)
2892 $this->tpl->setCurrentBlock(
"defaults_row");
2893 $this->tpl->setVariable(
"DEFAULTS_VALUE", $row[
"test_defaults_id"]);
2895 $this->tpl->parseCurrentBlock();
2897 $this->tpl->setCurrentBlock(
"defaults");
2898 $this->tpl->setVariable(
"TXT_DEFAULTS", $this->lng->txt(
"defaults"));
2899 $this->tpl->setVariable(
"TEXT_NO_DEFAULTS", $this->lng->txt(
"tst_defaults_dont_use"));
2900 $this->tpl->parseCurrentBlock();
2905 $this->tpl->setCurrentBlock(
"adm_content");
2909 $data[
"fields"] = array();
2911 $data[
"fields"][
"desc"] =
$_SESSION[
"error_post_vars"][
"Fobject"][
"desc"];
2912 foreach (
$data[
"fields"] as $key => $val)
2914 $this->tpl->setVariable(
"TXT_".strtoupper($key), $this->lng->txt($key));
2915 $this->tpl->setVariable(strtoupper($key), $val);
2917 if ($this->prepare_output)
2919 $this->tpl->parseCurrentBlock();
2922 $this->ctrl->setParameter($this,
"new_type", $new_type);
2923 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
'save'));
2924 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt($new_type.
"_new"));
2925 $this->tpl->setVariable(
"TXT_SELECT_QUESTIONPOOL", $this->lng->txt(
"select_questionpool"));
2926 $this->tpl->setVariable(
"OPTION_SELECT_QUESTIONPOOL", $this->lng->txt(
"dont_use_questionpool"));
2927 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
2928 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt($new_type.
"_add"));
2929 $this->tpl->setVariable(
"CMD_SUBMIT",
"save");
2931 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
2933 $this->tpl->setVariable(
"TXT_IMPORT_TST", $this->lng->txt(
"import_tst"));
2934 $this->tpl->setVariable(
"TXT_TST_FILE", $this->lng->txt(
"tst_upload_file"));
2935 $this->tpl->setVariable(
"TXT_IMPORT", $this->lng->txt(
"import"));
2938 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
"obj_tst"));
2940 $this->tpl->setVariable(
"ALT_IMG2",$this->lng->txt(
"obj_tst"));
2941 $this->tpl->setVariable(
"NEW_TYPE", $new_type);
2942 $this->tpl->parseCurrentBlock();
2958 if (method_exists($this, $method))
2964 $this->ctrl->redirect($this,
"participants");
2974 global $ilAccess, $ilToolbar;
2976 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
2980 $this->ctrl->redirect($this,
"infoScreen");
2983 if ($this->object->getFixedParticipants())
2986 $ilToolbar->addButton($this->lng->txt(
"tst_search_users"),
2987 $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start'));
2990 $participants =& $this->
object->getInvitedUsers();
2992 foreach ($participants as
$data)
2994 $maxpass = $this->
object->_getMaxPass($data[
"active_id"]);
2995 if (!is_null($maxpass))
3000 if (strlen($data[
"active_id"]))
3002 $last_access = $this->
object->_getLastAccess($data[
"active_id"]);
3005 $this->ctrl->setParameterByClass(
'iltestevaluationgui',
'active_id', $data[
'active_id']);
3006 array_push($rows, array(
3007 'usr_id' => $data[
"usr_id"],
3008 'active_id' => $data[
'active_id'],
3009 'login' => $data[
"login"],
3010 'clientip' => $data[
"clientip"],
3011 'name' => trim($data[
"lastname"] .
", " . $data[
"firstname"] .
" " . $data[
"title"]),
3012 'firstname' => $data[
"firstname"],
3013 'lastname' => $data[
"lastname"],
3014 'started' => ($data[
"active_id"] > 0) ? 1 : 0,
3015 'finished' => ($data[
"test_finished"] == 1) ? 1 : 0,
3016 'access' => $access,
3017 'maxpass' => $maxpass,
3018 'result' => $this->ctrl->getLinkTargetByClass(
'iltestevaluationgui',
'outParticipantsResultsOverview')
3021 include_once
"./Modules/Test/classes/tables/class.ilTestFixedParticipantsTableGUI.php";
3024 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
3028 $participants =& $this->
object->getTestParticipants();
3030 foreach ($participants as
$data)
3032 $maxpass = $this->
object->_getMaxPass($data[
"active_id"]);
3033 if (!is_null($maxpass))
3038 if (strlen($data[
"active_id"]))
3040 $last_access = $this->
object->_getLastAccess($data[
"active_id"]);
3043 $this->ctrl->setParameterByClass(
'iltestevaluationgui',
'active_id', $data[
'active_id']);
3044 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
3046 array_push($rows, array(
3047 'usr_id' => $data[
"active_id"],
3048 'active_id' => $data[
'active_id'],
3049 'login' => $data[
"login"],
3050 'name' => $fullname,
3051 'firstname' => $data[
"firstname"],
3052 'lastname' => $data[
"lastname"],
3053 'started' => ($data[
"active_id"] > 0) ? 1 : 0,
3054 'finished' => ($data[
"test_finished"] == 1) ? 1 : 0,
3055 'access' => $access,
3056 'maxpass' => $maxpass,
3057 'result' => $this->ctrl->getLinkTargetByClass(
'iltestevaluationgui',
'outParticipantsResultsOverview')
3060 include_once
"./Modules/Test/classes/tables/class.ilTestParticipantsTableGUI.php";
3063 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
3078 $this->
showUserResults($show_pass_details = TRUE, $show_answers = TRUE, $show_reached_points = TRUE);
3092 $this->
showUserResults($show_pass_details = FALSE, $show_answers = TRUE);
3106 $this->
showUserResults($show_pass_details = TRUE, $show_answers = FALSE);
3116 $template =
new ilTemplate(
"tpl.il_as_tst_participants_result_output.html", TRUE, TRUE,
"Modules/Test");
3118 if (count(
$_SESSION[
"show_user_results"]) == 0)
3121 $this->ctrl->redirect($this,
"participants");
3124 include_once
"./Modules/Test/classes/class.ilTestServiceGUI.php";
3127 foreach (
$_SESSION[
"show_user_results"] as $key => $active_id)
3131 if ($this->object->getFixedParticipants())
3133 $active_id = $this->
object->getActiveIdOfUser($active_id);
3137 $results = $serviceGUI->getResultsOfUserOutput($active_id, $this->object->_getResultPass($active_id), $show_pass_details, $show_answers, FALSE, $show_reached_points);
3139 if ($count < count(
$_SESSION[
"show_user_results"]))
3141 $template->touchBlock(
"break");
3143 $template->setCurrentBlock(
"user_result");
3144 $template->setVariable(
"USER_RESULT",
$results);
3145 $template->parseCurrentBlock();
3147 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"back"));
3148 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"participants"));
3149 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
3150 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
3152 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
3154 if ($this->object->getShowSolutionAnswersOnly())
3169 global
$ilias, $ilAccess;
3170 include_once
'class.ilTestServiceGUI.php';
3171 include_once
'./Services/PDF/classes/class.ilHTMLToPDFTransformer.php';
3174 $htmlArray = array();
3175 $pdfHolder = array();
3177 $this->inst_id = IL_INST_ID;
3178 $this->export_dir = $this->
object->getExportDirectory();
3180 $subdir = $date.
"__".$this->inst_id.
"__".
"test__PDF-Export__".$this->object->getId();
3181 include_once
"./Services/Utilities/classes/class.ilUtil.php";
3189 foreach ($allUsers as $user)
3193 $result_array =& $this->
object->getTestResult($user[
"active_id"],
$pass);
3194 $overview = $serviceGUI->getPassDetailsOverview($result_array, $user[
"active_id"],
$pass,
"iltestevaluationgui",
"outParticipantsPassDetails");
3195 $user_data = $serviceGUI->getResultsUserdata($user[
"active_id"], FALSE);
3196 $user_id = $this->
object->_getUserIdFromActiveId($user[
"active_id"]);
3198 $template =
new ilTemplate(
"tpl.il_as_tst_pass_details_overview_participants.html", TRUE, TRUE,
"Modules/Test");
3201 include_once
'./Services/PDF/classes/class.ilHTMLToPDFTransformer.php';
3204 $this->ctrl->setParameter($this,
"pdf",
"1");
3205 $template->setCurrentBlock(
"pdf_export");
3206 $template->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this,
"outParticipantsPassDetails"));
3207 $this->ctrl->setParameter($this,
"pdf",
"");
3208 $template->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
3209 $template->setVariable(
"PDF_IMG_ALT", $this->lng->txt(
"pdf_export"));
3211 $template->parseCurrentBlock();
3214 if (array_key_exists(
"statistics",
$_GET) && (
$_GET[
"statistics"] == 1))
3216 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"back"));
3217 $this->ctrl->setParameterByClass(
"ilTestEvaluationGUI",
"active_id", $active_id);
3218 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilTestEvaluationGUI",
"detailedEvaluation"));
3222 if ($this->object->getNrOfTries() == 1)
3224 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"back"));
3225 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"participants"));
3229 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(get_class($this),
"outParticipantsResultsOverview"));
3230 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_overview"));
3234 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
3235 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
3237 if ($this->object->getNrOfTries() == 1)
3239 $statement = $this->
object->getFinalStatement($user[
"active_id"]);
3240 $template->setVariable(
"USER_MARK", $statement[
"mark"]);
3241 if (strlen($statement[
"markects"]))
3243 $template->setVariable(
"USER_MARK_ECTS", $statement[
"markects"]);
3247 $list_of_answers = $serviceGUI->getPassListOfAnswers($result_array, $user[
"active_id"],
$pass, TRUE);
3248 $template->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
3249 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_results"));
3250 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
3251 $template->setVariable(
"PASS_DETAILS", $overview);
3252 $template->setVariable(
"USER_DETAILS", $user_data);
3255 $unameShort = utf8_encode($this->object->userLookupFullName($user_id));
3257 if($uname[
'lastname']==
"anonymous" && $uname[
'firstname']==
"anonymous" && $uname[
'login']==
"anonymous")
3260 $pdfName=$uname.
"-".$user[
"active_id"].
"-".$user[
"user_fi"].
"-".$date;
3264 $pdfName=iconv(
'UTF-8',
'UTF-8//TRANSLIT', $uname[
'lastname']).
"_".iconv(
'UTF-8',
'UTF-8//TRANSLIT', $uname[
'firstname']).
"_".$uname[
'login'].
"-".$this->
object->getTitle().
"-".$date;
3267 $template->setVariable(
"USER_NAME", sprintf($this->lng->txt(
"tst_result_user_name_pass"),
$pass + 1, $unameShort));
3270 if ($this->object->getShowSolutionAnswersOnly())
3275 $this->
object->deliverPDFFromHTML($template->get(), $this->
object->getTitle(), $this->export_dir.
"/".$subdir.
"/".$pdfName.
".pdf");
3279 $this->export_dir.
"/".$subdir.
".zip");
3291 $participants = array();
3293 $result = $ilDB->queryF(
"SELECT * FROM tst_active WHERE test_fi = %s",
3295 array($this->object->test_id)
3298 if ($result->numRows())
3300 while (
$row = $ilDB->fetchAssoc($result))
3302 $user[
"active_id"] =
$row[
"active_id"];
3303 $user[
"user_fi"] =
$row[
"user_fi"];
3304 array_push($participants, $user);
3306 return $participants;
3319 if (is_array(
$_POST[
"chbUser"]))
3321 foreach (
$_POST[
"chbUser"] as $user_id)
3323 $this->
object->disinviteUser($user_id);
3330 $this->ctrl->redirect($this,
"participants");
3335 if (is_array(
$_POST[
"chbUser"]))
3337 foreach (
$_POST[
"chbUser"] as $user_id)
3339 $this->
object->setClientIP($user_id,
$_POST[
"clientip_".$user_id]);
3346 $this->ctrl->redirect($this,
"participants");
3358 global $ilAccess,
$ilias;
3359 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
3363 $this->ctrl->redirect($this,
"infoScreen");
3366 $template =
new ilTemplate(
"tpl.il_as_tst_print_test_confirm.html", TRUE, TRUE,
"Modules/Test");
3368 include_once
'./Services/PDF/classes/class.ilHTMLToPDFTransformer.php';
3371 $this->ctrl->setParameter($this,
"pdf",
"1");
3372 $template->setCurrentBlock(
"pdf_export");
3373 $template->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this,
"print"));
3374 $this->ctrl->setParameter($this,
"pdf",
"");
3375 $template->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
3376 $template->setVariable(
"PDF_IMG_ALT", $this->lng->txt(
"pdf_export"));
3378 $template->parseCurrentBlock();
3384 $print_date = mktime(date(
"H"), date(
"i"), date(
"s"), date(
"m") , date(
"d"), date(
"Y"));
3388 foreach ($this->object->questions as $question)
3390 $template->setCurrentBlock(
"question");
3391 $question_gui = $this->
object->createQuestionGUI(
"", $question);
3392 $template->setVariable(
"COUNTER_QUESTION", $counter.
".");
3393 $template->setVariable(
"QUESTION_ID", $question_gui->object->getId());
3395 if ($question_gui->object->getMaximumPoints() == 1)
3397 $template->setVariable(
"QUESTION_POINTS", $question_gui->object->getMaximumPoints() .
" " . $this->lng->txt(
"point"));
3401 $template->setVariable(
"QUESTION_POINTS", $question_gui->object->getMaximumPoints() .
" " . $this->lng->txt(
"points"));
3403 $result_output = $question_gui->getSolutionOutput(
"", NULL, FALSE, TRUE, FALSE, $this->object->getShowSolutionFeedback());
3404 if (strlen($result_output) == 0) $result_output = $question_gui->getPreview(FALSE);
3405 $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
3406 $template->parseCurrentBlock(
"question");
3408 $max_points += $question_gui->object->getMaximumPoints();
3411 $template->setCurrentBlock(
"navigation_buttons");
3412 $template->setVariable(
"BUTTON_PRINT", $this->lng->txt(
"print"));
3413 $template->parseCurrentBlock();
3422 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1))
3424 $this->
object->deliverPDFFromHTML($template->get(), $this->
object->getTitle());
3428 $this->tpl->setVariable(
"PRINT_CONTENT", $template->get());
3436 if (is_array(
$_POST[
"user"]))
3439 foreach (
$_POST[
"user"] as $user_id)
3441 $client_ip =
$_POST[
"client_ip"][$i];
3442 $this->
object->inviteUser($user_id, $client_ip);
3450 $message = $this->lng->txt(
"tst_invited_selected_users");
3452 if (strlen($message))
3461 $this->ctrl->redirect($this,
"participants");
3474 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
3478 $this->ctrl->redirect($this,
"infoScreen");
3481 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_defaults.html",
"Modules/Test");
3483 $maxentries = $ilUser->getPref(
"hits_per_page");
3484 if ($maxentries < 1)
3489 $offset =
$_GET[
"offset"] ?
$_GET[
"offset"] : 0;
3490 $sortby =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"name";
3491 $sortorder =
$_GET[
"sort_order"] ?
$_GET[
"sort_order"] :
"asc";
3493 $defaults =& $this->
object->getAvailableDefaults($sortby, $sortorder);
3494 if (count($defaults) > 0)
3496 $tablerows = array();
3497 foreach ($defaults as
$row)
3499 array_push($tablerows, array(
"checkbox" =>
"<input type=\"checkbox\" name=\"chb_defaults[]\" value=\"" . $row[
"test_defaults_id"] .
"\"/>",
"name" => $row[
"name"]));
3501 $headervars = array(
"",
"name");
3503 include_once
"./Services/Table/classes/class.ilTableGUI.php";
3505 $tbl->setTitle($this->lng->txt(
"tst_defaults_available"));
3506 $header_names = array(
3508 $this->lng->txt(
"title")
3510 $tbl->setHeaderNames($header_names);
3512 $tbl->disable(
"sort");
3513 $tbl->disable(
"auto_sort");
3514 $tbl->enable(
"title");
3515 $tbl->enable(
"action");
3516 $tbl->enable(
"select_all");
3517 $tbl->setLimit($maxentries);
3518 $tbl->setOffset($offset);
3519 $tbl->setData($tablerows);
3520 $tbl->setMaxCount(count($tablerows));
3521 $tbl->setOrderDirection($sortorder);
3522 $tbl->setSelectAllCheckbox(
"chb_defaults");
3523 $tbl->setFormName(
"formDefaults");
3524 $tbl->addActionButton(
"deleteDefaults", $this->lng->txt(
"delete"));
3525 $tbl->addActionButton(
"applyDefaults", $this->lng->txt(
"apply"));
3527 $header_params = $this->ctrl->getParameterArray($this,
"defaults");
3528 $tbl->setHeaderVars($headervars, $header_params);
3531 $tbl->setFooter(
"tblfooter", $this->lng->txt(
"previous"), $this->lng->txt(
"next"));
3533 $tableoutput = $tbl->render();
3534 $this->tpl->setVariable(
"TEST_DEFAULTS_TABLE", $tableoutput);
3538 $this->tpl->setVariable(
"TEST_DEFAULTS_TABLE", $this->lng->txt(
"tst_defaults_not_defined"));
3540 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"addDefaults"));
3541 $this->tpl->setVariable(
"BUTTON_ADD", $this->lng->txt(
"add"));
3542 $this->tpl->setVariable(
"TEXT_DEFAULTS_OF_TEST", $this->lng->txt(
"tst_defaults_defaults_of_test"));
3550 if (count(
$_POST[
"chb_defaults"]))
3552 foreach (
$_POST[
"chb_defaults"] as $test_default_id)
3554 $this->
object->deleteDefaults($test_default_id);
3565 if (count(
$_POST[
"chb_defaults"]) == 1)
3567 foreach (
$_POST[
"chb_defaults"] as $test_default_id)
3569 $result = $this->
object->applyDefaults($test_default_id);
3592 if (strlen(
$_POST[
"name"]) > 0)
3594 $this->
object->addDefaults(
$_POST[
'name']);
3610 $this->ctrl->setCmd(
"showSummary");
3611 $this->ctrl->setCmdClass(
"ilinfoscreengui");
3617 $this->ctrl->setCmd(
"showSummary");
3618 $this->ctrl->setCmdClass(
"ilinfoscreengui");
3639 if ($this->object->getTestSequence()->hasHiddenQuestions())
3641 $this->
object->getTestSequence()->clearHiddenQuestions();
3642 $this->
object->getTestSequence()->saveToDb();
3646 if (!$ilAccess->checkAccess(
"visible",
"", $this->ref_id))
3648 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
3651 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
3654 $seq = $this->
object->getTestSession()->getLastSequence();
3656 include_once
"./Modules/Test/classes/class.ilTestOutputGUI.php";
3658 $this->ctrl->setParameter($output_gui,
"sequence", $seq);
3659 $info->setFormAction($this->ctrl->getFormAction($output_gui));
3660 if (strlen($session_lock))
3662 $info->addHiddenElement(
"lock", $session_lock);
3666 $info->addHiddenElement(
"lock", md5(
$_COOKIE[
'PHPSESSID'] . time()));
3668 $online_access =
false;
3669 if ($this->object->getFixedParticipants())
3671 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
3673 if ($online_access_result ===
true)
3675 $online_access =
true;
3682 if ($this->object->isComplete())
3684 if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess(
"read",
"", $this->ref_id))
3686 $executable = $this->
object->isExecutable($ilUser->getId(), $allowPassIncrease = TRUE);
3687 if ($executable[
"executable"])
3689 if ($this->object->getTestSession()->getActiveId() > 0)
3692 $resume_text = $this->lng->txt(
"tst_resume_test");
3693 if (($seq < 1) || ($seq == $this->object->getTestSequence()->getFirstSequence()))
3695 $resume_text = $this->
object->getStartTestLabel($this->object->getTestSession()->getActiveId());
3698 #if(!$_GET['crs_show_result'] or $this->object->getTestSequence()->getFirstSequence())
3700 $info->addFormButton(
"resume", $resume_text);
3706 $info->addFormButton(
"start", $this->object->getStartTestLabel($this->object->getTestSession()->getActiveId()));
3713 if ($this->object->getTestSession()->getActiveId() > 0)
3716 if ($this->object->canShowTestResults($ilUser->getId()))
3718 $info->addFormButton(
"outUserResultsOverview", $this->lng->txt(
"tst_show_results"));
3722 if ($this->object->getTestSession()->getActiveId() > 0)
3724 if ($this->object->getShowSolutionPrintview())
3726 $info->addFormButton(
"outUserListOfAnswerPasses", $this->lng->txt(
"tst_list_of_answers_show"));
3731 if ($this->object->getShowInfo())
3733 $info->enablePrivateNotes();
3736 if (strlen($this->object->getIntroduction()))
3738 $info->addSection($this->lng->txt(
"tst_introduction"));
3739 $info->addProperty(
"", $this->object->prepareTextareaOutput($this->object->getIntroduction()));
3742 $info->addSection($this->lng->txt(
"tst_general_properties"));
3743 if ($this->object->getShowInfo())
3745 $info->addProperty($this->lng->txt(
"author"), $this->
object->getAuthor());
3746 $info->addProperty($this->lng->txt(
"title"), $this->
object->getTitle());
3748 if ($this->object->isComplete())
3750 if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess(
"read",
"", $this->ref_id))
3752 if ($this->object->getShowInfo() || !$this->
object->getForceJS())
3755 $checked_javascript =
false;
3756 if ($this->object->getJavaScriptOutput())
3758 $checked_javascript =
true;
3760 if ($this->object->getForceJS())
3762 $info->addProperty($this->lng->txt(
"tst_test_output"), $this->lng->txt(
"tst_use_javascript"));
3766 $info->addPropertyCheckbox($this->lng->txt(
"tst_test_output"),
"chb_javascript", 1, $this->lng->txt(
"tst_use_javascript"), $checked_javascript);
3770 if (!$this->object->isRandomTest())
3772 if ($this->object->getNrOfTries() != 1)
3774 if ($this->object->getUsePreviousAnswers() == 0)
3776 if ($this->object->getShowInfo())
3778 $info->addProperty($this->lng->txt(
"tst_use_previous_answers"), $this->lng->txt(
"tst_dont_use_previous_answers"));
3783 $use_previous_answers = FALSE;
3784 if ($ilUser->prefs[
"tst_use_previous_answers"])
3786 $checked_previous_answers = TRUE;
3788 $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);
3792 if (
$_SESSION[
"AccountId"] == ANONYMOUS_USER_ID)
3794 $info->addPropertyTextinput($this->lng->txt(
"enter_anonymous_code"),
"anonymous_id",
"", 8,
"setAnonymousId", $this->lng->txt(
"submit"));
3799 if ($this->object->getShowInfo())
3801 $info->addSection($this->lng->txt(
"tst_sequence_properties"));
3802 $info->addProperty($this->lng->txt(
"tst_sequence"), $this->lng->txt(($this->object->getSequenceSettings() ==
TEST_FIXED_SEQUENCE)?
"tst_sequence_fixed":
"tst_sequence_postpone"));
3804 $info->addSection($this->lng->txt(
"tst_heading_scoring"));
3805 $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"));
3806 $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"));
3807 if ($this->object->isRandomTest())
3809 $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"));
3812 $info->addSection($this->lng->txt(
"tst_score_reporting"));
3813 $score_reporting_text =
"";
3814 switch ($this->object->getScoreReporting())
3817 $score_reporting_text = $this->lng->txt(
"tst_report_after_test");
3820 $score_reporting_text = $this->lng->txt(
"tst_report_after_first_question");
3823 $score_reporting_text = $this->lng->txt(
"tst_report_after_date");
3826 $score_reporting_text = $this->lng->txt(
"tst_report_after_never");
3829 $info->addProperty($this->lng->txt(
"tst_score_reporting"), $score_reporting_text);
3830 $reporting_date = $this->
object->getReportingDate();
3831 if ($reporting_date)
3833 #preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $reporting_date, $matches);
3834 #$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]));
3835 #$info->addProperty($this->lng->txt("tst_score_reporting_date"), $txt_reporting_date);
3836 $info->addProperty($this->lng->txt(
'tst_score_reporting_date'),
3840 $info->addSection($this->lng->txt(
"tst_session_settings"));
3841 $info->addProperty($this->lng->txt(
"tst_nr_of_tries"), ($this->
object->getNrOfTries() == 0)?$this->lng->txt(
"unlimited"):$this->
object->getNrOfTries());
3842 if ($this->object->getNrOfTries() != 1)
3844 $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());
3847 if ($this->object->getEnableProcessingTime())
3849 $info->addProperty($this->lng->txt(
"tst_processing_time"), $this->
object->getProcessingTime());
3851 if (strlen($this->object->getAllowedUsers()) && ($this->object->getAllowedUsersTimeGap()))
3853 $info->addProperty($this->lng->txt(
"tst_allowed_users"), $this->
object->getAllowedUsers());
3856 $starting_time = $this->
object->getStartingTime();
3859 $info->addProperty($this->lng->txt(
"tst_starting_time"),
3862 $ending_time = $this->
object->getEndingTime();
3865 $info->addProperty($this->lng->txt(
"tst_ending_time"),
3868 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
3871 if(
$_GET[
'crs_show_result'] and !$this->object->getTestSequence()->getFirstSequence())
3873 #ilUtil::sendInfo($this->lng->txt('crs_all_questions_answered_successfully'));
3877 $this->ctrl->forwardCommand($info);
3883 switch ($this->ctrl->getCmd())
3887 case "redirectToInfoScreen":
3894 case "outCorrectSolution":
3896 case "showAnswersOfUser":
3897 case "outUserResultsOverview":
3898 case "backFromSummary":
3899 case "show_answers":
3902 case "outTestSummary":
3903 case "outQuestionSummary":
3904 case "gotoQuestion":
3905 case "selectImagemapRegion":
3906 case "confirmSubmitAnswers":
3907 case "finalSubmission":
3909 case "redirectQuestion":
3910 case "outUserPassDetails":
3911 case "checkPassword":
3912 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
3915 case "evalAllUsers":
3916 case "evalUserDetail":
3917 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"eval_stat"),
"",
$_GET[
"ref_id"]);
3924 case "importVerifiedFile":
3925 case "cancelImport":
3928 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"",
$_GET[
"ref_id"]);
3936 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
3939 $tabs_gui->setBackTarget($this->lng->txt(
"backtocallingtest"), $this->ctrl->getLinkTarget($this,
"questions"));
3940 $tabs_gui->addTarget(
"tst_browse_for_questions",
3941 $this->ctrl->getLinkTarget($this,
"browseForQuestions"),
3942 array(
"browseForQuestions",
"filter",
"resetFilter",
"resetTextFilter",
"insertQuestions"),
3951 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
3954 $tabs_gui->setBackTarget($this->lng->txt(
"backtocallingtest"), $this->ctrl->getLinkTarget($this,
"questions"));
3955 $tabs_gui->addTarget(
"random_selection",
3956 $this->ctrl->getLinkTarget($this,
"randomQuestions"),
3957 array(
"randomQuestions"),
3972 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
3973 include_once
"./Modules/Test/classes/class.ilTestCertificateAdapter.php";
3975 $output_gui->certificateEditor();
3983 $ilTabs->addSubTabTarget(
"edit_test_questions",
3984 $this->ctrl->getLinkTarget($this,
'questions'),
3985 array(
"questions",
"browseForQuestions",
"questionBrowser",
"createQuestion",
3986 "randomselect",
"filter",
"resetFilter",
"insertQuestions",
3987 "back",
"createRandomSelection",
"cancelRandomSelect",
3988 "insertRandomSelection",
"removeQuestions",
"moveQuestions",
3989 "insertQuestionsBefore",
"insertQuestionsAfter",
"confirmRemoveQuestions",
3990 "cancelRemoveQuestions",
"executeCreateQuestion",
"cancelCreateQuestion",
3991 "addQuestionpool",
"saveRandomQuestions",
"saveQuestionSelectionMode"),
3995 if (!$this->object->isRandomTest())
3997 $ilTabs->addSubTabTarget(
"print_view",
3998 $this->ctrl->getLinkTarget($this,
'print'),
4009 $ilTabs->addSubTabTarget(
"eval_all_users",
4010 $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"outEvaluation"),
4011 array(
"outEvaluation",
"detailedEvaluation",
"exportEvaluation",
"evalUserDetail",
"passDetails",
4012 "outStatisticsResultsOverview",
"statisticsPassDetails")
4016 $ilTabs->addSubTabTarget(
"tst_results_aggregated",
4017 $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"eval_a"),
4022 $ilTabs->addSubTabTarget(
"tst_single_results",
4023 $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"singleResults"),
4024 array(
"singleResults"),
4032 ############ scoreQuestion ##############
4033 $ilTabs->addSubTabTarget(
"tst_regrade_questions",
4034 $this->ctrl->getLinkTargetByClass(
"iltestnewscoringgui",
"scoreQuestion"),
4035 array(
"scoreQuestion"),
4039 $ilTabs->addSubTabTarget(
"timing",
4040 $this->ctrl->getLinkTarget($this,
'timing'),
4044 $ilTabs->addSubTabTarget(
"recalculateResults",
4045 $this->ctrl->getLinkTarget($this,
'recalculate'),
4046 array(
"recalculate"),
4049 $ilTabs->addSubTabTarget(
"randomfill",
4050 $this->ctrl->getLinkTarget($this,
'randomfill'),
4051 array(
"randomfill"),
4060 $force_active = ($this->ctrl->getCmd() ==
"")
4063 $ilTabs->addSubTabTarget(
"general",
4064 $this->ctrl->getLinkTarget($this,
'properties'),
4065 array(
"properties",
"saveProperties",
"cancelProperties"),
4066 array(
"",
"ilobjtestgui",
"ilcertificategui"),
4070 $ilTabs->addSubTabTarget(
4072 $this->ctrl->getLinkTarget($this,
'scoring'),
4074 array(
"",
"ilobjtestgui",
"ilcertificategui")
4078 $ilTabs->addSubTabTarget(
4080 $this->ctrl->getLinkTarget($this,
'marks'),
4081 array(
"marks",
"addMarkStep",
"deleteMarkSteps",
"addSimpleMarkSchema",
4082 "saveMarks",
"cancelMarks"),
4083 array(
"",
"ilobjtestgui",
"ilcertificategui")
4086 include_once
'./Services/PDF/classes/class.ilHTMLToPDFTransformer.php';
4090 $ilTabs->addSubTabTarget(
4092 $this->ctrl->getLinkTarget($this,
'certificate'),
4093 array(
"certificate",
"certificateEditor",
"certificateRemoveBackground",
"certificateSave",
4094 "certificatePreview",
"certificateDelete",
"certificateUpload",
"certificateImport"),
4095 array(
"",
"ilobjtestgui",
"ilcertificategui")
4100 $ilTabs->addSubTabTarget(
4102 $this->ctrl->getLinkTarget($this,
"defaults"),
4103 array(
"defaults",
"deleteDefaults",
"addDefaults",
"applyDefaults"),
4104 array(
"",
"ilobjtestgui",
"ilcertificategui")
4112 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
4114 $form->setFormAction($this->ctrl->getFormAction($this));
4115 $form->setTableWidth(
"100%");
4116 $form->setId(
"tst_change_workingtime");
4120 $header->setTitle($this->lng->txt(
"tst_change_workingtime"));
4121 $form->addItem($header);
4124 $participantslist =
new ilSelectInputGUI($this->lng->txt(
'participants'),
"participant");
4125 $participants =& $this->
object->getTestParticipants();
4126 $times = $this->
object->getStartingTimeOfParticipants();
4127 $addons = $this->
object->getTimeExtensionsOfParticipants();
4129 '' => $this->lng->txt(
'please_select'),
4130 '0' => $this->lng->txt(
'all_participants')
4132 foreach ($participants as $participant)
4135 if ($times[$participant[
'active_id']])
4139 if ($addons[$participant[
'active_id']] > 0) $started .=
", " . $this->lng->txt(
'extratime') .
': ' . $addons[$participant[
'active_id']] .
' ' . $this->lng->txt(
'minutes');
4140 $options[$participant[
'active_id']] = $participant[
'login'] .
' (' . $participant[
'lastname'] .
', ' . $participant[
'firstname'] .
')'.$started;
4142 $participantslist->setRequired(
true);
4143 $participantslist->setOptions($options);
4144 $form->addItem($participantslist);
4147 $extratime =
new ilNumberInputGUI($this->lng->txt(
"extratime"),
"extratime");
4149 $extratime->setMinValue(0);
4150 $extratime->setMinvalueShouldBeGreater(
true);
4151 $extratime->setSuffix($this->lng->txt(
'minutes'));
4152 $extratime->setSize(5);
4153 $form->addItem($extratime);
4155 if (is_array(
$_POST) && strlen(
$_POST[
'cmd'][
'timing'])) $form->setValuesByArray(
$_POST);
4157 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])) $form->addCommandButton(
"timing", $this->lng->txt(
"save"));
4168 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
4172 $this->ctrl->redirect($this,
"infoScreen");
4175 if ($this->object->getProcessingTimeInSeconds() > 0 && $this->
object->getNrOfTries() == 1)
4178 if (count(
$_POST) && $form->checkInput())
4180 $res = $this->
object->addExtraTime($form->getInput(
'participant'), $form->getInput(
'extratime'));
4181 ilUtil::sendSuccess(sprintf($this->lng->txt(
'tst_extratime_added'), $form->getInput(
'extratime')),
true);
4185 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
4198 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
4200 $form->setFormAction($this->ctrl->getFormAction($this));
4201 $form->setTableWidth(
"100%");
4202 $form->setId(
"tst_recalculate");
4206 $header->setTitle($this->lng->txt(
"scoring"));
4207 $form->addItem($header);
4210 $count_system =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_text_count_system"),
"count_system");
4212 $count_system->addOption(
new ilRadioOption($this->lng->txt(
"tst_count_correct_solutions"), 1,
''));
4213 $count_system->setValue($this->object->getCountSystem());
4214 $count_system->setInfo($this->lng->txt(
"tst_count_system_description"));
4217 $count_system->setDisabled(
true);
4219 $form->addItem($count_system);
4222 $mc_scoring =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_score_mcmr_questions"),
"mc_scoring");
4223 $mc_scoring->
addOption(
new ilRadioOption($this->lng->txt(
"tst_score_mcmr_zero_points_when_unanswered"), 0,
''));
4224 $mc_scoring->addOption(
new ilRadioOption($this->lng->txt(
"tst_score_mcmr_use_scoring_system"), 1,
''));
4225 $mc_scoring->setValue($this->object->getMCScoring());
4226 $mc_scoring->setInfo($this->lng->txt(
"tst_score_mcmr_questions_description"));
4229 $mc_scoring->setDisabled(
true);
4231 $form->addItem($mc_scoring);
4234 $score_cutting =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_score_cutting"),
"score_cutting");
4236 $score_cutting->addOption(
new ilRadioOption($this->lng->txt(
"tst_score_cut_test"), 1,
''));
4237 $score_cutting->setValue($this->object->getScoreCutting());
4238 $score_cutting->setInfo($this->lng->txt(
"tst_score_cutting_description"));
4241 $score_cutting->setDisabled(
true);
4243 $form->addItem($score_cutting);
4248 $pass_scoring->addOption(
new ilRadioOption($this->lng->txt(
"tst_pass_best_pass"), 1,
''));
4249 $pass_scoring->setValue($this->object->getPassScoring());
4250 $pass_scoring->setInfo($this->lng->txt(
"tst_pass_scoring_description"));
4253 $pass_scoring->setDisabled(
true);
4255 $form->addItem($pass_scoring);
4257 if (is_array(
$_POST) && strlen(
$_POST[
'cmd'][
'recalculate'])) $form->setValuesByArray(
$_POST);
4259 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])) $form->addCommandButton(
"recalculate", $this->lng->txt(
"recalculate"));
4270 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
4274 $this->ctrl->redirect($this,
"infoScreen");
4278 if (count(
$_POST) && $form->checkInput())
4280 $this->
object->setCountSystem(
$_POST[
"count_system"]);
4281 $this->
object->setMCScoring(
$_POST[
"mc_scoring"]);
4282 $this->
object->setScoreCutting(
$_POST[
"score_cutting"]);
4283 $this->
object->setPassScoring(
$_POST[
"pass_scoring"]);
4284 $this->
object->saveToDb();
4285 $this->
object->recalculateSolutions();
4286 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
4291 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
4299 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
4301 $form->setFormAction($this->ctrl->getFormAction($this));
4302 $form->setTableWidth(
"100%");
4303 $form->setId(
"tst_randomfill");
4306 $header->setTitle($this->lng->txt(
"randomfill"));
4307 $form->addItem($header);
4309 $randomfill =
new ilNumberInputGUI($this->lng->txt(
"number_of_participants"),
"participants");
4311 $randomfill->setMinValue(0);
4312 $randomfill->setMinvalueShouldBeGreater(
true);
4313 $randomfill->setSize(5);
4314 $randomfill->setInfo($this->lng->txt(
'number_of_participants_info'));
4315 $form->addItem($randomfill);
4317 if (is_array(
$_POST) && strlen(
$_POST[
'cmd'][
'randomfill'])) $form->setValuesByArray(
$_POST);
4319 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])) $form->addCommandButton(
"randomfill", $this->lng->txt(
"fill_with_data"));
4330 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
4334 $this->ctrl->redirect($this,
"infoScreen");
4338 if (count(
$_POST) && $form->checkInput())
4340 $this->
object->createRandomSolutions(
$_POST[
'participants']);
4341 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
4346 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
4357 global $ilAccess,$ilUser;
4359 switch ($this->ctrl->getCmd())
4365 case "directfeedback":
4367 case "outCorrectSolution":
4369 case "showAnswersOfUser":
4370 case "outUserResultsOverview":
4371 case "backFromSummary":
4372 case "show_answers":
4375 case "confirmFinish":
4376 case "outTestSummary":
4377 case "outQuestionSummary":
4378 case "gotoQuestion":
4379 case "selectImagemapRegion":
4380 case "confirmSubmitAnswers":
4381 case "finalSubmission":
4383 case "redirectQuestion":
4384 case "outUserPassDetails":
4385 case "checkPassword":
4386 case "exportCertificate":
4387 case "finishListOfAnswers":
4388 case "backConfirmFinish":
4389 case "showFinalStatement":
4392 case "browseForQuestions":
4395 case "resetTextFilter":
4396 case "insertQuestions":
4405 case "deleteMarkSteps":
4406 case "addSimpleMarkSchema":
4408 case "certificateservice":
4409 case "certificateImport":
4410 case "certificateUpload":
4411 case "certificateEditor":
4412 case "certificateDelete":
4413 case "certificateSave":
4415 case "deleteDefaults":
4417 case "applyDefaults":
4418 case "inviteParticipants":
4419 case "searchParticipants":
4421 if (($ilAccess->checkAccess(
"write",
"", $this->ref_id)) && ((strcmp($this->ctrl->getCmdClass(),
"ilobjtestgui") == 0) || (strcmp($this->ctrl->getCmdClass(),
"ilcertificategui") == 0) || (strlen($this->ctrl->getCmdClass()) == 0)))
4431 case "detailedEvaluation":
4432 case "outEvaluation":
4433 case "singleResults":
4434 case "exportEvaluation":
4435 case "evalUserDetail":
4437 case "outStatisticsResultsOverview":
4438 case "statisticsPassDetails":
4442 case "scoreQuestion":
4449 if (strcmp(strtolower(get_class($this->
object)),
"ilobjtest") == 0)
4452 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
4454 $force_active = (
$_GET[
"up"] !=
"" ||
$_GET[
"down"] !=
"")
4459 if (
$_GET[
"browse"] == 1) $force_active =
true;
4460 if (preg_match(
"/deleteqpl_\d+/", $this->ctrl->getCmd()))
4462 $force_active =
true;
4465 $tabs_gui->addTarget(
"assQuestions",
4466 $this->ctrl->getLinkTarget($this,
'questions'),
4467 array(
"questions",
"browseForQuestions",
"questionBrowser",
"createQuestion",
4468 "randomselect",
"filter",
"resetFilter",
"insertQuestions",
4469 "back",
"createRandomSelection",
"cancelRandomSelect",
4470 "insertRandomSelection",
"removeQuestions",
"moveQuestions",
4471 "insertQuestionsBefore",
"insertQuestionsAfter",
"confirmRemoveQuestions",
4472 "cancelRemoveQuestions",
"executeCreateQuestion",
"cancelCreateQuestion",
4473 "addQuestionpool",
"saveRandomQuestions",
"saveQuestionSelectionMode",
"print",
4474 "addsource",
"removesource",
"randomQuestions"),
4475 "",
"", $force_active);
4479 if ($ilAccess->checkAccess(
"visible",
"", $this->ref_id))
4481 $tabs_gui->addTarget(
"info_short",
4482 $this->ctrl->getLinkTarget($this,
'infoScreen'),
4483 array(
"infoScreen",
"outIntroductionPage",
"showSummary",
4484 "setAnonymousId",
"outUserListOfAnswerPasses",
"redirectToInfoScreen"));
4488 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
4490 $tabs_gui->addTarget(
"settings",
4491 $this->ctrl->getLinkTarget($this,
'properties'),
4492 array(
"properties",
"saveProperties",
"cancelProperties",
4493 "marks",
"addMarkStep",
"deleteMarkSteps",
"addSimpleMarkSchema",
4494 "saveMarks",
"cancelMarks",
4495 "certificate",
"certificateEditor",
"certificateRemoveBackground",
4496 "certificateSave",
"certificatePreview",
"certificateDelete",
"certificateUpload",
4497 "certificateImport",
"scoring",
"defaults",
"addDefaults",
"deleteDefaults",
"applyDefaults",
4498 "inviteParticipants",
"saveFixedParticipantsStatus",
"searchParticipants",
"addParticipants",
4501 array(
"",
"ilobjtestgui",
"ilcertificategui")
4505 $tabs_gui->addTarget(
"participants",
4506 $this->ctrl->getLinkTarget($this,
'participants'),
4507 array(
"participants",
"saveClientIP",
4508 "removeParticipant",
4509 "showParticipantAnswersForAuthor",
4510 "deleteAllUserResults",
4511 "cancelDeleteAllUserData",
"deleteSingleUserResults",
4512 "outParticipantsResultsOverview",
"outParticipantsPassDetails",
4513 "showPassOverview",
"showUserAnswers",
"participantsAction",
4514 "showDetailedResults"),
4518 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
4521 $tabs_gui->addTarget(
'learning_progress',
4522 $this->ctrl->getLinkTargetByClass(array(
'illearningprogressgui'),
''),
4524 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui'));
4527 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
4529 include_once
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
4531 if (count($scoring))
4534 $tabs_gui->addTarget(
"manscoring",
4535 $this->ctrl->getLinkTargetByClass(
"iltestscoringgui",
"manscoring"),
4536 array(
"manscoring",
"scoringfilter",
"scoringfilterreset",
"setPointsManual",
"setFeedbackManual",
"setManscoringDone",
'selectQuestion',
'scoringParticipants'),
4541 if (($ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) || ($ilAccess->checkAccess(
"write",
"", $this->ref_id)))
4544 $tabs_gui->addTarget(
"statistics",
4545 $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"outEvaluation"),
4546 array(
"statistics",
"outEvaluation",
"exportEvaluation",
"detailedEvaluation",
"eval_a",
"evalUserDetail",
4547 "passDetails",
"outStatisticsResultsOverview",
"statisticsPassDetails",
"singleResults")
4551 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
4554 $tabs_gui->addTarget(
"history",
4555 $this->ctrl->getLinkTarget($this,
'history'),
4559 $tabs_gui->addTarget(
"meta_data",
4560 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
'listSection'),
4561 "",
"ilmdeditorgui");
4564 $tabs_gui->addTarget(
"export",
4565 $this->ctrl->getLinkTarget($this,
'export'),
4566 array(
"export",
"createExportFile",
"confirmDeleteExportFile",
4567 "downloadExportFile",
"deleteExportFile",
"cancelDeleteExportFile"),
4571 $tabs_gui->addTarget(
"administration",
4572 $this->ctrl->getLinkTargetByClass(
"iltestnewscoringgui",
"scoreQuestion"),
4573 array(
"timing",
"scoreQuestion",
'recalculate',
'randomfill'),
4577 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->ref_id))
4579 $tabs_gui->addTarget(
"perm_settings",
4580 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
4597 if ($ilAccess->checkAccess(
"visible",
"", $a_target))
4600 $_GET[
"baseClass"] =
"ilObjTestGUI";
4601 $_GET[
"cmd"] =
"infoScreen";
4602 $_GET[
"ref_id"] = $a_target;
4603 include_once(
"ilias.php");
4607 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
4609 $_GET[
"cmd"] =
"frameset";
4610 $_GET[
"target"] =
"";
4611 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
4614 include(
"repository.php");
4618 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);