ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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.

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

Member Function Documentation

◆ addAvailabilityProperties()

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

Definition at line 630 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().

631  {
632  include_once "Services/Object/classes/class.ilObjectActivation.php";
633  $this->lng->loadLanguageModule('rep');
634 
636  $section->setTitle($this->lng->txt('rep_activation_availability'));
637  $form->addItem($section);
638 
639  // additional info only with multiple references
640  $act_obj_info = $act_ref_info = "";
641  if (sizeof(ilObject::_getAllReferences($this->testOBJ->getId())) > 1) {
642  $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
643  $act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
644  }
645 
646  $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
647  $online->setChecked($this->testOBJ->isOnline());
648  $online->setInfo($this->lng->txt('tst_activation_online_info') . $act_obj_info);
649  $form->addItem($online);
650 
651  $act_type = new ilCheckboxInputGUI($this->lng->txt('rep_visibility_until'), 'activation_type');
652  $act_type->setChecked($this->testOBJ->isActivationLimited());
653  // $act_type->setInfo($this->lng->txt('tst_availability_until_info'));
654 
655  $this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
656  include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
657  $dur = new ilDateDurationInputGUI($this->lng->txt("rep_time_period"), "access_period");
658  $dur->setShowTime(true);
659  $date = $this->testOBJ->getActivationStartingTime();
660  $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
661  $dur->setStartText($this->lng->txt('rep_activation_limited_start'));
662  $date = $this->testOBJ->getActivationEndingTime();
663  $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
664  $dur->setEndText($this->lng->txt('rep_activation_limited_end'));
665  $act_type->addSubItem($dur);
666 
667  $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'activation_visibility');
668  $visible->setInfo($this->lng->txt('tst_activation_limited_visibility_info'));
669  $visible->setChecked($this->testOBJ->getActivationVisibility());
670  $act_type->addSubItem($visible);
671 
672  $form->addItem($act_type);
673  }
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 497 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().

498  {
500  $header->setTitle($this->lng->txt("tst_general_properties"));
501  $form->addItem($header);
502 
503  // title & description (meta data)
504 
505  include_once 'Services/MetaData/classes/class.ilMD.php';
506  $md_obj = new ilMD($this->testOBJ->getId(), 0, "tst");
507  $md_section = $md_obj->getGeneral();
508 
509  $title = new ilTextInputGUI($this->lng->txt("title"), "title");
510  $title->setRequired(true);
511  $title->setValue($md_section->getTitle());
512  $form->addItem($title);
513 
514  $ids = $md_section->getDescriptionIds();
515  if ($ids) {
516  $desc_obj = $md_section->getDescription(array_pop($ids));
517 
518  $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description");
519  $desc->setCols(50);
520  $desc->setRows(4);
521  $desc->setValue($desc_obj->getDescription());
522  $form->addItem($desc);
523  }
524 
525  // pool usage
526  $pool_usage = new ilRadioGroupInputGUI($this->lng->txt('test_question_pool_usage'), 'use_pool');
527 
528  $optional_qpl = new ilRadioOption($this->lng->txt('test_question_pool_usage_optional'), 1);
529  $optional_qpl->setInfo($this->lng->txt('test_question_pool_usage_optional_info'));
530  $pool_usage->addOption($optional_qpl);
531 
532  $tst_directly = new ilRadioOption($this->lng->txt('test_question_pool_usage_tst_directly'), 0);
533  $tst_directly->setInfo($this->lng->txt('test_question_pool_usage_tst_directly_info'));
534  $pool_usage->addOption($tst_directly);
535 
536  $pool_usage->setValue($this->testOBJ->getPoolUsage() ? 1 : 0);
537  $form->addItem($pool_usage);
538 
539  // test mode (question set type)
540  $questSetType = new ilRadioGroupInputGUI($this->lng->txt("tst_question_set_type"), 'question_set_type');
541  $questSetTypeFixed = new ilRadioOption(
542  $this->lng->txt("tst_question_set_type_fixed"), ilObjTest::QUESTION_SET_TYPE_FIXED,
543  $this->lng->txt("tst_question_set_type_fixed_desc")
544  );
545  $questSetType->addOption($questSetTypeFixed);
546  $questSetTypeRandom = new ilRadioOption(
547  $this->lng->txt("tst_question_set_type_random"), ilObjTest::QUESTION_SET_TYPE_RANDOM,
548  $this->lng->txt("tst_question_set_type_random_desc")
549  );
550  $questSetType->addOption($questSetTypeRandom);
551  $questSetTypeContinues = new ilRadioOption(
552  $this->lng->txt("tst_question_set_type_dynamic"), ilObjTest::QUESTION_SET_TYPE_DYNAMIC,
553  $this->lng->txt("tst_question_set_type_dynamic_desc")
554  );
555  $questSetType->addOption($questSetTypeContinues);
556  $questSetType->setValue($this->testOBJ->getQuestionSetType());
557  if ($this->testOBJ->participantDataExist()) {
558  $questSetType->setDisabled(true);
559  }
560  $form->addItem($questSetType);
561 
562  // anonymity
563  $anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity');
564  if ($this->testOBJ->participantDataExist()) $anonymity->setDisabled(true);
565  $rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0);
566  $anonymity->addOption($rb);
567  $rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1);
568  $anonymity->addOption($rb);
569  $anonymity->setValue((int)$this->testOBJ->getAnonymity());
570  $form->addItem($anonymity);
571  }
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.
$header
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 1118 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().

