ILIAS  release_7 Revision v7.30-3-g800a261c036
ilObjTestSettingsGeneralGUI Class Reference
+ Inheritance diagram for ilObjTestSettingsGeneralGUI:
+ Collaboration diagram for ilObjTestSettingsGeneralGUI:

Public Member Functions

 __construct (ilCtrl $ctrl, ilAccessHandler $access, ilLanguage $lng, ilTree $tree, ilDBInterface $db, ilPluginAdmin $pluginAdmin, ilObjUser $activeUser, ilObjTestGUI $testGUI)
 Constructor. More...
 
 executeCommand ()
 Command Execution. More...
 
- Public Member Functions inherited from ilTestSettingsGUI
 __construct (ilObjTest $testOBJ)
 

Data Fields

const CMD_SHOW_FORM = 'showForm'
 command constants More...
 
const CMD_SAVE_FORM = 'saveForm'
 
const CMD_CONFIRMED_SAVE_FORM = 'confirmedSaveForm'
 
const CMD_SHOW_RESET_TPL_CONFIRM = 'showResetTemplateConfirmation'
 
const CMD_CONFIRMED_RESET_TPL = 'confirmedResetTemplate'
 
const ANSWER_FIXATION_NONE = 'none'
 
const ANSWER_FIXATION_ON_INSTANT_FEEDBACK = 'instant_feedback'
 
const ANSWER_FIXATION_ON_FOLLOWUP_QUESTION = 'followup_question'
 
const ANSWER_FIXATION_ON_IFB_OR_FUQST = 'ifb_or_fuqst'
 
const INSTANT_FEEDBACK_TRIGGER_MANUAL = 0
 
const INSTANT_FEEDBACK_TRIGGER_FORCED = 1
 

Protected Member Functions

 getSettingsTemplateMessageHTML ()
 
 addPresentationProperties (ilPropertyFormGUI $form)
 
 savePresentationProperties (ilPropertyFormGUI $form)
 
 setAnswerFixationSettingsByFormValue ($formValue)
 
 getAnswerFixationSettingsAsFormValue ()
 
- Protected Member Functions inherited from ilTestSettingsGUI
 getTemplateSettingValue ($settingName)
 
 isHiddenFormItem ($formFieldId)
 
 isSectionHeaderRequired ($fields)
 
 formPropertyExists (ilPropertyFormGUI $form, $propertyId)
 
 removeHiddenItems (ilPropertyFormGUI $form)
 

Protected Attributes

 $ctrl = null
 
 $access = null
 
 $lng = null
 
 $tpl = null
 
 $tree = null
 
 $db = null
 
 $pluginAdmin = null
 
 $activeUser = null
 
 $testGUI = null
 
- Protected Attributes inherited from ilTestSettingsGUI
 $testOBJ = null
 
 $settingsTemplate = null
 

Private Member Functions

 showFormCmd (ilPropertyFormGUI $form=null)
 
 showConfirmation (ilPropertyFormGUI $form, $oldQuestionSetType, $newQuestionSetType, $hasQuestionsWithoutQuestionpool)
 
 confirmedSaveFormCmd ()
 
 saveFormCmd ($isConfirmedSave=false)
 
 showResetTemplateConfirmationCmd ()
 Enable all settings - Confirmation. More...
 
 confirmedResetTemplateCmd ()
 Enable all settings - remove template. More...
 
 isSkillServiceSettingToBeAdjusted (ilPropertyFormGUI $form)
 
 isCharSelectorPropertyRequired ()
 
 buildForm ()
 
 performSaveForm (ilPropertyFormGUI $form)
 
 addGeneralProperties (ilPropertyFormGUI $form)
 
 saveGeneralProperties (ilPropertyFormGUI $form)
 
 addAvailabilityProperties (ilPropertyFormGUI $form)
 
 saveAvailabilityProperties (ilPropertyFormGUI $form)
 
 addTestIntroProperties (ilPropertyFormGUI $form)
 
 saveTestIntroProperties (ilPropertyFormGUI $form)
 
 addTestAccessProperties (ilPropertyFormGUI $form)
 
 saveTestAccessProperties (ilPropertyFormGUI $form)
 
 addTestRunProperties (ilPropertyFormGUI $form)
 
 saveTestRunProperties (ilPropertyFormGUI $form)
 
 addQuestionBehaviourProperties (ilPropertyFormGUI $form)
 
 saveQuestionBehaviourProperties (ilPropertyFormGUI $form)
 
 addTestSequenceProperties (ilPropertyFormGUI $form)
 
 saveTestSequenceSettings (ilPropertyFormGUI $form)
 
 addTestFinishProperties (ilPropertyFormGUI $form)
 
 saveTestFinishProperties (ilPropertyFormGUI $form)
 

Private Attributes

 $testQuestionSetConfigFactory = null
 

Detailed Description

Definition at line 20 of file class.ilObjTestSettingsGeneralGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjTestSettingsGeneralGUI::__construct ( ilCtrl  $ctrl,
ilAccessHandler  $access,
ilLanguage  $lng,
ilTree  $tree,
ilDBInterface  $db,
ilPluginAdmin  $pluginAdmin,
ilObjUser  $activeUser,
ilObjTestGUI  $testGUI 
)

Constructor.

Parameters
ilCtrl$ctrl
ilAccessHandler$access
ilLanguage$lng
ilTemplate$tpl
ilDBInterface$db
ilObjTestGUI$testGUI
Returns
\ilObjTestSettingsGeneralGUI

Definition at line 81 of file class.ilObjTestSettingsGeneralGUI.php.

90 {
91 global $DIC; /* @var ILIAS\DI\Container $DIC */
92
93 $this->ctrl = $ctrl;
94 $this->access = $access;
95 $this->lng = $lng;
96 $this->tpl = $DIC->ui()->mainTemplate();
97 $this->tree = $tree;
98 $this->db = $db;
99 $this->pluginAdmin = $pluginAdmin;
100 $this->activeUser = $activeUser;
101
102 $this->testGUI = $testGUI;
103
104 require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
105 $this->testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($this->tree, $this->db, $this->pluginAdmin, $testGUI->object);
106
108 }
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $access, $activeUser, $ctrl, $db, $DIC, $lng, $pluginAdmin, $testGUI, $tree, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ addAvailabilityProperties()

ilObjTestSettingsGeneralGUI::addAvailabilityProperties ( ilPropertyFormGUI  $form)
private
Parameters
ilPropertyFormGUI$form

Definition at line 678 of file class.ilObjTestSettingsGeneralGUI.php.

679 {
680 include_once "Services/Object/classes/class.ilObjectActivation.php";
681 $this->lng->loadLanguageModule('rep');
682
684 $section->setTitle($this->lng->txt('rep_activation_availability'));
685 $form->addItem($section);
686
687 // additional info only with multiple references
688 $act_obj_info = $act_ref_info = "";
689 if (sizeof(ilObject::_getAllReferences($this->testOBJ->getId())) > 1) {
690 $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
691 $act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
692 }
693
694 $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
695 $online->setChecked(!$this->testOBJ->getOfflineStatus());
696 $online->setInfo($this->lng->txt('tst_activation_online_info') . $act_obj_info);
697 $form->addItem($online);
698
699 $act_type = new ilCheckboxInputGUI($this->lng->txt('rep_visibility_until'), 'activation_type');
700 $act_type->setChecked($this->testOBJ->isActivationLimited());
701 // $act_type->setInfo($this->lng->txt('tst_availability_until_info'));
702
703 include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
704 $dur = new ilDateDurationInputGUI($this->lng->txt("rep_time_period"), "access_period");
705 $dur->setRequired(true);
706 $dur->setShowTime(true);
707 $date = $this->testOBJ->getActivationStartingTime();
708 $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
709 $dur->setStartText($this->lng->txt('rep_activation_limited_start'));
710 $date = $this->testOBJ->getActivationEndingTime();
711 $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
712 $dur->setEndText($this->lng->txt('rep_activation_limited_end'));
713 $act_type->addSubItem($dur);
714
715 $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'activation_visibility');
716 $visible->setInfo($this->lng->txt('tst_activation_limited_visibility_info'));
717 $visible->setChecked($this->testOBJ->getActivationVisibility());
718 $act_type->addSubItem($visible);
719
720 $form->addItem($act_type);
721 }
$section
Definition: Utf8Test.php:83
const IL_CAL_UNIX
This class represents a checkbox property in a property form.
input GUI for a time span (start and end date)
@classDescription Date and time handling
This class represents a section header in a property form.
static _getAllReferences($a_id)
get all reference ids of object
addItem($a_item)
Add Item (Property, SectionHeader).

References $section, ilObject\_getAllReferences(), ilPropertyFormGUI\addItem(), and IL_CAL_UNIX.

Referenced by buildForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGeneralProperties()

ilObjTestSettingsGeneralGUI::addGeneralProperties ( ilPropertyFormGUI  $form)
private
Parameters
ilPropertyFormGUI$form

Definition at line 546 of file class.ilObjTestSettingsGeneralGUI.php.

547 {
548 $header = new ilFormSectionHeaderGUI();
549 $header->setTitle($this->lng->txt("tst_general_properties"));
550 $form->addItem($header);
551
552 // title & description (meta data)
553
554 include_once 'Services/MetaData/classes/class.ilMD.php';
555 $md_obj = new ilMD($this->testOBJ->getId(), 0, "tst");
556 $md_section = $md_obj->getGeneral();
557
558 $title = new ilTextInputGUI($this->lng->txt("title"), "title");
559 $title->setRequired(true);
560 $title->setValue($md_section->getTitle());
561 $form->addItem($title);
562
563 $ids = $md_section->getDescriptionIds();
564 if ($ids) {
565 $desc_obj = $md_section->getDescription(array_pop($ids));
566
567 $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description");
568 $desc->setCols(50);
569 $desc->setRows(4);
570 $desc->setValue($desc_obj->getDescription());
571 $form->addItem($desc);
572 }
573
574 // pool usage
575 $pool_usage = new ilRadioGroupInputGUI($this->lng->txt('test_question_pool_usage'), 'use_pool');
576
577 $optional_qpl = new ilRadioOption($this->lng->txt('test_question_pool_usage_optional'), 1);
578 $optional_qpl->setInfo($this->lng->txt('test_question_pool_usage_optional_info'));
579 $pool_usage->addOption($optional_qpl);
580
581 $tst_directly = new ilRadioOption($this->lng->txt('test_question_pool_usage_tst_directly'), 0);
582 $tst_directly->setInfo($this->lng->txt('test_question_pool_usage_tst_directly_info'));
583 $pool_usage->addOption($tst_directly);
584
585 $pool_usage->setValue($this->testOBJ->getPoolUsage() ? 1 : 0);
586 $form->addItem($pool_usage);
587
588 // test mode (question set type)
589 $questSetType = new ilRadioGroupInputGUI($this->lng->txt("tst_question_set_type"), 'question_set_type');
590 $questSetTypeFixed = new ilRadioOption(
591 $this->lng->txt("tst_question_set_type_fixed"),
593 $this->lng->txt("tst_question_set_type_fixed_desc")
594 );
595 $questSetType->addOption($questSetTypeFixed);
596 $questSetTypeRandom = new ilRadioOption(
597 $this->lng->txt("tst_question_set_type_random"),
599 $this->lng->txt("tst_question_set_type_random_desc")
600 );
601 $questSetType->addOption($questSetTypeRandom);
602 $questSetTypeContinues = new ilRadioOption(
603 $this->lng->txt("tst_question_set_type_dynamic"),
605 $this->lng->txt("tst_question_set_type_dynamic_desc")
606 );
607 $questSetType->addOption($questSetTypeContinues);
608 $questSetType->setValue($this->testOBJ->getQuestionSetType());
609 if ($this->testOBJ->participantDataExist()) {
610 $questSetType->setDisabled(true);
611 }
612 $form->addItem($questSetType);
613
614 // anonymity
615 $anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity');
616 if ($this->testOBJ->participantDataExist()) {
617 $anonymity->setDisabled(true);
618 }
619 $rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0);
620 $anonymity->addOption($rb);
621 $rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1);
622 $anonymity->addOption($rb);
623 $anonymity->setValue((int) $this->testOBJ->getAnonymity());
624 $form->addItem($anonymity);
625 }
const QUESTION_SET_TYPE_DYNAMIC
type setting value for dynamic question set (continues testing mode)
const QUESTION_SET_TYPE_RANDOM
type setting value for random question set
const QUESTION_SET_TYPE_FIXED
type setting value for fixed question set
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a text area property in a property form.
This class represents a text property in a property form.

