ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilObjTestSettingsGeneralGUI Class Reference
+ Inheritance diagram for ilObjTestSettingsGeneralGUI:
+ Collaboration diagram for ilObjTestSettingsGeneralGUI:

Public Member Functions

 __construct (ilCtrl $ctrl, ilAccessHandler $access, ilLanguage $lng, ilTemplate $tpl, 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 INST_FB_HANDLING_OPT_NONE = 'none'
 
const INST_FB_HANDLING_OPT_FREEZE = 'freeze'
 
const INST_FB_HANDLING_OPT_FORCE = 'force'
 
const INST_FB_HANDLING_OPT_FORCE_AND_FREEZE = 'force_freeze'
 

Protected Member Functions

 getSettingsTemplateMessageHTML ()
 
- 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)
 
 saveInstFbHandlingSettings ($instantFeedbackHandlingValue)
 
 getInstFbHandlingValue ($freezeAnswersEnabled, $forceInstFbEnabled)
 

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,
ilTemplate  $tpl,
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

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

References $access, $activeUser, $ctrl, $db, $lng, $pluginAdmin, $testGUI, $tpl, and $tree.

88  {
89  $this->ctrl = $ctrl;
90  $this->access = $access;
91  $this->lng = $lng;
92  $this->tpl = $tpl;
93  $this->tree = $tree;
94  $this->db = $db;
95  $this->pluginAdmin = $pluginAdmin;
96  $this->activeUser = $activeUser;
97 
98  $this->testGUI = $testGUI;
99 
100  require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
101  $this->testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($this->tree, $this->db, $this->pluginAdmin, $testGUI->object);
102 
103  parent::__construct($testGUI->object);
104  }

Member Function Documentation

◆ addAvailabilityProperties()

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

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

References $section, ilObject\_getAllReferences(), ilPropertyFormGUI\addItem(), IL_CAL_UNIX, ilCheckboxInputGUI\setChecked(), ilFormPropertyGUI\setInfo(), ilDateDurationInputGUI\setShowTime(), and time.

Referenced by buildForm().

602  {
603  include_once "Services/Object/classes/class.ilObjectActivation.php";
604  $this->lng->loadLanguageModule('rep');
605 
607  $section->setTitle($this->lng->txt('rep_activation_availability'));
608  $form->addItem($section);
609 
610  // additional info only with multiple references
611  $act_obj_info = $act_ref_info = "";
612  if (sizeof(ilObject::_getAllReferences($this->testOBJ->getId())) > 1) {
613  $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
614  $act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
615  }
616 
617  $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
618  $online->setChecked($this->testOBJ->isOnline());
619  $online->setInfo($this->lng->txt('tst_activation_online_info') . $act_obj_info);
620  $form->addItem($online);
621 
622  $act_type = new ilCheckboxInputGUI($this->lng->txt('rep_visibility_until'), 'activation_type');
623  $act_type->setChecked($this->testOBJ->isActivationLimited());
624  // $act_type->setInfo($this->lng->txt('tst_availability_until_info'));
625 
626  $this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
627  include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
628  $dur = new ilDateDurationInputGUI($this->lng->txt("rep_time_period"), "access_period");
629  $dur->setShowTime(true);
630  $date = $this->testOBJ->getActivationStartingTime();
631  $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
632  $dur->setStartText($this->lng->txt('rep_activation_limited_start'));
633  $date = $this->testOBJ->getActivationEndingTime();
634  $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
635  $dur->setEndText($this->lng->txt('rep_activation_limited_end'));
636  $act_type->addSubItem($dur);
637 
638  $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'activation_visibility');
639  $visible->setInfo($this->lng->txt('tst_activation_limited_visibility_info'));
640  $visible->setChecked($this->testOBJ->getActivationVisibility());
641  $act_type->addSubItem($visible);
642 
643  $form->addItem($act_type);
644  }
This class represents a section header in a property form.
This class represents a checkbox property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
const IL_CAL_UNIX
static _getAllReferences($a_id)
get all reference ids of object
setInfo($a_info)
Set Information Text.
$section
Definition: Utf8Test.php:83
setChecked($a_checked)
Set Checked.
input GUI for a time span (start and end date)
Date and time handling
setShowTime($a_showtime)
Set Show Time Information.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
+ 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 470 of file class.ilObjTestSettingsGeneralGUI.php.

References $header, $title, ilPropertyFormGUI\addItem(), ilMD\getGeneral(), ilObjTest\QUESTION_SET_TYPE_DYNAMIC, ilObjTest\QUESTION_SET_TYPE_FIXED, ilObjTest\QUESTION_SET_TYPE_RANDOM, ilTextAreaInputGUI\setCols(), ilFormPropertyGUI\setDisabled(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), and ilRadioOption\setValue().

Referenced by buildForm().

471  {
473  $header->setTitle($this->lng->txt("tst_general_properties"));
474  $form->addItem($header);
475 
476  // title & description (meta data)
477 
478  include_once 'Services/MetaData/classes/class.ilMD.php';
479  $md_obj = new ilMD($this->testOBJ->getId(), 0, "tst");
480  $md_section = $md_obj->getGeneral();
481 
482  $title = new ilTextInputGUI($this->lng->txt("title"), "title");
483  $title->setRequired(true);
484  $title->setValue($md_section->getTitle());
485  $form->addItem($title);
486 
487  $ids = $md_section->getDescriptionIds();
488  if ($ids) {
489  $desc_obj = $md_section->getDescription(array_pop($ids));
490 
491  $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description");
492  $desc->setCols(50);
493  $desc->setRows(4);
494  $desc->setValue($desc_obj->getDescription());
495  $form->addItem($desc);
496  }
497 
498  // pool usage
499  $pool_usage = new ilRadioGroupInputGUI($this->lng->txt('test_question_pool_usage'), 'use_pool');
500 
501  $optional_qpl = new ilRadioOption($this->lng->txt('test_question_pool_usage_optional'), 1);
502  $optional_qpl->setInfo($this->lng->txt('test_question_pool_usage_optional_info'));
503  $pool_usage->addOption($optional_qpl);
504 
505  $tst_directly = new ilRadioOption($this->lng->txt('test_question_pool_usage_tst_directly'), 0);
506  $tst_directly->setInfo($this->lng->txt('test_question_pool_usage_tst_directly_info'));
507  $pool_usage->addOption($tst_directly);
508 
509  $pool_usage->setValue($this->testOBJ->getPoolUsage() ? 1 : 0);
510  $form->addItem($pool_usage);
511 
512  // test mode (question set type)
513  $questSetType = new ilRadioGroupInputGUI($this->lng->txt("tst_question_set_type"), 'question_set_type');
514  $questSetTypeFixed = new ilRadioOption(
515  $this->lng->txt("tst_question_set_type_fixed"),
517  $this->lng->txt("tst_question_set_type_fixed_desc")
518  );
519  $questSetType->addOption($questSetTypeFixed);
520  $questSetTypeRandom = new ilRadioOption(
521  $this->lng->txt("tst_question_set_type_random"),
523  $this->lng->txt("tst_question_set_type_random_desc")
524  );
525  $questSetType->addOption($questSetTypeRandom);
526  $questSetTypeContinues = new ilRadioOption(
527  $this->lng->txt("tst_question_set_type_dynamic"),
529  $this->lng->txt("tst_question_set_type_dynamic_desc")
530  );
531  $questSetType->addOption($questSetTypeContinues);
532  $questSetType->setValue($this->testOBJ->getQuestionSetType());
533  if ($this->testOBJ->participantDataExist()) {
534  $questSetType->setDisabled(true);
535  }
536  $form->addItem($questSetType);
537 
538  // anonymity
539  $anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity');
540  if ($this->testOBJ->participantDataExist()) {
541  $anonymity->setDisabled(true);
542  }
543  $rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0);
544  $anonymity->addOption($rb);
545  $rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1);
546  $anonymity->addOption($rb);
547  $anonymity->setValue((int) $this->testOBJ->getAnonymity());
548  $form->addItem($anonymity);
549  }
This class represents an option in a radio group.
const QUESTION_SET_TYPE_RANDOM
type setting value for random question set
This class represents a section header in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
setInfo($a_info)
Set Info.
setInfo($a_info)
Set Information Text.
This class represents a property in a property form.
setValue($a_value)
Set Value.
This class represents a text property in a property form.
& getGeneral()
Definition: class.ilMD.php:40
This class represents a text area property in a property form.
const QUESTION_SET_TYPE_FIXED
type setting value for fixed question set
const QUESTION_SET_TYPE_DYNAMIC
type setting value for dynamic question set (continues testing mode)
setDisabled($a_disabled)
Set Disabled.
+ 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 1042 of file class.ilObjTestSettingsGeneralGUI.php.

References ilPropertyFormGUI\addItem(), ilRadioGroupInputGUI\addOption(), ilCheckboxGroupInputGUI\addOption(), array, ilCharSelectorConfig\CONTEXT_TEST, getInstFbHandlingValue(), isCharSelectorPropertyRequired(), ilTestSettingsGUI\isSectionHeaderRequired(), ilCheckboxInputGUI\setChecked(), ilFormPropertyGUI\setDisabled(), ilRadioOption\setInfo(), ilTextInputGUI\setSize(), and ilCheckboxInputGUI\setValue().

Referenced by buildForm().