1119  {
1120  $fields = array(
1121  'title_output', 'autosave', 'chb_shuffle_questions', 'chb_shuffle_questions',
1122  'offer_hints', 'instant_feedback', 'obligations_enabled',
1123  );
1124 
1125  if( $this->isSectionHeaderRequired($fields) || $this->isCharSelectorPropertyRequired() )
1126  {
1127  // sequence properties
1128  $seqheader = new ilFormSectionHeaderGUI();
1129  $seqheader->setTitle($this->lng->txt("tst_presentation_properties"));
1130  $form->addItem($seqheader);
1131  }
1132 
1133  // question title output
1134  $title_output = new ilRadioGroupInputGUI($this->lng->txt("tst_title_output"), "title_output");
1135  $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_full"), 0, ''));
1136  $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_hide_points"), 1, ''));
1137  $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_no_title"), 2, ''));
1138  $title_output->setValue($this->testOBJ->getTitleOutput());
1139  $form->addItem($title_output);
1140 
1141  // Autosave
1142  $autosave_output = new ilCheckboxInputGUI($this->lng->txt('autosave'), 'autosave');
1143  $autosave_output->setValue(1);
1144  $autosave_output->setChecked($this->testOBJ->getAutosave());
1145  $autosave_output->setInfo($this->lng->txt('autosave_info'));
1146  $autosave_interval = new ilTextInputGUI($this->lng->txt('autosave_ival'), 'autosave_ival');
1147  $autosave_interval->setSize(10);
1148  $autosave_interval->setValue($this->testOBJ->getAutosaveIval()/1000);
1149  $autosave_interval->setSuffix($this->lng->txt('seconds'));
1150  $autosave_output->addSubItem($autosave_interval);
1151  $form->addItem($autosave_output);
1152 
1153  // shuffle questions
1154  $shuffle = new ilCheckboxInputGUI($this->lng->txt("tst_shuffle_questions"), "chb_shuffle_questions");
1155  $shuffle->setValue(1);
1156  $shuffle->setChecked($this->testOBJ->getShuffleQuestions());
1157  $shuffle->setInfo($this->lng->txt("tst_shuffle_questions_description"));
1158  $form->addItem($shuffle);
1159 
1160  // offer hints
1161  $checkBoxOfferHints = new ilCheckboxInputGUI($this->lng->txt('tst_setting_offer_hints_label'), 'offer_hints');
1162  $checkBoxOfferHints->setChecked($this->testOBJ->isOfferingQuestionHintsEnabled());
1163  $checkBoxOfferHints->setInfo($this->lng->txt('tst_setting_offer_hints_info'));
1164  if( $this->testOBJ->participantDataExist() )
1165  {
1166  $checkBoxOfferHints->setDisabled(true);
1167  }
1168  $form->addItem($checkBoxOfferHints);
1169 
1170  // instant feedback
1171  $instant_feedback = new ilCheckboxGroupInputGUI($this->lng->txt('tst_instant_feedback'), 'instant_feedback');
1172  $instant_feedback->addOption(new ilCheckboxOption(
1173  $this->lng->txt('tst_instant_feedback_results'), 'instant_feedback_points',
1174  $this->lng->txt('tst_instant_feedback_results_desc')
1175  ));
1176  $instant_feedback->addOption(new ilCheckboxOption(
1177  $this->lng->txt('tst_instant_feedback_answer_generic'), 'instant_feedback_generic',
1178  $this->lng->txt('tst_instant_feedback_answer_generic_desc')
1179  ));
1180  $instant_feedback->addOption(new ilCheckboxOption(
1181  $this->lng->txt('tst_instant_feedback_answer_specific'), 'instant_feedback_specific',
1182  $this->lng->txt('tst_instant_feedback_answer_specific_desc')
1183  ));
1184  $instant_feedback->addOption(new ilCheckboxOption(
1185  $this->lng->txt('tst_instant_feedback_solution'), 'instant_feedback_solution',
1186  $this->lng->txt('tst_instant_feedback_solution_desc')
1187  ));
1188  $values = array();
1189  if ($this->testOBJ->getSpecificAnswerFeedback()) array_push($values, 'instant_feedback_specific');
1190  if ($this->testOBJ->getGenericAnswerFeedback()) array_push($values, 'instant_feedback_generic');
1191  if ($this->testOBJ->getAnswerFeedbackPoints()) array_push($values, 'instant_feedback_points');
1192  if ($this->testOBJ->getInstantFeedbackSolution()) array_push($values, 'instant_feedback_solution');
1193  $instant_feedback->setValue($values);
1194  $form->addItem($instant_feedback);
1195 
1196  $radioGroup = new ilRadioGroupInputGUI(
1197  $this->lng->txt('tst_instant_feedback_handling'), 'instant_feedback_handling'
1198  );
1199  if( $this->testOBJ->participantDataExist() )
1200  {
1201  $radioGroup->setDisabled(true);
1202  }
1203  $radioOption = new ilRadioOption(
1204  $this->lng->txt('tst_instant_feedback_handling_none'),
1205  self::INST_FB_HANDLING_OPT_NONE
1206  );
1207  $radioOption->setInfo($this->lng->txt('tst_instant_feedback_handling_none_desc'));
1208  $radioGroup->addOption($radioOption);
1209  $radioOption = new ilRadioOption(
1210  $this->lng->txt('tst_instant_feedback_handling_freeze'),
1211  self::INST_FB_HANDLING_OPT_FREEZE
1212  );
1213  $radioOption->setInfo($this->lng->txt('tst_instant_feedback_handling_freeze_desc'));
1214  $radioGroup->addOption($radioOption);
1215  $radioOption = new ilRadioOption(
1216  $this->lng->txt('tst_instant_feedback_handling_force_and_freeze'),
1217  self::INST_FB_HANDLING_OPT_FORCE_AND_FREEZE
1218  );
1219  $radioOption->setInfo($this->lng->txt('tst_instant_feedback_handling_force_and_freeze_desc'));
1220  $radioGroup->addOption($radioOption);
1221  $radioOption = new ilRadioOption(
1222  $this->lng->txt('tst_instant_feedback_handling_force'),
1223  self::INST_FB_HANDLING_OPT_FORCE
1224  );
1225  $radioOption->setInfo($this->lng->txt('tst_instant_feedback_handling_force_desc'));
1226  $radioGroup->addOption($radioOption);
1227  $radioGroup->setValue($this->getInstFbHandlingValue(
1228  $this->testOBJ->isInstantFeedbackAnswerFixationEnabled(),
1229  $this->testOBJ->isForceInstantFeedbackEnabled()
1230  ));
1231  $form->addItem($radioGroup);
1232 
1233  // enable obligations
1234  $checkBoxEnableObligations = new ilCheckboxInputGUI($this->lng->txt('tst_setting_enable_obligations_label'), 'obligations_enabled');
1235  $checkBoxEnableObligations->setChecked($this->testOBJ->areObligationsEnabled());
1236  $checkBoxEnableObligations->setInfo($this->lng->txt('tst_setting_enable_obligations_info'));
1237  if( $this->testOBJ->participantDataExist() )
1238  {
1239  $checkBoxEnableObligations->setDisabled(true);
1240  }
1241  $form->addItem($checkBoxEnableObligations);
1242 
1243  // selector for unicode characters
1244  if( $this->isCharSelectorPropertyRequired() )
1245  {
1246  require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
1248  $char_selector->getConfig()->setAvailability($this->testOBJ->getCharSelectorAvailability());
1249  $char_selector->getConfig()->setDefinition($this->testOBJ->getCharSelectorDefinition());
1250  $char_selector->addFormProperties($form);
1251  $char_selector->setFormValues($form);
1252  }
1253  }
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 761 of file class.ilObjTestSettingsGeneralGUI.php.

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

Referenced by buildForm().