References ilPropertyFormGUI\addItem(), ilObjTest\QUESTION_SET_TYPE_DYNAMIC, ilObjTest\QUESTION_SET_TYPE_FIXED, and ilObjTest\QUESTION_SET_TYPE_RANDOM.

Referenced by buildForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addPresentationProperties()

ilObjTestSettingsGeneralGUI::addPresentationProperties ( ilPropertyFormGUI  $form)
protected
Parameters
ilPropertyFormGUI$form

Definition at line 744 of file class.ilObjTestSettingsGeneralGUI.php.

745 {
746 global $DIC; /* @var ILIAS\DI\Container $DIC */
747
749 $section->setTitle($this->lng->txt('tst_presentation_settings_section'));
750 $form->addItem($section);
751
752 $DIC->object()->commonSettings()->legacyForm($form, $this->testOBJ)->addTileImage();
753 }

References $DIC, $section, and ilPropertyFormGUI\addItem().

Referenced by buildForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addQuestionBehaviourProperties()

ilObjTestSettingsGeneralGUI::addQuestionBehaviourProperties ( ilPropertyFormGUI  $form)
private
Parameters
ilPropertyFormGUI$form

Definition at line 1149 of file class.ilObjTestSettingsGeneralGUI.php.

1150 {
1151 $fields = array(
1152 'title_output', 'autosave', 'chb_shuffle_questions', 'chb_shuffle_questions',
1153 'offer_hints', 'instant_feedback_contents', 'instant_feedback_trigger',
1154 'answer_fixation_handling', 'obligations_enabled'
1155 );
1156
1157 if ($this->isSectionHeaderRequired($fields) || $this->isCharSelectorPropertyRequired()) {
1158 // sequence properties
1159 $seqheader = new ilFormSectionHeaderGUI();
1160 $seqheader->setTitle($this->lng->txt("tst_presentation_properties"));
1161 $form->addItem($seqheader);
1162 }
1163
1164 // question title output
1165 $title_output = new ilRadioGroupInputGUI($this->lng->txt("tst_title_output"), "title_output");
1166 $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_full"), 0, ''));
1167 $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_hide_points"), 1, ''));
1168 $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_no_title"), 2, ''));
1169 $title_output->setValue($this->testOBJ->getTitleOutput());
1170 $form->addItem($title_output);
1171
1172 // Autosave
1173 $autosave_output = new ilCheckboxInputGUI($this->lng->txt('autosave'), 'autosave');
1174 $autosave_output->setValue(1);
1175 $autosave_output->setChecked($this->testOBJ->getAutosave());
1176 $autosave_output->setInfo($this->lng->txt('autosave_info'));
1177 $autosave_interval = new ilTextInputGUI($this->lng->txt('autosave_ival'), 'autosave_ival');
1178 $autosave_interval->setSize(10);
1179 $autosave_interval->setValue($this->testOBJ->getAutosaveIval() / 1000);
1180 $autosave_interval->setSuffix($this->lng->txt('seconds'));
1181 $autosave_output->addSubItem($autosave_interval);
1182 $form->addItem($autosave_output);
1183
1184 // shuffle questions
1185 $shuffle = new ilCheckboxInputGUI($this->lng->txt("tst_shuffle_questions"), "chb_shuffle_questions");
1186 $shuffle->setValue(1);
1187 $shuffle->setChecked($this->testOBJ->getShuffleQuestions());
1188 $shuffle->setInfo($this->lng->txt("tst_shuffle_questions_description"));
1189 $form->addItem($shuffle);
1190
1191 // offer hints
1192 $checkBoxOfferHints = new ilCheckboxInputGUI($this->lng->txt('tst_setting_offer_hints_label'), 'offer_hints');
1193 $checkBoxOfferHints->setChecked($this->testOBJ->isOfferingQuestionHintsEnabled());
1194 $checkBoxOfferHints->setInfo($this->lng->txt('tst_setting_offer_hints_info'));
1195 $form->addItem($checkBoxOfferHints);
1196
1197 // instant feedback
1198 $instant_feedback_enabled = new ilCheckboxInputGUI($this->lng->txt('tst_instant_feedback'), 'instant_feedback_enabled');
1199 $instant_feedback_enabled->setInfo($this->lng->txt('tst_instant_feedback_desc'));
1200 $instant_feedback_enabled->setChecked($this->testOBJ->isAnyInstantFeedbackOptionEnabled());
1201 $form->addItem($instant_feedback_enabled);
1202 $instant_feedback_contents = new ilCheckboxGroupInputGUI($this->lng->txt('tst_instant_feedback_contents'), 'instant_feedback_contents');
1203 $instant_feedback_contents->setRequired(true);
1204 $instant_feedback_contents->addOption(new ilCheckboxOption(
1205 $this->lng->txt('tst_instant_feedback_results'),
1206 'instant_feedback_points',
1207 $this->lng->txt('tst_instant_feedback_results_desc')
1208 ));
1209 $instant_feedback_contents->addOption(new ilCheckboxOption(
1210 $this->lng->txt('tst_instant_feedback_answer_generic'),
1211 'instant_feedback_generic',
1212 $this->lng->txt('tst_instant_feedback_answer_generic_desc')
1213 ));
1214 $instant_feedback_contents->addOption(new ilCheckboxOption(
1215 $this->lng->txt('tst_instant_feedback_answer_specific'),
1216 'instant_feedback_specific',
1217 $this->lng->txt('tst_instant_feedback_answer_specific_desc')
1218 ));
1219 $instant_feedback_contents->addOption(new ilCheckboxOption(
1220 $this->lng->txt('tst_instant_feedback_solution'),
1221 'instant_feedback_solution',
1222 $this->lng->txt('tst_instant_feedback_solution_desc')
1223 ));
1224 $instant_feedback_contents->setValue($this->testOBJ->getInstantFeedbackOptionsAsArray());
1225 $instant_feedback_enabled->addSubItem($instant_feedback_contents);
1226 $instant_feedback_trigger = new ilRadioGroupInputGUI(
1227 $this->lng->txt('tst_instant_feedback_trigger'),
1228 'instant_feedback_trigger'
1229 );
1230 $ifbTriggerOpt = new ilRadioOption(
1231 $this->lng->txt('tst_instant_feedback_trigger_manual'),
1232 self::INSTANT_FEEDBACK_TRIGGER_MANUAL
1233 );
1234 $ifbTriggerOpt->setInfo($this->lng->txt('tst_instant_feedback_trigger_manual_desc'));
1235 $instant_feedback_trigger->addOption($ifbTriggerOpt);
1236 $ifbTriggerOpt = new ilRadioOption(
1237 $this->lng->txt('tst_instant_feedback_trigger_forced'),
1238 self::INSTANT_FEEDBACK_TRIGGER_FORCED
1239 );
1240 $ifbTriggerOpt->setInfo($this->lng->txt('tst_instant_feedback_trigger_forced_desc'));
1241 $instant_feedback_trigger->addOption($ifbTriggerOpt);
1242 $instant_feedback_trigger->setValue($this->testOBJ->isForceInstantFeedbackEnabled());
1243 $instant_feedback_enabled->addSubItem($instant_feedback_trigger);
1244
1245 $answerFixation = new ilRadioGroupInputGUI(
1246 $this->lng->txt('tst_answer_fixation_handling'),
1247 'answer_fixation_handling'
1248 );
1249 $radioOption = new ilRadioOption(
1250 $this->lng->txt('tst_answer_fixation_none'),
1251 self::ANSWER_FIXATION_NONE
1252 );
1253 $radioOption->setInfo($this->lng->txt('tst_answer_fixation_none_desc'));
1254 $answerFixation->addOption($radioOption);
1255 $radioOption = new ilRadioOption(
1256 $this->lng->txt('tst_answer_fixation_on_instant_feedback'),
1257 self::ANSWER_FIXATION_ON_INSTANT_FEEDBACK
1258 );
1259 $radioOption->setInfo($this->lng->txt('tst_answer_fixation_on_instant_feedback_desc'));
1260 $answerFixation->addOption($radioOption);
1261 $radioOption = new ilRadioOption(
1262 $this->lng->txt('tst_answer_fixation_on_followup_question'),
1263 self::ANSWER_FIXATION_ON_FOLLOWUP_QUESTION
1264 );
1265 $radioOption->setInfo($this->lng->txt('tst_answer_fixation_on_followup_question_desc'));
1266 $answerFixation->addOption($radioOption);
1267 $radioOption = new ilRadioOption(
1268 $this->lng->txt('tst_answer_fixation_on_instantfb_or_followupqst'),
1269 self::ANSWER_FIXATION_ON_IFB_OR_FUQST
1270 );
1271 $radioOption->setInfo($this->lng->txt('tst_answer_fixation_on_instantfb_or_followupqst_desc'));
1272 $answerFixation->addOption($radioOption);
1273 $answerFixation->setValue($this->getAnswerFixationSettingsAsFormValue());
1274 $form->addItem($answerFixation);
1275
1276 // enable obligations
1277 $checkBoxEnableObligations = new ilCheckboxInputGUI($this->lng->txt('tst_setting_enable_obligations_label'), 'obligations_enabled');
1278 $checkBoxEnableObligations->setChecked($this->testOBJ->areObligationsEnabled());
1279 $checkBoxEnableObligations->setInfo($this->lng->txt('tst_setting_enable_obligations_info'));
1280 $form->addItem($checkBoxEnableObligations);
1281
1282 // selector for unicode characters
1283 if ($this->isCharSelectorPropertyRequired()) {
1284 require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
1286 $char_selector->getConfig()->setAvailability($this->testOBJ->getCharSelectorAvailability());
1287 $char_selector->getConfig()->setDefinition($this->testOBJ->getCharSelectorDefinition());
1288 $char_selector->addFormProperties($form);
1289 $char_selector->setFormValues($form);
1290 }
1291
1292 if ($this->testOBJ->participantDataExist()) {
1293 $checkBoxOfferHints->setDisabled(true);
1294 $instant_feedback_enabled->setDisabled(true);
1295 $instant_feedback_trigger->setDisabled(true);
1296 $instant_feedback_contents->setDisabled(true);
1297 $answerFixation->setDisabled(true);
1298 $checkBoxEnableObligations->setDisabled(true);
1299 }
1300 }
This shows a character selector.
This class represents a property in a property form.
This class represents an option in a checkbox group.

References ilPropertyFormGUI\addItem(), ilCharSelectorConfig\CONTEXT_TEST, getAnswerFixationSettingsAsFormValue(), isCharSelectorPropertyRequired(), and ilTestSettingsGUI\isSectionHeaderRequired().

Referenced by buildForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addTestAccessProperties()

ilObjTestSettingsGeneralGUI::addTestAccessProperties ( ilPropertyFormGUI  $form)
private
Parameters
ilPropertyFormGUI$form

