110 $this->testOBJ = $testGUI->object;
112 require_once
'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
115 $templateId = $this->testOBJ->getTemplate();
119 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
131 if (!$this->access->checkAccess(
"write",
"", $this->testGUI->ref_id))
134 $this->ctrl->redirect($this->testGUI,
"infoScreen");
139 $nextClass = $this->ctrl->getNextClass();
144 $cmd = $this->ctrl->getCmd(self::CMD_SHOW_FORM).
'Cmd';
151 $this->tpl->addJavascript(
"./Services/JavaScript/js/Basic.js");
158 $formHTML = $this->ctrl->getHTML($form);
161 $this->tpl->setContent($formHTML.$msgHTML);
171 $fields = array(
'act_starting_time',
'act_ending_time',
'starting_time',
'ending_time');
173 foreach($fields as $field)
195 $errors = !$form->checkInput();
197 $form->setValuesByPost();
211 $currentQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfig();
212 if( $form->getItemByPostVar(
'online')->getChecked() && !$this->testOBJ->isComplete($currentQuestionSetConfig) )
214 $form->getItemByPostVar(
'online')->setAlert(
215 $this->lng->txt(
"cannot_switch_to_online_no_questions_andor_no_mark_steps")
225 $questionSetTypeRelatingDataCleanupRequired =
false;
229 $oldQuestionSetType = $this->testOBJ->getQuestionSetType();
230 $newQuestionSetType = $form->getItemByPostVar(
'question_set_type')->getValue();
232 if( !$this->testOBJ->participantDataExist() && $newQuestionSetType != $oldQuestionSetType )
234 $oldQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfigByType(
238 if( $oldQuestionSetConfig->doesQuestionSetRelatedDataExist() )
240 if( !$isConfirmedSave )
245 $form, $oldQuestionSetType, $newQuestionSetType,
246 $this->testOBJ->hasQuestionsWithoutQuestionpool()
251 $form, $oldQuestionSetType, $newQuestionSetType,
false
255 $questionSetTypeRelatingDataCleanupRequired =
true;
258 if( $form->getItemByPostVar(
'online')->getChecked() )
260 $form->getItemByPostVar(
'online')->setChecked(
false);
262 if( $this->testOBJ->isOnline() )
264 $infoMsg = $this->lng->txt(
"tst_set_offline_due_to_switched_question_set_type_setting");
268 $infoMsg = $this->lng->txt(
"tst_cannot_online_due_to_switched_quest_set_type_setting");
280 $form->getItemByPostVar(
'chb_use_previous_answers')->setValue(0);
289 if( $questionSetTypeRelatingDataCleanupRequired )
291 $oldQuestionSetConfig->removeQuestionSetRelatedData();
296 if( !$this->testOBJ->participantDataExist() && !$this->testOBJ->getFixedParticipants() )
298 foreach ($this->testOBJ->getInvitedUsers() as $usrId => $usrData)
300 $this->testOBJ->disinviteUser($usrId);
307 $this->ctrl->redirect($this, self::CMD_SHOW_FORM);
312 include_once
'Services/MetaData/classes/class.ilMD.php';
313 $md_obj =&
new ilMD($this->testOBJ->getId(), 0,
"tst");
321 $md_desc_ids = $md_section->getDescriptionIds();
324 $md_desc = $md_section->getDescription(array_pop($md_desc_ids));
330 $md_desc = $md_section->addDescription();
337 $this->testOBJ->update();
342 $this->testOBJ->setPoolUsage($form->
getItemByPostVar(
'use_pool')->getChecked());
349 $this->testOBJ->setEnableArchiving(
false);
354 $this->testOBJ->setEnableArchiving($form->
getItemByPostVar(
'enable_archiving')->getChecked());
358 $this->testOBJ->setEnableExamview($form->
getItemByPostVar(
'enable_examview')->getChecked());
359 $this->testOBJ->setShowExamviewHtml($form->
getItemByPostVar(
'show_examview_html')->getChecked());
360 $this->testOBJ->setShowExamviewPdf($form->
getItemByPostVar(
'show_examview_pdf')->getChecked());
368 $this->testOBJ->setActivationLimited(
true);
369 $this->testOBJ->setActivationVisibility($form->
getItemByPostVar(
'activation_visibility')->getChecked());
372 $this->testOBJ->setActivationStartingTime($period->getStart()->get(
IL_CAL_UNIX));
373 $this->testOBJ->setActivationEndingTime($period->getEnd()->get(
IL_CAL_UNIX));
377 $this->testOBJ->setActivationLimited(
false);
380 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
382 $this->testOBJ->setShowInfo($form->
getItemByPostVar(
'showinfo')->getChecked());
384 $this->testOBJ->setShowFinalStatement($form->
getItemByPostVar(
'showfinalstatement')->getChecked());
387 $this->testOBJ->setSequenceSettings($form->
getItemByPostVar(
'chb_postpone')->getChecked());
389 $this->testOBJ->setShuffleQuestions($form->
getItemByPostVar(
'chb_shuffle_questions')->getChecked());
390 $this->testOBJ->setListOfQuestions($form->
getItemByPostVar(
'list_of_questions')->getChecked());
391 $listOfQuestionsOptions = $form->
getItemByPostVar(
'list_of_questions_options')->getValue();
392 if( is_array($listOfQuestionsOptions) )
394 $this->testOBJ->setListOfQuestionsStart( in_array(
'chb_list_of_questions_start', $listOfQuestionsOptions) );
395 $this->testOBJ->setListOfQuestionsEnd( in_array(
'chb_list_of_questions_end', $listOfQuestionsOptions) );
396 $this->testOBJ->setListOfQuestionsDescription( in_array(
'chb_list_of_questions_with_description', $listOfQuestionsOptions) );
400 $this->testOBJ->setListOfQuestionsStart(0);
401 $this->testOBJ->setListOfQuestionsEnd(0);
402 $this->testOBJ->setListOfQuestionsDescription(0);
407 $this->testOBJ->setMailNotification($form->
getItemByPostVar(
'mailnotification')->getValue());
411 $this->testOBJ->setMailNotificationType($form->
getItemByPostVar(
'mailnottype')->getChecked());
415 $this->testOBJ->setShowMarker($form->
getItemByPostVar(
'chb_show_marker')->getChecked());
419 $this->testOBJ->setShowCancel($form->
getItemByPostVar(
'chb_show_cancel')->getChecked());
424 $this->testOBJ->setKioskMode($form->
getItemByPostVar(
'kiosk')->getChecked());
426 if( is_array($kioskOptions) )
428 $this->testOBJ->setShowKioskModeTitle( in_array(
'kiosk_title', $kioskOptions) );
429 $this->testOBJ->setShowKioskModeParticipant( in_array(
'kiosk_participant', $kioskOptions) );
433 $this->testOBJ->setShowKioskModeTitle(
false );
434 $this->testOBJ->setShowKioskModeParticipant(
false );
441 $this->testOBJ->setShowExamIdInTestPassEnabled( $value );
447 $this->testOBJ->setRedirectionMode( $form->
getItemByPostVar(
'redirection_mode')->getValue() );
456 $this->testOBJ->setRedirectionUrl( $form->
getItemByPostVar(
'redirection_url')->getValue() );
460 $this->testOBJ->setRedirectionUrl(null);
465 $this->testOBJ->setSignSubmission(
true );
469 $this->testOBJ->setSignSubmission(
false );
472 $this->testOBJ->setEnableProcessingTime($form->
getItemByPostVar(
'chb_processing_time')->getChecked());
473 if ($this->testOBJ->getEnableProcessingTime())
476 $this->testOBJ->setProcessingTime(sprintf(
"%02d:%02d:%02d",
477 $processingTime->getHours(), $processingTime->getMinutes(), $processingTime->getSeconds()
482 $this->testOBJ->setProcessingTime(
'');
484 $this->testOBJ->setResetProcessingTime($form->
getItemByPostVar(
'chb_reset_processing_time')->getChecked());
486 if(!$this->testOBJ->participantDataExist() && $form->
getItemByPostVar(
'chb_starting_time')->getChecked() )
493 else if(!$this->testOBJ->participantDataExist())
495 $this->testOBJ->setStartingTime(
'');
507 $this->testOBJ->setEndingTime(
'');
512 $this->testOBJ->setForceJS($form->
getItemByPostVar(
'forcejs')->getChecked());
517 $this->testOBJ->setTitleOutput($form->
getItemByPostVar(
'title_output')->getValue());
521 $this->testOBJ->setPassword($form->
getItemByPostVar(
'password')->getValue());
525 $this->testOBJ->setAllowedUsers($form->
getItemByPostVar(
'allowedUsers')->getValue());
529 $this->testOBJ->setAllowedUsersTimeGap($form->
getItemByPostVar(
'allowedUsersTimeGap')->getValue());
534 if ($ilSetting->get(
'char_selector_availability') > 0)
536 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
538 $char_selector->addFormProperties($form);
539 $char_selector->getFormValues($form);
540 $this->testOBJ->setCharSelectorAvailability($char_selector->getConfig()->getAvailability());
541 $this->testOBJ->setCharSelectorDefinition($char_selector->getConfig()->getDefinition());
544 $this->testOBJ->setAutosave($form->
getItemByPostVar(
'autosave')->getChecked());
545 $this->testOBJ->setAutosaveIval($form->
getItemByPostVar(
'autosave_ival')->getValue() * 1000);
547 $this->testOBJ->setUsePreviousAnswers($form->
getItemByPostVar(
'chb_use_previous_answers')->getChecked());
550 $this->testOBJ->setHighscoreEnabled((
bool) $form->
getItemByPostVar(
'highscore_enabled')->getChecked());
551 $this->testOBJ->setHighscoreAnon((
bool) $form->
getItemByPostVar(
'highscore_anon')->getChecked());
552 $this->testOBJ->setHighscoreAchievedTS((
bool) $form->
getItemByPostVar(
'highscore_achieved_ts')->getChecked());
553 $this->testOBJ->setHighscoreScore((
bool) $form->
getItemByPostVar(
'highscore_score')->getChecked());
554 $this->testOBJ->setHighscorePercentage((
bool) $form->
getItemByPostVar(
'highscore_percentage')->getChecked());
555 $this->testOBJ->setHighscoreHints((
bool) $form->
getItemByPostVar(
'highscore_hints')->getChecked());
556 $this->testOBJ->setHighscoreWTime((
bool) $form->
getItemByPostVar(
'highscore_wtime')->getChecked());
557 $this->testOBJ->setHighscoreOwnTable((
bool) $form->
getItemByPostVar(
'highscore_own_table')->getChecked());
558 $this->testOBJ->setHighscoreTopTable((
bool) $form->
getItemByPostVar(
'highscore_top_table')->getChecked());
559 $this->testOBJ->setHighscoreTopNum((
int) $form->
getItemByPostVar(
'highscore_top_num')->getValue());
561 if( !$this->testOBJ->participantDataExist() )
566 $this->testOBJ->setQuestionSetType($form->
getItemByPostVar(
'question_set_type')->getValue());
570 $this->testOBJ->setAnonymity($form->
getItemByPostVar(
'anonymity')->getValue());
573 $this->testOBJ->setNrOfTries($form->
getItemByPostVar(
'nr_of_tries')->getValue());
578 $this->testOBJ->setFixedParticipants($form->
getItemByPostVar(
'fixedparticipants')->getChecked());
583 $this->testOBJ->saveToDb(
true);
586 include_once
'Modules/Test/classes/class.ilECSTestSettings.php';
588 $ecs->handleSettingsUpdate();
593 require_once
'Modules/Test/classes/confirmations/class.ilTestSettingsChangeConfirmationGUI.php';
596 $confirmation->setFormAction( $this->ctrl->getFormAction($this) );
600 $confirmation->setOldQuestionSetType($oldQuestionSetType);
601 $confirmation->setNewQuestionSetType($newQuestionSetType);
602 $confirmation->setQuestionLossInfoEnabled($hasQuestionsWithoutQuestionpool);
603 $confirmation->build();
605 $confirmation->populateParametersFromPropertyForm($form, $this->activeUser->getTimeZone());
607 $this->tpl->setContent( $this->ctrl->getHTML($confirmation) );
612 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
614 $form->setFormAction($this->ctrl->getFormAction($this));
615 $form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt(
"save"));
616 $form->setTableWidth(
"100%");
617 $form->setId(
"test_properties");
623 $header->setTitle($this->lng->txt(
"tst_general_properties"));
624 $form->addItem($header);
629 include_once
'Services/MetaData/classes/class.ilMD.php';
630 $md_obj =
new ilMD($this->testOBJ->getId(), 0,
"tst");
635 $title->setValue($md_section->getTitle());
636 $form->addItem($title);
638 $ids = $md_section->getDescriptionIds();
641 $desc_obj = $md_section->getDescription(array_pop($ids));
646 $desc->setValue($desc_obj->getDescription());
647 $form->addItem($desc);
652 if ($this->testOBJ->participantDataExist()) $anonymity->
setDisabled(
true);
653 $rb =
new ilRadioOption($this->lng->txt(
'tst_anonymity_no_anonymization'), 0);
654 $anonymity->addOption($rb);
655 $rb =
new ilRadioOption($this->lng->txt(
'tst_anonymity_anonymous_test'), 1);
656 $anonymity->addOption($rb);
657 $anonymity->
setValue((
int)$this->testOBJ->getAnonymity());
658 $form->addItem($anonymity);
661 $questSetType =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_question_set_type"),
'question_set_type');
664 $this->lng->txt(
"tst_question_set_type_fixed_desc")
666 $questSetType->addOption($questSetTypeFixed);
669 $this->lng->txt(
"tst_question_set_type_random_desc")
671 $questSetType->addOption($questSetTypeRandom);
674 $this->lng->txt(
"tst_question_set_type_dynamic_desc")
676 $questSetType->addOption($questSetTypeContinues);
677 $questSetType->
setValue($this->testOBJ->getQuestionSetType());
678 if( $this->testOBJ->participantDataExist() )
680 $questSetType->setDisabled(
true);
682 $form->addItem($questSetType);
685 $pool_usage =
new ilCheckboxInputGUI($this->lng->txt(
"test_question_pool_usage"),
"use_pool");
687 $pool_usage->setChecked($this->testOBJ->getPoolUsage());
688 $form->addItem($pool_usage);
691 $enable_archiving =
new ilCheckboxInputGUI($this->lng->txt(
'test_enable_archiving'),
'enable_archiving');
693 $enable_archiving->setChecked($this->testOBJ->getEnableArchiving());
694 $form->addItem($enable_archiving);
698 include_once
"Services/Object/classes/class.ilObjectActivation.php";
699 $this->lng->loadLanguageModule(
'rep');
702 $section->setTitle($this->lng->txt(
'rep_activation_availability'));
706 $act_obj_info = $act_ref_info =
"";
709 $act_obj_info =
' '.$this->lng->txt(
'rep_activation_online_object_info');
710 $act_ref_info = $this->lng->txt(
'rep_activation_access_ref_info');
714 $online->
setChecked($this->testOBJ->isOnline());
715 $online->setInfo($this->lng->txt(
'tst_activation_online_info').$act_obj_info);
716 $form->addItem($online);
718 $act_type =
new ilCheckboxInputGUI($this->lng->txt(
'rep_visibility_until'),
'activation_type');
719 $act_type->
setChecked($this->testOBJ->isActivationLimited());
722 $this->tpl->addJavaScript(
'./Services/Form/js/date_duration.js');
723 include_once
"Services/Form/classes/class.ilDateDurationInputGUI.php";
726 $date = $this->testOBJ->getActivationStartingTime();
728 $dur->setStartText($this->lng->txt(
'rep_activation_limited_start'));
729 $date = $this->testOBJ->getActivationEndingTime();
731 $dur->setEndText($this->lng->txt(
'rep_activation_limited_end'));
732 $act_type->addSubItem($dur);
734 $visible =
new ilCheckboxInputGUI($this->lng->txt(
'rep_activation_limited_visibility'),
'activation_visibility');
735 $visible->
setInfo($this->lng->txt(
'tst_activation_limited_visibility_info'));
736 $visible->setChecked($this->testOBJ->getActivationVisibility());
737 $act_type->addSubItem($visible);
739 $form->addItem($act_type);
745 $header->setTitle($this->lng->txt(
"tst_beginning_ending_information"));
746 $form->addItem($header);
751 $intro->
setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getIntroduction()));
754 $intro->setUseRte(TRUE);
755 $intro->addPlugin(
"latex");
756 $intro->addButton(
"latex");
757 $intro->setRTESupport($this->testOBJ->getId(),
"tst",
"assessment");
758 $intro->setRteTagSet(
'full');
759 $intro->setInfo($this->lng->txt(
'intro_desc'));
762 $showinfo->setValue(1);
763 $showinfo->setChecked($this->testOBJ->getShowInfo());
764 $showinfo->setOptionTitle($this->lng->txt(
"showinfo"));
765 $showinfo->setInfo($this->lng->txt(
"showinfo_desc"));
766 $intro->addSubItem($showinfo);
767 $form->addItem($intro);
770 $finalstatement =
new ilTextAreaInputGUI($this->lng->txt(
"final_statement"),
"finalstatement");
771 $finalstatement->
setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getFinalStatement()));
772 $finalstatement->setRows(10);
773 $finalstatement->setCols(80);
774 $finalstatement->setUseRte(TRUE);
775 $finalstatement->addPlugin(
"latex");
776 $finalstatement->addButton(
"latex");
777 $finalstatement->setRTESupport($this->testOBJ->getId(),
"tst",
"assessment");
778 $finalstatement->setRteTagSet(
'full');
781 $showfinal->setValue(1);
782 $showfinal->setChecked($this->testOBJ->getShowFinalStatement());
783 $showfinal->setOptionTitle($this->lng->txt(
"final_statement_show"));
784 $showfinal->setInfo($this->lng->txt(
"final_statement_show_desc"));
785 $finalstatement->addSubItem($showfinal);
786 $form->addItem($finalstatement);
789 $enable_examview =
new ilCheckboxInputGUI($this->lng->txt(
"enable_examview"),
'enable_examview');
791 $enable_examview->setChecked($this->testOBJ->getEnableExamview());
792 $enable_examview->setInfo($this->lng->txt(
"enable_examview_desc"));
794 $show_examview_html->setValue(1);
795 $show_examview_html->setChecked($this->testOBJ->getShowExamviewHtml());
796 $show_examview_html->setOptionTitle($this->lng->txt(
"show_examview_html"));
797 $show_examview_html->setInfo($this->lng->txt(
"show_examview_html_desc"));
798 $enable_examview->addSubItem($show_examview_html);
800 $show_examview_pdf->setValue(1);
801 $show_examview_pdf->setChecked($this->testOBJ->getShowExamviewPdf());
802 $show_examview_pdf->setOptionTitle($this->lng->txt(
"show_examview_pdf"));
803 $show_examview_pdf->setInfo($this->lng->txt(
"show_examview_pdf_desc"));
804 $enable_examview->addSubItem($show_examview_pdf);
805 $form->addItem($enable_examview);
811 $sessionheader->setTitle($this->lng->txt(
"tst_session_settings"));
812 $form->addItem($sessionheader);
816 $nr_of_tries =
new ilTextInputGUI($this->lng->txt(
"tst_nr_of_tries"),
"nr_of_tries");
818 $nr_of_tries->setValue($this->testOBJ->getNrOfTries());
819 $nr_of_tries->setRequired(
true);
820 $nr_of_tries->setSuffix($this->lng->txt(
"0_unlimited"));
821 $total = $this->testOBJ->evalTotalPersons();
822 if (
$total) $nr_of_tries->setDisabled(
true);
823 $form->addItem($nr_of_tries);
826 $processing =
new ilCheckboxInputGUI($this->lng->txt(
"tst_processing_time"),
"chb_processing_time");
832 $processing->setChecked(
true);
836 $processing->setChecked($this->testOBJ->getEnableProcessingTime());
841 $ptime = $this->testOBJ->getProcessingTimeAsArray();
842 $processingtime->setHours($ptime[
'hh']);
843 $processingtime->setMinutes($ptime[
'mm']);
844 $processingtime->setSeconds($ptime[
'ss']);
845 $processingtime->setShowMonths(
false);
846 $processingtime->setShowDays(
false);
847 $processingtime->setShowHours(
true);
848 $processingtime->setShowMinutes(
true);
849 $processingtime->setShowSeconds(
true);
850 $processingtime->setInfo($this->lng->txt(
"tst_processing_time_desc"));
851 $processing->addSubItem($processingtime);
855 $resetprocessing->setValue(1);
856 $resetprocessing->setOptionTitle($this->lng->txt(
"tst_reset_processing_time"));
857 $resetprocessing->setChecked($this->testOBJ->getResetProcessingTime());
858 $resetprocessing->setInfo($this->lng->txt(
"tst_reset_processing_time_desc"));
859 $processing->addSubItem($resetprocessing);
860 $form->addItem($processing);
863 $enablestartingtime =
new ilCheckboxInputGUI($this->lng->txt(
"tst_starting_time"),
"chb_starting_time");
868 $enablestartingtime->setChecked(
true);
872 $enablestartingtime->setChecked(strlen($this->testOBJ->getStartingTime()));
876 $startingtime->setShowDate(
true);
877 $startingtime->setShowTime(
true);
878 if( strlen($this->testOBJ->getStartingTime()) )
886 $enablestartingtime->addSubItem($startingtime);
887 $form->addItem($enablestartingtime);
888 if( $this->testOBJ->participantDataExist() )
890 $enablestartingtime->setDisabled(
true);
891 $startingtime->setDisabled(
true);
895 $enableendingtime =
new ilCheckboxInputGUI($this->lng->txt(
"tst_ending_time"),
"chb_ending_time");
899 $enableendingtime->setChecked(
true);
901 $enableendingtime->setChecked(strlen($this->testOBJ->getEndingTime()));
904 $endingtime->setShowDate(
true);
905 $endingtime->setShowTime(
true);
906 if (strlen($this->testOBJ->getEndingTime()))
914 $enableendingtime->addSubItem($endingtime);
915 $form->addItem($enableendingtime);
918 $password =
new ilTextInputGUI($this->lng->txt(
"tst_password"),
"password");
920 $password->setValue($this->testOBJ->getPassword());
921 $password->setInfo($this->lng->txt(
"tst_password_details"));
922 $form->addItem($password);
928 $seqheader->setTitle($this->lng->txt(
"tst_presentation_properties"));
929 $form->addItem($seqheader);
933 $prevanswers =
new ilCheckboxInputGUI($this->lng->txt(
"tst_use_previous_answers"),
"chb_use_previous_answers");
935 $prevanswers->setChecked($this->testOBJ->getUsePreviousAnswers());
936 $prevanswers->setInfo($this->lng->txt(
"tst_use_previous_answers_description"));
937 $form->addItem($prevanswers);
942 $forcejs->setChecked($this->testOBJ->getForceJS());
943 $forcejs->setOptionTitle($this->lng->txt(
"forcejs"));
944 $forcejs->setInfo($this->lng->txt(
"forcejs_desc"));
945 $form->addItem($forcejs);
950 $title_output->addOption(
new ilRadioOption($this->lng->txt(
"tst_title_output_hide_points"), 1,
''));
951 $title_output->addOption(
new ilRadioOption($this->lng->txt(
"tst_title_output_no_title"), 2,
''));
952 $title_output->setValue($this->testOBJ->getTitleOutput());
953 $title_output->setInfo($this->lng->txt(
"tst_title_output_description"));
954 $form->addItem($title_output);
958 if ($ilSetting->get(
'char_selector_availability') > 0)
960 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
962 $char_selector->getConfig()->setAvailability($this->testOBJ->getCharSelectorAvailability());
963 $char_selector->getConfig()->setDefinition($this->testOBJ->getCharSelectorDefinition());
964 $char_selector->addFormProperties($form);
965 $char_selector->setFormValues($form);
971 $autosave_output->setChecked($this->testOBJ->getAutosave());
972 $autosave_output->setInfo($this->lng->txt(
'autosave_info'));
974 $autosave_interval =
new ilTextInputGUI($this->lng->txt(
'autosave_ival'),
'autosave_ival');
975 $autosave_interval->
setSize(10);
976 $autosave_interval->setValue($this->testOBJ->getAutosaveIval()/1000);
977 $autosave_interval->setInfo($this->lng->txt(
'autosave_ival_info'));
978 $autosave_output->addSubItem($autosave_interval);
979 $form->addItem($autosave_output);
986 $seqheader->setTitle($this->lng->txt(
"tst_sequence_properties"));
987 $form->addItem($seqheader);
993 $postpone->setChecked($this->testOBJ->getSequenceSettings());
994 $postpone->setInfo($this->lng->txt(
"tst_postpone_description"));
995 $form->addItem($postpone);
998 $shuffle =
new ilCheckboxInputGUI($this->lng->txt(
"tst_shuffle_questions"),
"chb_shuffle_questions");
1000 $shuffle->setChecked($this->testOBJ->getShuffleQuestions());
1001 $shuffle->setInfo($this->lng->txt(
"tst_shuffle_questions_description"));
1002 $form->addItem($shuffle);
1005 $list_of_questions =
new ilCheckboxInputGUI($this->lng->txt(
"tst_show_summary"),
"list_of_questions");
1008 $list_of_questions->setChecked($this->testOBJ->getListOfQuestions());
1009 $list_of_questions->setInfo($this->lng->txt(
"tst_show_summary_description"));
1012 $list_of_questions_options->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_list_of_questions_start"),
'chb_list_of_questions_start',
''));
1013 $list_of_questions_options->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_list_of_questions_end"),
'chb_list_of_questions_end',
''));
1014 $list_of_questions_options->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_list_of_questions_with_description"),
'chb_list_of_questions_with_description',
''));
1016 if ($this->testOBJ->getListOfQuestionsStart()) array_push($values,
'chb_list_of_questions_start');
1017 if ($this->testOBJ->getListOfQuestionsEnd()) array_push($values,
'chb_list_of_questions_end');
1018 if ($this->testOBJ->getListOfQuestionsDescription()) array_push($values,
'chb_list_of_questions_with_description');
1019 $list_of_questions_options->setValue($values);
1021 $list_of_questions->addSubItem($list_of_questions_options);
1022 $form->addItem($list_of_questions);
1025 $marking =
new ilCheckboxInputGUI($this->lng->txt(
"question_marking"),
"chb_show_marker");
1027 $marking->setChecked($this->testOBJ->getShowMarker());
1028 $marking->setInfo($this->lng->txt(
"question_marking_description"));
1029 $form->addItem($marking);
1032 $cancel =
new ilCheckboxInputGUI($this->lng->txt(
"tst_show_cancel"),
"chb_show_cancel");
1034 $cancel->setChecked($this->testOBJ->getShowCancel());
1035 $cancel->setInfo($this->lng->txt(
"tst_show_cancel_description"));
1036 $form->addItem($cancel);
1042 $notifications->setTitle($this->lng->txt(
"tst_mail_notification"));
1043 $form->addItem($notifications);
1047 $mailnotification =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_finish_notification"),
"mailnotification");
1049 $mailnotification->addOption(
new ilRadioOption($this->lng->txt(
"tst_finish_notification_simple"), 1,
''));
1050 $mailnotification->addOption(
new ilRadioOption($this->lng->txt(
"tst_finish_notification_advanced"), 2,
''));
1051 $mailnotification->setValue($this->testOBJ->getMailNotification());
1052 $form->addItem($mailnotification);
1055 $mailnottype->setValue(1);
1056 $mailnottype->setOptionTitle($this->lng->txt(
"mailnottype"));
1057 $mailnottype->setChecked($this->testOBJ->getMailNotificationType());
1058 $form->addItem($mailnottype);
1062 $highscore_head->setTitle($this->lng->txt(
"tst_highscore_options"));
1063 $form->addItem($highscore_head);
1065 $highscore =
new ilCheckboxInputGUI($this->lng->txt(
"tst_highscore_enabled"),
"highscore_enabled");
1067 $highscore->setChecked($this->testOBJ->getHighscoreEnabled());
1068 $highscore->setInfo($this->lng->txt(
"tst_highscore_description"));
1069 $form->addItem($highscore);
1071 $highscore_anon =
new ilCheckboxInputGUI($this->lng->txt(
"tst_highscore_anon"),
"highscore_anon");
1073 $highscore_anon->setChecked($this->testOBJ->getHighscoreAnon());
1074 $highscore_anon->setInfo($this->lng->txt(
"tst_highscore_anon_description"));
1075 $highscore->addSubItem($highscore_anon);
1077 $highscore_achieved_ts =
new ilCheckboxInputGUI($this->lng->txt(
"tst_highscore_achieved_ts"),
"highscore_achieved_ts");
1078 $highscore_achieved_ts->
setValue(1);
1079 $highscore_achieved_ts->setChecked($this->testOBJ->getHighscoreAchievedTS());
1080 $highscore_achieved_ts->setInfo($this->lng->txt(
"tst_highscore_achieved_ts_description"));
1081 $highscore->addSubItem($highscore_achieved_ts);
1083 $highscore_score =
new ilCheckboxInputGUI($this->lng->txt(
"tst_highscore_score"),
"highscore_score");
1085 $highscore_score->setChecked($this->testOBJ->getHighscoreScore());
1086 $highscore_score->setInfo($this->lng->txt(
"tst_highscore_score_description"));
1087 $highscore->addSubItem($highscore_score);
1089 $highscore_percentage =
new ilCheckboxInputGUI($this->lng->txt(
"tst_highscore_percentage"),
"highscore_percentage");
1090 $highscore_percentage->
setValue(1);
1091 $highscore_percentage->setChecked($this->testOBJ->getHighscorePercentage());
1092 $highscore_percentage->setInfo($this->lng->txt(
"tst_highscore_percentage_description"));
1093 $highscore->addSubItem($highscore_percentage);
1095 $highscore_hints =
new ilCheckboxInputGUI($this->lng->txt(
"tst_highscore_hints"),
"highscore_hints");
1097 $highscore_hints->setChecked($this->testOBJ->getHighscoreHints());
1098 $highscore_hints->setInfo($this->lng->txt(
"tst_highscore_hints_description"));
1099 $highscore->addSubItem($highscore_hints);
1101 $highscore_wtime =
new ilCheckboxInputGUI($this->lng->txt(
"tst_highscore_wtime"),
"highscore_wtime");
1103 $highscore_wtime->setChecked($this->testOBJ->getHighscoreWTime());
1104 $highscore_wtime->setInfo($this->lng->txt(
"tst_highscore_wtime_description"));
1105 $highscore->addSubItem($highscore_wtime);
1107 $highscore_own_table =
new ilCheckboxInputGUI($this->lng->txt(
"tst_highscore_own_table"),
"highscore_own_table");
1109 $highscore_own_table->setChecked($this->testOBJ->getHighscoreOwnTable());
1110 $highscore_own_table->setInfo($this->lng->txt(
"tst_highscore_own_table_description"));
1111 $highscore->addSubItem($highscore_own_table);
1113 $highscore_top_table =
new ilCheckboxInputGUI($this->lng->txt(
"tst_highscore_top_table"),
"highscore_top_table");
1115 $highscore_top_table->setChecked($this->testOBJ->getHighscoreTopTable());
1116 $highscore_top_table->setInfo($this->lng->txt(
"tst_highscore_top_table_description"));
1117 $highscore->addSubItem($highscore_top_table);
1119 $highscore_top_num =
new ilTextInputGUI($this->lng->txt(
"tst_highscore_top_num"),
"highscore_top_num");
1120 $highscore_top_num->
setSize(4);
1121 $highscore_top_num->setSuffix($this->lng->txt(
"tst_highscore_top_num_unit"));
1122 $highscore_top_num->setValue($this->testOBJ->getHighscoreTopNum());
1123 $highscore_top_num->setInfo($this->lng->txt(
"tst_highscore_top_num_description"));
1124 $highscore->addSubItem($highscore_top_num);
1129 $testExecution->setTitle($this->lng->txt(
"tst_test_execution"));
1130 $form->addItem($testExecution);
1136 $kiosk->setChecked($this->testOBJ->getKioskMode());
1137 $kiosk->setInfo($this->lng->txt(
"kiosk_description"));
1142 $kiosktitle->addOption(
new ilCheckboxOption($this->lng->txt(
"kiosk_show_participant"),
'kiosk_participant',
''));
1144 if ($this->testOBJ->getShowKioskModeTitle()) array_push($values,
'kiosk_title');
1145 if ($this->testOBJ->getShowKioskModeParticipant()) array_push($values,
'kiosk_participant');
1146 $kiosktitle->setValue($values);
1147 $kiosktitle->setInfo($this->lng->txt(
"kiosk_options_desc"));
1148 $kiosk->addSubItem($kiosktitle);
1150 $form->addItem($kiosk);
1152 $examIdInPass =
new ilCheckboxInputGUI($this->lng->txt(
'examid_in_test_pass'),
'examid_in_test_pass');
1153 $examIdInPass->
setInfo($this->lng->txt(
'examid_in_test_pass_desc'));
1154 $examIdInPass->setChecked($this->testOBJ->isShowExamIdInTestPassEnabled());
1155 $form->addItem($examIdInPass);
1157 $redirection_mode = $this->testOBJ->getRedirectionMode();
1158 $rm_enabled =
new ilCheckboxInputGUI($this->lng->txt(
'redirect_after_finishing_tst'),
'redirection_enabled' );
1159 $rm_enabled->
setInfo($this->lng->txt(
'redirect_after_finishing_tst_desc'));
1160 $rm_enabled->setChecked($redirection_mode ==
'0' ?
false :
true);
1161 $radio_rm =
new ilRadioGroupInputGUI($this->lng->txt(
'redirect_after_finishing_tst'),
'redirection_mode');
1163 $radio_rm->addOption($always);
1165 $radio_rm->addOption($kiosk);
1167 $rm_enabled->addSubItem($radio_rm);
1168 $redirection_url =
new ilTextInputGUI($this->lng->txt(
'redirection_url'),
'redirection_url');
1169 $redirection_url->
setValue((
string)$this->testOBJ->getRedirectionUrl());
1170 $redirection_url->setRequired(
true);
1171 $rm_enabled->addSubItem($redirection_url);
1173 $form->addItem($rm_enabled);
1176 $sign_submission = $this->testOBJ->getSignSubmission();
1177 $sign_submission_enabled =
new ilCheckboxInputGUI($this->lng->txt(
'sign_submission'),
'sign_submission');
1178 $sign_submission_enabled->
setChecked($sign_submission);
1179 $sign_submission_enabled->setInfo($this->lng->txt(
'sign_submission_info'));
1180 $form->addItem($sign_submission_enabled);
1186 $restrictions->setTitle($this->lng->txt(
"tst_max_allowed_users"));
1187 $form->addItem($restrictions);
1190 $fixedparticipants =
new ilCheckboxInputGUI($this->lng->txt(
'participants_invitation'),
"fixedparticipants");
1192 $fixedparticipants->setChecked($this->testOBJ->getFixedParticipants());
1193 $fixedparticipants->setOptionTitle($this->lng->txt(
"tst_allow_fixed_participants"));
1194 $fixedparticipants->setInfo($this->lng->txt(
"participants_invitation_description"));
1195 $invited_users = $this->testOBJ->getInvitedUsers();
1196 if (
$total && (count($invited_users) == 0))
1198 $fixedparticipants->setDisabled(
true);
1200 $form->addItem($fixedparticipants);
1203 $simul =
new ilTextInputGUI($this->lng->txt(
"tst_allowed_users"),
"allowedUsers");
1205 $simul->setValue(($this->testOBJ->getAllowedUsers()) ? $this->testOBJ->getAllowedUsers() :
'');
1206 $form->addItem($simul);
1209 $idle =
new ilTextInputGUI($this->lng->txt(
"tst_allowed_users_time_gap"),
"allowedUsersTimeGap");
1211 $idle->setSuffix($this->lng->txt(
"seconds"));
1212 $idle->setValue(($this->testOBJ->getAllowedUsersTimeGap()) ? $this->testOBJ->getAllowedUsersTimeGap() :
'');
1213 $form->addItem($idle);
1216 include_once
'Modules/Test/classes/class.ilECSTestSettings.php';
1218 $ecs->addSettingsToForm($form,
'tst');
1221 if($this->settingsTemplate)
1223 foreach($this->settingsTemplate->getSettings() as $id => $item)
1227 $form->removeItemByPostVar($id);
1240 require_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
1243 $confirmationGUI->setFormAction($this->ctrl->getFormAction($this));
1244 $confirmationGUI->setHeaderText($this->lng->txt(
"test_confirm_template_reset"));
1248 $this->tpl->setContent( $this->ctrl->getHTML($confirmationGUI) );
1256 $this->testOBJ->setTemplate(null);
1257 $this->testOBJ->saveToDB();
1260 $this->ctrl->redirect($this, self::CMD_SHOW_FORM);
1265 if( !$this->settingsTemplate )
1270 $templateSettings = $this->settingsTemplate->getSettings();
1272 if( !isset($templateSettings[$settingName]) )
1277 return $templateSettings[$settingName][
'value'];
1282 if( $this->settingsTemplate )
1286 $link = $this->ctrl->getLinkTarget($this, self::CMD_SHOW_RESET_TPL_CONFIRM);
1287 $link =
"<a href=\"".$link.
"\">".$this->lng->txt(
"test_using_template_link").
"</a>";
1289 $msgHTML = $tpl->getMessageHTML(
1290 sprintf($this->lng->txt(
"test_using_template"), $this->settingsTemplate->getTitle(), $link),
"info"
1293 $msgHTML =
"<div style=\"margin-top:10px\">$msgHTML</div>";
1348 'redirection_enabled',
'sign_submission'
1356 'fixedparticipants',
1358 'allowedUsersTimeGap',
1365 foreach($fields as $fld)
1367 if( !isset($templateData[$fld]) || !$templateData[$fld][
'hide'] )