762  {
764  $header->setTitle($this->lng->txt("tst_settings_header_execution"));
765  $form->addItem($header);
766 
767  // starting time
768  $startingtime = new ilDateTimeInputGUI($this->lng->txt("tst_starting_time"), 'starting_time');
769  $startingtime->setInfo($this->lng->txt("tst_starting_time_desc"));
770  $startingtime->setShowTime(true);
771  if( $this->testOBJ->getStartingTime() != 0 )
772  {
773  $startingtime->setDate(new ilDateTime($this->testOBJ->getStartingTime(), IL_CAL_UNIX));
774  }
775  else
776  {
777  $startingtime->setDate(null);
778  }
779 
780  $form->addItem($startingtime);
781  if ($this->testOBJ->participantDataExist())
782  {
783  $startingtime->setDisabled(true);
784  }
785 
786  // ending time
787  $endingtime = new ilDateTimeInputGUI($this->lng->txt("tst_ending_time"), 'ending_time');
788  $endingtime->setInfo($this->lng->txt("tst_ending_time_desc"));
789  $endingtime->setShowTime(true);
790  if ($this->testOBJ->getEndingTime() != 0)
791  {
792  $endingtime->setDate(new ilDateTime($this->testOBJ->getEndingTime(), IL_CAL_UNIX));
793  }
794  else
795  {
796  $endingtime->setDate(null);
797  }
798  $form->addItem($endingtime);
799 
800  // test password
801  $pwEnabled = new ilCheckboxInputGUI($this->lng->txt('tst_password'), 'password_enabled');
802  $pwEnabled->setChecked($this->testOBJ->isPasswordEnabled());
803  $pwEnabled->setInfo($this->lng->txt("tst_password_details"));
804  $password = new ilTextInputGUI($this->lng->txt("tst_password_enter"), "password");
805  $password->setRequired(true);
806  $password->setSize(20);
807  $password->setMaxLength(20);
808  $password->setValue($this->testOBJ->getPassword());
809  $pwEnabled->addSubItem($password);
810  $form->addItem($pwEnabled);
811 
812  // fixed participants
813  $fixedparticipants = new ilCheckboxInputGUI($this->lng->txt('participants_invitation'), "fixedparticipants");
814  $fixedparticipants->setValue(1);
815  $fixedparticipants->setChecked($this->testOBJ->getFixedParticipants());
816  $fixedparticipants->setInfo($this->lng->txt("participants_invitation_description"));
817  if ($this->testOBJ->participantDataExist())
818  {
819  $fixedparticipants->setDisabled(true);
820  }
821  $form->addItem($fixedparticipants);
822 
823  // simultaneous users
824  $simulLimited = new ilCheckboxInputGUI($this->lng->txt("tst_allowed_users"), 'limitUsers');
825  $simulLimited->setInfo($this->lng->txt("tst_allowed_users_desc"));
826  $simulLimited->setChecked($this->testOBJ->isLimitUsersEnabled());
827 
828  // allowed simultaneous users
829  $simul = new ilNumberInputGUI($this->lng->txt("tst_allowed_users_max"), "allowedUsers");
830  $simul->setRequired(true);
831  $simul->allowDecimals(false);
832  $simul->setMinValue(1);
833  $simul->setMinvalueShouldBeGreater(false);
834  $simul->setSize(4);
835  $simul->setValue(($this->testOBJ->getAllowedUsers()) ? $this->testOBJ->getAllowedUsers() : '');
836  $simulLimited->addSubItem($simul);
837 
838  // idle time
839  $idle = new ilNumberInputGUI($this->lng->txt("tst_allowed_users_time_gap"), "allowedUsersTimeGap");
840  $idle->setInfo($this->lng->txt("tst_allowed_users_time_gap_desc"));
841  $idle->setSize(4);
842  $idle->setSuffix($this->lng->txt("seconds"));
843  $idle->setValue(($this->testOBJ->getAllowedUsersTimeGap()) ? $this->testOBJ->getAllowedUsersTimeGap() : 300);
844  $simulLimited->addSubItem($idle);
845 
846  $form->addItem($simulLimited);
847  return $header;
848  }
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.
$header
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 1414 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().

1415  {
1416  $testFinishHeader = new ilFormSectionHeaderGUI();
1417  $testFinishHeader->setTitle($this->lng->txt("tst_final_information"));
1418  $form->addItem($testFinishHeader);
1419 
1420  // examview
1421  $enable_examview = new ilCheckboxInputGUI($this->lng->txt("enable_examview"), 'enable_examview');
1422  $enable_examview->setValue(1);
1423  $enable_examview->setChecked($this->testOBJ->getEnableExamview());
1424  $enable_examview->setInfo($this->lng->txt("enable_examview_desc"));
1425  $show_examview_pdf = new ilCheckboxInputGUI('', 'show_examview_pdf');
1426  $show_examview_pdf->setValue(1);
1427  $show_examview_pdf->setChecked($this->testOBJ->getShowExamviewPdf());
1428  $show_examview_pdf->setOptionTitle($this->lng->txt("show_examview_pdf"));
1429  $enable_examview->addSubItem($show_examview_pdf);
1430  $form->addItem($enable_examview);
1431 
1432  // show final statement
1433  $showfinal = new ilCheckboxInputGUI($this->lng->txt("final_statement"), "showfinalstatement");
1434  $showfinal->setChecked($this->testOBJ->getShowFinalStatement());
1435  $showfinal->setInfo($this->lng->txt("final_statement_show_desc"));
1436  $form->addItem($showfinal);
1437  // final statement
1438  $finalstatement = new ilTextAreaInputGUI($this->lng->txt("final_statement"), "finalstatement");
1439  $finalstatement->setRequired(true);
1440  $finalstatement->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getFinalStatement(), false, true));
1441  $finalstatement->setRows(10);
1442  $finalstatement->setCols(80);
1443  $finalstatement->setUseRte(TRUE);
1444  $finalstatement->addPlugin("latex");
1445  $finalstatement->addButton("latex");
1446  $finalstatement->setRTESupport($this->testOBJ->getId(), "tst", "assessment");
1447  $finalstatement->setRteTagSet('full');
1448  $showfinal->addSubItem($finalstatement);
1449 
1450  $redirection_mode = $this->testOBJ->getRedirectionMode();
1451  $rm_enabled = new ilCheckboxInputGUI($this->lng->txt('redirect_after_finishing_tst'), 'redirection_enabled');
1452  $rm_enabled->setInfo($this->lng->txt('redirect_after_finishing_tst_desc'));
1453  $rm_enabled->setChecked($redirection_mode == '0' ? false : true);
1454  $radio_rm = new ilRadioGroupInputGUI($this->lng->txt('redirect_after_finishing_rule'), 'redirection_mode');
1455  $always = new ilRadioOption($this->lng->txt('redirect_always'), REDIRECT_ALWAYS);
1456  $radio_rm->addOption($always);
1457  $kiosk = new ilRadioOption($this->lng->txt('redirect_in_kiosk_mode'), REDIRECT_KIOSK);
1458  $radio_rm->addOption($kiosk);
1459  $radio_rm->setValue(in_array($redirection_mode, array(REDIRECT_ALWAYS, REDIRECT_KIOSK)) ? $redirection_mode : REDIRECT_ALWAYS);
1460  $rm_enabled->addSubItem($radio_rm);
1461  $redirection_url = new ilTextInputGUI($this->lng->txt('redirection_url'), 'redirection_url');
1462  $redirection_url->setValue((string)$this->testOBJ->getRedirectionUrl());
1463  $redirection_url->setRequired(true);
1464  $rm_enabled->addSubItem($redirection_url);
1465 
1466  $form->addItem($rm_enabled);
1467 
1468  // Sign submission
1469  $sign_submission = $this->testOBJ->getSignSubmission();
1470  $sign_submission_enabled = new ilCheckboxInputGUI($this->lng->txt('sign_submission'), 'sign_submission');
1471  $sign_submission_enabled->setChecked($sign_submission);
1472  $sign_submission_enabled->setInfo($this->lng->txt('sign_submission_info'));
1473  $form->addItem($sign_submission_enabled);
1474 
1475  // mail notification
1476  $mailnotification = new ilCheckboxInputGUI($this->lng->txt("tst_finish_notification"), "mailnotification");
1477  $mailnotification->setInfo($this->lng->txt("tst_finish_notification_desc"));
1478  $mailnotification->setChecked($this->testOBJ->getMailNotification() > 0);
1479  $form->addItem($mailnotification);
1480 
1481  $mailnotificationContent = new ilRadioGroupInputGUI($this->lng->txt("tst_finish_notification_content"), "mailnotification_content");
1482  $mailnotificationContent->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_simple"), 1, ''));
1483  $mailnotificationContent->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_advanced"), 2, ''));
1484  $mailnotificationContent->setValue($this->testOBJ->getMailNotification() ? $this->testOBJ->getMailNotification() : 1);
1485  $mailnotificationContent->setRequired(true);
1486  $mailnotification->addSubItem($mailnotificationContent);
1487 
1488  $mailnottype = new ilCheckboxInputGUI('', "mailnottype");
1489  $mailnottype->setValue(1);
1490  $mailnottype->setOptionTitle($this->lng->txt("mailnottype"));
1491  $mailnottype->setChecked($this->testOBJ->getMailNotificationType());
1492  $mailnotification->addSubItem($mailnottype);
1493  }
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 702 of file class.ilObjTestSettingsGeneralGUI.php.

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