1043  {
1044  $fields = array(
1045  'title_output', 'autosave', 'chb_shuffle_questions', 'chb_shuffle_questions',
1046  'offer_hints', 'instant_feedback', 'obligations_enabled',
1047  );
1048 
1049  if ($this->isSectionHeaderRequired($fields) || $this->isCharSelectorPropertyRequired()) {
1050  // sequence properties
1051  $seqheader = new ilFormSectionHeaderGUI();
1052  $seqheader->setTitle($this->lng->txt("tst_presentation_properties"));
1053  $form->addItem($seqheader);
1054  }
1055 
1056  // question title output
1057  $title_output = new ilRadioGroupInputGUI($this->lng->txt("tst_title_output"), "title_output");
1058  $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_full"), 0, ''));
1059  $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_hide_points"), 1, ''));
1060  $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_no_title"), 2, ''));
1061  $title_output->setValue($this->testOBJ->getTitleOutput());
1062  $form->addItem($title_output);
1063 
1064  // Autosave
1065  $autosave_output = new ilCheckboxInputGUI($this->lng->txt('autosave'), 'autosave');
1066  $autosave_output->setValue(1);
1067  $autosave_output->setChecked($this->testOBJ->getAutosave());
1068  $autosave_output->setInfo($this->lng->txt('autosave_info'));
1069  $autosave_interval = new ilTextInputGUI($this->lng->txt('autosave_ival'), 'autosave_ival');
1070  $autosave_interval->setSize(10);
1071  $autosave_interval->setValue($this->testOBJ->getAutosaveIval()/1000);
1072  $autosave_interval->setSuffix($this->lng->txt('seconds'));
1073  $autosave_output->addSubItem($autosave_interval);
1074  $form->addItem($autosave_output);
1075 
1076  // shuffle questions
1077  $shuffle = new ilCheckboxInputGUI($this->lng->txt("tst_shuffle_questions"), "chb_shuffle_questions");
1078  $shuffle->setValue(1);
1079  $shuffle->setChecked($this->testOBJ->getShuffleQuestions());
1080  $shuffle->setInfo($this->lng->txt("tst_shuffle_questions_description"));
1081  $form->addItem($shuffle);
1082 
1083  // offer hints
1084  $checkBoxOfferHints = new ilCheckboxInputGUI($this->lng->txt('tst_setting_offer_hints_label'), 'offer_hints');
1085  $checkBoxOfferHints->setChecked($this->testOBJ->isOfferingQuestionHintsEnabled());
1086  $checkBoxOfferHints->setInfo($this->lng->txt('tst_setting_offer_hints_info'));
1087  if ($this->testOBJ->participantDataExist()) {
1088  $checkBoxOfferHints->setDisabled(true);
1089  }
1090  $form->addItem($checkBoxOfferHints);
1091 
1092  // instant feedback
1093  $instant_feedback = new ilCheckboxGroupInputGUI($this->lng->txt('tst_instant_feedback'), 'instant_feedback');
1094  $instant_feedback->addOption(new ilCheckboxOption(
1095  $this->lng->txt('tst_instant_feedback_results'),
1096  'instant_feedback_points',
1097  $this->lng->txt('tst_instant_feedback_results_desc')
1098  ));
1099  $instant_feedback->addOption(new ilCheckboxOption(
1100  $this->lng->txt('tst_instant_feedback_answer_generic'),
1101  'instant_feedback_generic',
1102  $this->lng->txt('tst_instant_feedback_answer_generic_desc')
1103  ));
1104  $instant_feedback->addOption(new ilCheckboxOption(
1105  $this->lng->txt('tst_instant_feedback_answer_specific'),
1106  'instant_feedback_specific',
1107  $this->lng->txt('tst_instant_feedback_answer_specific_desc')
1108  ));
1109  $instant_feedback->addOption(new ilCheckboxOption(
1110  $this->lng->txt('tst_instant_feedback_solution'),
1111  'instant_feedback_solution',
1112  $this->lng->txt('tst_instant_feedback_solution_desc')
1113  ));
1114  $values = array();
1115  if ($this->testOBJ->getSpecificAnswerFeedback()) {
1116  array_push($values, 'instant_feedback_specific');
1117  }
1118  if ($this->testOBJ->getGenericAnswerFeedback()) {
1119  array_push($values, 'instant_feedback_generic');
1120  }
1121  if ($this->testOBJ->getAnswerFeedbackPoints()) {
1122  array_push($values, 'instant_feedback_points');
1123  }
1124  if ($this->testOBJ->getInstantFeedbackSolution()) {
1125  array_push($values, 'instant_feedback_solution');
1126  }
1127  $instant_feedback->setValue($values);
1128  $form->addItem($instant_feedback);
1129 
1130  $radioGroup = new ilRadioGroupInputGUI(
1131  $this->lng->txt('tst_instant_feedback_handling'),
1132  'instant_feedback_handling'
1133  );
1134  if ($this->testOBJ->participantDataExist()) {
1135  $radioGroup->setDisabled(true);
1136  }
1137  $radioOption = new ilRadioOption(
1138  $this->lng->txt('tst_instant_feedback_handling_none'),
1139  self::INST_FB_HANDLING_OPT_NONE
1140  );
1141  $radioOption->setInfo($this->lng->txt('tst_instant_feedback_handling_none_desc'));
1142  $radioGroup->addOption($radioOption);
1143  $radioOption = new ilRadioOption(
1144  $this->lng->txt('tst_instant_feedback_handling_freeze'),
1145  self::INST_FB_HANDLING_OPT_FREEZE
1146  );
1147  $radioOption->setInfo($this->lng->txt('tst_instant_feedback_handling_freeze_desc'));
1148  $radioGroup->addOption($radioOption);
1149  $radioOption = new ilRadioOption(
1150  $this->lng->txt('tst_instant_feedback_handling_force_and_freeze'),
1151  self::INST_FB_HANDLING_OPT_FORCE_AND_FREEZE
1152  );
1153  $radioOption->setInfo($this->lng->txt('tst_instant_feedback_handling_force_and_freeze_desc'));
1154  $radioGroup->addOption($radioOption);
1155  $radioOption = new ilRadioOption(
1156  $this->lng->txt('tst_instant_feedback_handling_force'),
1157  self::INST_FB_HANDLING_OPT_FORCE
1158  );
1159  $radioOption->setInfo($this->lng->txt('tst_instant_feedback_handling_force_desc'));
1160  $radioGroup->addOption($radioOption);
1161  $radioGroup->setValue($this->getInstFbHandlingValue(
1162  $this->testOBJ->isInstantFeedbackAnswerFixationEnabled(),
1163  $this->testOBJ->isForceInstantFeedbackEnabled()
1164  ));
1165  $form->addItem($radioGroup);
1166 
1167  // enable obligations
1168  $checkBoxEnableObligations = new ilCheckboxInputGUI($this->lng->txt('tst_setting_enable_obligations_label'), 'obligations_enabled');
1169  $checkBoxEnableObligations->setChecked($this->testOBJ->areObligationsEnabled());
1170  $checkBoxEnableObligations->setInfo($this->lng->txt('tst_setting_enable_obligations_info'));
1171  if ($this->testOBJ->participantDataExist()) {
1172  $checkBoxEnableObligations->setDisabled(true);
1173  }
1174  $form->addItem($checkBoxEnableObligations);
1175 
1176  // selector for unicode characters
1177  if ($this->isCharSelectorPropertyRequired()) {
1178  require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
1180  $char_selector->getConfig()->setAvailability($this->testOBJ->getCharSelectorAvailability());
1181  $char_selector->getConfig()->setDefinition($this->testOBJ->getCharSelectorDefinition());
1182  $char_selector->addFormProperties($form);
1183  $char_selector->setFormValues($form);
1184  }
1185  }
This class represents an option in a radio group.
This class represents an option in a checkbox group.
This shows a character selector.
This class represents a section header in a property form.
This class represents a checkbox property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
setInfo($a_info)
Set Info.
setChecked($a_checked)
Set Checked.
This class represents a property in a property form.
addOption($a_option)
Add Option.
setValue($a_value)
Set Value.
setSize($a_size)
Set Size.
This class represents a text property in a property form.
This class represents a property in a property form.
Create styles array
The data for the language used.
setDisabled($a_disabled)
Set Disabled.
getInstFbHandlingValue($freezeAnswersEnabled, $forceInstFbEnabled)
+ 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 724 of file class.ilObjTestSettingsGeneralGUI.php.

References $header, $password, ilPropertyFormGUI\addItem(), IL_CAL_UNIX, ilCheckboxInputGUI\setChecked(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), and ilCheckboxInputGUI\setValue().

Referenced by buildForm().