Definition at line 822 of file class.ilObjTestSettingsGeneralGUI.php.

823 {
824 $header = new ilFormSectionHeaderGUI();
825 $header->setTitle($this->lng->txt("tst_settings_header_execution"));
826 $form->addItem($header);
827
828 // starting time
829 $startingtime = new ilDateTimeInputGUI($this->lng->txt("tst_starting_time"), 'starting_time');
830 $startingtime->setInfo($this->lng->txt("tst_starting_time_desc"));
831 $startingtime->setShowTime(true);
832 if ((int) $this->testOBJ->getStartingTime() !== 0) {
833 $startingtime->setDate(new ilDateTime($this->testOBJ->getStartingTime(), IL_CAL_UNIX));
834 } else {
835 $startingtime->setDate(null);
836 }
837
838 $form->addItem($startingtime);
839 if ($this->testOBJ->participantDataExist()) {
840 $startingtime->setDisabled(true);
841 }
842
843 // ending time
844 $endingtime = new ilDateTimeInputGUI($this->lng->txt("tst_ending_time"), 'ending_time');
845 $endingtime->setInfo($this->lng->txt("tst_ending_time_desc"));
846 $endingtime->setShowTime(true);
847 if ((int) $this->testOBJ->getEndingTime() !== 0) {
848 $endingtime->setDate(new ilDateTime($this->testOBJ->getEndingTime(), IL_CAL_UNIX));
849 } else {
850 $endingtime->setDate(null);
851 }
852 $form->addItem($endingtime);
853
854 // test password
855 $pwEnabled = new ilCheckboxInputGUI($this->lng->txt('tst_password'), 'password_enabled');
856 $pwEnabled->setChecked($this->testOBJ->isPasswordEnabled());
857 $pwEnabled->setInfo($this->lng->txt("tst_password_details"));
858 $password = new ilTextInputGUI($this->lng->txt("tst_password_enter"), "password");
859 $password->setRequired(true);
860 $password->setSize(20);
861 $password->setMaxLength(20);
862 $password->setValue($this->testOBJ->getPassword());
863 $pwEnabled->addSubItem($password);
864 $form->addItem($pwEnabled);
865
866 // fixed participants
867 $fixedparticipants = new ilCheckboxInputGUI($this->lng->txt('participants_invitation'), "fixedparticipants");
868 $fixedparticipants->setValue(1);
869 $fixedparticipants->setChecked($this->testOBJ->getFixedParticipants());
870 $fixedparticipants->setInfo($this->lng->txt("participants_invitation_description"));
871 if ($this->testOBJ->participantDataExist()) {
872 $fixedparticipants->setDisabled(true);
873 }
874 $form->addItem($fixedparticipants);
875
876 // simultaneous users
877 $simulLimited = new ilCheckboxInputGUI($this->lng->txt("tst_allowed_users"), 'limitUsers');
878 $simulLimited->setInfo($this->lng->txt("tst_allowed_users_desc"));
879 $simulLimited->setChecked($this->testOBJ->isLimitUsersEnabled());
880
881 // allowed simultaneous users
882 $simul = new ilNumberInputGUI($this->lng->txt("tst_allowed_users_max"), "allowedUsers");
883 $simul->setRequired(true);
884 $simul->allowDecimals(false);
885 $simul->setMinValue(1);
886 $simul->setMinvalueShouldBeGreater(false);
887 $simul->setSize(4);
888 $simul->setValue(($this->testOBJ->getAllowedUsers()) ?: '');
889 $simulLimited->addSubItem($simul);
890
891 // idle time
892 $idle = new ilNumberInputGUI($this->lng->txt("tst_allowed_users_time_gap"), "allowedUsersTimeGap");
893 $idle->setInfo($this->lng->txt("tst_allowed_users_time_gap_desc"));
894 $idle->setSize(4);
895 $idle->setSuffix($this->lng->txt("seconds"));
896 $idle->setValue(($this->testOBJ->getAllowedUsersTimeGap()) ?: 300);
897 $simulLimited->addSubItem($idle);
898
899 $form->addItem($simulLimited);
900 return $header;
901 }
This class represents a date/time property in a property form.
This class represents a number property in a property form.
$password
Definition: cron.php:14

References $password, ilPropertyFormGUI\addItem(), and IL_CAL_UNIX.

Referenced by buildForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addTestFinishProperties()

ilObjTestSettingsGeneralGUI::addTestFinishProperties ( ilPropertyFormGUI  $form)
private
Parameters
ilPropertyFormGUI$form

Definition at line 1470 of file class.ilObjTestSettingsGeneralGUI.php.

1471 {
1472 $testFinishHeader = new ilFormSectionHeaderGUI();
1473 $testFinishHeader->setTitle($this->lng->txt("tst_final_information"));
1474 $form->addItem($testFinishHeader);
1475
1476 // examview
1477 $enable_examview = new ilCheckboxInputGUI($this->lng->txt("enable_examview"), 'enable_examview');
1478 $enable_examview->setValue(1);
1479 $enable_examview->setChecked($this->testOBJ->getEnableExamview());
1480 $enable_examview->setInfo($this->lng->txt("enable_examview_desc"));
1481 $show_examview_pdf = new ilCheckboxInputGUI('', 'show_examview_pdf');
1482 $show_examview_pdf->setValue(1);
1483 $show_examview_pdf->setChecked($this->testOBJ->getShowExamviewPdf());
1484 $show_examview_pdf->setOptionTitle($this->lng->txt("show_examview_pdf"));
1485 $enable_examview->addSubItem($show_examview_pdf);
1486 $form->addItem($enable_examview);
1487
1488 // show final statement
1489 $showfinal = new ilCheckboxInputGUI($this->lng->txt("final_statement"), "showfinalstatement");
1490 $showfinal->setChecked($this->testOBJ->getShowFinalStatement());
1491 $showfinal->setInfo($this->lng->txt("final_statement_show_desc"));
1492 $form->addItem($showfinal);
1493 // final statement
1494 $finalstatement = new ilTextAreaInputGUI($this->lng->txt("final_statement"), "finalstatement");
1495 $finalstatement->setRequired(true);
1496 $finalstatement->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getFinalStatement(), false, true));
1497 $finalstatement->setRows(10);
1498 $finalstatement->setCols(80);
1499 $finalstatement->setUseRte(true);
1500 $finalstatement->addPlugin("latex");
1501 $finalstatement->addButton("latex");
1502 $finalstatement->setRTESupport($this->testOBJ->getId(), "tst", "assessment");
1503 $finalstatement->setRteTagSet('full');
1504 $showfinal->addSubItem($finalstatement);
1505
1506 $redirection_mode = $this->testOBJ->getRedirectionMode();
1507 $rm_enabled = new ilCheckboxInputGUI($this->lng->txt('redirect_after_finishing_tst'), 'redirection_enabled');
1508 $rm_enabled->setInfo($this->lng->txt('redirect_after_finishing_tst_desc'));
1509 $rm_enabled->setChecked($redirection_mode == '0' ? false : true);
1510 $radio_rm = new ilRadioGroupInputGUI($this->lng->txt('redirect_after_finishing_rule'), 'redirection_mode');
1511 $always = new ilRadioOption($this->lng->txt('redirect_always'), REDIRECT_ALWAYS);
1512 $radio_rm->addOption($always);
1513 $kiosk = new ilRadioOption($this->lng->txt('redirect_in_kiosk_mode'), REDIRECT_KIOSK);
1514 $radio_rm->addOption($kiosk);
1515 $radio_rm->setValue(in_array($redirection_mode, array(REDIRECT_ALWAYS, REDIRECT_KIOSK)) ? $redirection_mode : REDIRECT_ALWAYS);
1516 $rm_enabled->addSubItem($radio_rm);
1517 $redirection_url = new ilTextInputGUI($this->lng->txt('redirection_url'), 'redirection_url');
1518 $redirection_url->setValue((string) $this->testOBJ->getRedirectionUrl());
1519 $redirection_url->setRequired(true);
1520 $redirection_url->setMaxLength(128);
1521 $rm_enabled->addSubItem($redirection_url);
1522
1523 $form->addItem($rm_enabled);
1524
1525 // Sign submission
1526 $sign_submission = $this->testOBJ->getSignSubmission();
1527 $sign_submission_enabled = new ilCheckboxInputGUI($this->lng->txt('sign_submission'), 'sign_submission');
1528 $sign_submission_enabled->setChecked($sign_submission);
1529 $sign_submission_enabled->setInfo($this->lng->txt('sign_submission_info'));
1530 $form->addItem($sign_submission_enabled);
1531
1532 // mail notification
1533 $mailnotification = new ilCheckboxInputGUI($this->lng->txt("tst_finish_notification"), "mailnotification");
1534 $mailnotification->setInfo($this->lng->txt("tst_finish_notification_desc"));
1535 $mailnotification->setChecked($this->testOBJ->getMailNotification() > 0);
1536 $form->addItem($mailnotification);
1537
1538 $mailnotificationContent = new ilRadioGroupInputGUI($this->lng->txt("tst_finish_notification_content"), "mailnotification_content");
1539 $mailnotificationContent->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_simple"), 1, ''));
1540 $mailnotificationContent->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_advanced"), 2, ''));
1541 $mailnotificationContent->setValue($this->testOBJ->getMailNotification() ? $this->testOBJ->getMailNotification() : 1);
1542 $mailnotificationContent->setRequired(true);
1543 $mailnotification->addSubItem($mailnotificationContent);
1544
1545 $mailnottype = new ilCheckboxInputGUI('', "mailnottype");
1546 $mailnottype->setValue(1);
1547 $mailnottype->setOptionTitle($this->lng->txt("mailnottype"));
1548 $mailnottype->setInfo($this->lng->txt("mailnottype_desc"));
1549 $mailnottype->setChecked($this->testOBJ->getMailNotificationType());
1550 $mailnotification->addSubItem($mailnottype);
1551 }
const REDIRECT_ALWAYS
const REDIRECT_KIOSK

References ilPropertyFormGUI\addItem(), REDIRECT_ALWAYS, and REDIRECT_KIOSK.

Referenced by buildForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addTestIntroProperties()

ilObjTestSettingsGeneralGUI::addTestIntroProperties ( ilPropertyFormGUI  $form)
private
Parameters
ilPropertyFormGUI$form

Definition at line 768 of file class.ilObjTestSettingsGeneralGUI.php.

769 {
771 $section->setTitle($this->lng->txt('tst_settings_header_intro'));
772 $form->addItem($section);
773
774 // introduction
775 $introEnabled = new ilCheckboxInputGUI($this->lng->txt("tst_introduction"), 'intro_enabled');
776 $introEnabled->setChecked($this->testOBJ->isIntroductionEnabled());
777 $introEnabled->setInfo($this->lng->txt('tst_introduction_desc'));
778 $form->addItem($introEnabled);
779 $intro = new ilTextAreaInputGUI($this->lng->txt("tst_introduction_text"), "introduction");
780 $intro->setRequired(true);
781 $intro->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getIntroduction(), false, true));
782 $intro->setRows(10);
783 $intro->setCols(80);
784 $intro->setUseRte(true);
785 $intro->addPlugin("latex");
786 $intro->addButton("latex");
787 $intro->setRTESupport($this->testOBJ->getId(), "tst", "assessment");
788 $intro->setRteTagSet('full');
789 $introEnabled->addSubItem($intro);
790
791 // showinfo
792 $showinfo = new ilCheckboxInputGUI($this->lng->txt("showinfo"), "showinfo");
793 $showinfo->setValue(1);
794 $showinfo->setChecked($this->testOBJ->getShowInfo());
795 $showinfo->setInfo($this->lng->txt("showinfo_desc"));
796 $form->addItem($showinfo);
797 }