Referenced by buildForm().

703  {
705  $section->setTitle($this->lng->txt('tst_settings_header_intro'));
706  $form->addItem($section);
707 
708  // introduction
709  $introEnabled = new ilCheckboxInputGUI($this->lng->txt("tst_introduction"), 'intro_enabled');
710  $introEnabled->setChecked($this->testOBJ->isIntroductionEnabled());
711  $introEnabled->setInfo($this->lng->txt('tst_introduction_desc'));
712  $form->addItem($introEnabled);
713  $intro = new ilTextAreaInputGUI($this->lng->txt("tst_introduction_text"), "introduction");
714  $intro->setRequired(true);
715  $intro->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getIntroduction(), false, true));
716  $intro->setRows(10);
717  $intro->setCols(80);
718  $intro->setUseRte(TRUE);
719  $intro->addPlugin("latex");
720  $intro->addButton("latex");
721  $intro->setRTESupport($this->testOBJ->getId(), "tst", "assessment");
722  $intro->setRteTagSet('full');
723  $introEnabled->addSubItem($intro);
724 
725  // showinfo
726  $showinfo = new ilCheckboxInputGUI($this->lng->txt("showinfo"), "showinfo");
727  $showinfo->setValue(1);
728  $showinfo->setChecked($this->testOBJ->getShowInfo());
729  $showinfo->setInfo($this->lng->txt("showinfo_desc"));
730  $form->addItem($showinfo);
731  }
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 922 of file class.ilObjTestSettingsGeneralGUI.php.

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

Referenced by buildForm().

923  {
924  // section header test run
926  $header->setTitle($this->lng->txt("tst_settings_header_test_run"));
927  $form->addItem($header);
928 
929  // max. number of passes
930  $limitPasses = new ilCheckboxInputGUI($this->lng->txt("tst_limit_nr_of_tries"), 'limitPasses');
931  $limitPasses->setInfo($this->lng->txt("tst_nr_of_tries_desc"));
932  $limitPasses->setChecked($this->testOBJ->getNrOfTries() > 0);
933  $nr_of_tries = new ilNumberInputGUI($this->lng->txt("tst_nr_of_tries"), "nr_of_tries");
934  $nr_of_tries->setSize(3);
935  $nr_of_tries->allowDecimals(false);
936  $nr_of_tries->setMinValue(1);
937  $nr_of_tries->setMinvalueShouldBeGreater(false);
938  $nr_of_tries->setValue($this->testOBJ->getNrOfTries() ? $this->testOBJ->getNrOfTries() : 1);
939  $nr_of_tries->setRequired(true);
940  if( $this->testOBJ->participantDataExist() )
941  {
942  $limitPasses->setDisabled(true);
943  $nr_of_tries->setDisabled(true);
944  }
945  $limitPasses->addSubItem($nr_of_tries);
946  $form->addItem($limitPasses);
947 
948  // pass_waiting time between testruns
949  $pass_waiting_enabled = new ilCheckboxInputGUI($this->lng->txt('tst_pass_waiting_enabled'), 'pass_waiting_enabled');
950  $pass_waiting_enabled->setInfo($this->lng->txt('tst_pass_waiting_info'));
951  $pass_waiting_enabled->setChecked($this->testOBJ->isPassWaitingEnabled());
952 
953  // pass_waiting
954  $duration = new ilDurationInputGUI($this->lng->txt("tst_pass_waiting_time"), "pass_waiting");
955 
956  $duration->setShowMonths(TRUE);
957  $duration->setShowDays(TRUE);
958  $duration->setShowHours(TRUE);
959  $duration->setShowMinutes(TRUE);
960 
961  $pw_time_array = explode(':', $this->testOBJ->getPassWaiting());
962  $duration->setMonths($pw_time_array[0]);
963  $duration->setDays($pw_time_array[1]);
964  $duration->setHours($pw_time_array[2]);
965  $duration->setMinutes($pw_time_array[3]);
966  $duration->setRequired(FALSE);
967  $pass_waiting_enabled->addSubItem($duration);
968 
969  $form->addItem($pass_waiting_enabled);
970 
971  // enable max. processing time
972  $processing = new ilCheckboxInputGUI($this->lng->txt("tst_processing_time"), "chb_processing_time");
973  $processing->setInfo($this->lng->txt("tst_processing_time_desc"));
974  $processing->setValue(1);
975 
976  if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_processing_time')) {
977  $processing->setChecked(true);
978  } else {
979  $processing->setChecked($this->testOBJ->getEnableProcessingTime());
980  }
981 
982  // max. processing time
983  $processingtime = new ilNumberInputGUI($this->lng->txt("tst_processing_time_duration"), 'processing_time');
984  $processingtime->allowDecimals(false);
985  $processingtime->setMinValue(1);
986  $processingtime->setMinvalueShouldBeGreater(false);
987  $processingtime->setValue($this->testOBJ->getProcessingTimeAsMinutes());
988  $processingtime->setSize(5);
989  $processingtime->setSuffix($this->lng->txt('minutes'));
990  $processingtime->setInfo($this->lng->txt("tst_processing_time_duration_desc"));
991  $processing->addSubItem($processingtime);
992 
993  // reset max. processing time
994  $resetprocessing = new ilCheckboxInputGUI('', "chb_reset_processing_time");
995  $resetprocessing->setValue(1);
996  $resetprocessing->setOptionTitle($this->lng->txt("tst_reset_processing_time"));
997  $resetprocessing->setChecked($this->testOBJ->getResetProcessingTime());
998  $resetprocessing->setInfo($this->lng->txt("tst_reset_processing_time_desc"));
999  $processing->addSubItem($resetprocessing);
1000  $form->addItem($processing);
1001 
1002  if( $this->testOBJ->participantDataExist() )
1003  {
1004  $processing->setDisabled(true);
1005  $processingtime->setDisabled(true);
1006  $resetprocessing->setDisabled(true);
1007 
1008  $duration->setDisabled(true);
1009  $pass_waiting_enabled->setDisabled(true);
1010  }
1011 
1012  // kiosk mode
1013  $kiosk = new ilCheckboxInputGUI($this->lng->txt("kiosk"), "kiosk");
1014  $kiosk->setValue(1);
1015  $kiosk->setChecked($this->testOBJ->getKioskMode());
1016  $kiosk->setInfo($this->lng->txt("kiosk_description"));
1017 
1018  // kiosk mode options
1019  $kiosktitle = new ilCheckboxGroupInputGUI($this->lng->txt("kiosk_options"), "kiosk_options");
1020  $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_title"), 'kiosk_title', ''));
1021  $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_participant"), 'kiosk_participant', ''));
1022  $values = array();
1023  if ($this->testOBJ->getShowKioskModeTitle()) array_push($values, 'kiosk_title');
1024  if ($this->testOBJ->getShowKioskModeParticipant()) array_push($values, 'kiosk_participant');
1025  $kiosktitle->setValue($values);
1026  $kiosktitle->setInfo($this->lng->txt("kiosk_options_desc"));
1027  $kiosk->addSubItem($kiosktitle);
1028 
1029  $form->addItem($kiosk);
1030 
1031  $examIdInPass = new ilCheckboxInputGUI($this->lng->txt('examid_in_test_pass'), 'examid_in_test_pass');
1032  $examIdInPass->setInfo($this->lng->txt('examid_in_test_pass_desc'));
1033  $examIdInPass->setChecked($this->testOBJ->isShowExamIdInTestPassEnabled());
1034  $form->addItem($examIdInPass);
1035  }
This class represents a duration (typical hh:mm:ss) property in a property form.
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).
allowDecimals($a_value)
Toggle Decimals.
setInfo($a_info)
Set Information Text.
$header
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 1310 of file class.ilObjTestSettingsGeneralGUI.php.

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