725  {
727  $header->setTitle($this->lng->txt("tst_settings_header_execution"));
728  $form->addItem($header);
729 
730  // starting time
731  $startingtime = new ilDateTimeInputGUI($this->lng->txt("tst_starting_time"), 'starting_time');
732  $startingtime->setInfo($this->lng->txt("tst_starting_time_desc"));
733  $startingtime->setShowTime(true);
734  if ($this->testOBJ->getStartingTime() != 0) {
735  $startingtime->setDate(new ilDateTime($this->testOBJ->getStartingTime(), IL_CAL_UNIX));
736  } else {
737  $startingtime->setDate(null);
738  }
739 
740  $form->addItem($startingtime);
741  if ($this->testOBJ->participantDataExist()) {
742  $startingtime->setDisabled(true);
743  }
744 
745  // ending time
746  $endingtime = new ilDateTimeInputGUI($this->lng->txt("tst_ending_time"), 'ending_time');
747  $endingtime->setInfo($this->lng->txt("tst_ending_time_desc"));
748  $endingtime->setShowTime(true);
749  if ($this->testOBJ->getEndingTime() != 0) {
750  $endingtime->setDate(new ilDateTime($this->testOBJ->getEndingTime(), IL_CAL_UNIX));
751  } else {
752  $endingtime->setDate(null);
753  }
754  $form->addItem($endingtime);
755 
756  // test password
757  $pwEnabled = new ilCheckboxInputGUI($this->lng->txt('tst_password'), 'password_enabled');
758  $pwEnabled->setChecked($this->testOBJ->isPasswordEnabled());
759  $pwEnabled->setInfo($this->lng->txt("tst_password_details"));
760  $password = new ilTextInputGUI($this->lng->txt("tst_password_enter"), "password");
761  $password->setRequired(true);
762  $password->setSize(20);
763  $password->setMaxLength(20);
764  $password->setValue($this->testOBJ->getPassword());
765  $pwEnabled->addSubItem($password);
766  $form->addItem($pwEnabled);
767 
768  // fixed participants
769  $fixedparticipants = new ilCheckboxInputGUI($this->lng->txt('participants_invitation'), "fixedparticipants");
770  $fixedparticipants->setValue(1);
771  $fixedparticipants->setChecked($this->testOBJ->getFixedParticipants());
772  $fixedparticipants->setInfo($this->lng->txt("participants_invitation_description"));
773  if ($this->testOBJ->participantDataExist()) {
774  $fixedparticipants->setDisabled(true);
775  }
776  $form->addItem($fixedparticipants);
777 
778  // simultaneous users
779  $simulLimited = new ilCheckboxInputGUI($this->lng->txt("tst_allowed_users"), 'limitUsers');
780  $simulLimited->setInfo($this->lng->txt("tst_allowed_users_desc"));
781  $simulLimited->setChecked($this->testOBJ->isLimitUsersEnabled());
782 
783  // allowed simultaneous users
784  $simul = new ilNumberInputGUI($this->lng->txt("tst_allowed_users_max"), "allowedUsers");
785  $simul->setRequired(true);
786  $simul->allowDecimals(false);
787  $simul->setMinValue(1);
788  $simul->setMinvalueShouldBeGreater(false);
789  $simul->setSize(4);
790  $simul->setValue(($this->testOBJ->getAllowedUsers()) ? $this->testOBJ->getAllowedUsers() : '');
791  $simulLimited->addSubItem($simul);
792 
793  // idle time
794  $idle = new ilNumberInputGUI($this->lng->txt("tst_allowed_users_time_gap"), "allowedUsersTimeGap");
795  $idle->setInfo($this->lng->txt("tst_allowed_users_time_gap_desc"));
796  $idle->setSize(4);
797  $idle->setSuffix($this->lng->txt("seconds"));
798  $idle->setValue(($this->testOBJ->getAllowedUsersTimeGap()) ? $this->testOBJ->getAllowedUsersTimeGap() : 300);
799  $simulLimited->addSubItem($idle);
800 
801  $form->addItem($simulLimited);
802  return $header;
803  }
This class represents a section header in a property form.
This class represents a checkbox property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
const IL_CAL_UNIX
This class represents a date/time property in a property form.
setInfo($a_info)
Set Information Text.
setChecked($a_checked)
Set Checked.
$password
Definition: pwgen.php:17
This class represents a number property in a property form.
setValue($a_value)
Set Value.
This class represents a text property in a property form.
Date and time handling
setRequired($a_required)
Set Required.
+ 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 1341 of file class.ilObjTestSettingsGeneralGUI.php.

References ilPropertyFormGUI\addItem(), ilRadioGroupInputGUI\addOption(), array, REDIRECT_ALWAYS, REDIRECT_KIOSK, ilCheckboxInputGUI\setChecked(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), ilTextInputGUI\setValue(), ilCheckboxInputGUI\setValue(), and ilRadioOption\setValue().

Referenced by buildForm().

1342  {
1343  $testFinishHeader = new ilFormSectionHeaderGUI();
1344  $testFinishHeader->setTitle($this->lng->txt("tst_final_information"));
1345  $form->addItem($testFinishHeader);
1346 
1347  // examview
1348  $enable_examview = new ilCheckboxInputGUI($this->lng->txt("enable_examview"), 'enable_examview');
1349  $enable_examview->setValue(1);
1350  $enable_examview->setChecked($this->testOBJ->getEnableExamview());
1351  $enable_examview->setInfo($this->lng->txt("enable_examview_desc"));
1352  $show_examview_pdf = new ilCheckboxInputGUI('', 'show_examview_pdf');
1353  $show_examview_pdf->setValue(1);
1354  $show_examview_pdf->setChecked($this->testOBJ->getShowExamviewPdf());
1355  $show_examview_pdf->setOptionTitle($this->lng->txt("show_examview_pdf"));
1356  $enable_examview->addSubItem($show_examview_pdf);
1357  $form->addItem($enable_examview);
1358 
1359  // show final statement
1360  $showfinal = new ilCheckboxInputGUI($this->lng->txt("final_statement"), "showfinalstatement");
1361  $showfinal->setChecked($this->testOBJ->getShowFinalStatement());
1362  $showfinal->setInfo($this->lng->txt("final_statement_show_desc"));
1363  $form->addItem($showfinal);
1364  // final statement
1365  $finalstatement = new ilTextAreaInputGUI($this->lng->txt("final_statement"), "finalstatement");
1366  $finalstatement->setRequired(true);
1367  $finalstatement->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getFinalStatement(), false, true));
1368  $finalstatement->setRows(10);
1369  $finalstatement->setCols(80);
1370  $finalstatement->setUseRte(true);
1371  $finalstatement->addPlugin("latex");
1372  $finalstatement->addButton("latex");
1373  $finalstatement->setRTESupport($this->testOBJ->getId(), "tst", "assessment");
1374  $finalstatement->setRteTagSet('full');
1375  $showfinal->addSubItem($finalstatement);
1376 
1377  $redirection_mode = $this->testOBJ->getRedirectionMode();
1378  $rm_enabled = new ilCheckboxInputGUI($this->lng->txt('redirect_after_finishing_tst'), 'redirection_enabled');
1379  $rm_enabled->setInfo($this->lng->txt('redirect_after_finishing_tst_desc'));
1380  $rm_enabled->setChecked($redirection_mode == '0' ? false : true);
1381  $radio_rm = new ilRadioGroupInputGUI($this->lng->txt('redirect_after_finishing_rule'), 'redirection_mode');
1382  $always = new ilRadioOption($this->lng->txt('redirect_always'), REDIRECT_ALWAYS);
1383  $radio_rm->addOption($always);
1384  $kiosk = new ilRadioOption($this->lng->txt('redirect_in_kiosk_mode'), REDIRECT_KIOSK);
1385  $radio_rm->addOption($kiosk);
1386  $radio_rm->setValue(in_array($redirection_mode, array(REDIRECT_ALWAYS, REDIRECT_KIOSK)) ? $redirection_mode : REDIRECT_ALWAYS);
1387  $rm_enabled->addSubItem($radio_rm);
1388  $redirection_url = new ilTextInputGUI($this->lng->txt('redirection_url'), 'redirection_url');
1389  $redirection_url->setValue((string) $this->testOBJ->getRedirectionUrl());
1390  $redirection_url->setRequired(true);
1391  $rm_enabled->addSubItem($redirection_url);
1392 
1393  $form->addItem($rm_enabled);
1394 
1395  // Sign submission
1396  $sign_submission = $this->testOBJ->getSignSubmission();
1397  $sign_submission_enabled = new ilCheckboxInputGUI($this->lng->txt('sign_submission'), 'sign_submission');
1398  $sign_submission_enabled->setChecked($sign_submission);
1399  $sign_submission_enabled->setInfo($this->lng->txt('sign_submission_info'));
1400  $form->addItem($sign_submission_enabled);
1401 
1402  // mail notification
1403  $mailnotification = new ilCheckboxInputGUI($this->lng->txt("tst_finish_notification"), "mailnotification");
1404  $mailnotification->setInfo($this->lng->txt("tst_finish_notification_desc"));
1405  $mailnotification->setChecked($this->testOBJ->getMailNotification() > 0);
1406  $form->addItem($mailnotification);
1407 
1408  $mailnotificationContent = new ilRadioGroupInputGUI($this->lng->txt("tst_finish_notification_content"), "mailnotification_content");
1409  $mailnotificationContent->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_simple"), 1, ''));
1410  $mailnotificationContent->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_advanced"), 2, ''));
1411  $mailnotificationContent->setValue($this->testOBJ->getMailNotification() ? $this->testOBJ->getMailNotification() : 1);
1412  $mailnotificationContent->setRequired(true);
1413  $mailnotification->addSubItem($mailnotificationContent);
1414 
1415  $mailnottype = new ilCheckboxInputGUI('', "mailnottype");
1416  $mailnottype->setValue(1);
1417  $mailnottype->setOptionTitle($this->lng->txt("mailnottype"));
1418  $mailnottype->setChecked($this->testOBJ->getMailNotificationType());
1419  $mailnotification->addSubItem($mailnottype);
1420  }
This class represents an option in a radio group.
This class represents a section header in a property form.
This class represents a checkbox property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
setInfo($a_info)
Set Information Text.
const REDIRECT_ALWAYS
setChecked($a_checked)
Set Checked.
This class represents a property in a property form.
addOption($a_option)
Add Option.
setValue($a_value)
Set Value.
setValue($a_value)
Set Value.
This class represents a text property in a property form.
const REDIRECT_KIOSK
Create styles array
The data for the language used.
This class represents a text area property in a property form.
setValue($a_value)
Set Value.
setRequired($a_required)
Set Required.
+ 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 670 of file class.ilObjTestSettingsGeneralGUI.php.

References $section, ilPropertyFormGUI\addItem(), ilCheckboxInputGUI\setChecked(), ilFormPropertyGUI\setRequired(), and ilCheckboxInputGUI\setValue().

Referenced by buildForm().

671  {
673  $section->setTitle($this->lng->txt('tst_settings_header_intro'));
674  $form->addItem($section);
675 
676  // introduction
677  $introEnabled = new ilCheckboxInputGUI($this->lng->txt("tst_introduction"), 'intro_enabled');
678  $introEnabled->setChecked($this->testOBJ->isIntroductionEnabled());
679  $introEnabled->setInfo($this->lng->txt('tst_introduction_desc'));
680  $form->addItem($introEnabled);
681  $intro = new ilTextAreaInputGUI($this->lng->txt("tst_introduction_text"), "introduction");
682  $intro->setRequired(true);
683  $intro->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getIntroduction(), false, true));
684  $intro->setRows(10);
685  $intro->setCols(80);
686  $intro->setUseRte(true);
687  $intro->addPlugin("latex");
688  $intro->addButton("latex");
689  $intro->setRTESupport($this->testOBJ->getId(), "tst", "assessment");
690  $intro->setRteTagSet('full');
691  $introEnabled->addSubItem($intro);
692 
693  // showinfo
694  $showinfo = new ilCheckboxInputGUI($this->lng->txt("showinfo"), "showinfo");
695  $showinfo->setValue(1);
696  $showinfo->setChecked($this->testOBJ->getShowInfo());
697  $showinfo->setInfo($this->lng->txt("showinfo_desc"));
698  $form->addItem($showinfo);
699  }
This class represents a section header in a property form.
This class represents a checkbox property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
$section
Definition: Utf8Test.php:83
setChecked($a_checked)
Set Checked.
setValue($a_value)
Set Value.
This class represents a text area property in a property form.
setRequired($a_required)
Set Required.
+ 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 861 of file class.ilObjTestSettingsGeneralGUI.php.