References $section, and ilPropertyFormGUI\addItem().

Referenced by buildForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addTestRunProperties()

ilObjTestSettingsGeneralGUI::addTestRunProperties ( ilPropertyFormGUI  $form)
private
Parameters
ilPropertyFormGUI$form

Definition at line 957 of file class.ilObjTestSettingsGeneralGUI.php.

958 {
959 // section header test run
960 $header = new ilFormSectionHeaderGUI();
961 $header->setTitle($this->lng->txt("tst_settings_header_test_run"));
962 $form->addItem($header);
963
964 // max. number of passes
965 $limitPasses = new ilCheckboxInputGUI($this->lng->txt("tst_limit_nr_of_tries"), 'limitPasses');
966 $limitPasses->setInfo($this->lng->txt("tst_nr_of_tries_desc"));
967 $limitPasses->setChecked($this->testOBJ->getNrOfTries() > 0);
968 $nr_of_tries = new ilNumberInputGUI($this->lng->txt("tst_nr_of_tries"), "nr_of_tries");
969 $nr_of_tries->setSize(3);
970 $nr_of_tries->allowDecimals(false);
971 $nr_of_tries->setMinValue(1);
972 $nr_of_tries->setMinvalueShouldBeGreater(false);
973 $nr_of_tries->setValue($this->testOBJ->getNrOfTries() ? $this->testOBJ->getNrOfTries() : 1);
974 $nr_of_tries->setRequired(true);
975 $limitPasses->addSubItem($nr_of_tries);
976 $blockAfterPassed = new ilCheckboxInputGUI(
977 $this->lng->txt('tst_block_passes_after_passed'),
978 'block_after_passed'
979 );
980 $blockAfterPassed->setInfo($this->lng->txt('tst_block_passes_after_passed_info'));
981 $blockAfterPassed->setChecked($this->testOBJ->isBlockPassesAfterPassedEnabled());
982 $limitPasses->addSubItem($blockAfterPassed);
983 if ($this->testOBJ->participantDataExist()) {
984 $limitPasses->setDisabled(true);
985 $blockAfterPassed->setDisabled(true);
986 $nr_of_tries->setDisabled(true);
987 }
988 $form->addItem($limitPasses);
989
990 // pass_waiting time between testruns
991 $pass_waiting_enabled = new ilCheckboxInputGUI($this->lng->txt('tst_pass_waiting_enabled'), 'pass_waiting_enabled');
992 $pass_waiting_enabled->setInfo($this->lng->txt('tst_pass_waiting_info'));
993 $pass_waiting_enabled->setChecked($this->testOBJ->isPassWaitingEnabled());
994
995 // pass_waiting
996 $duration = new ilDurationInputGUI($this->lng->txt("tst_pass_waiting_time"), "pass_waiting");
997
998 $duration->setShowMonths(true);
999 $duration->setShowDays(true);
1000 $duration->setShowHours(true);
1001 $duration->setShowMinutes(true);
1002
1003 $pw_time_array = explode(':', $this->testOBJ->getPassWaiting());
1004 $duration->setMonths($pw_time_array[0]);
1005 $duration->setDays($pw_time_array[1]);
1006 $duration->setHours($pw_time_array[2]);
1007 $duration->setMinutes($pw_time_array[3]);
1008 $duration->setRequired(false);
1009 $pass_waiting_enabled->addSubItem($duration);
1010
1011 $form->addItem($pass_waiting_enabled);
1012
1013 // enable max. processing time
1014 $processing = new ilCheckboxInputGUI($this->lng->txt("tst_processing_time"), "chb_processing_time");
1015 $processing->setInfo($this->lng->txt("tst_processing_time_desc"));
1016 $processing->setValue(1);
1017
1018 if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_processing_time')) {
1019 $processing->setChecked(true);
1020 } else {
1021 $processing->setChecked($this->testOBJ->getEnableProcessingTime());
1022 }
1023
1024 // max. processing time
1025 $processingtime = new ilNumberInputGUI($this->lng->txt("tst_processing_time_duration"), 'processing_time');
1026 $processingtime->allowDecimals(false);
1027 $processingtime->setMinValue(1);
1028 $processingtime->setMinvalueShouldBeGreater(false);
1029 $processingtime->setValue($this->testOBJ->getProcessingTimeAsMinutes());
1030 $processingtime->setSize(5);
1031 $processingtime->setSuffix($this->lng->txt('minutes'));
1032 $processingtime->setInfo($this->lng->txt("tst_processing_time_duration_desc"));
1033 $processing->addSubItem($processingtime);
1034
1035 // reset max. processing time
1036 $resetprocessing = new ilCheckboxInputGUI('', "chb_reset_processing_time");
1037 $resetprocessing->setValue(1);
1038 $resetprocessing->setOptionTitle($this->lng->txt("tst_reset_processing_time"));
1039 $resetprocessing->setChecked($this->testOBJ->getResetProcessingTime());
1040 $resetprocessing->setInfo($this->lng->txt("tst_reset_processing_time_desc"));
1041 $processing->addSubItem($resetprocessing);
1042 $form->addItem($processing);
1043
1044 if ($this->testOBJ->participantDataExist()) {
1045 $processing->setDisabled(true);
1046 $processingtime->setDisabled(true);
1047 $resetprocessing->setDisabled(true);
1048
1049 $duration->setDisabled(true);
1050 $pass_waiting_enabled->setDisabled(true);
1051 }
1052
1053 // kiosk mode
1054 $kiosk = new ilCheckboxInputGUI($this->lng->txt("kiosk"), "kiosk");
1055 $kiosk->setValue(1);
1056 $kiosk->setChecked($this->testOBJ->getKioskMode());
1057 $kiosk->setInfo($this->lng->txt("kiosk_description"));
1058
1059 // kiosk mode options
1060 $kiosktitle = new ilCheckboxGroupInputGUI($this->lng->txt("kiosk_options"), "kiosk_options");
1061 $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_title"), 'kiosk_title', ''));
1062 $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_participant"), 'kiosk_participant', ''));
1063 $values = array();
1064 if ($this->testOBJ->getShowKioskModeTitle()) {
1065 array_push($values, 'kiosk_title');
1066 }
1067 if ($this->testOBJ->getShowKioskModeParticipant()) {
1068 array_push($values, 'kiosk_participant');
1069 }
1070 $kiosktitle->setValue($values);
1071 $kiosktitle->setInfo($this->lng->txt("kiosk_options_desc"));
1072 $kiosk->addSubItem($kiosktitle);
1073
1074 $form->addItem($kiosk);
1075
1076 $examIdInPass = new ilCheckboxInputGUI($this->lng->txt('examid_in_test_pass'), 'examid_in_test_pass');
1077 $examIdInPass->setInfo($this->lng->txt('examid_in_test_pass_desc'));
1078 $examIdInPass->setChecked($this->testOBJ->isShowExamIdInTestPassEnabled());
1079 $form->addItem($examIdInPass);
1080 }
This class represents a duration (typical hh:mm:ss) property in a property form.
getTemplateSettingValue($settingName)

References ilPropertyFormGUI\addItem(), and ilTestSettingsGUI\getTemplateSettingValue().

Referenced by buildForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addTestSequenceProperties()

ilObjTestSettingsGeneralGUI::addTestSequenceProperties ( ilPropertyFormGUI  $form)
private
Parameters
ilPropertyFormGUI$form

Definition at line 1363 of file class.ilObjTestSettingsGeneralGUI.php.

1364 {
1365 // sequence properties
1366 $seqheader = new ilFormSectionHeaderGUI();
1367 $seqheader->setTitle($this->lng->txt("tst_sequence_properties"));
1368 $form->addItem($seqheader);
1369
1370 // use previous answers
1371 $prevanswers = new ilCheckboxInputGUI($this->lng->txt("tst_use_previous_answers"), "chb_use_previous_answers");
1372 $prevanswers->setValue(1);
1373 $prevanswers->setChecked($this->testOBJ->getUsePreviousAnswers());
1374 $prevanswers->setInfo($this->lng->txt("tst_use_previous_answers_description"));
1375 $form->addItem($prevanswers);
1376
1377 // show suspend test
1378 $cancel = new ilCheckboxInputGUI($this->lng->txt("tst_show_cancel"), "chb_show_cancel");
1379 $cancel->setValue(1);
1380 $cancel->setChecked($this->testOBJ->getShowCancel());
1381 $cancel->setInfo($this->lng->txt("tst_show_cancel_description"));
1382 $form->addItem($cancel);
1383
1384 // postpone questions
1385 $postpone = new ilRadioGroupInputGUI($this->lng->txt("tst_postpone"), "postpone");
1386 $postpone->addOption(new ilRadioOption(
1387 $this->lng->txt("tst_postpone_off"),
1388 0,
1389 $this->lng->txt("tst_postpone_off_desc")
1390 ));
1391 $postpone->addOption(new ilRadioOption(
1392 $this->lng->txt("tst_postpone_on"),
1393 1,
1394 $this->lng->txt("tst_postpone_on_desc")
1395 ));
1396 $postpone->setValue((int) $this->testOBJ->getSequenceSettings());
1397 $form->addItem($postpone);
1398
1399 // show list of questions
1400 $list_of_questions = new ilCheckboxInputGUI($this->lng->txt("tst_show_summary"), "list_of_questions");
1401 //$list_of_questions->setOptionTitle($this->lng->txt("tst_show_summary"));
1402 $list_of_questions->setValue(1);
1403 $list_of_questions->setChecked($this->testOBJ->getListOfQuestions());
1404 $list_of_questions->setInfo($this->lng->txt("tst_show_summary_description"));
1405
1406 $list_of_questions_options = new ilCheckboxGroupInputGUI('', "list_of_questions_options");
1407 $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_start"), 'chb_list_of_questions_start', ''));
1408 $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_end"), 'chb_list_of_questions_end', ''));
1409 $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_with_description"), 'chb_list_of_questions_with_description', ''));
1410 $values = array();
1411 if ($this->testOBJ->getListOfQuestionsStart()) {
1412 array_push($values, 'chb_list_of_questions_start');
1413 }
1414 if ($this->testOBJ->getListOfQuestionsEnd()) {
1415 array_push($values, 'chb_list_of_questions_end');
1416 }
1417 if ($this->testOBJ->getListOfQuestionsDescription()) {
1418 array_push($values, 'chb_list_of_questions_with_description');
1419 }
1420 $list_of_questions_options->setValue($values);
1421
1422 $list_of_questions->addSubItem($list_of_questions_options);
1423 $form->addItem($list_of_questions);
1424
1425 // show question marking
1426 $marking = new ilCheckboxInputGUI($this->lng->txt("question_marking"), "chb_show_marker");
1427 $marking->setValue(1);
1428 $marking->setChecked($this->testOBJ->getShowMarker());
1429 $marking->setInfo($this->lng->txt("question_marking_description"));
1430 $form->addItem($marking);
1431 }

References ilPropertyFormGUI\addItem().

Referenced by buildForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildForm()

ilObjTestSettingsGeneralGUI::buildForm ( )
private

Definition at line 449 of file class.ilObjTestSettingsGeneralGUI.php.