Referenced by buildForm().

1311  {
1312  // sequence properties
1313  $seqheader = new ilFormSectionHeaderGUI();
1314  $seqheader->setTitle($this->lng->txt("tst_sequence_properties"));
1315  $form->addItem($seqheader);
1316 
1317  // use previous answers
1318  $prevanswers = new ilCheckboxInputGUI($this->lng->txt("tst_use_previous_answers"), "chb_use_previous_answers");
1319  $prevanswers->setValue(1);
1320  $prevanswers->setChecked($this->testOBJ->getUsePreviousAnswers());
1321  $prevanswers->setInfo($this->lng->txt("tst_use_previous_answers_description"));
1322  $form->addItem($prevanswers);
1323 
1324  // show suspend test
1325  $cancel = new ilCheckboxInputGUI($this->lng->txt("tst_show_cancel"), "chb_show_cancel");
1326  $cancel->setValue(1);
1327  $cancel->setChecked($this->testOBJ->getShowCancel());
1328  $cancel->setInfo($this->lng->txt("tst_show_cancel_description"));
1329  $form->addItem($cancel);
1330 
1331  // postpone questions
1332  $postpone = new ilRadioGroupInputGUI($this->lng->txt("tst_postpone"), "postpone");
1333  $postpone->addOption(new ilRadioOption(
1334  $this->lng->txt("tst_postpone_off"), 0, $this->lng->txt("tst_postpone_off_desc")
1335  ));
1336  $postpone->addOption(new ilRadioOption(
1337  $this->lng->txt("tst_postpone_on"), 1, $this->lng->txt("tst_postpone_on_desc")
1338  ));
1339  $postpone->setValue((int)$this->testOBJ->getSequenceSettings());
1340  $form->addItem($postpone);
1341 
1342  // show list of questions
1343  $list_of_questions = new ilCheckboxInputGUI($this->lng->txt("tst_show_summary"), "list_of_questions");
1344  //$list_of_questions->setOptionTitle($this->lng->txt("tst_show_summary"));
1345  $list_of_questions->setValue(1);
1346  $list_of_questions->setChecked($this->testOBJ->getListOfQuestions());
1347  $list_of_questions->setInfo($this->lng->txt("tst_show_summary_description"));
1348 
1349  $list_of_questions_options = new ilCheckboxGroupInputGUI('', "list_of_questions_options");
1350  $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_start"), 'chb_list_of_questions_start', ''));
1351  $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_end"), 'chb_list_of_questions_end', ''));
1352  $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_with_description"), 'chb_list_of_questions_with_description', ''));
1353  $values = array();
1354  if ($this->testOBJ->getListOfQuestionsStart()) array_push($values, 'chb_list_of_questions_start');
1355  if ($this->testOBJ->getListOfQuestionsEnd()) array_push($values, 'chb_list_of_questions_end');
1356  if ($this->testOBJ->getListOfQuestionsDescription()) array_push($values, 'chb_list_of_questions_with_description');
1357  $list_of_questions_options->setValue($values);
1358 
1359  $list_of_questions->addSubItem($list_of_questions_options);
1360  $form->addItem($list_of_questions);
1361 
1362  // show question marking
1363  $marking = new ilCheckboxInputGUI($this->lng->txt("question_marking"), "chb_show_marker");
1364  $marking->setValue(1);
1365  $marking->setChecked($this->testOBJ->getShowMarker());
1366  $marking->setInfo($this->lng->txt("question_marking_description"));
1367  $form->addItem($marking);
1368  }
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 422 of file class.ilObjTestSettingsGeneralGUI.php.

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

Referenced by saveFormCmd(), and showFormCmd().

423  {
424  require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
425  $form = new ilPropertyFormGUI();
426  $form->setFormAction($this->ctrl->getFormAction($this));
427  $form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt("save"));
428  $form->setTableWidth("100%");
429  $form->setId("test_properties");
430 
431  $this->addGeneralProperties($form);
432  $this->addAvailabilityProperties($form);
433  $this->addTestIntroProperties($form);
434  $this->addTestAccessProperties($form);
435  $this->addTestRunProperties($form);
436  $this->addQuestionBehaviourProperties($form);
437  $this->addTestSequenceProperties($form);
438  $this->addTestFinishProperties($form);
439 
440  // Edit ecs export settings
441  include_once 'Modules/Test/classes/class.ilECSTestSettings.php';
442  $ecs = new ilECSTestSettings($this->testOBJ);
443  $ecs->addSettingsToForm($form, 'tst');
444 
445  // skill service activation for FIXED tests only
447  {
448  $otherHead = new ilFormSectionHeaderGUI();
449  $otherHead->setTitle($this->lng->txt('other'));
450  $form->addItem($otherHead);
451 
452  $skillService = new ilCheckboxInputGUI($this->lng->txt('tst_activate_skill_service'), 'skill_service');
453  $skillService->setInfo($this->lng->txt('tst_activate_skill_service_desc'));
454  $skillService->setChecked($this->testOBJ->isSkillServiceEnabled());
455  if($this->testOBJ->participantDataExist()) $skillService->setDisabled(true);
456  $form->addItem($skillService);
457  }
458 
459  // remove items when using template
460  $this->removeHiddenItems($form);
461 
462  return $form;
463  }
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)
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 385 of file class.ilObjTestSettingsGeneralGUI.php.

References ilUtil\sendSuccess().

386  {
387  $this->testOBJ->setTemplate(null);
388  $this->testOBJ->saveToDB();
389 
390  ilUtil::sendSuccess($this->lng->txt("test_template_reset"), true);
391  $this->ctrl->redirect($this, self::CMD_SHOW_FORM);
392  }
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 196 of file class.ilObjTestSettingsGeneralGUI.php.

References saveFormCmd().

197  {
198  return $this->saveFormCmd(true);
199  }
+ Here is the call graph for this function:

◆ executeCommand()

ilObjTestSettingsGeneralGUI::executeCommand ( )

Command Execution.

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

References $cmd, and ilUtil\sendInfo().

111  {
112  // allow only write access
113 
114  if (!$this->access->checkAccess("write", "", $this->testGUI->ref_id))
115  {
116  ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
117  $this->ctrl->redirect($this->testGUI, "infoScreen");
118  }
119 
120  // process command
121 
122  $nextClass = $this->ctrl->getNextClass();
123 
124  switch($nextClass)
125  {
126  default:
127  $cmd = $this->ctrl->getCmd(self::CMD_SHOW_FORM).'Cmd';
128  $this->$cmd();
129  }
130  }
$cmd
Definition: sahs_server.php:35
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 1569 of file class.ilObjTestSettingsGeneralGUI.php.

