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() )
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")
235 $qstSetSetting = $form->getItemByPostVar(
'question_set_type');
236 $qTitleSetting = $form->getItemByPostVar(
'title_output');
240 $qstSetSetting->setAlert($this->lng->txt(
'tst_conflicting_setting'));
241 $qTitleSetting->setAlert($this->lng->txt(
'tst_conflicting_setting'));
252 $questionSetTypeRelatingDataCleanupRequired =
false;
254 $oldQuestionSetType = $this->testOBJ->getQuestionSetType();
257 $newQuestionSetType = $form->getItemByPostVar(
'question_set_type')->getValue();
259 if( !$this->testOBJ->participantDataExist() && $newQuestionSetType != $oldQuestionSetType )
261 $oldQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfigByType(
265 if( $oldQuestionSetConfig->doesQuestionSetRelatedDataExist() )
267 if( !$isConfirmedSave )
272 $form, $oldQuestionSetType, $newQuestionSetType,
273 $this->testOBJ->hasQuestionsWithoutQuestionpool()
278 $form, $oldQuestionSetType, $newQuestionSetType,
false 282 $questionSetTypeRelatingDataCleanupRequired =
true;
285 if( $form->getItemByPostVar(
'online')->getChecked() )
287 $form->getItemByPostVar(
'online')->setChecked(
false);
289 if( $this->testOBJ->isOnline() )
291 $infoMsg[] = $this->lng->txt(
"tst_set_offline_due_to_switched_question_set_type_setting");
295 $infoMsg[] = $this->lng->txt(
"tst_cannot_online_due_to_switched_quest_set_type_setting");
302 $newQuestionSetType = $oldQuestionSetType;
309 $form->getItemByPostVar(
'chb_use_previous_answers')->setChecked(
false);
314 if( $form->getItemByPostVar(
'obligations_enabled')->getChecked() )
316 switch( $form->getItemByPostVar(
'instant_feedback_handling')->getValue() )
318 case self::INST_FB_HANDLING_OPT_FREEZE:
320 $form->getItemByPostVar(
'instant_feedback_handling')->setValue(self::INST_FB_HANDLING_OPT_NONE);
321 $infoMsg[] = $this->lng->txt(
"tst_conflict_fbh_oblig_quest");
322 $infoMsg[] = $this->lng->txt(
"tst_conflict_reset_non_fbh");
325 case self::INST_FB_HANDLING_OPT_FORCE_AND_FREEZE:
327 $form->getItemByPostVar(
'instant_feedback_handling')->setValue(self::INST_FB_HANDLING_OPT_FORCE);
328 $infoMsg[] = $this->lng->txt(
"tst_conflict_fbh_oblig_quest");
329 $infoMsg[] = $this->lng->txt(
"tst_conflict_reset_fbh_force");
340 if( $questionSetTypeRelatingDataCleanupRequired )
342 $oldQuestionSetConfig->removeQuestionSetRelatedData();
347 if( !$this->testOBJ->participantDataExist() && !$this->testOBJ->getFixedParticipants() )
349 foreach ($this->testOBJ->getInvitedUsers() as $usrId => $usrData)
351 $this->testOBJ->disinviteUser($usrId);
357 if( count($infoMsg) )
363 $this->ctrl->redirect($this, self::CMD_SHOW_FORM);
371 require_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
374 $confirmationGUI->setFormAction($this->ctrl->getFormAction($this));
375 $confirmationGUI->setHeaderText($this->lng->txt(
"test_confirm_template_reset"));
376 $confirmationGUI->setCancel($this->lng->txt(
'cancel'), self::CMD_SHOW_FORM);
377 $confirmationGUI->setConfirm($this->lng->txt(
'confirm'), self::CMD_CONFIRMED_RESET_TPL);
379 $this->tpl->setContent( $this->ctrl->getHTML($confirmationGUI) );
387 $this->testOBJ->setTemplate(null);
388 $this->testOBJ->saveToDB();
391 $this->ctrl->redirect($this, self::CMD_SHOW_FORM);
418 return $ilSetting->get(
'char_selector_availability') > 0;
424 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
426 $form->setFormAction($this->ctrl->getFormAction($this));
427 $form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt(
"save"));
428 $form->setTableWidth(
"100%");
429 $form->setId(
"test_properties");
441 include_once
'Modules/Test/classes/class.ilECSTestSettings.php';
443 $ecs->addSettingsToForm($form,
'tst');
449 $otherHead->setTitle($this->lng->txt(
'other'));
450 $form->addItem($otherHead);
452 $skillService =
new ilCheckboxInputGUI($this->lng->txt(
'tst_activate_skill_service'),
'skill_service');
453 $skillService->
setInfo($this->lng->txt(
'tst_activate_skill_service_desc'));
454 $skillService->setChecked($this->testOBJ->isSkillServiceEnabled());
455 if($this->testOBJ->participantDataExist()) $skillService->setDisabled(
true);
456 $form->addItem($skillService);
476 if( !$this->testOBJ->participantDataExist() )
481 $this->testOBJ->setSkillServiceEnabled($form->
getItemByPostVar(
'skill_service')->getChecked());
486 $this->testOBJ->saveToDb(
true);
489 include_once
'Modules/Test/classes/class.ilECSTestSettings.php';
491 $ecs->handleSettingsUpdate();
500 $header->setTitle($this->lng->txt(
"tst_general_properties"));
505 include_once
'Services/MetaData/classes/class.ilMD.php';
506 $md_obj =
new ilMD($this->testOBJ->getId(), 0,
"tst");
510 $title->setRequired(
true);
511 $title->setValue($md_section->getTitle());
514 $ids = $md_section->getDescriptionIds();
516 $desc_obj = $md_section->getDescription(array_pop($ids));
521 $desc->setValue($desc_obj->getDescription());
526 $pool_usage =
new ilRadioGroupInputGUI($this->lng->txt(
'test_question_pool_usage'),
'use_pool');
528 $optional_qpl =
new ilRadioOption($this->lng->txt(
'test_question_pool_usage_optional'), 1);
529 $optional_qpl->
setInfo($this->lng->txt(
'test_question_pool_usage_optional_info'));
530 $pool_usage->addOption($optional_qpl);
532 $tst_directly =
new ilRadioOption($this->lng->txt(
'test_question_pool_usage_tst_directly'), 0);
533 $tst_directly->
setInfo($this->lng->txt(
'test_question_pool_usage_tst_directly_info'));
534 $pool_usage->addOption($tst_directly);
536 $pool_usage->setValue($this->testOBJ->getPoolUsage() ? 1 : 0);
540 $questSetType =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_question_set_type"),
'question_set_type');
543 $this->lng->txt(
"tst_question_set_type_fixed_desc")
545 $questSetType->addOption($questSetTypeFixed);
548 $this->lng->txt(
"tst_question_set_type_random_desc")
550 $questSetType->addOption($questSetTypeRandom);
553 $this->lng->txt(
"tst_question_set_type_dynamic_desc")
555 $questSetType->addOption($questSetTypeContinues);
556 $questSetType->
setValue($this->testOBJ->getQuestionSetType());
557 if ($this->testOBJ->participantDataExist()) {
558 $questSetType->setDisabled(
true);
564 if ($this->testOBJ->participantDataExist()) $anonymity->
setDisabled(
true);
565 $rb =
new ilRadioOption($this->lng->txt(
'tst_anonymity_no_anonymization'), 0);
566 $anonymity->addOption($rb);
567 $rb =
new ilRadioOption($this->lng->txt(
'tst_anonymity_anonymous_test'), 1);
568 $anonymity->addOption($rb);
569 $anonymity->
setValue((
int)$this->testOBJ->getAnonymity());
578 include_once
'Services/MetaData/classes/class.ilMD.php';
579 $md_obj =
new ilMD($this->testOBJ->getId(), 0,
"tst");
587 $md_desc_ids = $md_section->getDescriptionIds();
590 $md_desc = $md_section->getDescription(array_pop($md_desc_ids));
596 $md_desc = $md_section->addDescription();
603 $this->testOBJ->update();
608 $this->testOBJ->setPoolUsage((
int)$form->
getItemByPostVar(
'use_pool')->getValue());
611 if (!$this->testOBJ->participantDataExist())
616 $this->testOBJ->setQuestionSetType($form->
getItemByPostVar(
'question_set_type')->getValue());
621 if( !$this->testOBJ->participantDataExist() && $this->
formPropertyExists($form,
'anonymity') )
623 $this->testOBJ->setAnonymity($form->
getItemByPostVar(
'anonymity')->getValue());
632 include_once
"Services/Object/classes/class.ilObjectActivation.php";
633 $this->lng->loadLanguageModule(
'rep');
636 $section->setTitle($this->lng->txt(
'rep_activation_availability'));
640 $act_obj_info = $act_ref_info =
"";
642 $act_obj_info =
' ' . $this->lng->txt(
'rep_activation_online_object_info');
643 $act_ref_info = $this->lng->txt(
'rep_activation_access_ref_info');
647 $online->
setChecked($this->testOBJ->isOnline());
648 $online->setInfo($this->lng->txt(
'tst_activation_online_info') . $act_obj_info);
651 $act_type =
new ilCheckboxInputGUI($this->lng->txt(
'rep_visibility_until'),
'activation_type');
652 $act_type->
setChecked($this->testOBJ->isActivationLimited());
655 $this->tpl->addJavaScript(
'./Services/Form/js/date_duration.js');
656 include_once
"Services/Form/classes/class.ilDateDurationInputGUI.php";
659 $date = $this->testOBJ->getActivationStartingTime();
661 $dur->setStartText($this->lng->txt(
'rep_activation_limited_start'));
662 $date = $this->testOBJ->getActivationEndingTime();
664 $dur->setEndText($this->lng->txt(
'rep_activation_limited_end'));
665 $act_type->addSubItem($dur);
667 $visible =
new ilCheckboxInputGUI($this->lng->txt(
'rep_activation_limited_visibility'),
'activation_visibility');
668 $visible->
setInfo($this->lng->txt(
'tst_activation_limited_visibility_info'));
669 $visible->setChecked($this->testOBJ->getActivationVisibility());
670 $act_type->addSubItem($visible);
686 $this->testOBJ->setActivationLimited(
true);
687 $this->testOBJ->setActivationVisibility($form->
getItemByPostVar(
'activation_visibility')->getChecked());
690 $this->testOBJ->setActivationStartingTime($period->getStart()->get(
IL_CAL_UNIX));
691 $this->testOBJ->setActivationEndingTime($period->getEnd()->get(
IL_CAL_UNIX));
695 $this->testOBJ->setActivationLimited(
false);
705 $section->setTitle($this->lng->txt(
'tst_settings_header_intro'));
709 $introEnabled =
new ilCheckboxInputGUI($this->lng->txt(
"tst_introduction"),
'intro_enabled');
710 $introEnabled->
setChecked($this->testOBJ->isIntroductionEnabled());
711 $introEnabled->setInfo($this->lng->txt(
'tst_introduction_desc'));
713 $intro =
new ilTextAreaInputGUI($this->lng->txt(
"tst_introduction_text"),
"introduction");
715 $intro->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getIntroduction(),
false,
true));
718 $intro->setUseRte(TRUE);
719 $intro->addPlugin(
"latex");
720 $intro->addButton(
"latex");
721 $intro->setRTESupport($this->testOBJ->getId(),
"tst",
"assessment");
722 $intro->setRteTagSet(
'full');
723 $introEnabled->addSubItem($intro);
728 $showinfo->setChecked($this->testOBJ->getShowInfo());
729 $showinfo->setInfo($this->lng->txt(
"showinfo_desc"));
740 $this->testOBJ->setIntroductionEnabled($form->
getItemByPostVar(
'intro_enabled')->getChecked());
748 $this->testOBJ->setIntroduction(
'');
754 $this->testOBJ->setShowInfo($form->
getItemByPostVar(
'showinfo')->getChecked());
764 $header->setTitle($this->lng->txt(
"tst_settings_header_execution"));
768 $startingtime =
new ilDateTimeInputGUI($this->lng->txt(
"tst_starting_time"),
'starting_time');
769 $startingtime->
setInfo($this->lng->txt(
"tst_starting_time_desc"));
770 $startingtime->setShowTime(
true);
771 if( $this->testOBJ->getStartingTime() != 0 )
777 $startingtime->setDate(null);
781 if ($this->testOBJ->participantDataExist())
783 $startingtime->setDisabled(
true);
787 $endingtime =
new ilDateTimeInputGUI($this->lng->txt(
"tst_ending_time"),
'ending_time');
788 $endingtime->
setInfo($this->lng->txt(
"tst_ending_time_desc"));
789 $endingtime->setShowTime(
true);
790 if ($this->testOBJ->getEndingTime() != 0)
796 $endingtime->setDate(null);
801 $pwEnabled =
new ilCheckboxInputGUI($this->lng->txt(
'tst_password'),
'password_enabled');
802 $pwEnabled->
setChecked($this->testOBJ->isPasswordEnabled());
803 $pwEnabled->setInfo($this->lng->txt(
"tst_password_details"));
804 $password =
new ilTextInputGUI($this->lng->txt(
"tst_password_enter"),
"password");
806 $password->setSize(20);
807 $password->setMaxLength(20);
808 $password->setValue($this->testOBJ->getPassword());
809 $pwEnabled->addSubItem($password);
813 $fixedparticipants =
new ilCheckboxInputGUI($this->lng->txt(
'participants_invitation'),
"fixedparticipants");
815 $fixedparticipants->setChecked($this->testOBJ->getFixedParticipants());
816 $fixedparticipants->setInfo($this->lng->txt(
"participants_invitation_description"));
817 if ($this->testOBJ->participantDataExist())
819 $fixedparticipants->setDisabled(
true);
821 $form->
addItem($fixedparticipants);
824 $simulLimited =
new ilCheckboxInputGUI($this->lng->txt(
"tst_allowed_users"),
'limitUsers');
825 $simulLimited->
setInfo($this->lng->txt(
"tst_allowed_users_desc"));
826 $simulLimited->setChecked($this->testOBJ->isLimitUsersEnabled());
829 $simul =
new ilNumberInputGUI($this->lng->txt(
"tst_allowed_users_max"),
"allowedUsers");
831 $simul->allowDecimals(
false);
832 $simul->setMinValue(1);
833 $simul->setMinvalueShouldBeGreater(
false);
835 $simul->setValue(($this->testOBJ->getAllowedUsers()) ? $this->testOBJ->getAllowedUsers() :
'');
836 $simulLimited->addSubItem($simul);
839 $idle =
new ilNumberInputGUI($this->lng->txt(
"tst_allowed_users_time_gap"),
"allowedUsersTimeGap");
840 $idle->
setInfo($this->lng->txt(
"tst_allowed_users_time_gap_desc"));
842 $idle->setSuffix($this->lng->txt(
"seconds"));
843 $idle->setValue(($this->testOBJ->getAllowedUsersTimeGap()) ? $this->testOBJ->getAllowedUsersTimeGap() : 300);
844 $simulLimited->addSubItem($idle);
855 if( !$this->testOBJ->participantDataExist() )
861 $this->testOBJ->setStartingTime($starting_time->getUnixtime());
862 $this->testOBJ->setStartingTimeEnabled(
true);
866 $this->testOBJ->setStartingTime(null);
867 $this->testOBJ->setStartingTimeEnabled(
false);
875 $this->testOBJ->setEndingTime($ending_time->getUnixtime());
876 $this->testOBJ->setEndingTimeEnabled(
true);
880 $this->testOBJ->setEndingTime(null);
881 $this->testOBJ->setEndingTimeEnabled(
false);
886 $this->testOBJ->setPasswordEnabled($form->
getItemByPostVar(
'password_enabled')->getChecked());
890 $this->testOBJ->setPassword($form->
getItemByPostVar(
'password')->getValue());
894 $this->testOBJ->setPassword(
'');
898 if( $this->
formPropertyExists($form,
'fixedparticipants') && !$this->testOBJ->participantDataExist() )
900 $this->testOBJ->setFixedParticipants($form->
getItemByPostVar(
'fixedparticipants')->getChecked());
905 $this->testOBJ->setLimitUsersEnabled($form->
getItemByPostVar(
'limitUsers')->getChecked());
909 $this->testOBJ->setAllowedUsers($form->
getItemByPostVar(
'allowedUsers')->getValue());
910 $this->testOBJ->setAllowedUsersTimeGap($form->
getItemByPostVar(
'allowedUsersTimeGap')->getValue());
914 $this->testOBJ->setAllowedUsers(
'');
926 $header->setTitle($this->lng->txt(
"tst_settings_header_test_run"));
930 $limitPasses =
new ilCheckboxInputGUI($this->lng->txt(
"tst_limit_nr_of_tries"),
'limitPasses');
931 $limitPasses->
setInfo($this->lng->txt(
"tst_nr_of_tries_desc"));
932 $limitPasses->setChecked($this->testOBJ->getNrOfTries() > 0);
933 $nr_of_tries =
new ilNumberInputGUI($this->lng->txt(
"tst_nr_of_tries"),
"nr_of_tries");
935 $nr_of_tries->allowDecimals(
false);
936 $nr_of_tries->setMinValue(1);
937 $nr_of_tries->setMinvalueShouldBeGreater(
false);
938 $nr_of_tries->setValue($this->testOBJ->getNrOfTries() ? $this->testOBJ->getNrOfTries() : 1);
939 $nr_of_tries->setRequired(
true);
940 if( $this->testOBJ->participantDataExist() )
942 $limitPasses->setDisabled(
true);
943 $nr_of_tries->setDisabled(
true);
945 $limitPasses->addSubItem($nr_of_tries);
949 $pass_waiting_enabled =
new ilCheckboxInputGUI($this->lng->txt(
'tst_pass_waiting_enabled'),
'pass_waiting_enabled');
950 $pass_waiting_enabled->
setInfo($this->lng->txt(
'tst_pass_waiting_info'));
951 $pass_waiting_enabled->setChecked($this->testOBJ->isPassWaitingEnabled());
961 $pw_time_array = explode(
':', $this->testOBJ->getPassWaiting());
965 $duration->setMinutes($pw_time_array[3]);
967 $pass_waiting_enabled->addSubItem(
$duration);
969 $form->
addItem($pass_waiting_enabled);
972 $processing =
new ilCheckboxInputGUI($this->lng->txt(
"tst_processing_time"),
"chb_processing_time");
973 $processing->
setInfo($this->lng->txt(
"tst_processing_time_desc"));
974 $processing->setValue(1);
977 $processing->setChecked(
true);
979 $processing->setChecked($this->testOBJ->getEnableProcessingTime());
983 $processingtime =
new ilNumberInputGUI($this->lng->txt(
"tst_processing_time_duration"),
'processing_time');
985 $processingtime->setMinValue(1);
986 $processingtime->setMinvalueShouldBeGreater(
false);
987 $processingtime->setValue($this->testOBJ->getProcessingTimeAsMinutes());
988 $processingtime->setSize(5);
989 $processingtime->setSuffix($this->lng->txt(
'minutes'));
990 $processingtime->setInfo($this->lng->txt(
"tst_processing_time_duration_desc"));
991 $processing->addSubItem($processingtime);
995 $resetprocessing->setValue(1);
996 $resetprocessing->setOptionTitle($this->lng->txt(
"tst_reset_processing_time"));
997 $resetprocessing->setChecked($this->testOBJ->getResetProcessingTime());
998 $resetprocessing->setInfo($this->lng->txt(
"tst_reset_processing_time_desc"));
999 $processing->addSubItem($resetprocessing);
1002 if( $this->testOBJ->participantDataExist() )
1004 $processing->setDisabled(
true);
1005 $processingtime->setDisabled(
true);
1006 $resetprocessing->setDisabled(
true);
1009 $pass_waiting_enabled->setDisabled(
true);
1015 $kiosk->setChecked($this->testOBJ->getKioskMode());
1016 $kiosk->setInfo($this->lng->txt(
"kiosk_description"));
1021 $kiosktitle->addOption(
new ilCheckboxOption($this->lng->txt(
"kiosk_show_participant"),
'kiosk_participant',
''));
1023 if ($this->testOBJ->getShowKioskModeTitle()) array_push($values,
'kiosk_title');
1024 if ($this->testOBJ->getShowKioskModeParticipant()) array_push($values,
'kiosk_participant');
1025 $kiosktitle->setValue($values);
1026 $kiosktitle->setInfo($this->lng->txt(
"kiosk_options_desc"));
1027 $kiosk->addSubItem($kiosktitle);
1031 $examIdInPass =
new ilCheckboxInputGUI($this->lng->txt(
'examid_in_test_pass'),
'examid_in_test_pass');
1032 $examIdInPass->
setInfo($this->lng->txt(
'examid_in_test_pass_desc'));
1033 $examIdInPass->setChecked($this->testOBJ->isShowExamIdInTestPassEnabled());
1034 $form->
addItem($examIdInPass);
1042 if (!$this->testOBJ->participantDataExist())
1049 $this->testOBJ->setNrOfTries($form->
getItemByPostVar(
'nr_of_tries')->getValue());
1053 $this->testOBJ->setNrOfTries(0);
1064 $pass_waiting_duration[] = sprintf(
"%'.02d", $pass_waiting_values->getMonths());
1065 $pass_waiting_duration[] = sprintf(
"%'.03d",$pass_waiting_values->getDays());
1066 $pass_waiting_duration[] = sprintf(
"%'.02d", $pass_waiting_values->getHours());
1067 $pass_waiting_duration[] = sprintf(
"%'.02d", $pass_waiting_values->getMinutes());
1068 $pass_waiting_duration[] = sprintf(
"%'.02d", $pass_waiting_values->getSeconds());
1070 $pass_waiting_string = implode(
':', $pass_waiting_duration);
1071 $this->testOBJ->setPassWaiting($pass_waiting_string);
1075 $this->testOBJ->setPassWaiting(
"00:000:00:00:00");
1079 $this->testOBJ->setEnableProcessingTime($form->
getItemByPostVar(
'chb_processing_time')->getChecked());
1080 if ($this->testOBJ->getEnableProcessingTime())
1082 $this->testOBJ->setProcessingTimeByMinutes($form->
getItemByPostVar(
'processing_time')->getValue());
1083 $this->testOBJ->setResetProcessingTime($form->
getItemByPostVar(
'chb_reset_processing_time')->getChecked());
1087 $this->testOBJ->setProcessingTime(
'');
1088 $this->testOBJ->setResetProcessingTime(
false);
1094 $this->testOBJ->setKioskMode($form->
getInput(
'kiosk'));
1096 if (is_array($kioskOptions))
1098 $this->testOBJ->setShowKioskModeTitle(in_array(
'kiosk_title', $kioskOptions));
1099 $this->testOBJ->setShowKioskModeParticipant(in_array(
'kiosk_participant', $kioskOptions));
1103 $this->testOBJ->setShowKioskModeTitle(
false);
1104 $this->testOBJ->setShowKioskModeParticipant(
false);
1111 $this->testOBJ->setShowExamIdInTestPassEnabled($value);
1121 'title_output',
'autosave',
'chb_shuffle_questions',
'chb_shuffle_questions',
1122 'offer_hints',
'instant_feedback',
'obligations_enabled',
1129 $seqheader->setTitle($this->lng->txt(
"tst_presentation_properties"));
1136 $title_output->addOption(
new ilRadioOption($this->lng->txt(
"tst_title_output_hide_points"), 1,
''));
1137 $title_output->addOption(
new ilRadioOption($this->lng->txt(
"tst_title_output_no_title"), 2,
''));
1138 $title_output->setValue($this->testOBJ->getTitleOutput());
1139 $form->
addItem($title_output);
1144 $autosave_output->setChecked($this->testOBJ->getAutosave());
1145 $autosave_output->setInfo($this->lng->txt(
'autosave_info'));
1146 $autosave_interval =
new ilTextInputGUI($this->lng->txt(
'autosave_ival'),
'autosave_ival');
1147 $autosave_interval->
setSize(10);
1148 $autosave_interval->setValue($this->testOBJ->getAutosaveIval()/1000);
1149 $autosave_interval->setSuffix($this->lng->txt(
'seconds'));
1150 $autosave_output->addSubItem($autosave_interval);
1151 $form->
addItem($autosave_output);
1154 $shuffle =
new ilCheckboxInputGUI($this->lng->txt(
"tst_shuffle_questions"),
"chb_shuffle_questions");
1156 $shuffle->setChecked($this->testOBJ->getShuffleQuestions());
1157 $shuffle->setInfo($this->lng->txt(
"tst_shuffle_questions_description"));
1161 $checkBoxOfferHints =
new ilCheckboxInputGUI($this->lng->txt(
'tst_setting_offer_hints_label'),
'offer_hints');
1162 $checkBoxOfferHints->
setChecked($this->testOBJ->isOfferingQuestionHintsEnabled());
1163 $checkBoxOfferHints->setInfo($this->lng->txt(
'tst_setting_offer_hints_info'));
1164 if( $this->testOBJ->participantDataExist() )
1166 $checkBoxOfferHints->setDisabled(
true);
1168 $form->
addItem($checkBoxOfferHints);
1173 $this->lng->txt(
'tst_instant_feedback_results'),
'instant_feedback_points',
1174 $this->lng->txt(
'tst_instant_feedback_results_desc')
1177 $this->lng->txt(
'tst_instant_feedback_answer_generic'),
'instant_feedback_generic',
1178 $this->lng->txt(
'tst_instant_feedback_answer_generic_desc')
1181 $this->lng->txt(
'tst_instant_feedback_answer_specific'),
'instant_feedback_specific',
1182 $this->lng->txt(
'tst_instant_feedback_answer_specific_desc')
1185 $this->lng->txt(
'tst_instant_feedback_solution'),
'instant_feedback_solution',
1186 $this->lng->txt(
'tst_instant_feedback_solution_desc')
1189 if ($this->testOBJ->getSpecificAnswerFeedback()) array_push($values,
'instant_feedback_specific');
1190 if ($this->testOBJ->getGenericAnswerFeedback()) array_push($values,
'instant_feedback_generic');
1191 if ($this->testOBJ->getAnswerFeedbackPoints()) array_push($values,
'instant_feedback_points');
1192 if ($this->testOBJ->getInstantFeedbackSolution()) array_push($values,
'instant_feedback_solution');
1193 $instant_feedback->setValue($values);
1194 $form->
addItem($instant_feedback);
1197 $this->lng->txt(
'tst_instant_feedback_handling'),
'instant_feedback_handling' 1199 if( $this->testOBJ->participantDataExist() )
1204 $this->lng->txt(
'tst_instant_feedback_handling_none'),
1205 self::INST_FB_HANDLING_OPT_NONE
1207 $radioOption->
setInfo($this->lng->txt(
'tst_instant_feedback_handling_none_desc'));
1208 $radioGroup->addOption($radioOption);
1210 $this->lng->txt(
'tst_instant_feedback_handling_freeze'),
1211 self::INST_FB_HANDLING_OPT_FREEZE
1213 $radioOption->
setInfo($this->lng->txt(
'tst_instant_feedback_handling_freeze_desc'));
1214 $radioGroup->addOption($radioOption);
1216 $this->lng->txt(
'tst_instant_feedback_handling_force_and_freeze'),
1217 self::INST_FB_HANDLING_OPT_FORCE_AND_FREEZE
1219 $radioOption->
setInfo($this->lng->txt(
'tst_instant_feedback_handling_force_and_freeze_desc'));
1220 $radioGroup->addOption($radioOption);
1222 $this->lng->txt(
'tst_instant_feedback_handling_force'),
1223 self::INST_FB_HANDLING_OPT_FORCE
1225 $radioOption->
setInfo($this->lng->txt(
'tst_instant_feedback_handling_force_desc'));
1226 $radioGroup->addOption($radioOption);
1228 $this->testOBJ->isInstantFeedbackAnswerFixationEnabled(),
1229 $this->testOBJ->isForceInstantFeedbackEnabled()
1234 $checkBoxEnableObligations =
new ilCheckboxInputGUI($this->lng->txt(
'tst_setting_enable_obligations_label'),
'obligations_enabled');
1235 $checkBoxEnableObligations->
setChecked($this->testOBJ->areObligationsEnabled());
1236 $checkBoxEnableObligations->setInfo($this->lng->txt(
'tst_setting_enable_obligations_info'));
1237 if( $this->testOBJ->participantDataExist() )
1239 $checkBoxEnableObligations->setDisabled(
true);
1241 $form->
addItem($checkBoxEnableObligations);
1246 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
1248 $char_selector->getConfig()->setAvailability($this->testOBJ->getCharSelectorAvailability());
1249 $char_selector->getConfig()->setDefinition($this->testOBJ->getCharSelectorDefinition());
1250 $char_selector->addFormProperties($form);
1251 $char_selector->setFormValues($form);
1262 $this->testOBJ->setTitleOutput($form->
getItemByPostVar(
'title_output')->getValue());
1267 $this->testOBJ->setAutosave($form->
getItemByPostVar(
'autosave')->getChecked());
1268 $this->testOBJ->setAutosaveIval($form->
getItemByPostVar(
'autosave_ival')->getValue() * 1000);
1273 $this->testOBJ->setShuffleQuestions($form->
getItemByPostVar(
'chb_shuffle_questions')->getChecked());
1276 if (!$this->testOBJ->participantDataExist() && $this->
formPropertyExists($form,
'offer_hints'))
1278 $this->testOBJ->setOfferingQuestionHintsEnabled($form->
getItemByPostVar(
'offer_hints')->getChecked());
1283 $this->testOBJ->setScoringFeedbackOptionsByArray($form->
getItemByPostVar(
'instant_feedback')->getValue());
1286 if (!$this->testOBJ->participantDataExist() && $this->
formPropertyExists($form,
'instant_feedback_handling'))
1291 if (!$this->testOBJ->participantDataExist() && $this->
formPropertyExists($form,
'obligations_enabled'))
1293 $this->testOBJ->setObligationsEnabled($form->
getItemByPostVar(
'obligations_enabled')->getChecked());
1298 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
1300 $char_selector->addFormProperties($form);
1301 $char_selector->getFormValues($form);
1302 $this->testOBJ->setCharSelectorAvailability($char_selector->getConfig()->getAvailability());
1303 $this->testOBJ->setCharSelectorDefinition($char_selector->getConfig()->getDefinition());
1314 $seqheader->setTitle($this->lng->txt(
"tst_sequence_properties"));
1318 $prevanswers =
new ilCheckboxInputGUI($this->lng->txt(
"tst_use_previous_answers"),
"chb_use_previous_answers");
1320 $prevanswers->setChecked($this->testOBJ->getUsePreviousAnswers());
1321 $prevanswers->setInfo($this->lng->txt(
"tst_use_previous_answers_description"));
1325 $cancel =
new ilCheckboxInputGUI($this->lng->txt(
"tst_show_cancel"),
"chb_show_cancel");
1327 $cancel->setChecked($this->testOBJ->getShowCancel());
1328 $cancel->setInfo($this->lng->txt(
"tst_show_cancel_description"));
1334 $this->lng->txt(
"tst_postpone_off"), 0, $this->lng->txt(
"tst_postpone_off_desc")
1337 $this->lng->txt(
"tst_postpone_on"), 1, $this->lng->txt(
"tst_postpone_on_desc")
1339 $postpone->setValue((
int)$this->testOBJ->getSequenceSettings());
1343 $list_of_questions =
new ilCheckboxInputGUI($this->lng->txt(
"tst_show_summary"),
"list_of_questions");
1346 $list_of_questions->setChecked($this->testOBJ->getListOfQuestions());
1347 $list_of_questions->setInfo($this->lng->txt(
"tst_show_summary_description"));
1350 $list_of_questions_options->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_list_of_questions_start"),
'chb_list_of_questions_start',
''));
1351 $list_of_questions_options->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_list_of_questions_end"),
'chb_list_of_questions_end',
''));
1352 $list_of_questions_options->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_list_of_questions_with_description"),
'chb_list_of_questions_with_description',
''));
1354 if ($this->testOBJ->getListOfQuestionsStart()) array_push($values,
'chb_list_of_questions_start');
1355 if ($this->testOBJ->getListOfQuestionsEnd()) array_push($values,
'chb_list_of_questions_end');
1356 if ($this->testOBJ->getListOfQuestionsDescription()) array_push($values,
'chb_list_of_questions_with_description');
1357 $list_of_questions_options->setValue($values);
1359 $list_of_questions->addSubItem($list_of_questions_options);
1360 $form->
addItem($list_of_questions);
1363 $marking =
new ilCheckboxInputGUI($this->lng->txt(
"question_marking"),
"chb_show_marker");
1365 $marking->setChecked($this->testOBJ->getShowMarker());
1366 $marking->setInfo($this->lng->txt(
"question_marking_description"));
1377 $this->testOBJ->setUsePreviousAnswers($form->
getInput(
'chb_use_previous_answers'));
1382 $this->testOBJ->setShowCancel($form->
getItemByPostVar(
'chb_show_cancel')->getChecked());
1387 $this->testOBJ->setPostponingEnabled((
bool)$form->
getItemByPostVar(
'postpone')->getValue());
1390 $this->testOBJ->setListOfQuestions($form->
getItemByPostVar(
'list_of_questions')->getChecked());
1391 $listOfQuestionsOptions = $form->
getItemByPostVar(
'list_of_questions_options')->getValue();
1392 if(is_array($listOfQuestionsOptions))
1394 $this->testOBJ->setListOfQuestionsStart(in_array(
'chb_list_of_questions_start', $listOfQuestionsOptions));
1395 $this->testOBJ->setListOfQuestionsEnd(in_array(
'chb_list_of_questions_end', $listOfQuestionsOptions));
1396 $this->testOBJ->setListOfQuestionsDescription(in_array(
'chb_list_of_questions_with_description', $listOfQuestionsOptions));
1400 $this->testOBJ->setListOfQuestionsStart(0);
1401 $this->testOBJ->setListOfQuestionsEnd(0);
1402 $this->testOBJ->setListOfQuestionsDescription(0);
1407 $this->testOBJ->setShowMarker($form->
getItemByPostVar(
'chb_show_marker')->getChecked());
1417 $testFinishHeader->setTitle($this->lng->txt(
"tst_final_information"));
1418 $form->
addItem($testFinishHeader);
1421 $enable_examview =
new ilCheckboxInputGUI($this->lng->txt(
"enable_examview"),
'enable_examview');
1423 $enable_examview->setChecked($this->testOBJ->getEnableExamview());
1424 $enable_examview->setInfo($this->lng->txt(
"enable_examview_desc"));
1426 $show_examview_pdf->setValue(1);
1427 $show_examview_pdf->setChecked($this->testOBJ->getShowExamviewPdf());
1428 $show_examview_pdf->setOptionTitle($this->lng->txt(
"show_examview_pdf"));
1429 $enable_examview->addSubItem($show_examview_pdf);
1430 $form->
addItem($enable_examview);
1433 $showfinal =
new ilCheckboxInputGUI($this->lng->txt(
"final_statement"),
"showfinalstatement");
1434 $showfinal->
setChecked($this->testOBJ->getShowFinalStatement());
1435 $showfinal->setInfo($this->lng->txt(
"final_statement_show_desc"));
1438 $finalstatement =
new ilTextAreaInputGUI($this->lng->txt(
"final_statement"),
"finalstatement");
1440 $finalstatement->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getFinalStatement(),
false,
true));
1441 $finalstatement->setRows(10);
1442 $finalstatement->setCols(80);
1443 $finalstatement->setUseRte(TRUE);
1444 $finalstatement->addPlugin(
"latex");
1445 $finalstatement->addButton(
"latex");
1446 $finalstatement->setRTESupport($this->testOBJ->getId(),
"tst",
"assessment");
1447 $finalstatement->setRteTagSet(
'full');
1448 $showfinal->addSubItem($finalstatement);
1450 $redirection_mode = $this->testOBJ->getRedirectionMode();
1451 $rm_enabled =
new ilCheckboxInputGUI($this->lng->txt(
'redirect_after_finishing_tst'),
'redirection_enabled');
1452 $rm_enabled->
setInfo($this->lng->txt(
'redirect_after_finishing_tst_desc'));
1453 $rm_enabled->setChecked($redirection_mode ==
'0' ?
false :
true);
1454 $radio_rm =
new ilRadioGroupInputGUI($this->lng->txt(
'redirect_after_finishing_rule'),
'redirection_mode');
1456 $radio_rm->addOption($always);
1458 $radio_rm->addOption($kiosk);
1460 $rm_enabled->addSubItem($radio_rm);
1461 $redirection_url =
new ilTextInputGUI($this->lng->txt(
'redirection_url'),
'redirection_url');
1462 $redirection_url->
setValue((
string)$this->testOBJ->getRedirectionUrl());
1463 $redirection_url->setRequired(
true);
1464 $rm_enabled->addSubItem($redirection_url);
1469 $sign_submission = $this->testOBJ->getSignSubmission();
1470 $sign_submission_enabled =
new ilCheckboxInputGUI($this->lng->txt(
'sign_submission'),
'sign_submission');
1471 $sign_submission_enabled->
setChecked($sign_submission);
1472 $sign_submission_enabled->setInfo($this->lng->txt(
'sign_submission_info'));
1473 $form->
addItem($sign_submission_enabled);
1476 $mailnotification =
new ilCheckboxInputGUI($this->lng->txt(
"tst_finish_notification"),
"mailnotification");
1477 $mailnotification->
setInfo($this->lng->txt(
"tst_finish_notification_desc"));
1478 $mailnotification->setChecked($this->testOBJ->getMailNotification() > 0);
1479 $form->
addItem($mailnotification);
1481 $mailnotificationContent =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_finish_notification_content"),
"mailnotification_content");
1482 $mailnotificationContent->
addOption(
new ilRadioOption($this->lng->txt(
"tst_finish_notification_simple"), 1,
''));
1483 $mailnotificationContent->addOption(
new ilRadioOption($this->lng->txt(
"tst_finish_notification_advanced"), 2,
''));
1484 $mailnotificationContent->setValue($this->testOBJ->getMailNotification() ? $this->testOBJ->getMailNotification() : 1);
1485 $mailnotificationContent->setRequired(
true);
1486 $mailnotification->addSubItem($mailnotificationContent);
1489 $mailnottype->setValue(1);
1490 $mailnottype->setOptionTitle($this->lng->txt(
"mailnottype"));
1491 $mailnottype->setChecked($this->testOBJ->getMailNotificationType());
1492 $mailnotification->addSubItem($mailnottype);
1502 $this->testOBJ->setEnableExamview($form->
getItemByPostVar(
'enable_examview')->getChecked());
1503 $this->testOBJ->setShowExamviewPdf($form->
getItemByPostVar(
'show_examview_pdf')->getChecked());
1506 $this->testOBJ->setShowFinalStatement($form->
getItemByPostVar(
'showfinalstatement')->getChecked());
1511 $this->testOBJ->setRedirectionMode($form->
getItemByPostVar(
'redirection_mode')->getValue());
1519 $this->testOBJ->setRedirectionUrl($form->
getItemByPostVar(
'redirection_url')->getValue());
1523 $this->testOBJ->setRedirectionUrl(null);
1528 $this->testOBJ->setSignSubmission($form->
getItemByPostVar(
'sign_submission')->getChecked());
1533 $this->testOBJ->setMailNotification($form->
getItemByPostVar(
'mailnotification_content')->getValue());
1534 $this->testOBJ->setMailNotificationType($form->
getItemByPostVar(
'mailnottype')->getChecked());
1538 $this->testOBJ->setMailNotification(0);
1539 $this->testOBJ->setMailNotificationType(
false);
1545 switch($instantFeedbackHandlingValue)
1547 case self::INST_FB_HANDLING_OPT_NONE:
1548 $this->testOBJ->setInstantFeedbackAnswerFixationEnabled(
false);
1549 $this->testOBJ->setForceInstantFeedbackEnabled(
false);
1552 case self::INST_FB_HANDLING_OPT_FREEZE:
1553 $this->testOBJ->setInstantFeedbackAnswerFixationEnabled(
true);
1554 $this->testOBJ->setForceInstantFeedbackEnabled(
false);
1557 case self::INST_FB_HANDLING_OPT_FORCE:
1558 $this->testOBJ->setInstantFeedbackAnswerFixationEnabled(
false);
1559 $this->testOBJ->setForceInstantFeedbackEnabled(
true);
1562 case self::INST_FB_HANDLING_OPT_FORCE_AND_FREEZE:
1563 $this->testOBJ->setInstantFeedbackAnswerFixationEnabled(
true);
1564 $this->testOBJ->setForceInstantFeedbackEnabled(
true);
1573 case !$freezeAnswersEnabled && !$forceInstFbEnabled:
return self::INST_FB_HANDLING_OPT_NONE;
1574 case $freezeAnswersEnabled && !$forceInstFbEnabled:
return self::INST_FB_HANDLING_OPT_FREEZE;
1575 case !$freezeAnswersEnabled && $forceInstFbEnabled:
return self::INST_FB_HANDLING_OPT_FORCE;
1576 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.
static _getUsedHTMLTagsAsString($a_module="")
Returns a string of all allowed HTML tags for text editing.
performSaveForm(ilPropertyFormGUI $form)
const QUESTION_SET_TYPE_RANDOM
type setting value for random question set
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
__construct(ilCtrl $ctrl, ilAccessHandler $access, ilLanguage $lng, ilTemplate $tpl, ilTree $tree, ilDBInterface $db, ilPluginAdmin $pluginAdmin, ilObjUser $activeUser, ilObjTestGUI $testGUI)
Constructor.
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)
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...
Create styles array
The data for the language used.
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
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
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.