450 {
451 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
452 $form = new ilPropertyFormGUI();
453 $form->setFormAction($this->ctrl->getFormAction($this));
454 $form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt("save"));
455 $form->setTableWidth("100%");
456 $form->setId("test_properties");
457
458 $this->addGeneralProperties($form);
459 $this->addAvailabilityProperties($form);
460 $this->addPresentationProperties($form);
461 $this->addTestIntroProperties($form);
462 $this->addTestAccessProperties($form);
463 $this->addTestRunProperties($form);
464 $this->addQuestionBehaviourProperties($form);
465 $this->addTestSequenceProperties($form);
466 $this->addTestFinishProperties($form);
467
468 // Edit ecs export settings
469 include_once 'Modules/Test/classes/class.ilECSTestSettings.php';
470 $ecs = new ilECSTestSettings($this->testOBJ);
471 $ecs->addSettingsToForm($form, 'tst');
472
473 // additional features
474
475 $orgunitServiceActive = ilOrgUnitGlobalSettings::getInstance()->getObjectPositionSettingsByType(
476 $this->testOBJ->getType()
477 )->isActive();
478
479 $skillServiceActive = ilObjTest::isSkillManagementGloballyActivated();
480
481
482 if ($orgunitServiceActive || $skillServiceActive) {
483 $otherHead = new ilFormSectionHeaderGUI();
484 $otherHead->setTitle($this->lng->txt('obj_features'));
485 $form->addItem($otherHead);
486 }
487
488 require_once 'Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
489 ilObjectServiceSettingsGUI::initServiceSettingsForm($this->testOBJ->getId(), $form, array(
491 ));
492
493 // skill service activation for FIXED tests only
494 if ($skillServiceActive) {
495 $skillService = new ilCheckboxInputGUI($this->lng->txt('tst_activate_skill_service'), 'skill_service');
496 $skillService->setInfo($this->lng->txt('tst_activate_skill_service_desc'));
497 $skillService->setChecked($this->testOBJ->isSkillServiceEnabled());
498 if ($this->testOBJ->participantDataExist()) {
499 $skillService->setDisabled(true);
500 }
501 $form->addItem($skillService);
502 }
503
504 // remove items when using template
505 $this->removeHiddenItems($form);
506
507 return $form;
508 }
Class ilECSTestSettings.
addQuestionBehaviourProperties(ilPropertyFormGUI $form)
static isSkillManagementGloballyActivated()
static initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Init service settings form.
This class represents a property form user interface.
removeHiddenItems(ilPropertyFormGUI $form)

References addAvailabilityProperties(), addGeneralProperties(), addPresentationProperties(), addQuestionBehaviourProperties(), addTestAccessProperties(), addTestFinishProperties(), addTestIntroProperties(), addTestRunProperties(), addTestSequenceProperties(), ilOrgUnitGlobalSettings\getInstance(), ilObjectServiceSettingsGUI\initServiceSettingsForm(), ilObjTest\isSkillManagementGloballyActivated(), ilObjectServiceSettingsGUI\ORGU_POSITION_ACCESS, and ilTestSettingsGUI\removeHiddenItems().

Referenced by saveFormCmd(), and showFormCmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmedResetTemplateCmd()

ilObjTestSettingsGeneralGUI::confirmedResetTemplateCmd ( )
private

Enable all settings - remove template.

Definition at line 414 of file class.ilObjTestSettingsGeneralGUI.php.

415 {
416 $this->testOBJ->setTemplate(null);
417 $this->testOBJ->saveToDB();
418
419 ilUtil::sendSuccess($this->lng->txt("test_template_reset"), true);
420 $this->ctrl->redirect($this, self::CMD_SHOW_FORM);
421 }

◆ confirmedSaveFormCmd()

ilObjTestSettingsGeneralGUI::confirmedSaveFormCmd ( )
private

Definition at line 198 of file class.ilObjTestSettingsGeneralGUI.php.

199 {
200 return $this->saveFormCmd(true);
201 }

References saveFormCmd().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjTestSettingsGeneralGUI::executeCommand ( )

Command Execution.

Definition at line 113 of file class.ilObjTestSettingsGeneralGUI.php.

114 {
115 global $DIC; /* @var ILIAS\DI\Container $DIC */
116
117 // allow only write access
118
119 if (!$this->access->checkAccess("write", "", $this->testGUI->ref_id)) {
120 ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
121 $this->ctrl->redirect($this->testGUI, "infoScreen");
122 }
123
124 $DIC->tabs()->activateTab(ilTestTabsManager::TAB_ID_SETTINGS);
125
126 // process command
127
128 $nextClass = $this->ctrl->getNextClass();
129
130 switch ($nextClass) {
131 default:
132 $cmd = $this->ctrl->getCmd(self::CMD_SHOW_FORM) . 'Cmd';
133 $this->$cmd();
134 }
135 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $DIC, ilUtil\sendInfo(), and ilTestTabsManager\TAB_ID_SETTINGS.

+ Here is the call graph for this function:

◆ getAnswerFixationSettingsAsFormValue()

ilObjTestSettingsGeneralGUI::getAnswerFixationSettingsAsFormValue ( )
protected

Definition at line 1612 of file class.ilObjTestSettingsGeneralGUI.php.

1613 {
1614 if ($this->testOBJ->isInstantFeedbackAnswerFixationEnabled() && $this->testOBJ->isFollowupQuestionAnswerFixationEnabled()) {
1616 }
1617
1618 if ($this->testOBJ->isFollowupQuestionAnswerFixationEnabled()) {
1620 }
1621
1622 if ($this->testOBJ->isInstantFeedbackAnswerFixationEnabled()) {
1624 }
1625
1627 }

References ANSWER_FIXATION_NONE, ANSWER_FIXATION_ON_FOLLOWUP_QUESTION, ANSWER_FIXATION_ON_IFB_OR_FUQST, and ANSWER_FIXATION_ON_INSTANT_FEEDBACK.

Referenced by addQuestionBehaviourProperties().

+ Here is the caller graph for this function:

◆ getSettingsTemplateMessageHTML()

ilObjTestSettingsGeneralGUI::getSettingsTemplateMessageHTML ( )
protected

Definition at line 170 of file class.ilObjTestSettingsGeneralGUI.php.

171 {
172 if ($this->settingsTemplate) {
173 $title = $this->settingsTemplate->getTitle();
174
175 if ($this->settingsTemplate->getAutoGenerated()) {
176 $title = $this->lng->txt($title);
177 }
178
179 global $DIC;
180 $tpl = $DIC['tpl'];
181
182 $link = $this->ctrl->getLinkTarget($this, self::CMD_SHOW_RESET_TPL_CONFIRM);
183 $link = "<a href=\"" . $link . "\">" . $this->lng->txt("test_using_template_link") . "</a>";
184
186 sprintf($this->lng->txt("test_using_template"), $title, $link),
187 "info"
188 );
189
190 $msgHTML = "<div style=\"margin-top:10px\">$msgHTML</div>";
191 } else {
192 $msgHTML = '';
193 }
194
195 return $msgHTML;
196 }
static getSystemMessageHTML($a_txt, $a_type="info")
Get HTML for a system message.

References $DIC, $tpl, and ilUtil\getSystemMessageHTML().

Referenced by showFormCmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isCharSelectorPropertyRequired()

ilObjTestSettingsGeneralGUI::isCharSelectorPropertyRequired ( )
private

Definition at line 440 of file class.ilObjTestSettingsGeneralGUI.php.

441 {
442 global $DIC;
443 $ilSetting = $DIC['ilSetting'];
444
445 return $ilSetting->get('char_selector_availability') > 0;
446 }
global $ilSetting
Definition: privfeed.php:17

References $DIC, and $ilSetting.

Referenced by addQuestionBehaviourProperties(), and saveQuestionBehaviourProperties().

+ Here is the caller graph for this function:

◆ isSkillServiceSettingToBeAdjusted()

ilObjTestSettingsGeneralGUI::isSkillServiceSettingToBeAdjusted ( ilPropertyFormGUI  $form)
private

Definition at line 423 of file class.ilObjTestSettingsGeneralGUI.php.

424 {
425 if (!($form->getItemByPostVar('skill_service') instanceof ilFormPropertyGUI)) {
426 return false;
427 }
428
430 return false;
431 }
432
433 if (!$form->getInput('skill_service')) {
434 return false;
435 }
436
437 return true;
438 }
This class represents a property in a property form.
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
getItemByPostVar($a_post_var)
Get Item by POST variable.

References ilPropertyFormGUI\getInput(), ilPropertyFormGUI\getItemByPostVar(), and ilObjTest\isSkillManagementGloballyActivated().

+ Here is the call graph for this function:

◆ performSaveForm()

ilObjTestSettingsGeneralGUI::performSaveForm ( ilPropertyFormGUI  $form)
private

Definition at line 510 of file class.ilObjTestSettingsGeneralGUI.php.

511 {
512 $this->saveGeneralProperties($form);
513 $this->savePresentationProperties($form);
514 $this->saveAvailabilityProperties($form);
515 $this->saveTestIntroProperties($form);
516 $this->saveTestAccessProperties($form);
517 $this->saveTestRunProperties($form);
519 $this->saveTestSequenceSettings($form);
520 $this->saveTestFinishProperties($form);
521
522 if (!$this->testOBJ->participantDataExist()) {
523 // skill service
524 if (ilObjTest::isSkillManagementGloballyActivated() && $form->getItemByPostVar('skill_service') instanceof ilFormPropertyGUI) {
525 $this->testOBJ->setSkillServiceEnabled((bool) $form->getInput('skill_service'));
526 }
527 }
528
529 require_once 'Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
530 ilObjectServiceSettingsGUI::updateServiceSettingsForm($this->testOBJ->getId(), $form, array(
532 ));
533
534 // store settings to db
535 $this->testOBJ->saveToDb(true);
536
537 // Update ecs export settings
538 include_once 'Modules/Test/classes/class.ilECSTestSettings.php';
539 $ecs = new ilECSTestSettings($this->testOBJ);
540 $ecs->handleSettingsUpdate();
541 }
saveQuestionBehaviourProperties(ilPropertyFormGUI $form)
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.

References ilPropertyFormGUI\getInput(), ilPropertyFormGUI\getItemByPostVar(), ilObjTest\isSkillManagementGloballyActivated(), ilObjectServiceSettingsGUI\ORGU_POSITION_ACCESS, saveAvailabilityProperties(), saveGeneralProperties(), savePresentationProperties(), saveQuestionBehaviourProperties(), saveTestAccessProperties(), saveTestFinishProperties(), saveTestIntroProperties(), saveTestRunProperties(), saveTestSequenceSettings(), and ilObjectServiceSettingsGUI\updateServiceSettingsForm().

Referenced by saveFormCmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveAvailabilityProperties()

ilObjTestSettingsGeneralGUI::saveAvailabilityProperties ( ilPropertyFormGUI  $form)
private
Parameters
ilPropertyFormGUI$form

Definition at line 726 of file class.ilObjTestSettingsGeneralGUI.php.

727 {
728 // activation
729 if ($form->getInput('activation_type')) {
730 $this->testOBJ->setActivationLimited(true);
731 $this->testOBJ->setActivationVisibility((bool) $form->getInput('activation_visibility'));
732
733 $period = $form->getItemByPostVar("access_period");
734 $this->testOBJ->setActivationStartingTime($period->getStart()->get(IL_CAL_UNIX));
735 $this->testOBJ->setActivationEndingTime($period->getEnd()->get(IL_CAL_UNIX));
736 } else {
737 $this->testOBJ->setActivationLimited(false);
738 }
739 }

References ilPropertyFormGUI\getInput(), ilPropertyFormGUI\getItemByPostVar(), and IL_CAL_UNIX.

Referenced by performSaveForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveFormCmd()

ilObjTestSettingsGeneralGUI::saveFormCmd (   $isConfirmedSave = false)
private

Definition at line 203 of file class.ilObjTestSettingsGeneralGUI.php.