Referenced by addQuestionBehaviourProperties().

1570  {
1571  switch( true )
1572  {
1573  case !$freezeAnswersEnabled && !$forceInstFbEnabled: return self::INST_FB_HANDLING_OPT_NONE;
1574  case $freezeAnswersEnabled && !$forceInstFbEnabled: return self::INST_FB_HANDLING_OPT_FREEZE;
1575  case !$freezeAnswersEnabled && $forceInstFbEnabled: return self::INST_FB_HANDLING_OPT_FORCE;
1576  case $freezeAnswersEnabled && $forceInstFbEnabled: return self::INST_FB_HANDLING_OPT_FORCE_AND_FREEZE;
1577  }
1578  }
+ Here is the caller graph for this function:

◆ getSettingsTemplateMessageHTML()

ilObjTestSettingsGeneralGUI::getSettingsTemplateMessageHTML ( )
protected

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

References $title, and $tpl.

Referenced by showFormCmd().

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

◆ isCharSelectorPropertyRequired()

ilObjTestSettingsGeneralGUI::isCharSelectorPropertyRequired ( )
private

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

References $ilSetting.

Referenced by addQuestionBehaviourProperties(), and saveQuestionBehaviourProperties().

415  {
416  global $ilSetting;
417 
418  return $ilSetting->get('char_selector_availability') > 0;
419  }
global $ilSetting
Definition: privfeed.php:17
+ Here is the caller graph for this function:

◆ isSkillServiceSettingToBeAdjusted()

ilObjTestSettingsGeneralGUI::isSkillServiceSettingToBeAdjusted ( ilPropertyFormGUI  $form)
private

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

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

395  {
396  if( !($form->getItemByPostVar('skill_service') instanceof ilFormPropertyGUI) )
397  {
398  return false;
399  }
400 
402  {
403  return false;
404  }
405 
406  if( !$form->getItemByPostVar('skill_service')->getChecked() )
407  {
408  return false;
409  }
410 
411  return true;
412  }
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 465 of file class.ilObjTestSettingsGeneralGUI.php.

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

Referenced by saveFormCmd().

466  {
467  $this->saveGeneralProperties($form);
468  $this->saveAvailabilityProperties($form);
469  $this->saveTestIntroProperties($form);
470  $this->saveTestAccessProperties($form);
471  $this->saveTestRunProperties($form);
472  $this->saveQuestionBehaviourProperties($form);
473  $this->saveTestSequenceSettings($form);
474  $this->saveTestFinishProperties($form);
475 
476  if( !$this->testOBJ->participantDataExist() )
477  {
478  // skill service
479  if( ilObjTest::isSkillManagementGloballyActivated() && $form->getItemByPostVar('skill_service') instanceof ilFormPropertyGUI )
480  {
481  $this->testOBJ->setSkillServiceEnabled($form->getItemByPostVar('skill_service')->getChecked());
482  }
483  }
484 
485  // store settings to db
486  $this->testOBJ->saveToDb(true);
487 
488  // Update ecs export settings
489  include_once 'Modules/Test/classes/class.ilECSTestSettings.php';
490  $ecs = new ilECSTestSettings($this->testOBJ);
491  $ecs->handleSettingsUpdate();
492  }
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 678 of file class.ilObjTestSettingsGeneralGUI.php.

References ilPropertyFormGUI\getItemByPostVar(), and IL_CAL_UNIX.

Referenced by performSaveForm().

679  {
680  // online status
681  $this->testOBJ->setOnline($form->getItemByPostVar('online')->getChecked());
682 
683  // activation
684  if ($form->getItemByPostVar('activation_type')->getChecked())
685  {
686  $this->testOBJ->setActivationLimited(true);
687  $this->testOBJ->setActivationVisibility($form->getItemByPostVar('activation_visibility')->getChecked());
688 
689  $period = $form->getItemByPostVar("access_period");
690  $this->testOBJ->setActivationStartingTime($period->getStart()->get(IL_CAL_UNIX));
691  $this->testOBJ->setActivationEndingTime($period->getEnd()->get(IL_CAL_UNIX));
692  }
693  else
694  {
695  $this->testOBJ->setActivationLimited(false);
696  }
697  }
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 201 of file class.ilObjTestSettingsGeneralGUI.php.

References $errors, 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().

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

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

Referenced by performSaveForm().

577  {
578  include_once 'Services/MetaData/classes/class.ilMD.php';
579  $md_obj = new ilMD($this->testOBJ->getId(), 0, "tst");
580  $md_section = $md_obj->getGeneral();
581 
582  // title
583  $md_section->setTitle(ilUtil::stripSlashes($form->getItemByPostVar('title')->getValue()));
584  $md_section->update();
585 
586  // Description
587  $md_desc_ids = $md_section->getDescriptionIds();
588  if ($md_desc_ids)
589  {
590  $md_desc = $md_section->getDescription(array_pop($md_desc_ids));
591  $md_desc->setDescription(ilUtil::stripSlashes($form->getItemByPostVar('description')->getValue()));
592  $md_desc->update();
593  }
594  else
595  {
596  $md_desc = $md_section->addDescription();
597  $md_desc->setDescription(ilUtil::stripSlashes($form->getItemByPostVar('description')->getValue()));
598  $md_desc->save();
599  }
600 
601  $this->testOBJ->setTitle(ilUtil::stripSlashes($form->getItemByPostVar('title')->getValue()));
602  $this->testOBJ->setDescription(ilUtil::stripSlashes($form->getItemByPostVar('description')->getValue()));
603  $this->testOBJ->update();
604 
605  // pool usage setting
606  if ($form->getItemByPostVar('use_pool') instanceof ilFormPropertyGUI)
607  {
608  $this->testOBJ->setPoolUsage((int)$form->getItemByPostVar('use_pool')->getValue());
609  }
610 
611  if (!$this->testOBJ->participantDataExist())
612  {
613  // question set type
614  if ($form->getItemByPostVar('question_set_type') instanceof ilFormPropertyGUI)
615  {
616  $this->testOBJ->setQuestionSetType($form->getItemByPostVar('question_set_type')->getValue());
617  }
618  }
619 
620  // anonymity setting
621  if( !$this->testOBJ->participantDataExist() && $this->formPropertyExists($form, 'anonymity') )
622  {
623  $this->testOBJ->setAnonymity($form->getItemByPostVar('anonymity')->getValue());
624  }
625  }
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 1543 of file class.ilObjTestSettingsGeneralGUI.php.

Referenced by saveQuestionBehaviourProperties().

1544  {
1545  switch($instantFeedbackHandlingValue)
1546  {
1547  case self::INST_FB_HANDLING_OPT_NONE:
1548  $this->testOBJ->setInstantFeedbackAnswerFixationEnabled(false);
1549  $this->testOBJ->setForceInstantFeedbackEnabled(false);
1550  break;
1551 
1552  case self::INST_FB_HANDLING_OPT_FREEZE:
1553  $this->testOBJ->setInstantFeedbackAnswerFixationEnabled(true);
1554  $this->testOBJ->setForceInstantFeedbackEnabled(false);
1555  break;
1556 
1557  case self::INST_FB_HANDLING_OPT_FORCE:
1558  $this->testOBJ->setInstantFeedbackAnswerFixationEnabled(false);
1559  $this->testOBJ->setForceInstantFeedbackEnabled(true);
1560  break;
1561 
1562  case self::INST_FB_HANDLING_OPT_FORCE_AND_FREEZE:
1563  $this->testOBJ->setInstantFeedbackAnswerFixationEnabled(true);
1564  $this->testOBJ->setForceInstantFeedbackEnabled(true);
1565  break;
1566  }
1567  }
+ Here is the caller graph for this function:

