4 require_once
'Modules/Test/classes/class.ilTestSettingsGUI.php';
5 require_once
'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php';
96 require_once
'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
109 if (!$this->access->checkAccess(
"write",
"", $this->testGUI->ref_id))
112 $this->ctrl->redirect($this->testGUI,
"infoScreen");
117 $nextClass = $this->ctrl->getNextClass();
122 $cmd = $this->ctrl->getCmd(self::CMD_SHOW_FORM).
'Cmd';
129 $this->tpl->addJavascript(
"./Services/JavaScript/js/Basic.js");
136 $formHTML = $this->ctrl->getHTML($form);
139 $this->tpl->setContent($formHTML.$msgHTML);
144 require_once
'Modules/Test/classes/confirmations/class.ilTestSettingsChangeConfirmationGUI.php';
147 $confirmation->setFormAction( $this->ctrl->getFormAction($this) );
151 $confirmation->setOldQuestionSetType($oldQuestionSetType);
152 $confirmation->setNewQuestionSetType($newQuestionSetType);
153 $confirmation->setQuestionLossInfoEnabled($hasQuestionsWithoutQuestionpool);
154 $confirmation->build();
156 $confirmation->populateParametersFromPropertyForm($form, $this->activeUser->getTimeZone());
158 $this->tpl->setContent( $this->ctrl->getHTML($confirmation) );
163 if( $this->settingsTemplate )
167 $link = $this->ctrl->getLinkTarget($this, self::CMD_SHOW_RESET_TPL_CONFIRM);
168 $link =
"<a href=\"".$link.
"\">".$this->lng->txt(
"test_using_template_link").
"</a>";
170 $msgHTML = $tpl->getMessageHTML(
171 sprintf($this->lng->txt(
"test_using_template"), $this->settingsTemplate->getTitle(), $link),
"info"
174 $msgHTML =
"<div style=\"margin-top:10px\">$msgHTML</div>";
195 $errors = !$form->checkInput();
196 $form->setValuesByPost();
210 $currentQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfig();
211 if( $form->getItemByPostVar(
'online')->getChecked() && !$this->testOBJ->isComplete($currentQuestionSetConfig) )
213 $form->getItemByPostVar(
'online')->setAlert(
214 $this->lng->txt(
"cannot_switch_to_online_no_questions_andor_no_mark_steps")
226 $questionSetTypeRelatingDataCleanupRequired =
false;
228 $oldQuestionSetType = $this->testOBJ->getQuestionSetType();
231 $newQuestionSetType = $form->getItemByPostVar(
'question_set_type')->getValue();
233 if( !$this->testOBJ->participantDataExist() && $newQuestionSetType != $oldQuestionSetType )
235 $oldQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfigByType(
239 if( $oldQuestionSetConfig->doesQuestionSetRelatedDataExist() )
241 if( !$isConfirmedSave )
246 $form, $oldQuestionSetType, $newQuestionSetType,
247 $this->testOBJ->hasQuestionsWithoutQuestionpool()
252 $form, $oldQuestionSetType, $newQuestionSetType,
false
256 $questionSetTypeRelatingDataCleanupRequired =
true;
259 if( $form->getItemByPostVar(
'online')->getChecked() )
261 $form->getItemByPostVar(
'online')->setChecked(
false);
263 if( $this->testOBJ->isOnline() )
265 $infoMsg[] = $this->lng->txt(
"tst_set_offline_due_to_switched_question_set_type_setting");
269 $infoMsg[] = $this->lng->txt(
"tst_cannot_online_due_to_switched_quest_set_type_setting");
276 $newQuestionSetType = $oldQuestionSetType;
283 $form->getItemByPostVar(
'chb_use_previous_answers')->setChecked(
false);
287 $form->getItemByPostVar(
'skill_service')->setChecked(
false);
289 if( $this->testOBJ->isSkillServiceEnabled() )
291 $infoMsg[] = $this->lng->txt(
"tst_disabled_skl_due_to_non_fixed_quest_set_type");
295 $infoMsg[] = $this->lng->txt(
"tst_cannot_enable_skl_due_to_non_fixed_quest_set_type");
306 if( $questionSetTypeRelatingDataCleanupRequired )
308 $oldQuestionSetConfig->removeQuestionSetRelatedData();
313 if( !$this->testOBJ->participantDataExist() && !$this->testOBJ->getFixedParticipants() )
315 foreach ($this->testOBJ->getInvitedUsers() as $usrId => $usrData)
317 $this->testOBJ->disinviteUser($usrId);
323 if( count($infoMsg) )
329 $this->ctrl->redirect($this, self::CMD_SHOW_FORM);
337 require_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
340 $confirmationGUI->setFormAction($this->ctrl->getFormAction($this));
341 $confirmationGUI->setHeaderText($this->lng->txt(
"test_confirm_template_reset"));
345 $this->tpl->setContent( $this->ctrl->getHTML($confirmationGUI) );
353 $this->testOBJ->setTemplate(null);
354 $this->testOBJ->saveToDB();
357 $this->ctrl->redirect($this, self::CMD_SHOW_FORM);
384 return $ilSetting->get(
'char_selector_availability') > 0;
390 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
392 $form->setFormAction($this->ctrl->getFormAction($this));
393 $form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt(
"save"));
394 $form->setTableWidth(
"100%");
395 $form->setId(
"test_properties");
407 include_once
'Modules/Test/classes/class.ilECSTestSettings.php';
409 $ecs->addSettingsToForm($form,
'tst');
415 $otherHead->setTitle($this->lng->txt(
'other'));
416 $form->addItem($otherHead);
418 $skillService =
new ilCheckboxInputGUI($this->lng->txt(
'tst_activate_skill_service'),
'skill_service');
419 $skillService->
setInfo($this->lng->txt(
'tst_activate_skill_service_desc'));
420 $skillService->setChecked($this->testOBJ->isSkillServiceEnabled());
421 if($this->testOBJ->participantDataExist()) $skillService->setDisabled(
true);
422 $form->addItem($skillService);
442 if( !$this->testOBJ->participantDataExist() )
447 $this->testOBJ->setSkillServiceEnabled($form->
getItemByPostVar(
'skill_service')->getChecked());
452 $this->testOBJ->saveToDb(
true);
455 include_once
'Modules/Test/classes/class.ilECSTestSettings.php';
457 $ecs->handleSettingsUpdate();
466 $header->setTitle($this->lng->txt(
"tst_general_properties"));
471 include_once
'Services/MetaData/classes/class.ilMD.php';
472 $md_obj =
new ilMD($this->testOBJ->getId(), 0,
"tst");
477 $title->setValue($md_section->getTitle());
480 $ids = $md_section->getDescriptionIds();
482 $desc_obj = $md_section->getDescription(array_pop($ids));
487 $desc->setValue($desc_obj->getDescription());
492 $pool_usage =
new ilRadioGroupInputGUI($this->lng->txt(
'test_question_pool_usage'),
'use_pool');
494 $optional_qpl =
new ilRadioOption($this->lng->txt(
'test_question_pool_usage_optional'), 1);
495 $optional_qpl->
setInfo($this->lng->txt(
'test_question_pool_usage_optional_info'));
496 $pool_usage->addOption($optional_qpl);
498 $tst_directly =
new ilRadioOption($this->lng->txt(
'test_question_pool_usage_tst_directly'), 0);
499 $tst_directly->
setInfo($this->lng->txt(
'test_question_pool_usage_tst_directly_info'));
500 $pool_usage->addOption($tst_directly);
502 $pool_usage->setValue($this->testOBJ->getPoolUsage() ? 1 : 0);
506 $questSetType =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_question_set_type"),
'question_set_type');
509 $this->lng->txt(
"tst_question_set_type_fixed_desc")
511 $questSetType->addOption($questSetTypeFixed);
514 $this->lng->txt(
"tst_question_set_type_random_desc")
516 $questSetType->addOption($questSetTypeRandom);
519 $this->lng->txt(
"tst_question_set_type_dynamic_desc")
521 $questSetType->addOption($questSetTypeContinues);
522 $questSetType->
setValue($this->testOBJ->getQuestionSetType());
523 if ($this->testOBJ->participantDataExist()) {
524 $questSetType->setDisabled(
true);
534 include_once
'Services/MetaData/classes/class.ilMD.php';
535 $md_obj =&
new ilMD($this->testOBJ->getId(), 0,
"tst");
543 $md_desc_ids = $md_section->getDescriptionIds();
546 $md_desc = $md_section->getDescription(array_pop($md_desc_ids));
552 $md_desc = $md_section->addDescription();
559 $this->testOBJ->update();
564 $this->testOBJ->setPoolUsage((
int)$form->
getItemByPostVar(
'use_pool')->getValue());
567 if (!$this->testOBJ->participantDataExist())
572 $this->testOBJ->setQuestionSetType($form->
getItemByPostVar(
'question_set_type')->getValue());
582 include_once
"Services/Object/classes/class.ilObjectActivation.php";
583 $this->lng->loadLanguageModule(
'rep');
586 $section->setTitle($this->lng->txt(
'rep_activation_availability'));
590 $act_obj_info = $act_ref_info =
"";
592 $act_obj_info =
' ' . $this->lng->txt(
'rep_activation_online_object_info');
593 $act_ref_info = $this->lng->txt(
'rep_activation_access_ref_info');
597 $online->
setChecked($this->testOBJ->isOnline());
598 $online->setInfo($this->lng->txt(
'tst_activation_online_info') . $act_obj_info);
601 $act_type =
new ilCheckboxInputGUI($this->lng->txt(
'rep_visibility_until'),
'activation_type');
602 $act_type->
setChecked($this->testOBJ->isActivationLimited());
605 $this->tpl->addJavaScript(
'./Services/Form/js/date_duration.js');
606 include_once
"Services/Form/classes/class.ilDateDurationInputGUI.php";
609 $date = $this->testOBJ->getActivationStartingTime();
611 $dur->setStartText($this->lng->txt(
'rep_activation_limited_start'));
612 $date = $this->testOBJ->getActivationEndingTime();
614 $dur->setEndText($this->lng->txt(
'rep_activation_limited_end'));
615 $act_type->addSubItem($dur);
617 $visible =
new ilCheckboxInputGUI($this->lng->txt(
'rep_activation_limited_visibility'),
'activation_visibility');
618 $visible->
setInfo($this->lng->txt(
'tst_activation_limited_visibility_info'));
619 $visible->setChecked($this->testOBJ->getActivationVisibility());
620 $act_type->addSubItem($visible);
636 $this->testOBJ->setActivationLimited(
true);
637 $this->testOBJ->setActivationVisibility($form->
getItemByPostVar(
'activation_visibility')->getChecked());
640 $this->testOBJ->setActivationStartingTime($period->getStart()->get(
IL_CAL_UNIX));
641 $this->testOBJ->setActivationEndingTime($period->getEnd()->get(
IL_CAL_UNIX));
645 $this->testOBJ->setActivationLimited(
false);
655 $section->setTitle($this->lng->txt(
'tst_settings_header_intro'));
659 $introEnabled =
new ilCheckboxInputGUI($this->lng->txt(
"tst_introduction"),
'intro_enabled');
660 $introEnabled->
setChecked($this->testOBJ->isIntroductionEnabled());
661 $introEnabled->setInfo($this->lng->txt(
'tst_introduction_desc'));
663 $intro =
new ilTextAreaInputGUI($this->lng->txt(
"tst_introduction_text"),
"introduction");
665 $intro->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getIntroduction(),
false,
true));
668 $intro->setUseRte(TRUE);
669 $intro->addPlugin(
"latex");
670 $intro->addButton(
"latex");
671 $intro->setRTESupport($this->testOBJ->getId(),
"tst",
"assessment");
672 $intro->setRteTagSet(
'full');
673 $introEnabled->addSubItem($intro);
678 $showinfo->setChecked($this->testOBJ->getShowInfo());
679 $showinfo->setInfo($this->lng->txt(
"showinfo_desc"));
690 $this->testOBJ->setIntroductionEnabled($form->
getItemByPostVar(
'intro_enabled')->getChecked());
698 $this->testOBJ->setIntroduction(
'');
704 $this->testOBJ->setShowInfo($form->
getItemByPostVar(
'showinfo')->getChecked());
714 $header->setTitle($this->lng->txt(
"tst_settings_header_execution"));
718 $enablestartingtime =
new ilCheckboxInputGUI($this->lng->txt(
"tst_starting_time"),
"chb_starting_time");
719 $enablestartingtime->
setInfo($this->lng->txt(
"tst_starting_time_desc"));
720 $enablestartingtime->setChecked($this->testOBJ->isStartingTimeEnabled());
724 $startingtime->setShowTime(
true);
725 if( strlen($this->testOBJ->getStartingTime()) )
733 $enablestartingtime->addSubItem($startingtime);
734 $form->
addItem($enablestartingtime);
735 if ($this->testOBJ->participantDataExist())
737 $enablestartingtime->setDisabled(
true);
738 $startingtime->setDisabled(
true);
742 $enableendingtime =
new ilCheckboxInputGUI($this->lng->txt(
"tst_ending_time"),
"chb_ending_time");
743 $enableendingtime->
setInfo($this->lng->txt(
"tst_ending_time_desc"));
744 $enableendingtime->setChecked($this->testOBJ->isEndingTimeEnabled());
748 $endingtime->setShowTime(
true);
749 if (strlen($this->testOBJ->getEndingTime()))
757 $enableendingtime->addSubItem($endingtime);
758 $form->
addItem($enableendingtime);
761 $pwEnabled =
new ilCheckboxInputGUI($this->lng->txt(
'tst_password'),
'password_enabled');
762 $pwEnabled->
setChecked($this->testOBJ->isPasswordEnabled());
763 $pwEnabled->setInfo($this->lng->txt(
"tst_password_details"));
764 $password =
new ilTextInputGUI($this->lng->txt(
"tst_password_enter"),
"password");
766 $password->setSize(20);
767 $password->setValue($this->testOBJ->getPassword());
768 $pwEnabled->addSubItem($password);
772 $fixedparticipants =
new ilCheckboxInputGUI($this->lng->txt(
'participants_invitation'),
"fixedparticipants");
774 $fixedparticipants->setChecked($this->testOBJ->getFixedParticipants());
775 $fixedparticipants->setInfo($this->lng->txt(
"participants_invitation_description"));
776 $invited_users = $this->testOBJ->getInvitedUsers();
777 if ($this->testOBJ->participantDataExist() && (count($invited_users) == 0))
779 $fixedparticipants->setDisabled(
true);
781 $form->
addItem($fixedparticipants);
784 $simulLimited =
new ilCheckboxInputGUI($this->lng->txt(
"tst_allowed_users"),
'limitUsers');
785 $simulLimited->
setInfo($this->lng->txt(
"tst_allowed_users_desc"));
786 $simulLimited->setChecked($this->testOBJ->isLimitUsersEnabled());
789 $simul =
new ilNumberInputGUI($this->lng->txt(
"tst_allowed_users_max"),
"allowedUsers");
791 $simul->allowDecimals(
false);
792 $simul->setMinValue(1);
793 $simul->setMinvalueShouldBeGreater(
false);
795 $simul->setValue(($this->testOBJ->getAllowedUsers()) ? $this->testOBJ->getAllowedUsers() :
'');
796 $simulLimited->addSubItem($simul);
799 $idle =
new ilNumberInputGUI($this->lng->txt(
"tst_allowed_users_time_gap"),
"allowedUsersTimeGap");
800 $idle->
setInfo($this->lng->txt(
"tst_allowed_users_time_gap_desc"));
802 $idle->setSuffix($this->lng->txt(
"seconds"));
803 $idle->setValue(($this->testOBJ->getAllowedUsersTimeGap()) ? $this->testOBJ->getAllowedUsersTimeGap() : 300);
804 $simulLimited->addSubItem($idle);
816 if( $this->
formPropertyExists($form,
'chb_starting_time') && !$this->testOBJ->participantDataExist() )
824 $this->testOBJ->setStartingTimeEnabled(
true);
828 $this->testOBJ->setStartingTimeEnabled(
false);
841 $this->testOBJ->setEndingTimeEnabled(
true);
845 $this->testOBJ->setEndingTimeEnabled(
false);
851 $this->testOBJ->setPasswordEnabled($form->
getItemByPostVar(
'password_enabled')->getChecked());
855 $this->testOBJ->setPassword($form->
getItemByPostVar(
'password')->getValue());
859 $this->testOBJ->setPassword(
'');
863 if( $this->
formPropertyExists($form,
'fixedparticipants') && !$this->testOBJ->participantDataExist() )
865 $this->testOBJ->setFixedParticipants($form->
getItemByPostVar(
'fixedparticipants')->getChecked());
870 $this->testOBJ->setLimitUsersEnabled($form->
getItemByPostVar(
'limitUsers')->getChecked());
874 $this->testOBJ->setAllowedUsers($form->
getItemByPostVar(
'allowedUsers')->getValue());
875 $this->testOBJ->setAllowedUsersTimeGap($form->
getItemByPostVar(
'allowedUsersTimeGap')->getValue());
879 $this->testOBJ->setAllowedUsers(
'');
891 $header->setTitle($this->lng->txt(
"tst_settings_header_test_run"));
895 $limitPasses =
new ilCheckboxInputGUI($this->lng->txt(
"tst_limit_nr_of_tries"),
'limitPasses');
896 $limitPasses->
setInfo($this->lng->txt(
"tst_nr_of_tries_desc"));
897 $limitPasses->setChecked($this->testOBJ->getNrOfTries() > 0);
898 $nr_of_tries =
new ilNumberInputGUI($this->lng->txt(
"tst_nr_of_tries"),
"nr_of_tries");
900 $nr_of_tries->allowDecimals(
false);
901 $nr_of_tries->setMinValue(1);
902 $nr_of_tries->setMinvalueShouldBeGreater(
false);
903 $nr_of_tries->setValue($this->testOBJ->getNrOfTries() ? $this->testOBJ->getNrOfTries() : 1);
904 $nr_of_tries->setRequired(
true);
905 if( $this->testOBJ->participantDataExist() )
907 $limitPasses->setDisabled(
true);
908 $nr_of_tries->setDisabled(
true);
910 $limitPasses->addSubItem($nr_of_tries);
914 $processing =
new ilCheckboxInputGUI($this->lng->txt(
"tst_processing_time"),
"chb_processing_time");
915 $processing->
setInfo($this->lng->txt(
"tst_processing_time_desc"));
916 $processing->setValue(1);
919 $processing->setChecked(
true);
921 $processing->setChecked($this->testOBJ->getEnableProcessingTime());
925 $processingtime =
new ilNumberInputGUI($this->lng->txt(
"tst_processing_time_duration"),
'processing_time');
927 $processingtime->setMinValue(1);
928 $processingtime->setMinvalueShouldBeGreater(
false);
929 $processingtime->setValue($this->testOBJ->getProcessingTimeAsMinutes());
930 $processingtime->setSize(5);
931 $processingtime->setSuffix($this->lng->txt(
'minutes'));
932 $processingtime->setInfo($this->lng->txt(
"tst_processing_time_duration_desc"));
933 $processing->addSubItem($processingtime);
937 $resetprocessing->setValue(1);
938 $resetprocessing->setOptionTitle($this->lng->txt(
"tst_reset_processing_time"));
939 $resetprocessing->setChecked($this->testOBJ->getResetProcessingTime());
940 $resetprocessing->setInfo($this->lng->txt(
"tst_reset_processing_time_desc"));
941 $processing->addSubItem($resetprocessing);
944 if( $this->testOBJ->participantDataExist() )
946 $processing->setDisabled(
true);
947 $processingtime->setDisabled(
true);
948 $resetprocessing->setDisabled(
true);
954 $kiosk->setChecked($this->testOBJ->getKioskMode());
955 $kiosk->setInfo($this->lng->txt(
"kiosk_description"));
960 $kiosktitle->addOption(
new ilCheckboxOption($this->lng->txt(
"kiosk_show_participant"),
'kiosk_participant',
''));
962 if ($this->testOBJ->getShowKioskModeTitle()) array_push($values,
'kiosk_title');
963 if ($this->testOBJ->getShowKioskModeParticipant()) array_push($values,
'kiosk_participant');
964 $kiosktitle->setValue($values);
965 $kiosktitle->setInfo($this->lng->txt(
"kiosk_options_desc"));
966 $kiosk->addSubItem($kiosktitle);
970 $examIdInPass =
new ilCheckboxInputGUI($this->lng->txt(
'examid_in_test_pass'),
'examid_in_test_pass');
971 $examIdInPass->
setInfo($this->lng->txt(
'examid_in_test_pass_desc'));
972 $examIdInPass->setChecked($this->testOBJ->isShowExamIdInTestPassEnabled());
981 if (!$this->testOBJ->participantDataExist())
988 $this->testOBJ->setNrOfTries($form->
getItemByPostVar(
'nr_of_tries')->getValue());
992 $this->testOBJ->setNrOfTries(0);
996 $this->testOBJ->setEnableProcessingTime($form->
getItemByPostVar(
'chb_processing_time')->getChecked());
997 if ($this->testOBJ->getEnableProcessingTime())
999 $this->testOBJ->setProcessingTimeByMinutes($form->
getItemByPostVar(
'processing_time')->getValue());
1000 $this->testOBJ->setResetProcessingTime($form->
getItemByPostVar(
'chb_reset_processing_time')->getChecked());
1004 $this->testOBJ->setProcessingTime(
'');
1005 $this->testOBJ->setResetProcessingTime(
false);
1011 $this->testOBJ->setKioskMode($form->
getInput(
'kiosk'));
1013 if (is_array($kioskOptions))
1015 $this->testOBJ->setShowKioskModeTitle(in_array(
'kiosk_title', $kioskOptions));
1016 $this->testOBJ->setShowKioskModeParticipant(in_array(
'kiosk_participant', $kioskOptions));
1020 $this->testOBJ->setShowKioskModeTitle(
false);
1021 $this->testOBJ->setShowKioskModeParticipant(
false);
1028 $this->testOBJ->setShowExamIdInTestPassEnabled($value);
1038 'title_output',
'autosave',
'chb_shuffle_questions',
'chb_shuffle_questions',
1039 'offer_hints',
'instant_feedback',
'obligations_enabled',
1046 $seqheader->setTitle($this->lng->txt(
"tst_presentation_properties"));
1053 $title_output->addOption(
new ilRadioOption($this->lng->txt(
"tst_title_output_hide_points"), 1,
''));
1054 $title_output->addOption(
new ilRadioOption($this->lng->txt(
"tst_title_output_no_title"), 2,
''));
1055 $title_output->setValue($this->testOBJ->getTitleOutput());
1056 $form->
addItem($title_output);
1061 $autosave_output->setChecked($this->testOBJ->getAutosave());
1062 $autosave_output->setInfo($this->lng->txt(
'autosave_info'));
1063 $autosave_interval =
new ilTextInputGUI($this->lng->txt(
'autosave_ival'),
'autosave_ival');
1064 $autosave_interval->
setSize(10);
1065 $autosave_interval->setValue($this->testOBJ->getAutosaveIval()/1000);
1066 $autosave_interval->setSuffix($this->lng->txt(
'seconds'));
1067 $autosave_output->addSubItem($autosave_interval);
1068 $form->
addItem($autosave_output);
1071 $shuffle =
new ilCheckboxInputGUI($this->lng->txt(
"tst_shuffle_questions"),
"chb_shuffle_questions");
1073 $shuffle->setChecked($this->testOBJ->getShuffleQuestions());
1074 $shuffle->setInfo($this->lng->txt(
"tst_shuffle_questions_description"));
1078 $checkBoxOfferHints =
new ilCheckboxInputGUI($this->lng->txt(
'tst_setting_offer_hints_label'),
'offer_hints');
1079 $checkBoxOfferHints->
setChecked($this->testOBJ->isOfferingQuestionHintsEnabled());
1080 $checkBoxOfferHints->setInfo($this->lng->txt(
'tst_setting_offer_hints_info'));
1081 if( $this->testOBJ->participantDataExist() )
1083 $checkBoxOfferHints->setDisabled(
true);
1085 $form->
addItem($checkBoxOfferHints);
1090 $this->lng->txt(
'tst_instant_feedback_results'),
'instant_feedback_points',
1091 $this->lng->txt(
'tst_instant_feedback_results_desc')
1094 $this->lng->txt(
'tst_instant_feedback_answer_generic'),
'instant_feedback_generic',
1095 $this->lng->txt(
'tst_instant_feedback_answer_generic_desc')
1098 $this->lng->txt(
'tst_instant_feedback_answer_specific'),
'instant_feedback_specific',
1099 $this->lng->txt(
'tst_instant_feedback_answer_specific_desc')
1102 $this->lng->txt(
'tst_instant_feedback_solution'),
'instant_feedback_solution',
1103 $this->lng->txt(
'tst_instant_feedback_solution_desc')
1106 $this->lng->txt(
'tst_instant_feedback_fix_usr_answer'),
'instant_feedback_answer_fixation',
1107 $this->lng->txt(
'tst_instant_feedback_fix_usr_answer_desc')
1110 if ($this->testOBJ->getSpecificAnswerFeedback()) array_push($values,
'instant_feedback_specific');
1111 if ($this->testOBJ->getGenericAnswerFeedback()) array_push($values,
'instant_feedback_generic');
1112 if ($this->testOBJ->getAnswerFeedbackPoints()) array_push($values,
'instant_feedback_points');
1113 if ($this->testOBJ->getInstantFeedbackSolution()) array_push($values,
'instant_feedback_solution');
1114 if( $this->testOBJ->isInstantFeedbackAnswerFixationEnabled() ) array_push($values,
'instant_feedback_answer_fixation');
1115 $instant_feedback->setValue($values);
1116 $form->
addItem($instant_feedback);
1119 $checkBoxEnableObligations =
new ilCheckboxInputGUI($this->lng->txt(
'tst_setting_enable_obligations_label'),
'obligations_enabled');
1120 $checkBoxEnableObligations->
setChecked($this->testOBJ->areObligationsEnabled());
1121 $checkBoxEnableObligations->setInfo($this->lng->txt(
'tst_setting_enable_obligations_info'));
1122 if( $this->testOBJ->participantDataExist() )
1124 $checkBoxEnableObligations->setDisabled(
true);
1126 $form->
addItem($checkBoxEnableObligations);
1131 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
1133 $char_selector->getConfig()->setAvailability($this->testOBJ->getCharSelectorAvailability());
1134 $char_selector->getConfig()->setDefinition($this->testOBJ->getCharSelectorDefinition());
1135 $char_selector->addFormProperties($form);
1136 $char_selector->setFormValues($form);
1147 $this->testOBJ->setTitleOutput($form->
getItemByPostVar(
'title_output')->getValue());
1152 $this->testOBJ->setAutosave($form->
getItemByPostVar(
'autosave')->getChecked());
1153 $this->testOBJ->setAutosaveIval($form->
getItemByPostVar(
'autosave_ival')->getValue() * 1000);
1158 $this->testOBJ->setShuffleQuestions($form->
getItemByPostVar(
'chb_shuffle_questions')->getChecked());
1161 if (!$this->testOBJ->participantDataExist() && $this->
formPropertyExists($form,
'offer_hints'))
1163 $this->testOBJ->setOfferingQuestionHintsEnabled($form->
getItemByPostVar(
'offer_hints')->getChecked());
1168 $this->testOBJ->setScoringFeedbackOptionsByArray($form->
getItemByPostVar(
'instant_feedback')->getValue());
1171 if (!$this->testOBJ->participantDataExist() && $this->
formPropertyExists($form,
'obligations_enabled'))
1173 $this->testOBJ->setObligationsEnabled($form->
getItemByPostVar(
'obligations_enabled')->getChecked());
1178 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
1180 $char_selector->addFormProperties($form);
1181 $char_selector->getFormValues($form);
1182 $this->testOBJ->setCharSelectorAvailability($char_selector->getConfig()->getAvailability());
1183 $this->testOBJ->setCharSelectorDefinition($char_selector->getConfig()->getDefinition());
1194 $seqheader->setTitle($this->lng->txt(
"tst_sequence_properties"));
1198 $prevanswers =
new ilCheckboxInputGUI($this->lng->txt(
"tst_use_previous_answers"),
"chb_use_previous_answers");
1200 $prevanswers->setChecked($this->testOBJ->getUsePreviousAnswers());
1201 $prevanswers->setInfo($this->lng->txt(
"tst_use_previous_answers_description"));
1205 $cancel =
new ilCheckboxInputGUI($this->lng->txt(
"tst_show_cancel"),
"chb_show_cancel");
1207 $cancel->setChecked($this->testOBJ->getShowCancel());
1208 $cancel->setInfo($this->lng->txt(
"tst_show_cancel_description"));
1214 $postpone->setChecked($this->testOBJ->getSequenceSettings());
1215 $postpone->setInfo($this->lng->txt(
"tst_postpone_description"));
1219 $list_of_questions =
new ilCheckboxInputGUI($this->lng->txt(
"tst_show_summary"),
"list_of_questions");
1222 $list_of_questions->setChecked($this->testOBJ->getListOfQuestions());
1223 $list_of_questions->setInfo($this->lng->txt(
"tst_show_summary_description"));
1226 $list_of_questions_options->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_list_of_questions_start"),
'chb_list_of_questions_start',
''));
1227 $list_of_questions_options->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_list_of_questions_end"),
'chb_list_of_questions_end',
''));
1228 $list_of_questions_options->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_list_of_questions_with_description"),
'chb_list_of_questions_with_description',
''));
1230 if ($this->testOBJ->getListOfQuestionsStart()) array_push($values,
'chb_list_of_questions_start');
1231 if ($this->testOBJ->getListOfQuestionsEnd()) array_push($values,
'chb_list_of_questions_end');
1232 if ($this->testOBJ->getListOfQuestionsDescription()) array_push($values,
'chb_list_of_questions_with_description');
1233 $list_of_questions_options->setValue($values);
1235 $list_of_questions->addSubItem($list_of_questions_options);
1236 $form->
addItem($list_of_questions);
1239 $marking =
new ilCheckboxInputGUI($this->lng->txt(
"question_marking"),
"chb_show_marker");
1241 $marking->setChecked($this->testOBJ->getShowMarker());
1242 $marking->setInfo($this->lng->txt(
"question_marking_description"));
1253 $this->testOBJ->setUsePreviousAnswers($form->
getInput(
'chb_use_previous_answers'));
1258 $this->testOBJ->setShowCancel($form->
getItemByPostVar(
'chb_show_cancel')->getChecked());
1263 $this->testOBJ->setPostponingEnabled($form->
getItemByPostVar(
'chb_postpone')->getChecked());
1266 $this->testOBJ->setListOfQuestions($form->
getItemByPostVar(
'list_of_questions')->getChecked());
1267 $listOfQuestionsOptions = $form->
getItemByPostVar(
'list_of_questions_options')->getValue();
1268 if(is_array($listOfQuestionsOptions))
1270 $this->testOBJ->setListOfQuestionsStart(in_array(
'chb_list_of_questions_start', $listOfQuestionsOptions));
1271 $this->testOBJ->setListOfQuestionsEnd(in_array(
'chb_list_of_questions_end', $listOfQuestionsOptions));
1272 $this->testOBJ->setListOfQuestionsDescription(in_array(
'chb_list_of_questions_with_description', $listOfQuestionsOptions));
1276 $this->testOBJ->setListOfQuestionsStart(0);
1277 $this->testOBJ->setListOfQuestionsEnd(0);
1278 $this->testOBJ->setListOfQuestionsDescription(0);
1283 $this->testOBJ->setShowMarker($form->
getItemByPostVar(
'chb_show_marker')->getChecked());
1293 $testFinishHeader->setTitle($this->lng->txt(
"tst_final_information"));
1294 $form->
addItem($testFinishHeader);
1297 $enable_examview =
new ilCheckboxInputGUI($this->lng->txt(
"enable_examview"),
'enable_examview');
1299 $enable_examview->setChecked($this->testOBJ->getEnableExamview());
1300 $enable_examview->setInfo($this->lng->txt(
"enable_examview_desc"));
1302 $show_examview_html->setValue(1);
1303 $show_examview_html->setChecked($this->testOBJ->getShowExamviewHtml());
1304 $show_examview_html->setOptionTitle($this->lng->txt(
"show_examview_html"));
1305 $enable_examview->addSubItem($show_examview_html);
1307 $show_examview_pdf->setValue(1);
1308 $show_examview_pdf->setChecked($this->testOBJ->getShowExamviewPdf());
1309 $show_examview_pdf->setOptionTitle($this->lng->txt(
"show_examview_pdf"));
1310 $enable_examview->addSubItem($show_examview_pdf);
1311 $form->
addItem($enable_examview);
1314 $showfinal =
new ilCheckboxInputGUI($this->lng->txt(
"final_statement"),
"showfinalstatement");
1315 $showfinal->
setChecked($this->testOBJ->getShowFinalStatement());
1316 $showfinal->setInfo($this->lng->txt(
"final_statement_show_desc"));
1319 $finalstatement =
new ilTextAreaInputGUI($this->lng->txt(
"final_statement"),
"finalstatement");
1321 $finalstatement->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getFinalStatement(),
false,
true));
1322 $finalstatement->setRows(10);
1323 $finalstatement->setCols(80);
1324 $finalstatement->setUseRte(TRUE);
1325 $finalstatement->addPlugin(
"latex");
1326 $finalstatement->addButton(
"latex");
1327 $finalstatement->setRTESupport($this->testOBJ->getId(),
"tst",
"assessment");
1328 $finalstatement->setRteTagSet(
'full');
1329 $showfinal->addSubItem($finalstatement);
1331 $redirection_mode = $this->testOBJ->getRedirectionMode();
1332 $rm_enabled =
new ilCheckboxInputGUI($this->lng->txt(
'redirect_after_finishing_tst'),
'redirection_enabled');
1333 $rm_enabled->
setInfo($this->lng->txt(
'redirect_after_finishing_tst_desc'));
1334 $rm_enabled->setChecked($redirection_mode ==
'0' ?
false :
true);
1335 $radio_rm =
new ilRadioGroupInputGUI($this->lng->txt(
'redirect_after_finishing_rule'),
'redirection_mode');
1337 $radio_rm->addOption($always);
1339 $radio_rm->addOption($kiosk);
1341 $rm_enabled->addSubItem($radio_rm);
1342 $redirection_url =
new ilTextInputGUI($this->lng->txt(
'redirection_url'),
'redirection_url');
1343 $redirection_url->
setValue((
string)$this->testOBJ->getRedirectionUrl());
1344 $redirection_url->setRequired(
true);
1345 $rm_enabled->addSubItem($redirection_url);
1350 $sign_submission = $this->testOBJ->getSignSubmission();
1351 $sign_submission_enabled =
new ilCheckboxInputGUI($this->lng->txt(
'sign_submission'),
'sign_submission');
1352 $sign_submission_enabled->
setChecked($sign_submission);
1353 $sign_submission_enabled->setInfo($this->lng->txt(
'sign_submission_info'));
1354 $form->
addItem($sign_submission_enabled);
1357 $mailnotification =
new ilCheckboxInputGUI($this->lng->txt(
"tst_finish_notification"),
"mailnotification");
1358 $mailnotification->
setInfo($this->lng->txt(
"tst_finish_notification_desc"));
1359 $mailnotification->setChecked($this->testOBJ->getMailNotification() > 0);
1360 $form->
addItem($mailnotification);
1362 $mailnotificationContent =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_finish_notification_content"),
"mailnotification_content");
1363 $mailnotificationContent->
addOption(
new ilRadioOption($this->lng->txt(
"tst_finish_notification_simple"), 1,
''));
1364 $mailnotificationContent->addOption(
new ilRadioOption($this->lng->txt(
"tst_finish_notification_advanced"), 2,
''));
1365 $mailnotificationContent->setValue($this->testOBJ->getMailNotification() ? $this->testOBJ->getMailNotification() : 1);
1366 $mailnotificationContent->setRequired(
true);
1367 $mailnotification->addSubItem($mailnotificationContent);
1370 $mailnottype->setValue(1);
1371 $mailnottype->setOptionTitle($this->lng->txt(
"mailnottype"));
1372 $mailnottype->setChecked($this->testOBJ->getMailNotificationType());
1373 $mailnotification->addSubItem($mailnottype);
1383 $this->testOBJ->setEnableExamview($form->
getItemByPostVar(
'enable_examview')->getChecked());
1384 $this->testOBJ->setShowExamviewHtml($form->
getItemByPostVar(
'show_examview_html')->getChecked());
1385 $this->testOBJ->setShowExamviewPdf($form->
getItemByPostVar(
'show_examview_pdf')->getChecked());
1388 $this->testOBJ->setShowFinalStatement($form->
getItemByPostVar(
'showfinalstatement')->getChecked());
1393 $this->testOBJ->setRedirectionMode($form->
getItemByPostVar(
'redirection_mode')->getValue());
1401 $this->testOBJ->setRedirectionUrl($form->
getItemByPostVar(
'redirection_url')->getValue());
1405 $this->testOBJ->setRedirectionUrl(null);
1410 $this->testOBJ->setSignSubmission($form->
getItemByPostVar(
'sign_submission')->getChecked());
1415 $this->testOBJ->setMailNotification($form->
getItemByPostVar(
'mailnotification_content')->getValue());
1416 $this->testOBJ->setMailNotificationType($form->
getItemByPostVar(
'mailnottype')->getChecked());
1420 $this->testOBJ->setMailNotification(0);
1421 $this->testOBJ->setMailNotificationType(
false);