References $header, ilPropertyFormGUI\addItem(), ilCheckboxGroupInputGUI\addOption(), ilNumberInputGUI\allowDecimals(), array, ilTestSettingsGUI\getTemplateSettingValue(), ilFormPropertyGUI\setInfo(), ilDurationInputGUI\setShowMonths(), ilNumberInputGUI\setSize(), and ilCheckboxInputGUI\setValue().

Referenced by buildForm().

862  {
863  // section header test run
865  $header->setTitle($this->lng->txt("tst_settings_header_test_run"));
866  $form->addItem($header);
867 
868  // max. number of passes
869  $limitPasses = new ilCheckboxInputGUI($this->lng->txt("tst_limit_nr_of_tries"), 'limitPasses');
870  $limitPasses->setInfo($this->lng->txt("tst_nr_of_tries_desc"));
871  $limitPasses->setChecked($this->testOBJ->getNrOfTries() > 0);
872  $nr_of_tries = new ilNumberInputGUI($this->lng->txt("tst_nr_of_tries"), "nr_of_tries");
873  $nr_of_tries->setSize(3);
874  $nr_of_tries->allowDecimals(false);
875  $nr_of_tries->setMinValue(1);
876  $nr_of_tries->setMinvalueShouldBeGreater(false);
877  $nr_of_tries->setValue($this->testOBJ->getNrOfTries() ? $this->testOBJ->getNrOfTries() : 1);
878  $nr_of_tries->setRequired(true);
879  if ($this->testOBJ->participantDataExist()) {
880  $limitPasses->setDisabled(true);
881  $nr_of_tries->setDisabled(true);
882  }
883  $limitPasses->addSubItem($nr_of_tries);
884  $form->addItem($limitPasses);
885 
886  // pass_waiting time between testruns
887  $pass_waiting_enabled = new ilCheckboxInputGUI($this->lng->txt('tst_pass_waiting_enabled'), 'pass_waiting_enabled');
888  $pass_waiting_enabled->setInfo($this->lng->txt('tst_pass_waiting_info'));
889  $pass_waiting_enabled->setChecked($this->testOBJ->isPassWaitingEnabled());
890 
891  // pass_waiting
892  $duration = new ilDurationInputGUI($this->lng->txt("tst_pass_waiting_time"), "pass_waiting");
893 
894  $duration->setShowMonths(true);
895  $duration->setShowDays(true);
896  $duration->setShowHours(true);
897  $duration->setShowMinutes(true);
898 
899  $pw_time_array = explode(':', $this->testOBJ->getPassWaiting());
900  $duration->setMonths($pw_time_array[0]);
901  $duration->setDays($pw_time_array[1]);
902  $duration->setHours($pw_time_array[2]);
903  $duration->setMinutes($pw_time_array[3]);
904  $duration->setRequired(false);
905  $pass_waiting_enabled->addSubItem($duration);
906 
907  $form->addItem($pass_waiting_enabled);
908 
909  // enable max. processing time
910  $processing = new ilCheckboxInputGUI($this->lng->txt("tst_processing_time"), "chb_processing_time");
911  $processing->setInfo($this->lng->txt("tst_processing_time_desc"));
912  $processing->setValue(1);
913 
914  if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_processing_time')) {
915  $processing->setChecked(true);
916  } else {
917  $processing->setChecked($this->testOBJ->getEnableProcessingTime());
918  }
919 
920  // max. processing time
921  $processingtime = new ilNumberInputGUI($this->lng->txt("tst_processing_time_duration"), 'processing_time');
922  $processingtime->allowDecimals(false);
923  $processingtime->setMinValue(1);
924  $processingtime->setMinvalueShouldBeGreater(false);
925  $processingtime->setValue($this->testOBJ->getProcessingTimeAsMinutes());
926  $processingtime->setSize(5);
927  $processingtime->setSuffix($this->lng->txt('minutes'));
928  $processingtime->setInfo($this->lng->txt("tst_processing_time_duration_desc"));
929  $processing->addSubItem($processingtime);
930 
931  // reset max. processing time
932  $resetprocessing = new ilCheckboxInputGUI('', "chb_reset_processing_time");
933  $resetprocessing->setValue(1);
934  $resetprocessing->setOptionTitle($this->lng->txt("tst_reset_processing_time"));
935  $resetprocessing->setChecked($this->testOBJ->getResetProcessingTime());
936  $resetprocessing->setInfo($this->lng->txt("tst_reset_processing_time_desc"));
937  $processing->addSubItem($resetprocessing);
938  $form->addItem($processing);
939 
940  if ($this->testOBJ->participantDataExist()) {
941  $processing->setDisabled(true);
942  $processingtime->setDisabled(true);
943  $resetprocessing->setDisabled(true);
944 
945  $duration->setDisabled(true);
946  $pass_waiting_enabled->setDisabled(true);
947  }
948 
949  // kiosk mode
950  $kiosk = new ilCheckboxInputGUI($this->lng->txt("kiosk"), "kiosk");
951  $kiosk->setValue(1);
952  $kiosk->setChecked($this->testOBJ->getKioskMode());
953  $kiosk->setInfo($this->lng->txt("kiosk_description"));
954 
955  // kiosk mode options
956  $kiosktitle = new ilCheckboxGroupInputGUI($this->lng->txt("kiosk_options"), "kiosk_options");
957  $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_title"), 'kiosk_title', ''));
958  $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_participant"), 'kiosk_participant', ''));
959  $values = array();
960  if ($this->testOBJ->getShowKioskModeTitle()) {
961  array_push($values, 'kiosk_title');
962  }
963  if ($this->testOBJ->getShowKioskModeParticipant()) {
964  array_push($values, 'kiosk_participant');
965  }
966  $kiosktitle->setValue($values);
967  $kiosktitle->setInfo($this->lng->txt("kiosk_options_desc"));
968  $kiosk->addSubItem($kiosktitle);
969 
970  $form->addItem($kiosk);
971 
972  $examIdInPass = new ilCheckboxInputGUI($this->lng->txt('examid_in_test_pass'), 'examid_in_test_pass');
973  $examIdInPass->setInfo($this->lng->txt('examid_in_test_pass_desc'));
974  $examIdInPass->setChecked($this->testOBJ->isShowExamIdInTestPassEnabled());
975  $form->addItem($examIdInPass);
976  }
This class represents a duration (typical hh:mm:ss) property in a property form.
This class represents an option in a checkbox group.
setShowMonths($a_show_months)
Set show months.
This class represents a section header in a property form.
This class represents a checkbox property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
allowDecimals($a_value)
Toggle Decimals.
setInfo($a_info)
Set Information Text.
This class represents a number property in a property form.
setValue($a_value)
Set Value.
This class represents a property in a property form.
Create styles array
The data for the language used.
setSize($a_size)
Set Size.
getTemplateSettingValue($settingName)
+ 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 1234 of file class.ilObjTestSettingsGeneralGUI.php.

References ilPropertyFormGUI\addItem(), ilRadioGroupInputGUI\addOption(), array, and ilCheckboxInputGUI\setValue().

Referenced by buildForm().

1235  {
1236  // sequence properties
1237  $seqheader = new ilFormSectionHeaderGUI();
1238  $seqheader->setTitle($this->lng->txt("tst_sequence_properties"));
1239  $form->addItem($seqheader);
1240 
1241  // use previous answers
1242  $prevanswers = new ilCheckboxInputGUI($this->lng->txt("tst_use_previous_answers"), "chb_use_previous_answers");
1243  $prevanswers->setValue(1);
1244  $prevanswers->setChecked($this->testOBJ->getUsePreviousAnswers());
1245  $prevanswers->setInfo($this->lng->txt("tst_use_previous_answers_description"));
1246  $form->addItem($prevanswers);
1247 
1248  // show suspend test
1249  $cancel = new ilCheckboxInputGUI($this->lng->txt("tst_show_cancel"), "chb_show_cancel");
1250  $cancel->setValue(1);
1251  $cancel->setChecked($this->testOBJ->getShowCancel());
1252  $cancel->setInfo($this->lng->txt("tst_show_cancel_description"));
1253  $form->addItem($cancel);
1254 
1255  // postpone questions
1256  $postpone = new ilRadioGroupInputGUI($this->lng->txt("tst_postpone"), "postpone");
1257  $postpone->addOption(new ilRadioOption(
1258  $this->lng->txt("tst_postpone_off"),
1259  0,
1260  $this->lng->txt("tst_postpone_off_desc")
1261  ));
1262  $postpone->addOption(new ilRadioOption(
1263  $this->lng->txt("tst_postpone_on"),
1264  1,
1265  $this->lng->txt("tst_postpone_on_desc")
1266  ));
1267  $postpone->setValue((int) $this->testOBJ->getSequenceSettings());
1268  $form->addItem($postpone);
1269 
1270  // show list of questions
1271  $list_of_questions = new ilCheckboxInputGUI($this->lng->txt("tst_show_summary"), "list_of_questions");
1272  //$list_of_questions->setOptionTitle($this->lng->txt("tst_show_summary"));
1273  $list_of_questions->setValue(1);
1274  $list_of_questions->setChecked($this->testOBJ->getListOfQuestions());
1275  $list_of_questions->setInfo($this->lng->txt("tst_show_summary_description"));
1276 
1277  $list_of_questions_options = new ilCheckboxGroupInputGUI('', "list_of_questions_options");
1278  $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_start"), 'chb_list_of_questions_start', ''));
1279  $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_end"), 'chb_list_of_questions_end', ''));
1280  $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_with_description"), 'chb_list_of_questions_with_description', ''));
1281  $values = array();
1282  if ($this->testOBJ->getListOfQuestionsStart()) {
1283  array_push($values, 'chb_list_of_questions_start');
1284  }
1285  if ($this->testOBJ->getListOfQuestionsEnd()) {
1286  array_push($values, 'chb_list_of_questions_end');
1287  }
1288  if ($this->testOBJ->getListOfQuestionsDescription()) {
1289  array_push($values, 'chb_list_of_questions_with_description');
1290  }
1291  $list_of_questions_options->setValue($values);
1292 
1293  $list_of_questions->addSubItem($list_of_questions_options);
1294  $form->addItem($list_of_questions);
1295 
1296  // show question marking
1297  $marking = new ilCheckboxInputGUI($this->lng->txt("question_marking"), "chb_show_marker");
1298  $marking->setValue(1);
1299  $marking->setChecked($this->testOBJ->getShowMarker());
1300  $marking->setInfo($this->lng->txt("question_marking_description"));
1301  $form->addItem($marking);
1302  }
This class represents an option in a radio group.
This class represents an option in a checkbox group.
This class represents a section header in a property form.
This class represents a checkbox property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
This class represents a property in a property form.
addOption($a_option)
Add Option.
setValue($a_value)
Set Value.
This class represents a property in a property form.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildForm()