◆ saveQuestionBehaviourProperties()

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

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

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

Referenced by performSaveForm().

1259  {
1260  if ($form->getItemByPostVar('title_output') instanceof ilFormPropertyGUI)
1261  {
1262  $this->testOBJ->setTitleOutput($form->getItemByPostVar('title_output')->getValue());
1263  }
1264 
1265  if ($form->getItemByPostVar('autosave') instanceof ilFormPropertyGUI)
1266  {
1267  $this->testOBJ->setAutosave($form->getItemByPostVar('autosave')->getChecked());
1268  $this->testOBJ->setAutosaveIval($form->getItemByPostVar('autosave_ival')->getValue() * 1000);
1269  }
1270 
1271  if ($form->getItemByPostVar('chb_shuffle_questions') instanceof ilFormPropertyGUI)
1272  {
1273  $this->testOBJ->setShuffleQuestions($form->getItemByPostVar('chb_shuffle_questions')->getChecked());
1274  }
1275 
1276  if (!$this->testOBJ->participantDataExist() && $this->formPropertyExists($form, 'offer_hints'))
1277  {
1278  $this->testOBJ->setOfferingQuestionHintsEnabled($form->getItemByPostVar('offer_hints')->getChecked());
1279  }
1280 
1281  if ($this->formPropertyExists($form, 'instant_feedback'))
1282  {
1283  $this->testOBJ->setScoringFeedbackOptionsByArray($form->getItemByPostVar('instant_feedback')->getValue());
1284  }
1285 
1286  if (!$this->testOBJ->participantDataExist() && $this->formPropertyExists($form, 'instant_feedback_handling'))
1287  {
1288  $this->saveInstFbHandlingSettings($form->getItemByPostVar('instant_feedback_handling')->getValue());
1289  }
1290 
1291  if (!$this->testOBJ->participantDataExist() && $this->formPropertyExists($form, 'obligations_enabled'))
1292  {
1293  $this->testOBJ->setObligationsEnabled($form->getItemByPostVar('obligations_enabled')->getChecked());
1294  }
1295 
1296  if( $this->isCharSelectorPropertyRequired() )
1297  {
1298  require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
1300  $char_selector->addFormProperties($form);
1301  $char_selector->getFormValues($form);
1302  $this->testOBJ->setCharSelectorAvailability($char_selector->getConfig()->getAvailability());
1303  $this->testOBJ->setCharSelectorDefinition($char_selector->getConfig()->getDefinition());
1304  }
1305  }
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 853 of file class.ilObjTestSettingsGeneralGUI.php.

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

Referenced by performSaveForm().

854  {
855  if( !$this->testOBJ->participantDataExist() )
856  {
857  // starting time
858  $starting_time = $form->getItemByPostVar('starting_time')->getDate();
859  if($starting_time instanceof ilDateTime)
860  {
861  $this->testOBJ->setStartingTime($starting_time->getUnixtime());
862  $this->testOBJ->setStartingTimeEnabled(true);
863  }
864  else
865  {
866  $this->testOBJ->setStartingTime(null);
867  $this->testOBJ->setStartingTimeEnabled(false);
868  }
869  }
870 
871  // ending time
872  $ending_time = $form->getItemByPostVar('ending_time')->getDate();
873  if($ending_time instanceof ilDateTime)
874  {
875  $this->testOBJ->setEndingTime($ending_time->getUnixtime());
876  $this->testOBJ->setEndingTimeEnabled(true);
877  }
878  else
879  {
880  $this->testOBJ->setEndingTime(null);
881  $this->testOBJ->setEndingTimeEnabled(false);
882  }
883 
884  if( $this->formPropertyExists($form, 'password_enabled') )
885  {
886  $this->testOBJ->setPasswordEnabled($form->getItemByPostVar('password_enabled')->getChecked());
887 
888  if( $form->getItemByPostVar('password_enabled')->getChecked() )
889  {
890  $this->testOBJ->setPassword($form->getItemByPostVar('password')->getValue());
891  }
892  else
893  {
894  $this->testOBJ->setPassword(''); // otherwise test will still respect value
895  }
896  }
897 
898  if( $this->formPropertyExists($form, 'fixedparticipants') && !$this->testOBJ->participantDataExist() )
899  {
900  $this->testOBJ->setFixedParticipants($form->getItemByPostVar('fixedparticipants')->getChecked());
901  }
902 
903  if( $this->formPropertyExists($form, 'limitUsers') )
904  {
905  $this->testOBJ->setLimitUsersEnabled($form->getItemByPostVar('limitUsers')->getChecked());
906 
907  if( $form->getItemByPostVar('limitUsers')->getChecked() )
908  {
909  $this->testOBJ->setAllowedUsers($form->getItemByPostVar('allowedUsers')->getValue());
910  $this->testOBJ->setAllowedUsersTimeGap($form->getItemByPostVar('allowedUsersTimeGap')->getValue());
911  }
912  else
913  {
914  $this->testOBJ->setAllowedUsers(''); // otherwise test will still respect value
915  }
916  }
917  }
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 1498 of file class.ilObjTestSettingsGeneralGUI.php.

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

Referenced by performSaveForm().

1499  {
1500  if( $this->formPropertyExists($form, 'enable_examview') )
1501  {
1502  $this->testOBJ->setEnableExamview($form->getItemByPostVar('enable_examview')->getChecked());
1503  $this->testOBJ->setShowExamviewPdf($form->getItemByPostVar('show_examview_pdf')->getChecked());
1504  }
1505 
1506  $this->testOBJ->setShowFinalStatement($form->getItemByPostVar('showfinalstatement')->getChecked());
1507  $this->testOBJ->setFinalStatement($form->getItemByPostVar('finalstatement')->getValue(), false, ilObjAdvancedEditing::_getUsedHTMLTagsAsString("assessment"));
1508 
1509  if( $form->getItemByPostVar('redirection_enabled')->getChecked() )
1510  {
1511  $this->testOBJ->setRedirectionMode($form->getItemByPostVar('redirection_mode')->getValue());
1512  }
1513  else
1514  {
1515  $this->testOBJ->setRedirectionMode(REDIRECT_NONE);
1516  }
1517  if( strlen($form->getItemByPostVar('redirection_url')->getValue()) )
1518  {
1519  $this->testOBJ->setRedirectionUrl($form->getItemByPostVar('redirection_url')->getValue());
1520  }
1521  else
1522  {
1523  $this->testOBJ->setRedirectionUrl(null);
1524  }
1525 
1526  if( $this->formPropertyExists($form, 'sign_submission') )
1527  {
1528  $this->testOBJ->setSignSubmission($form->getItemByPostVar('sign_submission')->getChecked());
1529  }
1530 
1531  if( $this->formPropertyExists($form, 'mailnotification') && $form->getItemByPostVar('mailnotification')->getChecked() )
1532  {
1533  $this->testOBJ->setMailNotification($form->getItemByPostVar('mailnotification_content')->getValue());
1534  $this->testOBJ->setMailNotificationType($form->getItemByPostVar('mailnottype')->getChecked());
1535  }
1536  else
1537  {
1538  $this->testOBJ->setMailNotification(0);
1539  $this->testOBJ->setMailNotificationType(false);
1540  }
1541  }
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 736 of file class.ilObjTestSettingsGeneralGUI.php.

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

