ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilTestSettingsTemplateConfig.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once 'Services/Administration/classes/class.ilSettingsTemplateConfig.php';
5 require_once 'Modules/Test/classes/inc.AssessmentConstants.php';
6 require_once 'Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php';
7 
15 {
19  protected $lng;
20 
24  public function __construct(ilLanguage $lng)
25  {
26  $this->lng = $lng;
27  parent::__construct('tst');
28  }
29 
30  public function init()
31  {
32  $this->initLanguage();
33  $this->initHidableTabs();
34  $this->initSettings();
35  }
36 
37  private function initLanguage()
38  {
39  $this->lng->loadLanguageModule("tst");
40  $this->lng->loadLanguageModule("assessment");
41  }
42 
43  private function initHidableTabs()
44  {
45  $this->addHidableTab("questions", $this->lng->txt('assQuestions') . ' - ' . $this->lng->txt('edit_test_questions'));
46  $this->addHidableTab("mark_schema", $this->lng->txt('settings') . ' - ' . $this->lng->txt("mark_schema"));
47  $this->addHidableTab("certificate", $this->lng->txt('settings') . ' - ' . $this->lng->txt("certificate"));
48  $this->addHidableTab("defaults", $this->lng->txt('settings') . ' - ' . $this->lng->txt("tst_default_settings"));
49 
50  $this->addHidableTab("learning_progress", $this->lng->txt("learning_progress"));
51  $this->addHidableTab("manscoring", $this->lng->txt("manscoring"));
52  $this->addHidableTab("statistics", $this->lng->txt("statistics"));
53  $this->addHidableTab("history", $this->lng->txt("history"));
54  $this->addHidableTab("meta_data", $this->lng->txt("meta_data"));
55  $this->addHidableTab("export", $this->lng->txt("export"));
56  $this->addHidableTab("permissions", $this->lng->txt("permission"));
57  }
58 
59  private function initSettings()
60  {
62  $this->addTestIntroProperties();
63  $this->addTestAccessProperties();
64  $this->addTestRunProperties();
67  $this->addTestFinishProperties();
72  }
73 
74  private function addGeneralPropertySettings()
75  {
76  $this->addSetting(
77  "use_pool",
79  $this->lng->txt("test_question_pool_usage"),
80  true,
81  0,
82  array(
83  1 => $this->lng->txt('test_question_pool_usage_optional'),
84  0 => $this->lng->txt('test_question_pool_usage_tst_directly')
85  )
86  );
87 
88  $this->addSetting(
89  "question_set_type",
91  $this->lng->txt("tst_question_set_type"),
92  true,
93  0,
94  array(
95  ilObjTest::QUESTION_SET_TYPE_FIXED => $this->lng->txt("tst_question_set_type_fixed"),
96  ilObjTest::QUESTION_SET_TYPE_RANDOM => $this->lng->txt("tst_question_set_type_random"),
97  ilObjTest::QUESTION_SET_TYPE_DYNAMIC => $this->lng->txt("tst_question_set_type_dynamic"),
98  )
99  );
100  }
101 
102  private function addTestIntroProperties()
103  {
104  // Test Introduction
105  $this->addSetting(
106  "intro_enabled",
108  $this->lng->txt("tst_introduction"),
109  false
110  );
111 
112  // All Details on Info Screen
113  $this->addSetting(
114  "showinfo",
116  $this->lng->txt("showinfo"),
117  true
118  );
119  }
120 
121  private function addTestAccessProperties()
122  {
123  $this->addSetting(
124  "chb_starting_time",
126  $this->lng->txt("tst_starting_time"),
127  false
128  );
129 
130  $this->addSetting(
131  "chb_ending_time",
133  $this->lng->txt("tst_ending_time"),
134  false
135  );
136 
137  $this->addSetting(
138  "password_enabled",
140  $this->lng->txt("tst_password"),
141  false
142  );
143 
144  $this->addSetting(
145  "fixedparticipants",
147  $this->lng->txt("participants_invitation"),
148  true
149  );
150 
151  $this->addSetting(
152  "limitUsers",
154  $this->lng->txt("tst_allowed_users"),
155  false
156  );
157  }
158 
159  private function addTestRunProperties()
160  {
161  $this->addSetting(
162  "nr_of_tries",
164  $this->lng->txt("tst_nr_of_tries"),
165  false,
166  3
167  );
168 
169  $this->addSetting(
170  "chb_processing_time",
172  $this->lng->txt("tst_processing_time"),
173  false
174  );
175 
176  $this->addSetting(
177  "kiosk",
179  $this->lng->txt("kiosk"),
180  false
181  );
182 
183  $this->addSetting(
184  "examid_in_test_pass",
186  $this->lng->txt("examid_in_test_pass"),
187  false
188  );
189  }
190 
192  {
193  $this->addSetting(
194  "title_output",
196  $this->lng->txt("tst_title_output"),
197  true,
198  0,
199  array(
200  '0' => $this->lng->txt("tst_title_output_full"),
201  '1' => $this->lng->txt("tst_title_output_hide_points"),
202  '2' => $this->lng->txt("tst_title_output_no_title"),
203  )
204  );
205 
206  $this->addSetting(
207  "autosave",
209  $this->lng->txt("autosave"),
210  true,
211  5
212  );
213 
214  $this->addSetting(
215  "chb_shuffle_questions",
217  $this->lng->txt("tst_shuffle_questions"),
218  true
219  );
220 
221  $this->addSetting(
222  "offer_hints",
224  $this->lng->txt("tst_setting_offer_hints_label"),
225  true
226  );
227 
228  $this->addSetting(
229  "instant_feedback_contents",
231  $this->lng->txt("tst_instant_feedback"),
232  true,
233  0,
234  array(
235  'instant_feedback_points' => $this->lng->txt("tst_instant_feedback_results"),
236  'instant_feedback_generic' => $this->lng->txt("tst_instant_feedback_answer_generic"),
237  'instant_feedback_specific' => $this->lng->txt("tst_instant_feedback_answer_specific"),
238  'instant_feedback_solution' => $this->lng->txt("tst_instant_feedback_solution")
239  )
240  );
241 
242  $this->addSetting(
243  "instant_feedback_trigger",
245  $this->lng->txt("tst_instant_feedback_trigger"),
246  true,
247  0,
248  array(
249  ilObjTestSettingsGeneralGUI::INSTANT_FEEDBACK_TRIGGER_MANUAL => $this->lng->txt("tst_instant_feedback_trigger_manual"),
250  ilObjTestSettingsGeneralGUI::INSTANT_FEEDBACK_TRIGGER_FORCED => $this->lng->txt("tst_instant_feedback_trigger_forced")
251  )
252  );
253 
254  $this->addSetting(
255  'answer_fixation_handling',
257  $this->lng->txt('tst_answer_fixation_handling'),
258  true,
259  0,
260  array(
261  ilObjTestSettingsGeneralGUI::ANSWER_FIXATION_NONE => $this->lng->txt('tst_answer_fixation_none'),
262  ilObjTestSettingsGeneralGUI::ANSWER_FIXATION_ON_INSTANT_FEEDBACK => $this->lng->txt('tst_answer_fixation_on_instant_feedback'),
263  ilObjTestSettingsGeneralGUI::ANSWER_FIXATION_ON_FOLLOWUP_QUESTION => $this->lng->txt('tst_answer_fixation_on_followup_question'),
264  ilObjTestSettingsGeneralGUI::ANSWER_FIXATION_ON_IFB_OR_FUQST => $this->lng->txt('tst_answer_fixation_on_instantfb_or_followupqst')
265  )
266  );
267 
268  $this->addSetting(
269  "obligations_enabled",
271  $this->lng->txt("tst_setting_enable_obligations_label"),
272  true
273  );
274  }
275 
276  private function addTestSequenceProperties()
277  {
278  $this->addSetting(
279  "chb_use_previous_answers",
281  $this->lng->txt("tst_use_previous_answers"),
282  true
283  );
284 
285  $this->addSetting(
286  "chb_show_cancel",
288  $this->lng->txt("tst_show_cancel"),
289  true
290  );
291 
292  $this->addSetting(
293  "chb_postpone",
295  $this->lng->txt("tst_postpone"),
296  true
297  );
298 
299  $this->addSetting(
300  "list_of_questions",
302  $this->lng->txt("tst_show_summary"),
303  false
304  );
305 
306  $this->addSetting(
307  "chb_show_marker",
309  $this->lng->txt("question_marking"),
310  true
311  );
312  }
313 
314  private function addTestFinishProperties()
315  {
316  $this->addSetting(
317  "enable_examview",
319  $this->lng->txt("enable_examview"),
320  false
321  );
322 
323  $this->addSetting(
324  "showfinalstatement",
326  $this->lng->txt("final_statement"),
327  false
328  );
329 
330  /* $this->addSetting(
331  "redirection_enabled",
332  ilSettingsTemplateConfig::SELECT,
333  $this->lng->txt("redirect_after_finishing_tst"),
334  false,
335  0,
336  array(
337  REDIRECT_NONE => $this->lng->txt("redirect_none"),
338  REDIRECT_ALWAYS => $this->lng->txt("redirect_always"),
339  REDIRECT_KIOSK => $this->lng->txt("redirect_in_kiosk_mode"),
340  )
341  ); */
342  $this->addSetting(
343  "redirection_enabled",
345  $this->lng->txt("redirect_after_finishing_tst"),
346  false
347  );
348 
349  $this->addSetting(
350  "sign_submission",
352  $this->lng->txt("sign_submission"),
353  true
354  );
355 
356  $this->addSetting(
357  "mailnotification",
359  $this->lng->txt("tst_finish_notification"),
360  false,
361  0,
362  array(
363  '0' => $this->lng->txt("tst_finish_notification_no"),
364  '1' => $this->lng->txt("tst_finish_notification_simple"),
365  '2' => $this->lng->txt("tst_finish_notification_advanced"),
366  )
367  );
368  }
369 
370  private function addScoringOptionsProperties()
371  {
372  $this->addSetting(
373  "count_system",
375  $this->lng->txt("tst_text_count_system"),
376  true,
377  0,
378  array(
379  '0' => $this->lng->txt("tst_count_partial_solutions"),
380  '1' => $this->lng->txt("tst_count_correct_solutions")
381  )
382  );
383 
384  $this->addSetting(
385  "mc_scoring",
387  $this->lng->txt("tst_score_mcmr_questions"),
388  true,
389  0,
390  array(
391  '0' => $this->lng->txt("tst_score_mcmr_zero_points_when_unanswered"),
392  '1' => $this->lng->txt("tst_score_mcmr_use_scoring_system")
393  )
394  );
395 
396  $this->addSetting(
397  "score_cutting",
399  $this->lng->txt("tst_score_cutting"),
400  true,
401  0,
402  array(
403  '0' => $this->lng->txt("tst_score_cut_question"),
404  '1' => $this->lng->txt("tst_score_cut_test")
405  )
406  );
407 
408  $this->addSetting(
409  "pass_scoring",
411  $this->lng->txt("tst_pass_scoring"),
412  true,
413  0,
414  array(
415  '0' => $this->lng->txt("tst_pass_last_pass"),
416  '1' => $this->lng->txt("tst_pass_best_pass")
417  )
418  );
419 
420  $this->addSetting(
421  "pass_deletion_allowed",
423  $this->lng->txt("tst_pass_deletion"),
424  true,
425  0,
426  array(
427  '0' => $this->lng->txt("tst_pass_deletion_not_allowed"),
428  '1' => $this->lng->txt("tst_pass_deletion_allowed")
429  )
430  );
431  }
432 
433  private function addResultSummaryProperties()
434  {
435  $this->addSetting(
436  "results_access_enabled",
438  $this->lng->txt("tst_results_access_enabled"),
439  false,
440  0,
441  array(
442  '0' => $this->lng->txt("tst_results_access_never"),
443  '2' => $this->lng->txt("tst_results_access_always"),
444  '1' => $this->lng->txt("tst_results_access_finished"),
445  '3' => $this->lng->txt("tst_results_access_date")
446  )
447  );
448 
449  $this->addSetting(
450  "grading_status",
452  $this->lng->txt("tst_results_grading_opt_show_status"),
453  true
454  );
455 
456  $this->addSetting(
457  "grading_mark",
459  $this->lng->txt("tst_results_grading_opt_show_mark"),
460  true
461  );
462  }
463 
464  private function addResultDetailsProperties()
465  {
466  $this->addSetting(
467  "solution_details",
469  $this->lng->txt("tst_show_solution_details"),
470  false
471  );
472 
473  $this->addSetting(
474  "solution_feedback",
476  $this->lng->txt("tst_show_solution_feedback"),
477  true
478  );
479 
480  $this->addSetting(
481  "solution_suggested",
483  $this->lng->txt("tst_show_solution_suggested"),
484  true
485  );
486 
487  $this->addSetting(
488  "solution_printview",
490  $this->lng->txt("tst_show_solution_printview"),
491  false
492  );
493 
494  $this->addSetting(
495  "highscore_enabled",
497  $this->lng->txt("tst_highscore_enabled"),
498  false
499  );
500 
501  $this->addSetting(
502  "solution_signature",
504  $this->lng->txt("tst_show_solution_signature"),
505  true
506  );
507 
508  $this->addSetting(
509  "examid_in_test_res",
511  $this->lng->txt("examid_in_test_res"),
512  true
513  );
514 
515  $this->addSetting(
516  "exp_sc_short",
518  $this->lng->txt("tst_exp_sc_short"),
519  true
520  );
521  }
522 
524  {
525  $this->addSetting(
526  "anonymity",
528  $this->lng->txt("tst_anonymity"),
529  true,
530  0,
531  array(
532  '0' => $this->lng->txt("tst_anonymity_no_anonymization"),
533  '1' => $this->lng->txt("tst_anonymity_anonymous_test"),
534  )
535  );
536 
537  $this->addSetting(
538  "enable_archiving",
540  $this->lng->txt("test_enable_archiving"),
541  true
542  );
543  }
544 }
const QUESTION_SET_TYPE_RANDOM
type setting value for random question set
addHidableTab($a_tab_id, $a_text)
Add hidable tabs.
addSetting($a_id, $a_type, $a_text, $a_hidable, $a_length=0, $a_options=array())
Add setting.
Settings template config class.
const QUESTION_SET_TYPE_FIXED
type setting value for fixed question set
language handling
const QUESTION_SET_TYPE_DYNAMIC
type setting value for dynamic question set (continues testing mode)