ilObjTestSettingsGeneralGUI::buildForm ( )
private

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

References $form, addAvailabilityProperties(), addGeneralProperties(), addQuestionBehaviourProperties(), addTestAccessProperties(), addTestFinishProperties(), addTestIntroProperties(), addTestRunProperties(), addTestSequenceProperties(), ilObjTest\isSkillManagementGloballyActivated(), ilTestSettingsGUI\removeHiddenItems(), and ilFormPropertyGUI\setInfo().

Referenced by saveFormCmd(), and showFormCmd().

397  {
398  require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
399  $form = new ilPropertyFormGUI();
400  $form->setFormAction($this->ctrl->getFormAction($this));
401  $form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt("save"));
402  $form->setTableWidth("100%");
403  $form->setId("test_properties");
404 
405  $this->addGeneralProperties($form);
409  $this->addTestRunProperties($form);
413 
414  // Edit ecs export settings
415  include_once 'Modules/Test/classes/class.ilECSTestSettings.php';
416  $ecs = new ilECSTestSettings($this->testOBJ);
417  $ecs->addSettingsToForm($form, 'tst');
418 
419  // skill service activation for FIXED tests only
421  $otherHead = new ilFormSectionHeaderGUI();
422  $otherHead->setTitle($this->lng->txt('other'));
423  $form->addItem($otherHead);
424 
425  $skillService = new ilCheckboxInputGUI($this->lng->txt('tst_activate_skill_service'), 'skill_service');
426  $skillService->setInfo($this->lng->txt('tst_activate_skill_service_desc'));
427  $skillService->setChecked($this->testOBJ->isSkillServiceEnabled());
428  if ($this->testOBJ->participantDataExist()) {
429  $skillService->setDisabled(true);
430  }
431  $form->addItem($skillService);
432  }
433 
434  // remove items when using template
435  $this->removeHiddenItems($form);
436 
437  return $form;
438  }
This class represents a property form user interface.
This class represents a section header in a property form.
This class represents a checkbox property in a property form.
removeHiddenItems(ilPropertyFormGUI $form)
setInfo($a_info)
Set Information Text.
addQuestionBehaviourProperties(ilPropertyFormGUI $form)
if(isset($_POST['submit'])) $form
Class ilECSTestSettings.
static isSkillManagementGloballyActivated()
+ 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 362 of file class.ilObjTestSettingsGeneralGUI.php.

References ilUtil\sendSuccess().

363  {
364  $this->testOBJ->setTemplate(null);
365  $this->testOBJ->saveToDB();
366 
367  ilUtil::sendSuccess($this->lng->txt("test_template_reset"), true);
368  $this->ctrl->redirect($this, self::CMD_SHOW_FORM);
369  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
+ Here is the call graph for this function:

◆ confirmedSaveFormCmd()

ilObjTestSettingsGeneralGUI::confirmedSaveFormCmd ( )
private

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

References saveFormCmd().

190  {
191  return $this->saveFormCmd(true);
192  }
+ Here is the call graph for this function:

◆ executeCommand()

ilObjTestSettingsGeneralGUI::executeCommand ( )

Command Execution.

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

References ilUtil\sendInfo().

110  {
111  // allow only write access
112 
113  if (!$this->access->checkAccess("write", "", $this->testGUI->ref_id)) {
114  ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
115  $this->ctrl->redirect($this->testGUI, "infoScreen");
116  }
117 
118  // process command
119 
120  $nextClass = $this->ctrl->getNextClass();
121 
122  switch ($nextClass) {
123  default:
124  $cmd = $this->ctrl->getCmd(self::CMD_SHOW_FORM) . 'Cmd';
125  $this->$cmd();
126  }
127  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ getInstFbHandlingValue()

ilObjTestSettingsGeneralGUI::getInstFbHandlingValue (   $freezeAnswersEnabled,
  $forceInstFbEnabled 
)
private

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

Referenced by addQuestionBehaviourProperties().

1485  {
1486  switch (true) {
1487  case !$freezeAnswersEnabled && !$forceInstFbEnabled: return self::INST_FB_HANDLING_OPT_NONE;
1488  case $freezeAnswersEnabled && !$forceInstFbEnabled: return self::INST_FB_HANDLING_OPT_FREEZE;
1489  case !$freezeAnswersEnabled && $forceInstFbEnabled: return self::INST_FB_HANDLING_OPT_FORCE;
1490  case $freezeAnswersEnabled && $forceInstFbEnabled: return self::INST_FB_HANDLING_OPT_FORCE_AND_FREEZE;
1491  }
1492  }
+ Here is the caller graph for this function:

◆ getSettingsTemplateMessageHTML()

ilObjTestSettingsGeneralGUI::getSettingsTemplateMessageHTML ( )
protected

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

References $title, and $tpl.

Referenced by showFormCmd().

163  {
164  if ($this->settingsTemplate) {
165  $title = $this->settingsTemplate->getTitle();
166 
167  if ($this->settingsTemplate->getAutoGenerated()) {
168  $title = $this->lng->txt($title);
169  }
170 
171  global $tpl;
172 
173  $link = $this->ctrl->getLinkTarget($this, self::CMD_SHOW_RESET_TPL_CONFIRM);
174  $link = "<a href=\"" . $link . "\">" . $this->lng->txt("test_using_template_link") . "</a>";
175 
176  $msgHTML = $tpl->getMessageHTML(
177  sprintf($this->lng->txt("test_using_template"), $title, $link),
178  "info"
179  );
180 
181  $msgHTML = "<div style=\"margin-top:10px\">$msgHTML</div>";
182  } else {
183  $msgHTML = '';
184  }
185 
186  return $msgHTML;
187  }
+ Here is the caller graph for this function:

◆ isCharSelectorPropertyRequired()

ilObjTestSettingsGeneralGUI::isCharSelectorPropertyRequired ( )
private

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

References $ilSetting.

Referenced by addQuestionBehaviourProperties(), and saveQuestionBehaviourProperties().

389  {
390  global $ilSetting;
391 
392  return $ilSetting->get('char_selector_availability') > 0;
393  }
global $ilSetting
Definition: privfeed.php:17
+ Here is the caller graph for this function:

◆ isSkillServiceSettingToBeAdjusted()

ilObjTestSettingsGeneralGUI::isSkillServiceSettingToBeAdjusted ( ilPropertyFormGUI  $form)
private

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

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

372  {
373  if (!($form->getItemByPostVar('skill_service') instanceof ilFormPropertyGUI)) {
374  return false;
375  }
376 
378  return false;
379  }
380 
381  if (!$form->getItemByPostVar('skill_service')->getChecked()) {
382  return false;
383  }
384 
385  return true;
386  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
static isSkillManagementGloballyActivated()
This class represents a property in a property form.
+ Here is the call graph for this function:

◆ performSaveForm()

ilObjTestSettingsGeneralGUI::performSaveForm ( ilPropertyFormGUI  $form)
private

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

References ilPropertyFormGUI\getItemByPostVar(), ilObjTest\isSkillManagementGloballyActivated(), saveAvailabilityProperties(), saveGeneralProperties(), saveQuestionBehaviourProperties(), saveTestAccessProperties(), saveTestFinishProperties(), saveTestIntroProperties(), saveTestRunProperties(), and saveTestSequenceSettings().

Referenced by saveFormCmd().

441  {
442  $this->saveGeneralProperties($form);
443  $this->saveAvailabilityProperties($form);
444  $this->saveTestIntroProperties($form);
445  $this->saveTestAccessProperties($form);
446  $this->saveTestRunProperties($form);
447  $this->saveQuestionBehaviourProperties($form);
448  $this->saveTestSequenceSettings($form);
449  $this->saveTestFinishProperties($form);
450 
451  if (!$this->testOBJ->participantDataExist()) {
452  // skill service
453  if (ilObjTest::isSkillManagementGloballyActivated() && $form->getItemByPostVar('skill_service') instanceof ilFormPropertyGUI) {
454  $this->testOBJ->setSkillServiceEnabled($form->getItemByPostVar('skill_service')->getChecked());
455  }
456  }
457 
458  // store settings to db
459  $this->testOBJ->saveToDb(true);
460 
461  // Update ecs export settings
462  include_once 'Modules/Test/classes/class.ilECSTestSettings.php';
463  $ecs = new ilECSTestSettings($this->testOBJ);
464  $ecs->handleSettingsUpdate();
465  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
Class ilECSTestSettings.
saveQuestionBehaviourProperties(ilPropertyFormGUI $form)
static isSkillManagementGloballyActivated()
This class represents a property in a property form.
+ 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 649 of file class.ilObjTestSettingsGeneralGUI.php.

References ilPropertyFormGUI\getItemByPostVar(), and IL_CAL_UNIX.

Referenced by performSaveForm().

650  {
651  // online status
652  $this->testOBJ->setOnline($form->getItemByPostVar('online')->getChecked());
653 
654  // activation
655  if ($form->getItemByPostVar('activation_type')->getChecked()) {
656  $this->testOBJ->setActivationLimited(true);
657  $this->testOBJ->setActivationVisibility($form->getItemByPostVar('activation_visibility')->getChecked());
658 
659  $period = $form->getItemByPostVar("access_period");
660  $this->testOBJ->setActivationStartingTime($period->getStart()->get(IL_CAL_UNIX));
661  $this->testOBJ->setActivationEndingTime($period->getEnd()->get(IL_CAL_UNIX));
662  } else {
663  $this->testOBJ->setActivationLimited(false);
664  }
665  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
const IL_CAL_UNIX
+ 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 194 of file class.ilObjTestSettingsGeneralGUI.php.

References $errors, $form, array, buildForm(), performSaveForm(), ilObjTest\QUESTION_SET_TYPE_DYNAMIC, ilObjTest\QUESTION_SET_TYPE_FIXED, ilUtil\sendFailure(), ilUtil\sendInfo(), ilUtil\sendSuccess(), showConfirmation(), and showFormCmd().

Referenced by confirmedSaveFormCmd().

195  {
196  $form = $this->buildForm();
197 
198  // form validation and initialisation
199 
200  $errors = !$form->checkInput(); // ALWAYS CALL BEFORE setValuesByPost()
201  $form->setValuesByPost(); // NEVER CALL THIS BEFORE checkInput()
202  // Sarcasm? No. Because checkInput checks the form graph against the POST without
203  // actually setting the values into the form. Sounds ridiculous? Indeed, and it is.
204 
205  // return to form when any form validation errors exist
206 
207  if ($errors) {
208  ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
209  return $this->showFormCmd($form);
210  }
211 
212  // return to form when online is to be set, but no questions are configured
213 
214  $currentQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfig();
215  if ($form->getItemByPostVar('online')->getChecked() && !$this->testOBJ->isComplete($currentQuestionSetConfig)) {
216  $form->getItemByPostVar('online')->setAlert(
217  $this->lng->txt("cannot_switch_to_online_no_questions_andor_no_mark_steps")
218  );
219 
220  ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
221  return $this->showFormCmd($form);
222  }
223 
224  // avoid settings conflict "ctm" and "do not show question titles"
225 
226  $qstSetSetting = $form->getItemByPostVar('question_set_type');
227  $qTitleSetting = $form->getItemByPostVar('title_output');
228 
229  if ($qstSetSetting->getValue() == ilObjTest::QUESTION_SET_TYPE_DYNAMIC && $qTitleSetting->getValue() == 2) {
230  $qstSetSetting->setAlert($this->lng->txt('tst_conflicting_setting'));
231  $qTitleSetting->setAlert($this->lng->txt('tst_conflicting_setting'));
232 
233  ilUtil::sendFailure($this->lng->txt('tst_settings_conflict_message'));
234  return $this->showFormCmd($form);
235  }
236 
237  $infoMsg = array();
238 
239  // solve conflicts with question set type setting with confirmation screen if required
240  // determine wether question set type relating data is to be removed (questions/pools)
241 
242  $questionSetTypeRelatingDataCleanupRequired = false;
243 
244  $oldQuestionSetType = $this->testOBJ->getQuestionSetType();
245  if ($form->getItemByPostVar('question_set_type') instanceof ilFormPropertyGUI) {
246  $newQuestionSetType = $form->getItemByPostVar('question_set_type')->getValue();
247 
248  if (!$this->testOBJ->participantDataExist() && $newQuestionSetType != $oldQuestionSetType) {
249  $oldQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfigByType(
250  $oldQuestionSetType
251  );
252 
253  if ($oldQuestionSetConfig->doesQuestionSetRelatedDataExist()) {
254  if (!$isConfirmedSave) {
255  if ($oldQuestionSetType == ilObjTest::QUESTION_SET_TYPE_FIXED) {
256  return $this->showConfirmation(
257  $form,
258  $oldQuestionSetType,
259  $newQuestionSetType,
260  $this->testOBJ->hasQuestionsWithoutQuestionpool()
261  );
262  }
263 
264  return $this->showConfirmation(
265  $form,
266  $oldQuestionSetType,
267  $newQuestionSetType,
268  false
269  );
270  }
271 
272  $questionSetTypeRelatingDataCleanupRequired = true;
273  }
274 
275  if ($form->getItemByPostVar('online')->getChecked()) {
276  $form->getItemByPostVar('online')->setChecked(false);
277 
278  if ($this->testOBJ->isOnline()) {
279  $infoMsg[] = $this->lng->txt("tst_set_offline_due_to_switched_question_set_type_setting");
280  } else {
281  $infoMsg[] = $this->lng->txt("tst_cannot_online_due_to_switched_quest_set_type_setting");
282  }
283  }
284  }
285  } else {
286  $newQuestionSetType = $oldQuestionSetType;
287  }
288 
289  // adjust settiue to desired question set type
290 
291  if ($newQuestionSetType != ilObjTest::QUESTION_SET_TYPE_FIXED) {
292  $form->getItemByPostVar('chb_use_previous_answers')->setChecked(false);
293  }
294 
295  // avoid settings conflict "obligate questions" and "freeze answer"
296 
297  if ($form->getItemByPostVar('obligations_enabled')->getChecked()) {
298  switch ($form->getItemByPostVar('instant_feedback_handling')->getValue()) {
299  case self::INST_FB_HANDLING_OPT_FREEZE:
300 
301  $form->getItemByPostVar('instant_feedback_handling')->setValue(self::INST_FB_HANDLING_OPT_NONE);
302  $infoMsg[] = $this->lng->txt("tst_conflict_fbh_oblig_quest");
303  $infoMsg[] = $this->lng->txt("tst_conflict_reset_non_fbh");
304  break;
305 
306  case self::INST_FB_HANDLING_OPT_FORCE_AND_FREEZE:
307 
308  $form->getItemByPostVar('instant_feedback_handling')->setValue(self::INST_FB_HANDLING_OPT_FORCE);
309  $infoMsg[] = $this->lng->txt("tst_conflict_fbh_oblig_quest");
310  $infoMsg[] = $this->lng->txt("tst_conflict_reset_fbh_force");
311  break;
312  }
313  }
314 
315  // perform saving the form data
316 
317  $this->performSaveForm($form);
318 
319  // clean up test mode relating configuration data (questions/questionpools)
320 
321  if ($questionSetTypeRelatingDataCleanupRequired) {
322  $oldQuestionSetConfig->removeQuestionSetRelatedData();
323  }
324 
325  // disinvite all invited users if required
326 
327  if (!$this->testOBJ->participantDataExist() && !$this->testOBJ->getFixedParticipants()) {
328  foreach ($this->testOBJ->getInvitedUsers() as $usrId => $usrData) {
329  $this->testOBJ->disinviteUser($usrId);
330  }
331  }
332 
333  // redirect to form output
334 
335  if (count($infoMsg)) {
336  ilUtil::sendInfo(implode('<br />', $infoMsg), true);
337  }
338 
339  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
340  $this->ctrl->redirect($this, self::CMD_SHOW_FORM);
341  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(isset($_POST['submit'])) $form
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$errors
Definition: index.php:6
showConfirmation(ilPropertyFormGUI $form, $oldQuestionSetType, $newQuestionSetType, $hasQuestionsWithoutQuestionpool)
This class represents a property in a property form.
const QUESTION_SET_TYPE_FIXED
type setting value for fixed question set
const QUESTION_SET_TYPE_DYNAMIC
type setting value for dynamic question set (continues testing mode)
+ 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 554 of file class.ilObjTestSettingsGeneralGUI.php.

References ilTestSettingsGUI\formPropertyExists(), ilMD\getGeneral(), ilPropertyFormGUI\getItemByPostVar(), ilMDBase\save(), ilUtil\stripSlashes(), and ilMDBase\update().

Referenced by performSaveForm().

555  {
556  include_once 'Services/MetaData/classes/class.ilMD.php';
557  $md_obj = new ilMD($this->testOBJ->getId(), 0, "tst");
558  $md_section = $md_obj->getGeneral();
559 
560  // title
561  $md_section->setTitle(ilUtil::stripSlashes($form->getItemByPostVar('title')->getValue()));
562  $md_section->update();
563 
564  // Description
565  $md_desc_ids = $md_section->getDescriptionIds();
566  if ($md_desc_ids) {
567  $md_desc = $md_section->getDescription(array_pop($md_desc_ids));
568  $md_desc->setDescription(ilUtil::stripSlashes($form->getItemByPostVar('description')->getValue()));
569  $md_desc->update();
570  } else {
571  $md_desc = $md_section->addDescription();
572  $md_desc->setDescription(ilUtil::stripSlashes($form->getItemByPostVar('description')->getValue()));
573  $md_desc->save();
574  }
575 
576  $this->testOBJ->setTitle(ilUtil::stripSlashes($form->getItemByPostVar('title')->getValue()));
577  $this->testOBJ->setDescription(ilUtil::stripSlashes($form->getItemByPostVar('description')->getValue()));
578  $this->testOBJ->update();
579 
580  // pool usage setting
581  if ($form->getItemByPostVar('use_pool') instanceof ilFormPropertyGUI) {
582  $this->testOBJ->setPoolUsage((int) $form->getItemByPostVar('use_pool')->getValue());
583  }
584 
585  if (!$this->testOBJ->participantDataExist()) {
586  // question set type
587  if ($form->getItemByPostVar('question_set_type') instanceof ilFormPropertyGUI) {
588  $this->testOBJ->setQuestionSetType($form->getItemByPostVar('question_set_type')->getValue());
589  }
590  }
591 
592  // anonymity setting
593  if (!$this->testOBJ->participantDataExist() && $this->formPropertyExists($form, 'anonymity')) {
594  $this->testOBJ->setAnonymity($form->getItemByPostVar('anonymity')->getValue());
595  }
596  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
& getGeneral()
Definition: class.ilMD.php:40
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
This class represents a property in a property form.
formPropertyExists(ilPropertyFormGUI $form, $propertyId)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveInstFbHandlingSettings()

ilObjTestSettingsGeneralGUI::saveInstFbHandlingSettings (   $instantFeedbackHandlingValue)
private

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

Referenced by saveQuestionBehaviourProperties().

1460  {
1461  switch ($instantFeedbackHandlingValue) {
1462  case self::INST_FB_HANDLING_OPT_NONE:
1463  $this->testOBJ->setInstantFeedbackAnswerFixationEnabled(false);
1464  $this->testOBJ->setForceInstantFeedbackEnabled(false);
1465  break;
1466 
1467  case self::INST_FB_HANDLING_OPT_FREEZE:
1468  $this->testOBJ->setInstantFeedbackAnswerFixationEnabled(true);
1469  $this->testOBJ->setForceInstantFeedbackEnabled(false);
1470  break;
1471 
1472  case self::INST_FB_HANDLING_OPT_FORCE:
1473  $this->testOBJ->setInstantFeedbackAnswerFixationEnabled(false);
1474  $this->testOBJ->setForceInstantFeedbackEnabled(true);
1475  break;
1476 
1477  case self::INST_FB_HANDLING_OPT_FORCE_AND_FREEZE:
1478  $this->testOBJ->setInstantFeedbackAnswerFixationEnabled(true);
1479  $this->testOBJ->setForceInstantFeedbackEnabled(true);
1480  break;
1481  }
1482  }
+ Here is the caller graph for this function:

◆ saveQuestionBehaviourProperties()

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

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

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

Referenced by performSaveForm().

1191  {
1192  if ($form->getItemByPostVar('title_output') instanceof ilFormPropertyGUI) {
1193  $this->testOBJ->setTitleOutput($form->getItemByPostVar('title_output')->getValue());
1194  }
1195 
1196  if ($form->getItemByPostVar('autosave') instanceof ilFormPropertyGUI) {
1197  $this->testOBJ->setAutosave($form->getItemByPostVar('autosave')->getChecked());
1198  $this->testOBJ->setAutosaveIval($form->getItemByPostVar('autosave_ival')->getValue() * 1000);
1199  }
1200 
1201  if ($form->getItemByPostVar('chb_shuffle_questions') instanceof ilFormPropertyGUI) {
1202  $this->testOBJ->setShuffleQuestions($form->getItemByPostVar('chb_shuffle_questions')->getChecked());
1203  }
1204 
1205  if (!$this->testOBJ->participantDataExist() && $this->formPropertyExists($form, 'offer_hints')) {
1206  $this->testOBJ->setOfferingQuestionHintsEnabled($form->getItemByPostVar('offer_hints')->getChecked());
1207  }
1208 
1209  if ($this->formPropertyExists($form, 'instant_feedback')) {
1210  $this->testOBJ->setScoringFeedbackOptionsByArray($form->getItemByPostVar('instant_feedback')->getValue());
1211  }
1212 
1213  if (!$this->testOBJ->participantDataExist() && $this->formPropertyExists($form, 'instant_feedback_handling')) {
1214  $this->saveInstFbHandlingSettings($form->getItemByPostVar('instant_feedback_handling')->getValue());
1215  }
1216 
1217  if (!$this->testOBJ->participantDataExist() && $this->formPropertyExists($form, 'obligations_enabled')) {
1218  $this->testOBJ->setObligationsEnabled($form->getItemByPostVar('obligations_enabled')->getChecked());
1219  }
1220 
1221  if ($this->isCharSelectorPropertyRequired()) {
1222  require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
1224  $char_selector->addFormProperties($form);
1225  $char_selector->getFormValues($form);
1226  $this->testOBJ->setCharSelectorAvailability($char_selector->getConfig()->getAvailability());
1227  $this->testOBJ->setCharSelectorDefinition($char_selector->getConfig()->getDefinition());
1228  }
1229  }
saveInstFbHandlingSettings($instantFeedbackHandlingValue)
getItemByPostVar($a_post_var)
Get Item by POST variable.
This shows a character selector.
This class represents a property in a property form.
formPropertyExists(ilPropertyFormGUI $form, $propertyId)
+ 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 808 of file class.ilObjTestSettingsGeneralGUI.php.

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

Referenced by performSaveForm().

809  {
810  if (!$this->testOBJ->participantDataExist()) {
811  // starting time
812  $starting_time = $form->getItemByPostVar('starting_time')->getDate();
813  if ($starting_time instanceof ilDateTime) {
814  $this->testOBJ->setStartingTime($starting_time->getUnixtime());
815  $this->testOBJ->setStartingTimeEnabled(true);
816  } else {
817  $this->testOBJ->setStartingTime(null);
818  $this->testOBJ->setStartingTimeEnabled(false);
819  }
820  }
821 
822  // ending time
823  $ending_time = $form->getItemByPostVar('ending_time')->getDate();
824  if ($ending_time instanceof ilDateTime) {
825  $this->testOBJ->setEndingTime($ending_time->getUnixtime());
826  $this->testOBJ->setEndingTimeEnabled(true);
827  } else {
828  $this->testOBJ->setEndingTime(null);
829  $this->testOBJ->setEndingTimeEnabled(false);
830  }
831 
832  if ($this->formPropertyExists($form, 'password_enabled')) {
833  $this->testOBJ->setPasswordEnabled($form->getItemByPostVar('password_enabled')->getChecked());
834 
835  if ($form->getItemByPostVar('password_enabled')->getChecked()) {
836  $this->testOBJ->setPassword($form->getItemByPostVar('password')->getValue());
837  } else {
838  $this->testOBJ->setPassword(''); // otherwise test will still respect value
839  }
840  }
841 
842  if ($this->formPropertyExists($form, 'fixedparticipants') && !$this->testOBJ->participantDataExist()) {
843  $this->testOBJ->setFixedParticipants($form->getItemByPostVar('fixedparticipants')->getChecked());
844  }
845 
846  if ($this->formPropertyExists($form, 'limitUsers')) {
847  $this->testOBJ->setLimitUsersEnabled($form->getItemByPostVar('limitUsers')->getChecked());
848 
849  if ($form->getItemByPostVar('limitUsers')->getChecked()) {
850  $this->testOBJ->setAllowedUsers($form->getItemByPostVar('allowedUsers')->getValue());
851  $this->testOBJ->setAllowedUsersTimeGap($form->getItemByPostVar('allowedUsersTimeGap')->getValue());
852  } else {
853  $this->testOBJ->setAllowedUsers(''); // otherwise test will still respect value
854  }
855  }
856  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
Date and time handling
formPropertyExists(ilPropertyFormGUI $form, $propertyId)
+ 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 1425 of file class.ilObjTestSettingsGeneralGUI.php.

References ilObjAdvancedEditing\_getUsedHTMLTagsAsString(), ilTestSettingsGUI\formPropertyExists(), ilPropertyFormGUI\getItemByPostVar(), and REDIRECT_NONE.

Referenced by performSaveForm().

1426  {
1427  if ($this->formPropertyExists($form, 'enable_examview')) {
1428  $this->testOBJ->setEnableExamview($form->getItemByPostVar('enable_examview')->getChecked());
1429  $this->testOBJ->setShowExamviewPdf($form->getItemByPostVar('show_examview_pdf')->getChecked());
1430  }
1431 
1432  $this->testOBJ->setShowFinalStatement($form->getItemByPostVar('showfinalstatement')->getChecked());
1433  $this->testOBJ->setFinalStatement($form->getItemByPostVar('finalstatement')->getValue(), false, ilObjAdvancedEditing::_getUsedHTMLTagsAsString("assessment"));
1434 
1435  if ($form->getItemByPostVar('redirection_enabled')->getChecked()) {
1436  $this->testOBJ->setRedirectionMode($form->getItemByPostVar('redirection_mode')->getValue());
1437  } else {
1438  $this->testOBJ->setRedirectionMode(REDIRECT_NONE);
1439  }
1440  if (strlen($form->getItemByPostVar('redirection_url')->getValue())) {
1441  $this->testOBJ->setRedirectionUrl($form->getItemByPostVar('redirection_url')->getValue());
1442  } else {
1443  $this->testOBJ->setRedirectionUrl(null);
1444  }
1445 
1446  if ($this->formPropertyExists($form, 'sign_submission')) {
1447  $this->testOBJ->setSignSubmission($form->getItemByPostVar('sign_submission')->getChecked());
1448  }
1449 
1450  if ($this->formPropertyExists($form, 'mailnotification') && $form->getItemByPostVar('mailnotification')->getChecked()) {
1451  $this->testOBJ->setMailNotification($form->getItemByPostVar('mailnotification_content')->getValue());
1452  $this->testOBJ->setMailNotificationType($form->getItemByPostVar('mailnottype')->getChecked());
1453  } else {
1454  $this->testOBJ->setMailNotification(0);
1455  $this->testOBJ->setMailNotificationType(false);
1456  }
1457  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
static _getUsedHTMLTagsAsString($a_module="")
Returns a string of all allowed HTML tags for text editing.
const REDIRECT_NONE
Redirect after finishing test constants.
formPropertyExists(ilPropertyFormGUI $form, $propertyId)
+ 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 704 of file class.ilObjTestSettingsGeneralGUI.php.

References ilObjAdvancedEditing\_getUsedHTMLTagsAsString(), and ilPropertyFormGUI\getItemByPostVar().

Referenced by performSaveForm().

705  {
706  if ($form->getItemByPostVar('intro_enabled') instanceof ilFormPropertyGUI) {
707  $this->testOBJ->setIntroductionEnabled($form->getItemByPostVar('intro_enabled')->getChecked());
708 
709  if ($form->getItemByPostVar('intro_enabled')->getChecked()) {
710  $this->testOBJ->setIntroduction($form->getItemByPostVar('introduction')->getValue(), false, ilObjAdvancedEditing::_getUsedHTMLTagsAsString("assessment"));
711  } else {
712  $this->testOBJ->setIntroduction('');
713  }
714  }
715 
716  if ($form->getItemByPostVar('showinfo') instanceof ilFormPropertyGUI) {
717  $this->testOBJ->setShowInfo($form->getItemByPostVar('showinfo')->getChecked());
718  }
719  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
static _getUsedHTMLTagsAsString($a_module="")
Returns a string of all allowed HTML tags for text editing.
This class represents a property in a property form.
+ 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 981 of file class.ilObjTestSettingsGeneralGUI.php.

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

Referenced by performSaveForm().

982  {
983  if (!$this->testOBJ->participantDataExist()) {
984  // nr of tries (max passes)
985  if ($form->getItemByPostVar('limitPasses') instanceof ilFormPropertyGUI) {
986  if ($form->getItemByPostVar('limitPasses')->getChecked()) {
987  $this->testOBJ->setNrOfTries($form->getItemByPostVar('nr_of_tries')->getValue());
988  } else {
989  $this->testOBJ->setNrOfTries(0);
990  }
991  }
992 
993  // pass_waiting
994  if ($form->getItemByPostVar('pass_waiting_enabled') instanceof ilFormPropertyGUI) {
995  if ($form->getItemByPostVar('pass_waiting_enabled')->getChecked()) {
996  $pass_waiting_values = $form->getItemByPostVar('pass_waiting');
997 
998  $pass_waiting_duration[] = sprintf("%'.02d", $pass_waiting_values->getMonths());
999  $pass_waiting_duration[] = sprintf("%'.03d", $pass_waiting_values->getDays());
1000  $pass_waiting_duration[] = sprintf("%'.02d", $pass_waiting_values->getHours());
1001  $pass_waiting_duration[] = sprintf("%'.02d", $pass_waiting_values->getMinutes());
1002  $pass_waiting_duration[] = sprintf("%'.02d", $pass_waiting_values->getSeconds());
1003 
1004  $pass_waiting_string = implode(':', $pass_waiting_duration);
1005  $this->testOBJ->setPassWaiting($pass_waiting_string);
1006  } else {
1007  $this->testOBJ->setPassWaiting("00:000:00:00:00");
1008  }
1009  }
1010 
1011  $this->testOBJ->setEnableProcessingTime($form->getItemByPostVar('chb_processing_time')->getChecked());
1012  if ($this->testOBJ->getEnableProcessingTime()) {
1013  $this->testOBJ->setProcessingTimeByMinutes($form->getItemByPostVar('processing_time')->getValue());
1014  $this->testOBJ->setResetProcessingTime($form->getItemByPostVar('chb_reset_processing_time')->getChecked());
1015  } else {
1016  $this->testOBJ->setProcessingTime('');
1017  $this->testOBJ->setResetProcessingTime(false);
1018  }
1019  }
1020 
1021  if ($form->getItemByPostVar('kiosk') instanceof ilFormPropertyGUI) {
1022  $this->testOBJ->setKioskMode($form->getInput('kiosk'));
1023  $kioskOptions = $form->getItemByPostVar('kiosk_options')->getValue();
1024  if (is_array($kioskOptions)) {
1025  $this->testOBJ->setShowKioskModeTitle(in_array('kiosk_title', $kioskOptions));
1026  $this->testOBJ->setShowKioskModeParticipant(in_array('kiosk_participant', $kioskOptions));
1027  } else {
1028  $this->testOBJ->setShowKioskModeTitle(false);
1029  $this->testOBJ->setShowKioskModeParticipant(false);
1030  }
1031  }
1032 
1033  if ($form->getItemByPostVar('examid_in_test_pass') instanceof ilFormPropertyGUI) {
1034  $value = $form->getItemByPostVar('examid_in_test_pass')->getChecked();
1035  $this->testOBJ->setShowExamIdInTestPassEnabled($value);
1036  }
1037  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
This class represents a property in a property form.
+ 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 1307 of file class.ilObjTestSettingsGeneralGUI.php.

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

Referenced by performSaveForm().

1308  {
1309  if ($this->formPropertyExists($form, 'chb_use_previous_answers')) {
1310  $this->testOBJ->setUsePreviousAnswers($form->getInput('chb_use_previous_answers'));
1311  }
1312 
1313  if ($this->formPropertyExists($form, 'chb_show_cancel')) {
1314  $this->testOBJ->setShowCancel($form->getItemByPostVar('chb_show_cancel')->getChecked());
1315  }
1316 
1317  if ($this->formPropertyExists($form, 'postpone')) {
1318  $this->testOBJ->setPostponingEnabled((bool) $form->getItemByPostVar('postpone')->getValue());
1319  }
1320 
1321  $this->testOBJ->setListOfQuestions($form->getItemByPostVar('list_of_questions')->getChecked());
1322  $listOfQuestionsOptions = $form->getItemByPostVar('list_of_questions_options')->getValue();
1323  if (is_array($listOfQuestionsOptions)) {
1324  $this->testOBJ->setListOfQuestionsStart(in_array('chb_list_of_questions_start', $listOfQuestionsOptions));
1325  $this->testOBJ->setListOfQuestionsEnd(in_array('chb_list_of_questions_end', $listOfQuestionsOptions));
1326  $this->testOBJ->setListOfQuestionsDescription(in_array('chb_list_of_questions_with_description', $listOfQuestionsOptions));
1327  } else {
1328  $this->testOBJ->setListOfQuestionsStart(0);
1329  $this->testOBJ->setListOfQuestionsEnd(0);
1330  $this->testOBJ->setListOfQuestionsDescription(0);
1331  }
1332 
1333  if ($this->formPropertyExists($form, 'chb_show_marker')) {
1334  $this->testOBJ->setShowMarker($form->getItemByPostVar('chb_show_marker')->getChecked());
1335  }
1336  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
formPropertyExists(ilPropertyFormGUI $form, $propertyId)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showConfirmation()

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

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

Referenced by saveFormCmd().

144  {
145  require_once 'Modules/Test/classes/confirmations/class.ilTestSettingsChangeConfirmationGUI.php';
146  $confirmation = new ilTestSettingsChangeConfirmationGUI($this->lng, $this->testOBJ);
147 
148  $confirmation->setFormAction($this->ctrl->getFormAction($this));
149  $confirmation->setCancel($this->lng->txt('cancel'), self::CMD_SHOW_FORM);
150  $confirmation->setConfirm($this->lng->txt('confirm'), self::CMD_CONFIRMED_SAVE_FORM);
151 
152  $confirmation->setOldQuestionSetType($oldQuestionSetType);
153  $confirmation->setNewQuestionSetType($newQuestionSetType);
154  $confirmation->setQuestionLossInfoEnabled($hasQuestionsWithoutQuestionpool);
155  $confirmation->build();
156 
157  $confirmation->populateParametersFromPropertyForm($form, $this->activeUser->getTimeZone());
158 
159  $this->tpl->setContent($this->ctrl->getHTML($confirmation));
160  }
+ Here is the caller graph for this function:

◆ showFormCmd()

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

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

References $form, buildForm(), and getSettingsTemplateMessageHTML().

Referenced by saveFormCmd().

130  {
131  $this->tpl->addJavascript("./Services/JavaScript/js/Basic.js");
132 
133  if ($form === null) {
134  $form = $this->buildForm();
135  }
136 
137  $formHTML = $this->ctrl->getHTML($form);
138  $msgHTML = $this->getSettingsTemplateMessageHTML();
139 
140  $this->tpl->setContent($formHTML . $msgHTML);
141  }
+ 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 346 of file class.ilObjTestSettingsGeneralGUI.php.

347  {
348  require_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
349  $confirmationGUI = new ilConfirmationGUI();
350 
351  $confirmationGUI->setFormAction($this->ctrl->getFormAction($this));
352  $confirmationGUI->setHeaderText($this->lng->txt("test_confirm_template_reset"));
353  $confirmationGUI->setCancel($this->lng->txt('cancel'), self::CMD_SHOW_FORM);
354  $confirmationGUI->setConfirm($this->lng->txt('confirm'), self::CMD_CONFIRMED_RESET_TPL);
355 
356  $this->tpl->setContent($this->ctrl->getHTML($confirmationGUI));
357  }
Confirmation screen class.

Field Documentation

◆ $access

ilObjTestSettingsGeneralGUI::$access = null
protected

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

Referenced by __construct().

◆ $activeUser

ilObjTestSettingsGeneralGUI::$activeUser = null
protected

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

Referenced by __construct().

◆ $ctrl

ilObjTestSettingsGeneralGUI::$ctrl = null
protected

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

Referenced by __construct().

◆ $db

ilObjTestSettingsGeneralGUI::$db = null
protected

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

Referenced by __construct().

◆ $lng

ilObjTestSettingsGeneralGUI::$lng = null
protected

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

Referenced by __construct().

◆ $pluginAdmin

ilObjTestSettingsGeneralGUI::$pluginAdmin = null
protected

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

Referenced by __construct().

◆ $testGUI

ilObjTestSettingsGeneralGUI::$testGUI = null
protected

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

Referenced by __construct().

◆ $testQuestionSetConfigFactory

ilObjTestSettingsGeneralGUI::$testQuestionSetConfigFactory = null
private

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

◆ $tpl

ilObjTestSettingsGeneralGUI::$tpl = null
protected

◆ $tree

ilObjTestSettingsGeneralGUI::$tree = null
protected

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

Referenced by __construct().

◆ 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.

◆ INST_FB_HANDLING_OPT_FORCE

const ilObjTestSettingsGeneralGUI::INST_FB_HANDLING_OPT_FORCE = 'force'

◆ INST_FB_HANDLING_OPT_FORCE_AND_FREEZE

const ilObjTestSettingsGeneralGUI::INST_FB_HANDLING_OPT_FORCE_AND_FREEZE = 'force_freeze'

◆ INST_FB_HANDLING_OPT_FREEZE

const ilObjTestSettingsGeneralGUI::INST_FB_HANDLING_OPT_FREEZE = 'freeze'

◆ INST_FB_HANDLING_OPT_NONE

const ilObjTestSettingsGeneralGUI::INST_FB_HANDLING_OPT_NONE = 'none'

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