Referenced by performSaveForm().

737  {
738  if ($form->getItemByPostVar('intro_enabled') instanceof ilFormPropertyGUI)
739  {
740  $this->testOBJ->setIntroductionEnabled($form->getItemByPostVar('intro_enabled')->getChecked());
741 
742  if ($form->getItemByPostVar('intro_enabled')->getChecked())
743  {
744  $this->testOBJ->setIntroduction($form->getItemByPostVar('introduction')->getValue(), false, ilObjAdvancedEditing::_getUsedHTMLTagsAsString("assessment"));
745  }
746  else
747  {
748  $this->testOBJ->setIntroduction('');
749  }
750  }
751 
752  if ($form->getItemByPostVar('showinfo') instanceof ilFormPropertyGUI)
753  {
754  $this->testOBJ->setShowInfo($form->getItemByPostVar('showinfo')->getChecked());
755  }
756  }
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 1040 of file class.ilObjTestSettingsGeneralGUI.php.

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

Referenced by performSaveForm().

1041  {
1042  if (!$this->testOBJ->participantDataExist())
1043  {
1044  // nr of tries (max passes)
1045  if ($form->getItemByPostVar('limitPasses') instanceof ilFormPropertyGUI)
1046  {
1047  if ($form->getItemByPostVar('limitPasses')->getChecked())
1048  {
1049  $this->testOBJ->setNrOfTries($form->getItemByPostVar('nr_of_tries')->getValue());
1050  }
1051  else
1052  {
1053  $this->testOBJ->setNrOfTries(0);
1054  }
1055  }
1056 
1057  // pass_waiting
1058  if($form->getItemByPostVar('pass_waiting_enabled') instanceof ilFormPropertyGUI)
1059  {
1060  if ($form->getItemByPostVar('pass_waiting_enabled')->getChecked())
1061  {
1062  $pass_waiting_values = $form->getItemByPostVar('pass_waiting');
1063 
1064  $pass_waiting_duration[] = sprintf("%'.02d", $pass_waiting_values->getMonths());
1065  $pass_waiting_duration[] = sprintf("%'.03d",$pass_waiting_values->getDays());
1066  $pass_waiting_duration[] = sprintf("%'.02d", $pass_waiting_values->getHours());
1067  $pass_waiting_duration[] = sprintf("%'.02d", $pass_waiting_values->getMinutes());
1068  $pass_waiting_duration[] = sprintf("%'.02d", $pass_waiting_values->getSeconds());
1069 
1070  $pass_waiting_string = implode(':', $pass_waiting_duration);
1071  $this->testOBJ->setPassWaiting($pass_waiting_string);
1072  }
1073  else
1074  {
1075  $this->testOBJ->setPassWaiting("00:000:00:00:00");
1076  }
1077  }
1078 
1079  $this->testOBJ->setEnableProcessingTime($form->getItemByPostVar('chb_processing_time')->getChecked());
1080  if ($this->testOBJ->getEnableProcessingTime())
1081  {
1082  $this->testOBJ->setProcessingTimeByMinutes($form->getItemByPostVar('processing_time')->getValue());
1083  $this->testOBJ->setResetProcessingTime($form->getItemByPostVar('chb_reset_processing_time')->getChecked());
1084  }
1085  else
1086  {
1087  $this->testOBJ->setProcessingTime('');
1088  $this->testOBJ->setResetProcessingTime(false);
1089  }
1090  }
1091 
1092  if ($form->getItemByPostVar('kiosk') instanceof ilFormPropertyGUI)
1093  {
1094  $this->testOBJ->setKioskMode($form->getInput('kiosk'));
1095  $kioskOptions = $form->getItemByPostVar('kiosk_options')->getValue();
1096  if (is_array($kioskOptions))
1097  {
1098  $this->testOBJ->setShowKioskModeTitle(in_array('kiosk_title', $kioskOptions));
1099  $this->testOBJ->setShowKioskModeParticipant(in_array('kiosk_participant', $kioskOptions));
1100  }
1101  else
1102  {
1103  $this->testOBJ->setShowKioskModeTitle(false);
1104  $this->testOBJ->setShowKioskModeParticipant(false);
1105  }
1106  }
1107 
1108  if ($form->getItemByPostVar('examid_in_test_pass') instanceof ilFormPropertyGUI)
1109  {
1110  $value = $form->getItemByPostVar('examid_in_test_pass')->getChecked();
1111  $this->testOBJ->setShowExamIdInTestPassEnabled($value);
1112  }
1113  }
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 1373 of file class.ilObjTestSettingsGeneralGUI.php.

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

Referenced by performSaveForm().

1374  {
1375  if( $this->formPropertyExists($form, 'chb_use_previous_answers') )
1376  {
1377  $this->testOBJ->setUsePreviousAnswers($form->getInput('chb_use_previous_answers'));
1378  }
1379 
1380  if( $this->formPropertyExists($form, 'chb_show_cancel') )
1381  {
1382  $this->testOBJ->setShowCancel($form->getItemByPostVar('chb_show_cancel')->getChecked());
1383  }
1384 
1385  if( $this->formPropertyExists($form, 'postpone') )
1386  {
1387  $this->testOBJ->setPostponingEnabled((bool)$form->getItemByPostVar('postpone')->getValue());
1388  }
1389 
1390  $this->testOBJ->setListOfQuestions($form->getItemByPostVar('list_of_questions')->getChecked());
1391  $listOfQuestionsOptions = $form->getItemByPostVar('list_of_questions_options')->getValue();
1392  if(is_array($listOfQuestionsOptions))
1393  {
1394  $this->testOBJ->setListOfQuestionsStart(in_array('chb_list_of_questions_start', $listOfQuestionsOptions));
1395  $this->testOBJ->setListOfQuestionsEnd(in_array('chb_list_of_questions_end', $listOfQuestionsOptions));
1396  $this->testOBJ->setListOfQuestionsDescription(in_array('chb_list_of_questions_with_description', $listOfQuestionsOptions));
1397  }
1398  else
1399  {
1400  $this->testOBJ->setListOfQuestionsStart(0);
1401  $this->testOBJ->setListOfQuestionsEnd(0);
1402  $this->testOBJ->setListOfQuestionsDescription(0);
1403  }
1404 
1405  if( $this->formPropertyExists($form, 'chb_show_marker') )
1406  {
1407  $this->testOBJ->setShowMarker($form->getItemByPostVar('chb_show_marker')->getChecked());
1408  }
1409  }
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 147 of file class.ilObjTestSettingsGeneralGUI.php.

Referenced by saveFormCmd().

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

◆ showFormCmd()

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

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

References buildForm(), and getSettingsTemplateMessageHTML().

Referenced by saveFormCmd().

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

370  {
371  require_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
372  $confirmationGUI = new ilConfirmationGUI();
373 
374  $confirmationGUI->setFormAction($this->ctrl->getFormAction($this));
375  $confirmationGUI->setHeaderText($this->lng->txt("test_confirm_template_reset"));
376  $confirmationGUI->setCancel($this->lng->txt('cancel'), self::CMD_SHOW_FORM);
377  $confirmationGUI->setConfirm($this->lng->txt('confirm'), self::CMD_CONFIRMED_RESET_TPL);
378 
379  $this->tpl->setContent( $this->ctrl->getHTML($confirmationGUI) );
380  }
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: