ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
4require_once 'Services/Administration/classes/class.ilSettingsTemplateConfig.php';
5require_once 'Modules/Test/classes/inc.AssessmentConstants.php';
6require_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 {
64 $this->addTestRunProperties();
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",
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 'force_instant_feedback' => $this->lng->txt("tst_instant_feedback_forced")
240 )
241 );
242
243 $this->addSetting(
244 'instant_feedback_handling',
246 $this->lng->txt('tst_instant_feedback_handling'),
247 true,
249 array(
250 ilObjTestSettingsGeneralGUI::INST_FB_HANDLING_OPT_NONE => $this->lng->txt('tst_instant_feedback_handling_none'),
251 ilObjTestSettingsGeneralGUI::INST_FB_HANDLING_OPT_FREEZE => $this->lng->txt('tst_instant_feedback_handling_freeze'),
252 ilObjTestSettingsGeneralGUI::INST_FB_HANDLING_OPT_FORCE_AND_FREEZE => $this->lng->txt('tst_instant_feedback_handling_force_and_freeze'),
253 ilObjTestSettingsGeneralGUI::INST_FB_HANDLING_OPT_FORCE => $this->lng->txt('tst_instant_feedback_handling_force'),
254 )
255 );
256
257 $this->addSetting(
258 "obligations_enabled",
260 $this->lng->txt("tst_setting_enable_obligations_label"),
261 true
262 );
263 }
264
265 private function addTestSequenceProperties()
266 {
267 $this->addSetting(
268 "chb_use_previous_answers",
270 $this->lng->txt("tst_use_previous_answers"),
271 true
272 );
273
274 $this->addSetting(
275 "chb_show_cancel",
277 $this->lng->txt("tst_show_cancel"),
278 true
279 );
280
281 $this->addSetting(
282 "chb_postpone",
284 $this->lng->txt("tst_postpone"),
285 true
286 );
287
288 $this->addSetting(
289 "list_of_questions",
291 $this->lng->txt("tst_show_summary"),
292 false
293 );
294
295 $this->addSetting(
296 "chb_show_marker",
298 $this->lng->txt("question_marking"),
299 true
300 );
301 }
302
303 private function addTestFinishProperties()
304 {
305 $this->addSetting(
306 "enable_examview",
308 $this->lng->txt("enable_examview"),
309 false
310 );
311
312 $this->addSetting(
313 "showfinalstatement",
315 $this->lng->txt("final_statement"),
316 false
317 );
318
319 /* $this->addSetting(
320 "redirection_enabled",
321 ilSettingsTemplateConfig::SELECT,
322 $this->lng->txt("redirect_after_finishing_tst"),
323 false,
324 0,
325 array(
326 REDIRECT_NONE => $this->lng->txt("redirect_none"),
327 REDIRECT_ALWAYS => $this->lng->txt("redirect_always"),
328 REDIRECT_KIOSK => $this->lng->txt("redirect_in_kiosk_mode"),
329 )
330 ); */
331 $this->addSetting(
332 "redirection_enabled",
334 $this->lng->txt("redirect_after_finishing_tst"),
335 false
336 );
337
338 $this->addSetting(
339 "sign_submission",
341 $this->lng->txt("sign_submission"),
342 true
343 );
344
345 $this->addSetting(
346 "mailnotification",
348 $this->lng->txt("tst_finish_notification"),
349 false,
350 0,
351 array(
352 '0' => $this->lng->txt("tst_finish_notification_no"),
353 '1' => $this->lng->txt("tst_finish_notification_simple"),
354 '2' => $this->lng->txt("tst_finish_notification_advanced"),
355 )
356 );
357 }
358
360 {
361 $this->addSetting(
362 "count_system",
364 $this->lng->txt("tst_text_count_system"),
365 true,
366 0,
367 array(
368 '0' => $this->lng->txt("tst_count_partial_solutions"),
369 '1' => $this->lng->txt("tst_count_correct_solutions")
370 )
371 );
372
373 $this->addSetting(
374 "mc_scoring",
376 $this->lng->txt("tst_score_mcmr_questions"),
377 true,
378 0,
379 array(
380 '0' => $this->lng->txt("tst_score_mcmr_zero_points_when_unanswered"),
381 '1' => $this->lng->txt("tst_score_mcmr_use_scoring_system")
382 )
383 );
384
385 $this->addSetting(
386 "score_cutting",
388 $this->lng->txt("tst_score_cutting"),
389 true,
390 0,
391 array(
392 '0' => $this->lng->txt("tst_score_cut_question"),
393 '1' => $this->lng->txt("tst_score_cut_test")
394 )
395 );
396
397 $this->addSetting(
398 "pass_scoring",
400 $this->lng->txt("tst_pass_scoring"),
401 true,
402 0,
403 array(
404 '0' => $this->lng->txt("tst_pass_last_pass"),
405 '1' => $this->lng->txt("tst_pass_best_pass")
406 )
407 );
408
409 $this->addSetting(
410 "pass_deletion_allowed",
412 $this->lng->txt("tst_pass_deletion"),
413 true,
414 0,
415 array(
416 '0' => $this->lng->txt("tst_pass_deletion_not_allowed"),
417 '1' => $this->lng->txt("tst_pass_deletion_allowed")
418 )
419 );
420 }
421
422 private function addResultSummaryProperties()
423 {
424 $this->addSetting(
425 "results_access_enabled",
427 $this->lng->txt("tst_results_access_enabled"),
428 false,
429 0,
430 array(
431 '0' => $this->lng->txt("tst_results_access_never"),
432 '2' => $this->lng->txt("tst_results_access_always"),
433 '1' => $this->lng->txt("tst_results_access_finished"),
434 '3' => $this->lng->txt("tst_results_access_date")
435 )
436 );
437
438 $this->addSetting(
439 "grading_status",
441 $this->lng->txt("tst_results_grading_opt_show_status"),
442 true
443 );
444
445 $this->addSetting(
446 "grading_mark",
448 $this->lng->txt("tst_results_grading_opt_show_mark"),
449 true
450 );
451 }
452
453 private function addResultDetailsProperties()
454 {
455 $this->addSetting(
456 "solution_details",
458 $this->lng->txt("tst_show_solution_details"),
459 false
460 );
461
462 $this->addSetting(
463 "solution_feedback",
465 $this->lng->txt("tst_show_solution_feedback"),
466 true
467 );
468
469 $this->addSetting(
470 "solution_suggested",
472 $this->lng->txt("tst_show_solution_suggested"),
473 true
474 );
475
476 $this->addSetting(
477 "solution_printview",
479 $this->lng->txt("tst_show_solution_printview"),
480 false
481 );
482
483 $this->addSetting(
484 "highscore_enabled",
486 $this->lng->txt("tst_highscore_enabled"),
487 false
488 );
489
490 $this->addSetting(
491 "solution_signature",
493 $this->lng->txt("tst_show_solution_signature"),
494 true
495 );
496
497 $this->addSetting(
498 "examid_in_test_res",
500 $this->lng->txt("examid_in_test_res"),
501 true
502 );
503
504 $this->addSetting(
505 "exp_sc_short",
507 $this->lng->txt("tst_exp_sc_short"),
508 true
509 );
510 }
511
513 {
514 $this->addSetting(
515 "anonymity",
517 $this->lng->txt("tst_anonymity"),
518 true,
519 0,
520 array(
521 '0' => $this->lng->txt("tst_anonymity_no_anonymization"),
522 '1' => $this->lng->txt("tst_anonymity_anonymous_test"),
523 )
524 );
525
526 $this->addSetting(
527 "enable_archiving",
529 $this->lng->txt("test_enable_archiving"),
530 true
531 );
532 }
533}
language handling
const QUESTION_SET_TYPE_DYNAMIC
type setting value for dynamic question set (continues testing mode)
const QUESTION_SET_TYPE_RANDOM
type setting value for random question set
const QUESTION_SET_TYPE_FIXED
type setting value for fixed question set
Settings template config class.
addSetting($a_id, $a_type, $a_text, $a_hidable, $a_length=0, $a_options=array())
Add setting.
addHidableTab($a_tab_id, $a_text)
Add hidable tabs.