4 require_once
'Modules/Test/classes/class.ilTestSettingsGUI.php';
5 require_once
'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php';
101 require_once
'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
104 parent::__construct($testGUI->object);
114 if (!$this->access->checkAccess(
"write",
"", $this->testGUI->ref_id))
117 $this->ctrl->redirect($this->testGUI,
"infoScreen");
122 $nextClass = $this->ctrl->getNextClass();
127 $cmd = $this->ctrl->getCmd(self::CMD_SHOW_FORM).
'Cmd';
134 $this->tpl->addJavascript(
"./Services/JavaScript/js/Basic.js");
141 $formHTML = $this->ctrl->getHTML($form);
144 $this->tpl->setContent($formHTML.$msgHTML);
149 require_once
'Modules/Test/classes/confirmations/class.ilTestSettingsChangeConfirmationGUI.php';
152 $confirmation->setFormAction( $this->ctrl->getFormAction($this) );
153 $confirmation->setCancel($this->lng->txt(
'cancel'), self::CMD_SHOW_FORM);
154 $confirmation->setConfirm($this->lng->txt(
'confirm'), self::CMD_CONFIRMED_SAVE_FORM);
156 $confirmation->setOldQuestionSetType($oldQuestionSetType);
157 $confirmation->setNewQuestionSetType($newQuestionSetType);
158 $confirmation->setQuestionLossInfoEnabled($hasQuestionsWithoutQuestionpool);
159 $confirmation->build();
161 $confirmation->populateParametersFromPropertyForm($form, $this->activeUser->getTimeZone());
163 $this->tpl->setContent( $this->ctrl->getHTML($confirmation) );
168 if( $this->settingsTemplate )
170 $title = $this->settingsTemplate->getTitle();
172 if( $this->settingsTemplate->getAutoGenerated() )
174 $title = $this->lng->txt($title);
179 $link = $this->ctrl->getLinkTarget($this, self::CMD_SHOW_RESET_TPL_CONFIRM);
180 $link =
"<a href=\"".$link.
"\">".$this->lng->txt(
"test_using_template_link").
"</a>";
182 $msgHTML = $tpl->getMessageHTML(
183 sprintf($this->lng->txt(
"test_using_template"), $title, $link),
"info" 186 $msgHTML =
"<div style=\"margin-top:10px\">$msgHTML</div>";
207 $errors = !$form->checkInput();
208 $form->setValuesByPost();
222 $currentQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfig();
223 if( $form->getItemByPostVar(
'online')->getChecked() && !$this->testOBJ->isComplete($currentQuestionSetConfig) )
225 $form->getItemByPostVar(
'online')->setAlert(
226 $this->lng->txt(
"cannot_switch_to_online_no_questions_andor_no_mark_steps")
238 $questionSetTypeRelatingDataCleanupRequired =
false;
240 $oldQuestionSetType = $this->testOBJ->getQuestionSetType();
243 $newQuestionSetType = $form->getItemByPostVar(
'question_set_type')->getValue();
245 if( !$this->testOBJ->participantDataExist() && $newQuestionSetType != $oldQuestionSetType )
247 $oldQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfigByType(
251 if( $oldQuestionSetConfig->doesQuestionSetRelatedDataExist() )
253 if( !$isConfirmedSave )
258 $form, $oldQuestionSetType, $newQuestionSetType,
259 $this->testOBJ->hasQuestionsWithoutQuestionpool()
264 $form, $oldQuestionSetType, $newQuestionSetType,
false 268 $questionSetTypeRelatingDataCleanupRequired =
true;
271 if( $form->getItemByPostVar(
'online')->getChecked() )
273 $form->getItemByPostVar(
'online')->setChecked(
false);
275 if( $this->testOBJ->isOnline() )
277 $infoMsg[] = $this->lng->txt(
"tst_set_offline_due_to_switched_question_set_type_setting");
281 $infoMsg[] = $this->lng->txt(
"tst_cannot_online_due_to_switched_quest_set_type_setting");
288 $newQuestionSetType = $oldQuestionSetType;
295 $form->getItemByPostVar(
'chb_use_previous_answers')->setChecked(
false);
300 if( $form->getItemByPostVar(
'obligations_enabled')->getChecked() )
302 switch( $form->getItemByPostVar(
'instant_feedback_handling')->getValue() )
304 case self::INST_FB_HANDLING_OPT_FREEZE:
306 $form->getItemByPostVar(
'instant_feedback_handling')->setValue(self::INST_FB_HANDLING_OPT_NONE);
307 $infoMsg[] = $this->lng->txt(
"tst_conflict_fbh_oblig_quest");
308 $infoMsg[] = $this->lng->txt(
"tst_conflict_reset_non_fbh");
311 case self::INST_FB_HANDLING_OPT_FORCE_AND_FREEZE:
313 $form->getItemByPostVar(
'instant_feedback_handling')->setValue(self::INST_FB_HANDLING_OPT_FORCE);
314 $infoMsg[] = $this->lng->txt(
"tst_conflict_fbh_oblig_quest");
315 $infoMsg[] = $this->lng->txt(
"tst_conflict_reset_fbh_force");
326 if( $questionSetTypeRelatingDataCleanupRequired )
328 $oldQuestionSetConfig->removeQuestionSetRelatedData();
333 if( !$this->testOBJ->participantDataExist() && !$this->testOBJ->getFixedParticipants() )
335 foreach ($this->testOBJ->getInvitedUsers() as $usrId => $usrData)
337 $this->testOBJ->disinviteUser($usrId);
343 if( count($infoMsg) )
349 $this->ctrl->redirect($this, self::CMD_SHOW_FORM);
357 require_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
360 $confirmationGUI->setFormAction($this->ctrl->getFormAction($this));
361 $confirmationGUI->setHeaderText($this->lng->txt(
"test_confirm_template_reset"));
362 $confirmationGUI->setCancel($this->lng->txt(
'cancel'), self::CMD_SHOW_FORM);
363 $confirmationGUI->setConfirm($this->lng->txt(
'confirm'), self::CMD_CONFIRMED_RESET_TPL);
365 $this->tpl->setContent( $this->ctrl->getHTML($confirmationGUI) );
373 $this->testOBJ->setTemplate(null);
374 $this->testOBJ->saveToDB();
377 $this->ctrl->redirect($this, self::CMD_SHOW_FORM);
404 return $ilSetting->get(
'char_selector_availability') > 0;
410 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
412 $form->setFormAction($this->ctrl->getFormAction($this));
413 $form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt(
"save"));
414 $form->setTableWidth(
"100%");
415 $form->setId(
"test_properties");
427 include_once
'Modules/Test/classes/class.ilECSTestSettings.php';
429 $ecs->addSettingsToForm($form,
'tst');
435 $otherHead->setTitle($this->lng->txt(
'other'));
436 $form->addItem($otherHead);
438 $skillService =
new ilCheckboxInputGUI($this->lng->txt(
'tst_activate_skill_service'),
'skill_service');
439 $skillService->
setInfo($this->lng->txt(
'tst_activate_skill_service_desc'));
440 $skillService->setChecked($this->testOBJ->isSkillServiceEnabled());
441 if($this->testOBJ->participantDataExist()) $skillService->setDisabled(
true);
442 $form->addItem($skillService);
462 if( !$this->testOBJ->participantDataExist() )
467 $this->testOBJ->setSkillServiceEnabled($form->
getItemByPostVar(
'skill_service')->getChecked());
472 $this->testOBJ->saveToDb(
true);
475 include_once
'Modules/Test/classes/class.ilECSTestSettings.php';
477 $ecs->handleSettingsUpdate();
486 $header->setTitle($this->lng->txt(
"tst_general_properties"));
491 include_once
'Services/MetaData/classes/class.ilMD.php';
492 $md_obj =
new ilMD($this->testOBJ->getId(), 0,
"tst");
497 $title->setValue($md_section->getTitle());
500 $ids = $md_section->getDescriptionIds();
502 $desc_obj = $md_section->getDescription(array_pop($ids));
507 $desc->setValue($desc_obj->getDescription());
512 $pool_usage =
new ilRadioGroupInputGUI($this->lng->txt(
'test_question_pool_usage'),
'use_pool');
514 $optional_qpl =
new ilRadioOption($this->lng->txt(
'test_question_pool_usage_optional'), 1);
515 $optional_qpl->
setInfo($this->lng->txt(
'test_question_pool_usage_optional_info'));
516 $pool_usage->addOption($optional_qpl);
518 $tst_directly =
new ilRadioOption($this->lng->txt(
'test_question_pool_usage_tst_directly'), 0);
519 $tst_directly->
setInfo($this->lng->txt(
'test_question_pool_usage_tst_directly_info'));
520 $pool_usage->addOption($tst_directly);
522 $pool_usage->setValue($this->testOBJ->getPoolUsage() ? 1 : 0);
526 $questSetType =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_question_set_type"),
'question_set_type');
529 $this->lng->txt(
"tst_question_set_type_fixed_desc")
531 $questSetType->addOption($questSetTypeFixed);
534 $this->lng->txt(
"tst_question_set_type_random_desc")
536 $questSetType->addOption($questSetTypeRandom);
539 $this->lng->txt(
"tst_question_set_type_dynamic_desc")
541 $questSetType->addOption($questSetTypeContinues);
542 $questSetType->
setValue($this->testOBJ->getQuestionSetType());
543 if ($this->testOBJ->participantDataExist()) {
544 $questSetType->setDisabled(
true);
550 if ($this->testOBJ->participantDataExist()) $anonymity->
setDisabled(
true);
551 $rb =
new ilRadioOption($this->lng->txt(
'tst_anonymity_no_anonymization'), 0);
552 $anonymity->addOption($rb);
553 $rb =
new ilRadioOption($this->lng->txt(
'tst_anonymity_anonymous_test'), 1);
554 $anonymity->addOption($rb);
555 $anonymity->
setValue((
int)$this->testOBJ->getAnonymity());
564 include_once
'Services/MetaData/classes/class.ilMD.php';
565 $md_obj =&
new ilMD($this->testOBJ->getId(), 0,
"tst");
573 $md_desc_ids = $md_section->getDescriptionIds();
576 $md_desc = $md_section->getDescription(array_pop($md_desc_ids));
582 $md_desc = $md_section->addDescription();
589 $this->testOBJ->update();
594 $this->testOBJ->setPoolUsage((
int)$form->
getItemByPostVar(
'use_pool')->getValue());
597 if (!$this->testOBJ->participantDataExist())
602 $this->testOBJ->setQuestionSetType($form->
getItemByPostVar(
'question_set_type')->getValue());
607 if( !$this->testOBJ->participantDataExist() && $this->
formPropertyExists($form,
'anonymity') )
609 $this->testOBJ->setAnonymity($form->
getItemByPostVar(
'anonymity')->getValue());
618 include_once
"Services/Object/classes/class.ilObjectActivation.php";
619 $this->lng->loadLanguageModule(
'rep');
622 $section->setTitle($this->lng->txt(
'rep_activation_availability'));
626 $act_obj_info = $act_ref_info =
"";
628 $act_obj_info =
' ' . $this->lng->txt(
'rep_activation_online_object_info');
629 $act_ref_info = $this->lng->txt(
'rep_activation_access_ref_info');
633 $online->
setChecked($this->testOBJ->isOnline());
634 $online->setInfo($this->lng->txt(
'tst_activation_online_info') . $act_obj_info);
637 $act_type =
new ilCheckboxInputGUI($this->lng->txt(
'rep_visibility_until'),
'activation_type');
638 $act_type->
setChecked($this->testOBJ->isActivationLimited());
641 $this->tpl->addJavaScript(
'./Services/Form/js/date_duration.js');
642 include_once
"Services/Form/classes/class.ilDateDurationInputGUI.php";
645 $date = $this->testOBJ->getActivationStartingTime();
647 $dur->setStartText($this->lng->txt(
'rep_activation_limited_start'));
648 $date = $this->testOBJ->getActivationEndingTime();
650 $dur->setEndText($this->lng->txt(
'rep_activation_limited_end'));
651 $act_type->addSubItem($dur);
653 $visible =
new ilCheckboxInputGUI($this->lng->txt(
'rep_activation_limited_visibility'),
'activation_visibility');
654 $visible->
setInfo($this->lng->txt(
'tst_activation_limited_visibility_info'));
655 $visible->setChecked($this->testOBJ->getActivationVisibility());
656 $act_type->addSubItem($visible);
672 $this->testOBJ->setActivationLimited(
true);
673 $this->testOBJ->setActivationVisibility($form->
getItemByPostVar(
'activation_visibility')->getChecked());
676 $this->testOBJ->setActivationStartingTime($period->getStart()->get(
IL_CAL_UNIX));
677 $this->testOBJ->setActivationEndingTime($period->getEnd()->get(
IL_CAL_UNIX));
681 $this->testOBJ->setActivationLimited(
false);
691 $section->setTitle($this->lng->txt(
'tst_settings_header_intro'));
695 $introEnabled =
new ilCheckboxInputGUI($this->lng->txt(
"tst_introduction"),
'intro_enabled');
696 $introEnabled->
setChecked($this->testOBJ->isIntroductionEnabled());
697 $introEnabled->setInfo($this->lng->txt(
'tst_introduction_desc'));
699 $intro =
new ilTextAreaInputGUI($this->lng->txt(
"tst_introduction_text"),
"introduction");
701 $intro->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getIntroduction(),
false,
true));
704 $intro->setUseRte(TRUE);
705 $intro->addPlugin(
"latex");
706 $intro->addButton(
"latex");
707 $intro->setRTESupport($this->testOBJ->getId(),
"tst",
"assessment");
708 $intro->setRteTagSet(
'full');
709 $introEnabled->addSubItem($intro);
714 $showinfo->setChecked($this->testOBJ->getShowInfo());
715 $showinfo->setInfo($this->lng->txt(
"showinfo_desc"));
726 $this->testOBJ->setIntroductionEnabled($form->
getItemByPostVar(
'intro_enabled')->getChecked());
734 $this->testOBJ->setIntroduction(
'');
740 $this->testOBJ->setShowInfo($form->
getItemByPostVar(
'showinfo')->getChecked());
750 $header->setTitle($this->lng->txt(
"tst_settings_header_execution"));
754 $enablestartingtime =
new ilCheckboxInputGUI($this->lng->txt(
"tst_starting_time"),
"chb_starting_time");
755 $enablestartingtime->
setInfo($this->lng->txt(
"tst_starting_time_desc"));
756 $enablestartingtime->setChecked($this->testOBJ->isStartingTimeEnabled());
760 $startingtime->setShowTime(
true);
761 if( strlen($this->testOBJ->getStartingTime()) )
769 $enablestartingtime->addSubItem($startingtime);
770 $form->
addItem($enablestartingtime);
771 if ($this->testOBJ->participantDataExist())
773 $enablestartingtime->setDisabled(
true);
774 $startingtime->setDisabled(
true);
778 $enableendingtime =
new ilCheckboxInputGUI($this->lng->txt(
"tst_ending_time"),
"chb_ending_time");
779 $enableendingtime->
setInfo($this->lng->txt(
"tst_ending_time_desc"));
780 $enableendingtime->setChecked($this->testOBJ->isEndingTimeEnabled());
784 $endingtime->setShowTime(
true);
785 if (strlen($this->testOBJ->getEndingTime()))
793 $enableendingtime->addSubItem($endingtime);
794 $form->
addItem($enableendingtime);
797 $pwEnabled =
new ilCheckboxInputGUI($this->lng->txt(
'tst_password'),
'password_enabled');
798 $pwEnabled->
setChecked($this->testOBJ->isPasswordEnabled());
799 $pwEnabled->setInfo($this->lng->txt(
"tst_password_details"));
800 $password =
new ilTextInputGUI($this->lng->txt(
"tst_password_enter"),
"password");
802 $password->setSize(20);
803 $password->setMaxLength(20);
804 $password->setValue($this->testOBJ->getPassword());
805 $pwEnabled->addSubItem($password);
809 $fixedparticipants =
new ilCheckboxInputGUI($this->lng->txt(
'participants_invitation'),
"fixedparticipants");
811 $fixedparticipants->setChecked($this->testOBJ->getFixedParticipants());
812 $fixedparticipants->setInfo($this->lng->txt(
"participants_invitation_description"));
813 if ($this->testOBJ->participantDataExist())
815 $fixedparticipants->setDisabled(
true);
817 $form->
addItem($fixedparticipants);
820 $simulLimited =
new ilCheckboxInputGUI($this->lng->txt(
"tst_allowed_users"),
'limitUsers');
821 $simulLimited->
setInfo($this->lng->txt(
"tst_allowed_users_desc"));
822 $simulLimited->setChecked($this->testOBJ->isLimitUsersEnabled());
825 $simul =
new ilNumberInputGUI($this->lng->txt(
"tst_allowed_users_max"),
"allowedUsers");
827 $simul->allowDecimals(
false);
828 $simul->setMinValue(1);
829 $simul->setMinvalueShouldBeGreater(
false);
831 $simul->setValue(($this->testOBJ->getAllowedUsers()) ? $this->testOBJ->getAllowedUsers() :
'');
832 $simulLimited->addSubItem($simul);
835 $idle =
new ilNumberInputGUI($this->lng->txt(
"tst_allowed_users_time_gap"),
"allowedUsersTimeGap");
836 $idle->
setInfo($this->lng->txt(
"tst_allowed_users_time_gap_desc"));
838 $idle->setSuffix($this->lng->txt(
"seconds"));
839 $idle->setValue(($this->testOBJ->getAllowedUsersTimeGap()) ? $this->testOBJ->getAllowedUsersTimeGap() : 300);
840 $simulLimited->addSubItem($idle);
852 if( $this->
formPropertyExists($form,
'chb_starting_time') && !$this->testOBJ->participantDataExist() )
860 $this->testOBJ->setStartingTimeEnabled(
true);
864 $this->testOBJ->setStartingTimeEnabled(
false);
877 $this->testOBJ->setEndingTimeEnabled(
true);
881 $this->testOBJ->setEndingTimeEnabled(
false);
887 $this->testOBJ->setPasswordEnabled($form->
getItemByPostVar(
'password_enabled')->getChecked());
891 $this->testOBJ->setPassword($form->
getItemByPostVar(
'password')->getValue());
895 $this->testOBJ->setPassword(
'');
899 if( $this->
formPropertyExists($form,
'fixedparticipants') && !$this->testOBJ->participantDataExist() )
901 $this->testOBJ->setFixedParticipants($form->
getItemByPostVar(
'fixedparticipants')->getChecked());
906 $this->testOBJ->setLimitUsersEnabled($form->
getItemByPostVar(
'limitUsers')->getChecked());
910 $this->testOBJ->setAllowedUsers($form->
getItemByPostVar(
'allowedUsers')->getValue());
911 $this->testOBJ->setAllowedUsersTimeGap($form->
getItemByPostVar(
'allowedUsersTimeGap')->getValue());
915 $this->testOBJ->setAllowedUsers(
'');
927 $header->setTitle($this->lng->txt(
"tst_settings_header_test_run"));
931 $limitPasses =
new ilCheckboxInputGUI($this->lng->txt(
"tst_limit_nr_of_tries"),
'limitPasses');
932 $limitPasses->
setInfo($this->lng->txt(
"tst_nr_of_tries_desc"));
933 $limitPasses->setChecked($this->testOBJ->getNrOfTries() > 0);
934 $nr_of_tries =
new ilNumberInputGUI($this->lng->txt(
"tst_nr_of_tries"),
"nr_of_tries");
936 $nr_of_tries->allowDecimals(
false);
937 $nr_of_tries->setMinValue(1);
938 $nr_of_tries->setMinvalueShouldBeGreater(
false);
939 $nr_of_tries->setValue($this->testOBJ->getNrOfTries() ? $this->testOBJ->getNrOfTries() : 1);
940 $nr_of_tries->setRequired(
true);
941 if( $this->testOBJ->participantDataExist() )
943 $limitPasses->setDisabled(
true);
944 $nr_of_tries->setDisabled(
true);
946 $limitPasses->addSubItem($nr_of_tries);
950 $processing =
new ilCheckboxInputGUI($this->lng->txt(
"tst_processing_time"),
"chb_processing_time");
951 $processing->
setInfo($this->lng->txt(
"tst_processing_time_desc"));
952 $processing->setValue(1);
955 $processing->setChecked(
true);
957 $processing->setChecked($this->testOBJ->getEnableProcessingTime());
961 $processingtime =
new ilNumberInputGUI($this->lng->txt(
"tst_processing_time_duration"),
'processing_time');
963 $processingtime->setMinValue(1);
964 $processingtime->setMinvalueShouldBeGreater(
false);
965 $processingtime->setValue($this->testOBJ->getProcessingTimeAsMinutes());
966 $processingtime->setSize(5);
967 $processingtime->setSuffix($this->lng->txt(
'minutes'));
968 $processingtime->setInfo($this->lng->txt(
"tst_processing_time_duration_desc"));
969 $processing->addSubItem($processingtime);
973 $resetprocessing->setValue(1);
974 $resetprocessing->setOptionTitle($this->lng->txt(
"tst_reset_processing_time"));
975 $resetprocessing->setChecked($this->testOBJ->getResetProcessingTime());
976 $resetprocessing->setInfo($this->lng->txt(
"tst_reset_processing_time_desc"));
977 $processing->addSubItem($resetprocessing);
980 if( $this->testOBJ->participantDataExist() )
982 $processing->setDisabled(
true);
983 $processingtime->setDisabled(
true);
984 $resetprocessing->setDisabled(
true);
990 $kiosk->setChecked($this->testOBJ->getKioskMode());
991 $kiosk->setInfo($this->lng->txt(
"kiosk_description"));
996 $kiosktitle->addOption(
new ilCheckboxOption($this->lng->txt(
"kiosk_show_participant"),
'kiosk_participant',
''));
998 if ($this->testOBJ->getShowKioskModeTitle()) array_push($values,
'kiosk_title');
999 if ($this->testOBJ->getShowKioskModeParticipant()) array_push($values,
'kiosk_participant');
1000 $kiosktitle->setValue($values);
1001 $kiosktitle->setInfo($this->lng->txt(
"kiosk_options_desc"));
1002 $kiosk->addSubItem($kiosktitle);
1006 $examIdInPass =
new ilCheckboxInputGUI($this->lng->txt(
'examid_in_test_pass'),
'examid_in_test_pass');
1007 $examIdInPass->
setInfo($this->lng->txt(
'examid_in_test_pass_desc'));
1008 $examIdInPass->setChecked($this->testOBJ->isShowExamIdInTestPassEnabled());
1009 $form->
addItem($examIdInPass);
1017 if (!$this->testOBJ->participantDataExist())
1024 $this->testOBJ->setNrOfTries($form->
getItemByPostVar(
'nr_of_tries')->getValue());
1028 $this->testOBJ->setNrOfTries(0);
1032 $this->testOBJ->setEnableProcessingTime($form->
getItemByPostVar(
'chb_processing_time')->getChecked());
1033 if ($this->testOBJ->getEnableProcessingTime())
1035 $this->testOBJ->setProcessingTimeByMinutes($form->
getItemByPostVar(
'processing_time')->getValue());
1036 $this->testOBJ->setResetProcessingTime($form->
getItemByPostVar(
'chb_reset_processing_time')->getChecked());
1040 $this->testOBJ->setProcessingTime(
'');
1041 $this->testOBJ->setResetProcessingTime(
false);
1047 $this->testOBJ->setKioskMode($form->
getInput(
'kiosk'));
1049 if (is_array($kioskOptions))
1051 $this->testOBJ->setShowKioskModeTitle(in_array(
'kiosk_title', $kioskOptions));
1052 $this->testOBJ->setShowKioskModeParticipant(in_array(
'kiosk_participant', $kioskOptions));
1056 $this->testOBJ->setShowKioskModeTitle(
false);
1057 $this->testOBJ->setShowKioskModeParticipant(
false);
1064 $this->testOBJ->setShowExamIdInTestPassEnabled($value);
1074 'title_output',
'autosave',
'chb_shuffle_questions',
'chb_shuffle_questions',
1075 'offer_hints',
'instant_feedback',
'obligations_enabled',
1082 $seqheader->setTitle($this->lng->txt(
"tst_presentation_properties"));
1089 $title_output->addOption(
new ilRadioOption($this->lng->txt(
"tst_title_output_hide_points"), 1,
''));
1090 $title_output->addOption(
new ilRadioOption($this->lng->txt(
"tst_title_output_no_title"), 2,
''));
1091 $title_output->setValue($this->testOBJ->getTitleOutput());
1092 $form->
addItem($title_output);
1097 $autosave_output->setChecked($this->testOBJ->getAutosave());
1098 $autosave_output->setInfo($this->lng->txt(
'autosave_info'));
1099 $autosave_interval =
new ilTextInputGUI($this->lng->txt(
'autosave_ival'),
'autosave_ival');
1100 $autosave_interval->
setSize(10);
1101 $autosave_interval->setValue($this->testOBJ->getAutosaveIval()/1000);
1102 $autosave_interval->setSuffix($this->lng->txt(
'seconds'));
1103 $autosave_output->addSubItem($autosave_interval);
1104 $form->
addItem($autosave_output);
1107 $shuffle =
new ilCheckboxInputGUI($this->lng->txt(
"tst_shuffle_questions"),
"chb_shuffle_questions");
1109 $shuffle->setChecked($this->testOBJ->getShuffleQuestions());
1110 $shuffle->setInfo($this->lng->txt(
"tst_shuffle_questions_description"));
1114 $checkBoxOfferHints =
new ilCheckboxInputGUI($this->lng->txt(
'tst_setting_offer_hints_label'),
'offer_hints');
1115 $checkBoxOfferHints->
setChecked($this->testOBJ->isOfferingQuestionHintsEnabled());
1116 $checkBoxOfferHints->setInfo($this->lng->txt(
'tst_setting_offer_hints_info'));
1117 if( $this->testOBJ->participantDataExist() )
1119 $checkBoxOfferHints->setDisabled(
true);
1121 $form->
addItem($checkBoxOfferHints);
1126 $this->lng->txt(
'tst_instant_feedback_results'),
'instant_feedback_points',
1127 $this->lng->txt(
'tst_instant_feedback_results_desc')
1130 $this->lng->txt(
'tst_instant_feedback_answer_generic'),
'instant_feedback_generic',
1131 $this->lng->txt(
'tst_instant_feedback_answer_generic_desc')
1134 $this->lng->txt(
'tst_instant_feedback_answer_specific'),
'instant_feedback_specific',
1135 $this->lng->txt(
'tst_instant_feedback_answer_specific_desc')
1138 $this->lng->txt(
'tst_instant_feedback_solution'),
'instant_feedback_solution',
1139 $this->lng->txt(
'tst_instant_feedback_solution_desc')
1142 if ($this->testOBJ->getSpecificAnswerFeedback()) array_push($values,
'instant_feedback_specific');
1143 if ($this->testOBJ->getGenericAnswerFeedback()) array_push($values,
'instant_feedback_generic');
1144 if ($this->testOBJ->getAnswerFeedbackPoints()) array_push($values,
'instant_feedback_points');
1145 if ($this->testOBJ->getInstantFeedbackSolution()) array_push($values,
'instant_feedback_solution');
1146 $instant_feedback->setValue($values);
1147 $form->
addItem($instant_feedback);
1150 $this->lng->txt(
'tst_instant_feedback_handling'),
'instant_feedback_handling' 1153 $this->lng->txt(
'tst_instant_feedback_handling_none'),
1154 self::INST_FB_HANDLING_OPT_NONE
1156 $radioOption->
setInfo($this->lng->txt(
'tst_instant_feedback_handling_none_desc'));
1157 $radioGroup->addOption($radioOption);
1159 $this->lng->txt(
'tst_instant_feedback_handling_freeze'),
1160 self::INST_FB_HANDLING_OPT_FREEZE
1162 $radioOption->
setInfo($this->lng->txt(
'tst_instant_feedback_handling_freeze_desc'));
1163 $radioGroup->addOption($radioOption);
1165 $this->lng->txt(
'tst_instant_feedback_handling_force_and_freeze'),
1166 self::INST_FB_HANDLING_OPT_FORCE_AND_FREEZE
1168 $radioOption->
setInfo($this->lng->txt(
'tst_instant_feedback_handling_force_and_freeze_desc'));
1169 $radioGroup->addOption($radioOption);
1171 $this->lng->txt(
'tst_instant_feedback_handling_force'),
1172 self::INST_FB_HANDLING_OPT_FORCE
1174 $radioOption->
setInfo($this->lng->txt(
'tst_instant_feedback_handling_force_desc'));
1175 $radioGroup->addOption($radioOption);
1177 $this->testOBJ->isInstantFeedbackAnswerFixationEnabled(),
1178 $this->testOBJ->isForceInstantFeedbackEnabled()
1183 $checkBoxEnableObligations =
new ilCheckboxInputGUI($this->lng->txt(
'tst_setting_enable_obligations_label'),
'obligations_enabled');
1184 $checkBoxEnableObligations->
setChecked($this->testOBJ->areObligationsEnabled());
1185 $checkBoxEnableObligations->setInfo($this->lng->txt(
'tst_setting_enable_obligations_info'));
1186 if( $this->testOBJ->participantDataExist() )
1188 $checkBoxEnableObligations->setDisabled(
true);
1190 $form->
addItem($checkBoxEnableObligations);
1195 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
1197 $char_selector->getConfig()->setAvailability($this->testOBJ->getCharSelectorAvailability());
1198 $char_selector->getConfig()->setDefinition($this->testOBJ->getCharSelectorDefinition());
1199 $char_selector->addFormProperties($form);
1200 $char_selector->setFormValues($form);
1211 $this->testOBJ->setTitleOutput($form->
getItemByPostVar(
'title_output')->getValue());
1216 $this->testOBJ->setAutosave($form->
getItemByPostVar(
'autosave')->getChecked());
1217 $this->testOBJ->setAutosaveIval($form->
getItemByPostVar(
'autosave_ival')->getValue() * 1000);
1222 $this->testOBJ->setShuffleQuestions($form->
getItemByPostVar(
'chb_shuffle_questions')->getChecked());
1225 if (!$this->testOBJ->participantDataExist() && $this->
formPropertyExists($form,
'offer_hints'))
1227 $this->testOBJ->setOfferingQuestionHintsEnabled($form->
getItemByPostVar(
'offer_hints')->getChecked());
1232 $this->testOBJ->setScoringFeedbackOptionsByArray($form->
getItemByPostVar(
'instant_feedback')->getValue());
1240 if (!$this->testOBJ->participantDataExist() && $this->
formPropertyExists($form,
'obligations_enabled'))
1242 $this->testOBJ->setObligationsEnabled($form->
getItemByPostVar(
'obligations_enabled')->getChecked());
1247 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
1249 $char_selector->addFormProperties($form);
1250 $char_selector->getFormValues($form);
1251 $this->testOBJ->setCharSelectorAvailability($char_selector->getConfig()->getAvailability());
1252 $this->testOBJ->setCharSelectorDefinition($char_selector->getConfig()->getDefinition());
1263 $seqheader->setTitle($this->lng->txt(
"tst_sequence_properties"));
1267 $prevanswers =
new ilCheckboxInputGUI($this->lng->txt(
"tst_use_previous_answers"),
"chb_use_previous_answers");
1269 $prevanswers->setChecked($this->testOBJ->getUsePreviousAnswers());
1270 $prevanswers->setInfo($this->lng->txt(
"tst_use_previous_answers_description"));
1274 $cancel =
new ilCheckboxInputGUI($this->lng->txt(
"tst_show_cancel"),
"chb_show_cancel");
1276 $cancel->setChecked($this->testOBJ->getShowCancel());
1277 $cancel->setInfo($this->lng->txt(
"tst_show_cancel_description"));
1283 $this->lng->txt(
"tst_postpone_off"), 0, $this->lng->txt(
"tst_postpone_off_desc")
1286 $this->lng->txt(
"tst_postpone_on"), 1, $this->lng->txt(
"tst_postpone_on_desc")
1288 $postpone->setValue((
int)$this->testOBJ->getSequenceSettings());
1292 $list_of_questions =
new ilCheckboxInputGUI($this->lng->txt(
"tst_show_summary"),
"list_of_questions");
1295 $list_of_questions->setChecked($this->testOBJ->getListOfQuestions());
1296 $list_of_questions->setInfo($this->lng->txt(
"tst_show_summary_description"));
1299 $list_of_questions_options->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_list_of_questions_start"),
'chb_list_of_questions_start',
''));
1300 $list_of_questions_options->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_list_of_questions_end"),
'chb_list_of_questions_end',
''));
1301 $list_of_questions_options->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_list_of_questions_with_description"),
'chb_list_of_questions_with_description',
''));
1303 if ($this->testOBJ->getListOfQuestionsStart()) array_push($values,
'chb_list_of_questions_start');
1304 if ($this->testOBJ->getListOfQuestionsEnd()) array_push($values,
'chb_list_of_questions_end');
1305 if ($this->testOBJ->getListOfQuestionsDescription()) array_push($values,
'chb_list_of_questions_with_description');
1306 $list_of_questions_options->setValue($values);
1308 $list_of_questions->addSubItem($list_of_questions_options);
1309 $form->
addItem($list_of_questions);
1312 $marking =
new ilCheckboxInputGUI($this->lng->txt(
"question_marking"),
"chb_show_marker");
1314 $marking->setChecked($this->testOBJ->getShowMarker());
1315 $marking->setInfo($this->lng->txt(
"question_marking_description"));
1326 $this->testOBJ->setUsePreviousAnswers($form->
getInput(
'chb_use_previous_answers'));
1331 $this->testOBJ->setShowCancel($form->
getItemByPostVar(
'chb_show_cancel')->getChecked());
1336 $this->testOBJ->setPostponingEnabled((
bool)$form->
getItemByPostVar(
'postpone')->getValue());
1339 $this->testOBJ->setListOfQuestions($form->
getItemByPostVar(
'list_of_questions')->getChecked());
1340 $listOfQuestionsOptions = $form->
getItemByPostVar(
'list_of_questions_options')->getValue();
1341 if(is_array($listOfQuestionsOptions))
1343 $this->testOBJ->setListOfQuestionsStart(in_array(
'chb_list_of_questions_start', $listOfQuestionsOptions));
1344 $this->testOBJ->setListOfQuestionsEnd(in_array(
'chb_list_of_questions_end', $listOfQuestionsOptions));
1345 $this->testOBJ->setListOfQuestionsDescription(in_array(
'chb_list_of_questions_with_description', $listOfQuestionsOptions));
1349 $this->testOBJ->setListOfQuestionsStart(0);
1350 $this->testOBJ->setListOfQuestionsEnd(0);
1351 $this->testOBJ->setListOfQuestionsDescription(0);
1356 $this->testOBJ->setShowMarker($form->
getItemByPostVar(
'chb_show_marker')->getChecked());
1366 $testFinishHeader->setTitle($this->lng->txt(
"tst_final_information"));
1367 $form->
addItem($testFinishHeader);
1370 $enable_examview =
new ilCheckboxInputGUI($this->lng->txt(
"enable_examview"),
'enable_examview');
1372 $enable_examview->setChecked($this->testOBJ->getEnableExamview());
1373 $enable_examview->setInfo($this->lng->txt(
"enable_examview_desc"));
1375 $show_examview_pdf->setValue(1);
1376 $show_examview_pdf->setChecked($this->testOBJ->getShowExamviewPdf());
1377 $show_examview_pdf->setOptionTitle($this->lng->txt(
"show_examview_pdf"));
1378 $enable_examview->addSubItem($show_examview_pdf);
1379 $form->
addItem($enable_examview);
1382 $showfinal =
new ilCheckboxInputGUI($this->lng->txt(
"final_statement"),
"showfinalstatement");
1383 $showfinal->
setChecked($this->testOBJ->getShowFinalStatement());
1384 $showfinal->setInfo($this->lng->txt(
"final_statement_show_desc"));
1387 $finalstatement =
new ilTextAreaInputGUI($this->lng->txt(
"final_statement"),
"finalstatement");
1389 $finalstatement->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getFinalStatement(),
false,
true));
1390 $finalstatement->setRows(10);
1391 $finalstatement->setCols(80);
1392 $finalstatement->setUseRte(TRUE);
1393 $finalstatement->addPlugin(
"latex");
1394 $finalstatement->addButton(
"latex");
1395 $finalstatement->setRTESupport($this->testOBJ->getId(),
"tst",
"assessment");
1396 $finalstatement->setRteTagSet(
'full');
1397 $showfinal->addSubItem($finalstatement);
1399 $redirection_mode = $this->testOBJ->getRedirectionMode();
1400 $rm_enabled =
new ilCheckboxInputGUI($this->lng->txt(
'redirect_after_finishing_tst'),
'redirection_enabled');
1401 $rm_enabled->
setInfo($this->lng->txt(
'redirect_after_finishing_tst_desc'));
1402 $rm_enabled->setChecked($redirection_mode ==
'0' ?
false :
true);
1403 $radio_rm =
new ilRadioGroupInputGUI($this->lng->txt(
'redirect_after_finishing_rule'),
'redirection_mode');
1405 $radio_rm->addOption($always);
1407 $radio_rm->addOption($kiosk);
1409 $rm_enabled->addSubItem($radio_rm);
1410 $redirection_url =
new ilTextInputGUI($this->lng->txt(
'redirection_url'),
'redirection_url');
1411 $redirection_url->
setValue((
string)$this->testOBJ->getRedirectionUrl());
1412 $redirection_url->setRequired(
true);
1413 $rm_enabled->addSubItem($redirection_url);
1418 $sign_submission = $this->testOBJ->getSignSubmission();
1419 $sign_submission_enabled =
new ilCheckboxInputGUI($this->lng->txt(
'sign_submission'),
'sign_submission');
1420 $sign_submission_enabled->
setChecked($sign_submission);
1421 $sign_submission_enabled->setInfo($this->lng->txt(
'sign_submission_info'));
1422 $form->
addItem($sign_submission_enabled);
1425 $mailnotification =
new ilCheckboxInputGUI($this->lng->txt(
"tst_finish_notification"),
"mailnotification");
1426 $mailnotification->
setInfo($this->lng->txt(
"tst_finish_notification_desc"));
1427 $mailnotification->setChecked($this->testOBJ->getMailNotification() > 0);
1428 $form->
addItem($mailnotification);
1430 $mailnotificationContent =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_finish_notification_content"),
"mailnotification_content");
1431 $mailnotificationContent->
addOption(
new ilRadioOption($this->lng->txt(
"tst_finish_notification_simple"), 1,
''));
1432 $mailnotificationContent->addOption(
new ilRadioOption($this->lng->txt(
"tst_finish_notification_advanced"), 2,
''));
1433 $mailnotificationContent->setValue($this->testOBJ->getMailNotification() ? $this->testOBJ->getMailNotification() : 1);
1434 $mailnotificationContent->setRequired(
true);
1435 $mailnotification->addSubItem($mailnotificationContent);
1438 $mailnottype->setValue(1);
1439 $mailnottype->setOptionTitle($this->lng->txt(
"mailnottype"));
1440 $mailnottype->setChecked($this->testOBJ->getMailNotificationType());
1441 $mailnotification->addSubItem($mailnottype);
1451 $this->testOBJ->setEnableExamview($form->
getItemByPostVar(
'enable_examview')->getChecked());
1452 $this->testOBJ->setShowExamviewPdf($form->
getItemByPostVar(
'show_examview_pdf')->getChecked());
1455 $this->testOBJ->setShowFinalStatement($form->
getItemByPostVar(
'showfinalstatement')->getChecked());
1460 $this->testOBJ->setRedirectionMode($form->
getItemByPostVar(
'redirection_mode')->getValue());
1468 $this->testOBJ->setRedirectionUrl($form->
getItemByPostVar(
'redirection_url')->getValue());
1472 $this->testOBJ->setRedirectionUrl(null);
1477 $this->testOBJ->setSignSubmission($form->
getItemByPostVar(
'sign_submission')->getChecked());
1482 $this->testOBJ->setMailNotification($form->
getItemByPostVar(
'mailnotification_content')->getValue());
1483 $this->testOBJ->setMailNotificationType($form->
getItemByPostVar(
'mailnottype')->getChecked());
1487 $this->testOBJ->setMailNotification(0);
1488 $this->testOBJ->setMailNotificationType(
false);
1494 switch($instantFeedbackHandlingValue)
1496 case self::INST_FB_HANDLING_OPT_NONE:
1497 $this->testOBJ->setInstantFeedbackAnswerFixationEnabled(
false);
1498 $this->testOBJ->setForceInstantFeedbackEnabled(
false);
1501 case self::INST_FB_HANDLING_OPT_FREEZE:
1502 $this->testOBJ->setInstantFeedbackAnswerFixationEnabled(
true);
1503 $this->testOBJ->setForceInstantFeedbackEnabled(
false);
1506 case self::INST_FB_HANDLING_OPT_FORCE:
1507 $this->testOBJ->setInstantFeedbackAnswerFixationEnabled(
false);
1508 $this->testOBJ->setForceInstantFeedbackEnabled(
true);
1511 case self::INST_FB_HANDLING_OPT_FORCE_AND_FREEZE:
1512 $this->testOBJ->setInstantFeedbackAnswerFixationEnabled(
true);
1513 $this->testOBJ->setForceInstantFeedbackEnabled(
true);
1522 case !$freezeAnswersEnabled && !$forceInstFbEnabled:
return self::INST_FB_HANDLING_OPT_NONE;
1523 case $freezeAnswersEnabled && !$forceInstFbEnabled:
return self::INST_FB_HANDLING_OPT_FREEZE;
1524 case !$freezeAnswersEnabled && $forceInstFbEnabled:
return self::INST_FB_HANDLING_OPT_FORCE;
1525 case $freezeAnswersEnabled && $forceInstFbEnabled:
return self::INST_FB_HANDLING_OPT_FORCE_AND_FREEZE;
saveGeneralProperties(ilPropertyFormGUI $form)
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
addAvailabilityProperties(ilPropertyFormGUI $form)
saveInstFbHandlingSettings($instantFeedbackHandlingValue)
This class represents an option in a radio group.
This class provides processing control methods.
saveTestFinishProperties(ilPropertyFormGUI $form)
showResetTemplateConfirmationCmd()
Enable all settings - Confirmation.
This class represents an option in a checkbox group.
performSaveForm(ilPropertyFormGUI $form)
const QUESTION_SET_TYPE_RANDOM
type setting value for random question set
& _getUsedHTMLTagsAsString($a_module="")
Returns a string of all allowed HTML tags for text editing.
This shows a character selector.
saveTestSequenceSettings(ilPropertyFormGUI $form)
const CMD_SHOW_RESET_TPL_CONFIRM
removeHiddenItems(ilPropertyFormGUI $form)
const REDIRECT_NONE
Redirect after finishing test constants.
setInfo($a_info)
Set Info.
$testQuestionSetConfigFactory
static _getAllReferences($a_id)
get all reference ids of object
Administration class for plugins.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
addQuestionBehaviourProperties(ilPropertyFormGUI $form)
setValue($a_value)
Set Value.
const CMD_CONFIRMED_SAVE_FORM
isSectionHeaderRequired($fields)
__construct(ilCtrl $ctrl, ilAccessHandler $access, ilLanguage $lng, ilTemplate $tpl, ilTree $tree, ilDB $db, ilPluginAdmin $pluginAdmin, ilObjUser $activeUser, ilObjTestGUI $testGUI)
Constructor.
special template class to simplify handling of ITX/PEAR
setSize($a_size)
Set Size.
addGeneralProperties(ilPropertyFormGUI $form)
This class represents a text property in a property form.
setCols($a_cols)
Set Cols.
saveTestAccessProperties(ilPropertyFormGUI $form)
saveTestIntroProperties(ilPropertyFormGUI $form)
saveQuestionBehaviourProperties(ilPropertyFormGUI $form)
static isSkillManagementGloballyActivated()
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
isCharSelectorPropertyRequired()
const CMD_CONFIRMED_RESET_TPL
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
const INST_FB_HANDLING_OPT_FORCE_AND_FREEZE
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
executeCommand()
Command Execution.
addTestFinishProperties(ilPropertyFormGUI $form)
addTestRunProperties(ilPropertyFormGUI $form)
addTestSequenceProperties(ilPropertyFormGUI $form)
addTestIntroProperties(ilPropertyFormGUI $form)
getTemplateSettingValue($settingName)
showConfirmation(ilPropertyFormGUI $form, $oldQuestionSetType, $newQuestionSetType, $hasQuestionsWithoutQuestionpool)
const INST_FB_HANDLING_OPT_FREEZE
getSettingsTemplateMessageHTML()
This class represents a text area property in a property form.
isSkillServiceSettingToBeAdjusted(ilPropertyFormGUI $form)
showFormCmd(ilPropertyFormGUI $form=null)
const INST_FB_HANDLING_OPT_FORCE
const QUESTION_SET_TYPE_FIXED
type setting value for fixed question set
formPropertyExists(ilPropertyFormGUI $form, $propertyId)
const INST_FB_HANDLING_OPT_NONE
saveFormCmd($isConfirmedSave=false)
setValue($a_value)
Set Value.
saveTestRunProperties(ilPropertyFormGUI $form)
const QUESTION_SET_TYPE_DYNAMIC
type setting value for dynamic question set (continues testing mode)
addTestAccessProperties(ilPropertyFormGUI $form)
getInstFbHandlingValue($freezeAnswersEnabled, $forceInstFbEnabled)
saveAvailabilityProperties(ilPropertyFormGUI $form)
const CMD_SHOW_FORM
command constants
confirmedResetTemplateCmd()
Enable all settings - remove template.
Confirmation screen class.