203 : void
204 {
205 $form = $this->buildForm();
206
207 // form validation and initialisation
208
209 if ($isConfirmedSave) {
210 // since confirmation does only pickup POST and no FILES
211 // mocking the tile image file upload field is neccessary
212 // due to checkInput() behaviour (fixes mantis #24226)
213 $_FILES['tile_image'] = array(
214 'name' => '', 'type' => '', 'size' => '', 'tmp_name' => '', 'error' => ''
215 );
216
217 // TODO: get rid of question selection mode setting in settings form (move to creation screen)
218 }
219
220 $errors = !$form->checkInput(); // ALWAYS CALL BEFORE setValuesByPost()
221 // return to form when any form validation errors exist
222
223 if ($errors) {
224 $form->setValuesByPost();
225 ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
226 $this->showFormCmd($form);
227 return;
228 }
229
230 // return to form when online is to be set, but no questions are configured
231
232 $currentQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfig();
233 if ($form->getInput('online') && !$this->testOBJ->isComplete($currentQuestionSetConfig)) {
234 $form->getItemByPostVar('online')->setAlert(
235 $this->lng->txt("cannot_switch_to_online_no_questions_andor_no_mark_steps")
236 );
237
238 $form->setValuesByPost();
239 ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
240 $this->showFormCmd($form);
241 return;
242 }
243
244 // avoid settings conflict "ctm" and "do not show question titles"
245 if ($form->getInput('question_set_type') == ilObjTest::QUESTION_SET_TYPE_DYNAMIC && $form->getInput('title_output') == 2) {
246 $form->getItemByPostVar('question_set_type')->setAlert($this->lng->txt('tst_conflicting_setting'));
247 $form->getItemByPostVar('title_output')->setAlert($this->lng->txt('tst_conflicting_setting'));
248
249 $form->setValuesByPost();
250 ilUtil::sendFailure($this->lng->txt('tst_settings_conflict_message'));
251 $this->showFormCmd($form);
252 return;
253 }
254
255 // avoid settings conflict "obligate questions" and "freeze answer"
256 if ($form->getInput('obligations_enabled') && $form->getInput('answer_fixation_handling') != self::ANSWER_FIXATION_NONE) {
257 $form->getItemByPostVar('obligations_enabled')->setAlert($this->lng->txt('tst_conflicting_setting'));
258 $form->getItemByPostVar('answer_fixation_handling')->setAlert($this->lng->txt('tst_conflicting_setting'));
259
260 $form->setValuesByPost();
261 ilUtil::sendFailure($this->lng->txt('tst_settings_conflict_message'));
262 $this->showFormCmd($form);
263 return;
264 }
265
266 // avoid settings conflict "freeze answer on followup question" and "question postponing"
267 $conflictModes = array(self::ANSWER_FIXATION_ON_FOLLOWUP_QUESTION, self::ANSWER_FIXATION_ON_IFB_OR_FUQST);
268 if ($form->getInput('postpone') &&
269 in_array($form->getInput('answer_fixation_handling'), $conflictModes, true)) {
270 $form->getItemByPostVar('postpone')->setAlert($this->lng->txt('tst_conflicting_setting'));
271 $form->getItemByPostVar('answer_fixation_handling')->setAlert($this->lng->txt('tst_conflicting_setting'));
272
273 $form->setValuesByPost();
274 ilUtil::sendFailure($this->lng->txt('tst_settings_conflict_message'));
275 $this->showFormCmd($form);
276 return;
277 }
278
279 // avoid settings conflict "freeze answer on followup question" and "question shuffling"
280 $conflictModes = array(self::ANSWER_FIXATION_ON_FOLLOWUP_QUESTION, self::ANSWER_FIXATION_ON_IFB_OR_FUQST);
281 if ($form->getInput('chb_shuffle_questions') &&
282 in_array($form->getInput('answer_fixation_handling'), $conflictModes, true)) {
283 $form->getItemByPostVar('chb_shuffle_questions')->setAlert($this->lng->txt('tst_conflicting_setting'));
284 $form->getItemByPostVar('answer_fixation_handling')->setAlert($this->lng->txt('tst_conflicting_setting'));
285
286 $form->setValuesByPost();
287 ilUtil::sendFailure($this->lng->txt('tst_settings_conflict_message'));
288 $this->showFormCmd($form);
289 return;
290 }
291
292 $infoMsg = array();
293
294 // solve conflicts with question set type setting with confirmation screen if required
295 // determine wether question set type relating data is to be removed (questions/pools)
296
297 $questionSetTypeRelatingDataCleanupRequired = false;
298
299 $oldQuestionSetType = $this->testOBJ->getQuestionSetType();
300 if ($form->getItemByPostVar('question_set_type') instanceof ilFormPropertyGUI) {
301 $newQuestionSetType = $form->getInput('question_set_type');
302
303 if (!$this->testOBJ->participantDataExist() && $newQuestionSetType != $oldQuestionSetType) {
304 $oldQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfigByType(
305 $oldQuestionSetType
306 );
307
308 if ($oldQuestionSetConfig->doesQuestionSetRelatedDataExist()) {
309 if (!$isConfirmedSave) {
310 $form->setValuesByPost();
311 if ($oldQuestionSetType == ilObjTest::QUESTION_SET_TYPE_FIXED) {
312 $this->showConfirmation(
313 $form,
314 $oldQuestionSetType,
315 $newQuestionSetType,
316 $this->testOBJ->hasQuestionsWithoutQuestionpool()
317 );
318 return;
319 }
320
321 $this->showConfirmation(
322 $form,
323 $oldQuestionSetType,
324 $newQuestionSetType,
325 false
326 );
327 return;
328 }
329
330 $questionSetTypeRelatingDataCleanupRequired = true;
331 }
332
333 if ($form->getInput('online')) {
334 $form->getItemByPostVar('online')->setChecked(false);
335
336 if (!$this->testOBJ->getOfflineStatus()) {
337 $infoMsg[] = $this->lng->txt("tst_set_offline_due_to_switched_question_set_type_setting");
338 } else {
339 $infoMsg[] = $this->lng->txt("tst_cannot_online_due_to_switched_quest_set_type_setting");
340 }
341 }
342 }
343 } else {
344 $newQuestionSetType = $oldQuestionSetType;
345 }
346
347 // adjust settings due to chosen question set type
348
349 if ($newQuestionSetType != ilObjTest::QUESTION_SET_TYPE_FIXED) {
350 $form->getItemByPostVar('chb_use_previous_answers')->setChecked(false);
351 }
352
353 $ending_time = $form->getInput('ending_time');
354 $starting_time = $form->getInput('starting_time');
355 if (is_string($ending_time) && $ending_time !== ''
356 && is_string($starting_time) && $starting_time !== ''
357 && ($starting_time > $ending_time
358 || (new ilDateTime($ending_time, IL_CAL_DATETIME))->get(IL_CAL_UNIX) < (new ilDateTime($starting_time, IL_CAL_DATETIME))->get(IL_CAL_UNIX))
359 ) {
360 ilUtil::sendFailure($this->lng->txt("tst_ending_time_before_starting_time"), true);
361 $form->setValuesByPost();
362 $form->getItemByPostVar('starting_time')->setDate(new ilDateTime($this->testOBJ->getStartingTime(), IL_CAL_UNIX));
363 $this->showFormCmd($form);
364 return;
365 }
366
367 // perform saving the form data
368
369 $this->performSaveForm($form);
370
371 // clean up test mode relating configuration data (questions/questionpools)
372
373 if ($questionSetTypeRelatingDataCleanupRequired) {
374 $oldQuestionSetConfig->removeQuestionSetRelatedData();
375 }
376
377 // disinvite all invited users if required
378
379 if (!$this->testOBJ->participantDataExist() && !$this->testOBJ->getFixedParticipants()) {
380 foreach ($this->testOBJ->getInvitedUsers() as $usrId => $usrData) {
381 $this->testOBJ->disinviteUser($usrId);
382 }
383 }
384
385 // redirect to form output
386
387 if (count($infoMsg)) {
388 ilUtil::sendInfo(implode('<br />', $infoMsg), true);
389 }
390
391 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
392 $this->ctrl->redirect($this, self::CMD_SHOW_FORM);
393 }
const IL_CAL_DATETIME
showConfirmation(ilPropertyFormGUI $form, $oldQuestionSetType, $newQuestionSetType, $hasQuestionsWithoutQuestionpool)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$errors
Definition: imgupload.php:49

References $errors, buildForm(), IL_CAL_DATETIME, IL_CAL_UNIX, performSaveForm(), ilObjTest\QUESTION_SET_TYPE_DYNAMIC, ilObjTest\QUESTION_SET_TYPE_FIXED, ilUtil\sendFailure(), ilUtil\sendInfo(), showConfirmation(), and showFormCmd().

Referenced by confirmedSaveFormCmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveGeneralProperties()

ilObjTestSettingsGeneralGUI::saveGeneralProperties ( ilPropertyFormGUI  $form)
private
Parameters
ilPropertyFormGUI$form

Definition at line 630 of file class.ilObjTestSettingsGeneralGUI.php.

631 {
632 include_once 'Services/MetaData/classes/class.ilMD.php';
633 $md_obj = new ilMD($this->testOBJ->getId(), 0, "tst");
634 $md_section = $md_obj->getGeneral();
635
636 // title
637 $md_section->setTitle($form->getInput('title'));
638 $md_section->update();
639
640 // Description
641 $md_desc_ids = $md_section->getDescriptionIds();
642 if ($md_desc_ids) {
643 $md_desc = $md_section->getDescription(array_pop($md_desc_ids));
644 $md_desc->setDescription($form->getInput('description'));
645 $md_desc->update();
646 } else {
647 $md_desc = $md_section->addDescription();
648 $md_desc->setDescription($form->getInput('description'));
649 $md_desc->save();
650 }
651
652 $this->testOBJ->setTitle($form->getInput('title'));
653 $this->testOBJ->setDescription($form->getInput('description'));
654 $this->testOBJ->setOfflineStatus(!$form->getInput('online'));
655 $this->testOBJ->update();
656
657 // pool usage setting
658 if ($form->getItemByPostVar('use_pool') instanceof ilFormPropertyGUI) {
659 $this->testOBJ->setPoolUsage((bool) $form->getInput('use_pool'));
660 }
661
662 if (!$this->testOBJ->participantDataExist()) {
663 // question set type
664 if ($form->getItemByPostVar('question_set_type') instanceof ilFormPropertyGUI) {
665 $this->testOBJ->setQuestionSetType($form->getInput('question_set_type'));
666 }
667 }
668
669 // anonymity setting
670 if (!$this->testOBJ->participantDataExist() && $this->formPropertyExists($form, 'anonymity')) {
671 $this->testOBJ->setAnonymity((int) $form->getInput('anonymity'));
672 }
673 }

References ilPropertyFormGUI\getInput(), and ilPropertyFormGUI\getItemByPostVar().

Referenced by performSaveForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ savePresentationProperties()

ilObjTestSettingsGeneralGUI::savePresentationProperties ( ilPropertyFormGUI  $form)
protected
Parameters
ilPropertyFormGUI$form

Definition at line 758 of file class.ilObjTestSettingsGeneralGUI.php.

759 {
760 global $DIC; /* @var ILIAS\DI\Container $DIC */
761
762 $DIC->object()->commonSettings()->legacyForm($form, $this->testOBJ)->saveTileImage();
763 }

References $DIC.

Referenced by performSaveForm().

+ Here is the caller graph for this function:

◆ saveQuestionBehaviourProperties()

ilObjTestSettingsGeneralGUI::saveQuestionBehaviourProperties ( ilPropertyFormGUI  $form)
private
Parameters
ilPropertyFormGUI$form

Definition at line 1305 of file class.ilObjTestSettingsGeneralGUI.php.

1306 {
1307 if ($form->getItemByPostVar('title_output') instanceof ilFormPropertyGUI) {
1308 $this->testOBJ->setTitleOutput($form->getInput('title_output'));
1309 }
1310
1311 if ($form->getItemByPostVar('autosave') instanceof ilFormPropertyGUI) {
1312 $this->testOBJ->setAutosave((bool) $form->getInput('autosave'));
1313 $this->testOBJ->setAutosaveIval($form->getInput('autosave_ival') * 1000);
1314 }
1315
1316 if ($form->getItemByPostVar('chb_shuffle_questions') instanceof ilFormPropertyGUI) {
1317 $this->testOBJ->setShuffleQuestions((bool) $form->getInput('chb_shuffle_questions'));
1318 }
1319
1320 if (!$this->testOBJ->participantDataExist() && $this->formPropertyExists($form, 'offer_hints')) {
1321 $this->testOBJ->setOfferingQuestionHintsEnabled((bool) $form->getInput('offer_hints'));
1322 }
1323
1324 if (!$this->testOBJ->participantDataExist() && $this->formPropertyExists($form, 'instant_feedback_enabled')) {
1325 if ($form->getInput('instant_feedback_enabled')) {
1326 if ($this->formPropertyExists($form, 'instant_feedback_contents')) {
1327 $this->testOBJ->setInstantFeedbackOptionsByArray(
1328 $form->getInput('instant_feedback_contents')
1329 );
1330 }
1331 if ($this->formPropertyExists($form, 'instant_feedback_trigger')) {
1332 $this->testOBJ->setForceInstantFeedbackEnabled(
1333 (bool) $form->getInput('instant_feedback_trigger')
1334 );
1335 }
1336 } else {
1337 $this->testOBJ->setInstantFeedbackOptionsByArray(array());
1338 $this->testOBJ->setForceInstantFeedbackEnabled(false);
1339 }
1340 }
1341
1342 if (!$this->testOBJ->participantDataExist() && $this->formPropertyExists($form, 'answer_fixation_handling')) {
1343 $this->setAnswerFixationSettingsByFormValue($form->getInput('answer_fixation_handling'));
1344 }
1345
1346 if (!$this->testOBJ->participantDataExist() && $this->formPropertyExists($form, 'obligations_enabled')) {
1347 $this->testOBJ->setObligationsEnabled($form->getInput('obligations_enabled'));
1348 }
1349
1350 if ($this->isCharSelectorPropertyRequired()) {
1351 require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
1353 $char_selector->addFormProperties($form);
1354 $char_selector->getFormValues($form);
1355 $this->testOBJ->setCharSelectorAvailability($char_selector->getConfig()->getAvailability());
1356 $this->testOBJ->setCharSelectorDefinition($char_selector->getConfig()->getDefinition());
1357 }
1358 }
formPropertyExists(ilPropertyFormGUI $form, $propertyId)

References ilCharSelectorConfig\CONTEXT_TEST, ilTestSettingsGUI\formPropertyExists(), ilPropertyFormGUI\getInput(), ilPropertyFormGUI\getItemByPostVar(), isCharSelectorPropertyRequired(), and setAnswerFixationSettingsByFormValue().

Referenced by performSaveForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveTestAccessProperties()

ilObjTestSettingsGeneralGUI::saveTestAccessProperties ( ilPropertyFormGUI  $form)
private
Parameters
ilPropertyFormGUI$form

Definition at line 906 of file class.ilObjTestSettingsGeneralGUI.php.

907 {
908 if (!$this->testOBJ->participantDataExist()) {
909 $starting_time = $form->getInput('starting_time');
910 if (is_string($starting_time) && $starting_time !== '') {
911 $this->testOBJ->setStartingTime((new ilDateTime($starting_time, IL_CAL_DATETIME))->get(IL_CAL_UNIX));
912 $this->testOBJ->setStartingTimeEnabled(true);
913 } else {
914 $this->testOBJ->setStartingTime(null);
915 $this->testOBJ->setStartingTimeEnabled(false);
916 }
917 }
918
919 $ending_time = $form->getInput('ending_time');
920 if (is_string($ending_time) && $ending_time !== '') {
921 $this->testOBJ->setEndingTime((new ilDateTime($ending_time, IL_CAL_DATETIME))->get(IL_CAL_UNIX));
922 $this->testOBJ->setEndingTimeEnabled(true);
923 } else {
924 $this->testOBJ->setEndingTime(null);
925 $this->testOBJ->setEndingTimeEnabled(false);
926 }
927
928 if ($this->formPropertyExists($form, 'password_enabled')) {
929 $this->testOBJ->setPasswordEnabled((bool) $form->getInput('password_enabled'));
930
931 if ($form->getInput('password_enabled')) {
932 $this->testOBJ->setPassword($form->getInput('password'));
933 } else {
934 $this->testOBJ->setPassword(''); // otherwise test will still respect value
935 }
936 }
937
938 if ($this->formPropertyExists($form, 'fixedparticipants') && !$this->testOBJ->participantDataExist()) {
939 $this->testOBJ->setFixedParticipants((bool) $form->getInput('fixedparticipants'));
940 }
941
942 if ($this->formPropertyExists($form, 'limitUsers')) {
943 $this->testOBJ->setLimitUsersEnabled((bool) $form->getInput('limitUsers'));
944
945 if ($form->getInput('limitUsers')) {
946 $this->testOBJ->setAllowedUsers($form->getInput('allowedUsers'));
947 $this->testOBJ->setAllowedUsersTimeGap($form->getInput('allowedUsersTimeGap'));
948 } else {
949 $this->testOBJ->setAllowedUsers(''); // otherwise test will still respect value
950 }
951 }
952 }

References ilTestSettingsGUI\formPropertyExists(), ilPropertyFormGUI\getInput(), IL_CAL_DATETIME, and IL_CAL_UNIX.

Referenced by performSaveForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveTestFinishProperties()

ilObjTestSettingsGeneralGUI::saveTestFinishProperties ( ilPropertyFormGUI  $form)
private
Parameters
ilPropertyFormGUI$form

Definition at line 1556 of file class.ilObjTestSettingsGeneralGUI.php.

1557 {
1558 if ($this->formPropertyExists($form, 'enable_examview')) {
1559 $this->testOBJ->setEnableExamview((bool) $form->getInput('enable_examview'));
1560 $this->testOBJ->setShowExamviewPdf((bool) $form->getInput('show_examview_pdf'));
1561 }
1562
1563 $this->testOBJ->setShowFinalStatement((bool) $form->getInput('showfinalstatement'));
1564 $this->testOBJ->setFinalStatement($form->getInput('finalstatement'));
1565
1566 if ($form->getInput('redirection_enabled')) {
1567 $this->testOBJ->setRedirectionMode($form->getInput('redirection_mode'));
1568 } else {
1569 $this->testOBJ->setRedirectionMode(REDIRECT_NONE);
1570 }
1571 if ((string) $form->getInput('redirection_url') !== '') {
1572 $this->testOBJ->setRedirectionUrl($form->getInput('redirection_url'));
1573 } else {
1574 $this->testOBJ->setRedirectionUrl(null);
1575 }
1576
1577 if ($this->formPropertyExists($form, 'sign_submission')) {
1578 $this->testOBJ->setSignSubmission((bool) $form->getInput('sign_submission'));
1579 }
1580
1581 if ($this->formPropertyExists($form, 'mailnotification') && $form->getInput('mailnotification')) {
1582 $this->testOBJ->setMailNotification($form->getInput('mailnotification_content'));
1583 $this->testOBJ->setMailNotificationType((bool) $form->getInput('mailnottype'));
1584 } else {
1585 $this->testOBJ->setMailNotification(0);
1586 $this->testOBJ->setMailNotificationType(false);
1587 }
1588 }
const REDIRECT_NONE
Redirect after finishing test constants.

References ilTestSettingsGUI\formPropertyExists(), ilPropertyFormGUI\getInput(), and REDIRECT_NONE.

Referenced by performSaveForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveTestIntroProperties()

ilObjTestSettingsGeneralGUI::saveTestIntroProperties ( ilPropertyFormGUI  $form)
private
Parameters
ilPropertyFormGUI$form

Definition at line 802 of file class.ilObjTestSettingsGeneralGUI.php.

803 {
804 if ($form->getItemByPostVar('intro_enabled') instanceof ilFormPropertyGUI) {
805 $this->testOBJ->setIntroductionEnabled((bool) $form->getInput('intro_enabled'));
806
807 if ($form->getInput('intro_enabled')) {
808 $this->testOBJ->setIntroduction($form->getInput('introduction'));
809 } else {
810 $this->testOBJ->setIntroduction('');
811 }
812 }
813
814 if ($form->getItemByPostVar('showinfo') instanceof ilFormPropertyGUI) {
815 $this->testOBJ->setShowInfo((bool) $form->getInput('showinfo'));
816 }
817 }

References ilPropertyFormGUI\getInput(), and ilPropertyFormGUI\getItemByPostVar().

Referenced by performSaveForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveTestRunProperties()

ilObjTestSettingsGeneralGUI::saveTestRunProperties ( ilPropertyFormGUI  $form)
private
Parameters
ilPropertyFormGUI$form

Definition at line 1085 of file class.ilObjTestSettingsGeneralGUI.php.

1086 {
1087 if (!$this->testOBJ->participantDataExist()) {
1088 // nr of tries (max passes)
1089 if ($form->getItemByPostVar('limitPasses') instanceof ilFormPropertyGUI) {
1090 if ($form->getInput('limitPasses')) {
1091 $this->testOBJ->setNrOfTries($form->getInput('nr_of_tries'));
1092
1093 $this->testOBJ->setBlockPassesAfterPassedEnabled(
1094 (bool) $form->getInput('block_after_passed')
1095 );
1096 } else {
1097 $this->testOBJ->setNrOfTries(0);
1098 $this->testOBJ->setBlockPassesAfterPassedEnabled(false);
1099 }
1100 }
1101
1102 // pass_waiting
1103 if ($form->getItemByPostVar('pass_waiting_enabled') instanceof ilFormPropertyGUI) {
1104 if ($form->getInput('pass_waiting_enabled')) {
1105 $pass_waiting_values = $form->getInput('pass_waiting');
1106 $pass_waiting_duration[] = sprintf("%'.02d", $pass_waiting_values['MM'] ?? 0);
1107 $pass_waiting_duration[] = sprintf("%'.03d", $pass_waiting_values['dd'] ?? 0);
1108 $pass_waiting_duration[] = sprintf("%'.02d", $pass_waiting_values['hh'] ?? 0);
1109 $pass_waiting_duration[] = sprintf("%'.02d", $pass_waiting_values['mm'] ?? 0);
1110 $pass_waiting_duration[] = sprintf("%'.02d", $pass_waiting_values['ss'] ?? 0);
1111
1112 $pass_waiting_string = implode(':', $pass_waiting_duration);
1113 $this->testOBJ->setPassWaiting($pass_waiting_string);
1114 } else {
1115 $this->testOBJ->setPassWaiting("00:000:00:00:00");
1116 }
1117 }
1118
1119 $this->testOBJ->setEnableProcessingTime($form->getInput('chb_processing_time'));
1120 if ($this->testOBJ->getEnableProcessingTime()) {
1121 $this->testOBJ->setProcessingTimeByMinutes($form->getInput('processing_time'));
1122 $this->testOBJ->setResetProcessingTime($form->getInput('chb_reset_processing_time'));
1123 } else {
1124 $this->testOBJ->setProcessingTime('');
1125 $this->testOBJ->setResetProcessingTime(false);
1126 }
1127 }
1128
1129 if ($form->getItemByPostVar('kiosk') instanceof ilFormPropertyGUI) {
1130 $this->testOBJ->setKioskMode($form->getInput('kiosk'));
1131 $kioskOptions = $form->getInput('kiosk_options');
1132 if (is_array($kioskOptions)) {
1133 $this->testOBJ->setShowKioskModeTitle(in_array('kiosk_title', $kioskOptions, true));
1134 $this->testOBJ->setShowKioskModeParticipant(in_array('kiosk_participant', $kioskOptions, true));
1135 } else {
1136 $this->testOBJ->setShowKioskModeTitle(false);
1137 $this->testOBJ->setShowKioskModeParticipant(false);
1138 }
1139 }
1140
1141 if ($form->getItemByPostVar('examid_in_test_pass') instanceof ilFormPropertyGUI) {
1142 $this->testOBJ->setShowExamIdInTestPassEnabled((bool) $form->getInput('examid_in_test_pass'));
1143 }
1144 }

References ilPropertyFormGUI\getInput(), and ilPropertyFormGUI\getItemByPostVar().

Referenced by performSaveForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveTestSequenceSettings()

ilObjTestSettingsGeneralGUI::saveTestSequenceSettings ( ilPropertyFormGUI  $form)
private
Parameters
ilPropertyFormGUI$form

Definition at line 1436 of file class.ilObjTestSettingsGeneralGUI.php.

1437 {
1438 if ($this->formPropertyExists($form, 'chb_use_previous_answers')) {
1439 $this->testOBJ->setUsePreviousAnswers($form->getInput('chb_use_previous_answers'));
1440 }
1441
1442 if ($this->formPropertyExists($form, 'chb_show_cancel')) {
1443 $this->testOBJ->setShowCancel((bool) $form->getInput('chb_show_cancel'));
1444 }
1445
1446 if ($this->formPropertyExists($form, 'postpone')) {
1447 $this->testOBJ->setPostponingEnabled((bool) $form->getInput('postpone'));
1448 }
1449
1450 $this->testOBJ->setListOfQuestions((bool) $form->getInput('list_of_questions'));
1451 $listOfQuestionsOptions = $form->getInput('list_of_questions_options');
1452 if (is_array($listOfQuestionsOptions)) {
1453 $this->testOBJ->setListOfQuestionsStart(in_array('chb_list_of_questions_start', $listOfQuestionsOptions));
1454 $this->testOBJ->setListOfQuestionsEnd(in_array('chb_list_of_questions_end', $listOfQuestionsOptions));
1455 $this->testOBJ->setListOfQuestionsDescription(in_array('chb_list_of_questions_with_description', $listOfQuestionsOptions));
1456 } else {
1457 $this->testOBJ->setListOfQuestionsStart(0);
1458 $this->testOBJ->setListOfQuestionsEnd(0);
1459 $this->testOBJ->setListOfQuestionsDescription(0);
1460 }
1461
1462 if ($this->formPropertyExists($form, 'chb_show_marker')) {
1463 $this->testOBJ->setShowMarker((bool) $form->getInput('chb_show_marker'));
1464 }
1465 }

References ilTestSettingsGUI\formPropertyExists(), and ilPropertyFormGUI\getInput().

Referenced by performSaveForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAnswerFixationSettingsByFormValue()

ilObjTestSettingsGeneralGUI::setAnswerFixationSettingsByFormValue (   $formValue)
protected

Definition at line 1590 of file class.ilObjTestSettingsGeneralGUI.php.

1591 {
1592 switch ($formValue) {
1594 $this->testOBJ->setInstantFeedbackAnswerFixationEnabled(false);
1595 $this->testOBJ->setFollowupQuestionAnswerFixationEnabled(false);
1596 break;
1598 $this->testOBJ->setInstantFeedbackAnswerFixationEnabled(true);
1599 $this->testOBJ->setFollowupQuestionAnswerFixationEnabled(false);
1600 break;
1602 $this->testOBJ->setInstantFeedbackAnswerFixationEnabled(false);
1603 $this->testOBJ->setFollowupQuestionAnswerFixationEnabled(true);
1604 break;
1606 $this->testOBJ->setInstantFeedbackAnswerFixationEnabled(true);
1607 $this->testOBJ->setFollowupQuestionAnswerFixationEnabled(true);
1608 break;
1609 }
1610 }

References ANSWER_FIXATION_NONE, ANSWER_FIXATION_ON_FOLLOWUP_QUESTION, ANSWER_FIXATION_ON_IFB_OR_FUQST, and ANSWER_FIXATION_ON_INSTANT_FEEDBACK.

Referenced by saveQuestionBehaviourProperties().

+ Here is the caller graph for this function:

◆ showConfirmation()

ilObjTestSettingsGeneralGUI::showConfirmation ( ilPropertyFormGUI  $form,
  $oldQuestionSetType,
  $newQuestionSetType,
  $hasQuestionsWithoutQuestionpool 
)
private

Definition at line 151 of file class.ilObjTestSettingsGeneralGUI.php.

152 {
153 require_once 'Modules/Test/classes/confirmations/class.ilTestSettingsChangeConfirmationGUI.php';
154 $confirmation = new ilTestSettingsChangeConfirmationGUI($this->lng, $this->testOBJ);
155
156 $confirmation->setFormAction($this->ctrl->getFormAction($this));
157 $confirmation->setCancel($this->lng->txt('cancel'), self::CMD_SHOW_FORM);
158 $confirmation->setConfirm($this->lng->txt('confirm'), self::CMD_CONFIRMED_SAVE_FORM);
159
160 $confirmation->setOldQuestionSetType($oldQuestionSetType);
161 $confirmation->setNewQuestionSetType($newQuestionSetType);
162 $confirmation->setQuestionLossInfoEnabled($hasQuestionsWithoutQuestionpool);
163 $confirmation->build();
164
165 $confirmation->populateParametersFromPropertyForm($form, $this->activeUser->getTimeZone());
166
167 $this->tpl->setContent($this->ctrl->getHTML($confirmation));
168 }

Referenced by saveFormCmd().

+ Here is the caller graph for this function:

◆ showFormCmd()

ilObjTestSettingsGeneralGUI::showFormCmd ( ilPropertyFormGUI  $form = null)
private

Definition at line 137 of file class.ilObjTestSettingsGeneralGUI.php.

138 {
139 $this->tpl->addJavascript("./Services/JavaScript/js/Basic.js");
140
141 if ($form === null) {
142 $form = $this->buildForm();
143 }
144
145 $formHTML = $this->ctrl->getHTML($form);
146 $msgHTML = $this->getSettingsTemplateMessageHTML();
147
148 $this->tpl->setContent($formHTML . $msgHTML);
149 }

References buildForm(), and getSettingsTemplateMessageHTML().

Referenced by saveFormCmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showResetTemplateConfirmationCmd()

ilObjTestSettingsGeneralGUI::showResetTemplateConfirmationCmd ( )
private

Enable all settings - Confirmation.

Definition at line 398 of file class.ilObjTestSettingsGeneralGUI.php.

399 {
400 require_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
401 $confirmationGUI = new ilConfirmationGUI();
402
403 $confirmationGUI->setFormAction($this->ctrl->getFormAction($this));
404 $confirmationGUI->setHeaderText($this->lng->txt("test_confirm_template_reset"));
405 $confirmationGUI->setCancel($this->lng->txt('cancel'), self::CMD_SHOW_FORM);
406 $confirmationGUI->setConfirm($this->lng->txt('confirm'), self::CMD_CONFIRMED_RESET_TPL);
407
408 $this->tpl->setContent($this->ctrl->getHTML($confirmationGUI));
409 }
Confirmation screen class.

Field Documentation

◆ $access

ilAccessHandler ilObjTestSettingsGeneralGUI::$access = null
protected

Definition at line 43 of file class.ilObjTestSettingsGeneralGUI.php.

Referenced by __construct().

◆ $activeUser

ilObjUser ilObjTestSettingsGeneralGUI::$activeUser = null
protected

Definition at line 61 of file class.ilObjTestSettingsGeneralGUI.php.

Referenced by __construct().

◆ $ctrl

ilCtrl ilObjTestSettingsGeneralGUI::$ctrl = null
protected

Definition at line 40 of file class.ilObjTestSettingsGeneralGUI.php.

Referenced by __construct().

◆ $db

ilDBInterface ilObjTestSettingsGeneralGUI::$db = null
protected

Definition at line 55 of file class.ilObjTestSettingsGeneralGUI.php.

Referenced by __construct().

◆ $lng

ilLanguage ilObjTestSettingsGeneralGUI::$lng = null
protected

Definition at line 46 of file class.ilObjTestSettingsGeneralGUI.php.

Referenced by __construct().

◆ $pluginAdmin

ilPluginAdmin ilObjTestSettingsGeneralGUI::$pluginAdmin = null
protected

Definition at line 58 of file class.ilObjTestSettingsGeneralGUI.php.

Referenced by __construct().

◆ $testGUI

ilObjTestGUI ilObjTestSettingsGeneralGUI::$testGUI = null
protected

Definition at line 64 of file class.ilObjTestSettingsGeneralGUI.php.

Referenced by __construct().

◆ $testQuestionSetConfigFactory

ilObjTestSettingsGeneralGUI::$testQuestionSetConfigFactory = null
private

Definition at line 67 of file class.ilObjTestSettingsGeneralGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilObjTestSettingsGeneralGUI::$tpl = null
protected

◆ $tree

ilTree ilObjTestSettingsGeneralGUI::$tree = null
protected

Definition at line 52 of file class.ilObjTestSettingsGeneralGUI.php.

Referenced by __construct().

◆ ANSWER_FIXATION_NONE

◆ ANSWER_FIXATION_ON_FOLLOWUP_QUESTION

const ilObjTestSettingsGeneralGUI::ANSWER_FIXATION_ON_FOLLOWUP_QUESTION = 'followup_question'

◆ ANSWER_FIXATION_ON_IFB_OR_FUQST

const ilObjTestSettingsGeneralGUI::ANSWER_FIXATION_ON_IFB_OR_FUQST = 'ifb_or_fuqst'

◆ ANSWER_FIXATION_ON_INSTANT_FEEDBACK

const ilObjTestSettingsGeneralGUI::ANSWER_FIXATION_ON_INSTANT_FEEDBACK = 'instant_feedback'

◆ CMD_CONFIRMED_RESET_TPL

const ilObjTestSettingsGeneralGUI::CMD_CONFIRMED_RESET_TPL = 'confirmedResetTemplate'

Definition at line 29 of file class.ilObjTestSettingsGeneralGUI.php.

◆ CMD_CONFIRMED_SAVE_FORM

const ilObjTestSettingsGeneralGUI::CMD_CONFIRMED_SAVE_FORM = 'confirmedSaveForm'

Definition at line 27 of file class.ilObjTestSettingsGeneralGUI.php.

◆ CMD_SAVE_FORM

const ilObjTestSettingsGeneralGUI::CMD_SAVE_FORM = 'saveForm'

Definition at line 26 of file class.ilObjTestSettingsGeneralGUI.php.

◆ CMD_SHOW_FORM

const ilObjTestSettingsGeneralGUI::CMD_SHOW_FORM = 'showForm'

◆ CMD_SHOW_RESET_TPL_CONFIRM

const ilObjTestSettingsGeneralGUI::CMD_SHOW_RESET_TPL_CONFIRM = 'showResetTemplateConfirmation'

Definition at line 28 of file class.ilObjTestSettingsGeneralGUI.php.

◆ INSTANT_FEEDBACK_TRIGGER_FORCED

const ilObjTestSettingsGeneralGUI::INSTANT_FEEDBACK_TRIGGER_FORCED = 1

◆ INSTANT_FEEDBACK_TRIGGER_MANUAL

const ilObjTestSettingsGeneralGUI::INSTANT_FEEDBACK_TRIGGER_MANUAL = 0

The documentation for this class was generated from the following file: