19 declare(strict_types=1);
33 protected \ilDBInterface
$db;
42 if (!isset($this->instances_by_obj_fi[$obj_fi])) {
43 $where_part =
'WHERE obj_fi = ' . $this->db->quote($obj_fi,
'integer');
44 $this->instances_by_obj_fi[$obj_fi] = $this->
doSelect($where_part);
45 $test_id = $this->instances_by_obj_fi[$obj_fi]->getTestId();
46 $this->instances_by_test_fi[$test_id] = $this->instances_by_obj_fi[$obj_fi];
48 return $this->instances_by_obj_fi[$obj_fi];
53 if (!isset(self::$instances_by_test_fi[$test_id])) {
54 $where_part =
'WHERE test_id = ' . $this->db->quote($test_id,
'integer');
55 $this->instances_by_test_fi[$test_id] = $this->
doSelect($where_part);
56 $obj_id = $this->instances_by_test_fi[$test_id]->getObjId();
57 $this->instances_by_obj_fi[$obj_id] = $this->instances_by_test_fi[$test_id];
59 return $this->instances_by_test_fi[$test_id];
64 $query =
'SELECT ' . PHP_EOL
65 .
'test_id,' . PHP_EOL
67 .
'question_set_type,' . PHP_EOL
68 .
'anonymity,' . PHP_EOL
69 .
'intro_enabled,' . PHP_EOL
70 .
'hide_info_tab,' . PHP_EOL
71 .
'conditions_checkbox_enabled,' . PHP_EOL
72 .
'introduction,' . PHP_EOL
73 .
'introduction_page_id,' . PHP_EOL
74 .
'starting_time_enabled,' . PHP_EOL
75 .
'starting_time,' . PHP_EOL
76 .
'ending_time_enabled,' . PHP_EOL
77 .
'ending_time,' . PHP_EOL
78 .
'password_enabled,' . PHP_EOL
79 .
'password,' . PHP_EOL
80 .
'ip_range_from,' . PHP_EOL
81 .
'ip_range_to,' . PHP_EOL
82 .
'fixed_participants,' . PHP_EOL
83 .
'nr_of_tries,' . PHP_EOL
84 .
'block_after_passed,' . PHP_EOL
85 .
'pass_waiting,' . PHP_EOL
86 .
'enable_processing_time,' . PHP_EOL
87 .
'processing_time,' . PHP_EOL
88 .
'reset_processing_time,' . PHP_EOL
90 .
'examid_in_test_pass,' . PHP_EOL
91 .
'title_output,' . PHP_EOL
92 .
'autosave,' . PHP_EOL
93 .
'autosave_ival,' . PHP_EOL
94 .
'shuffle_questions,' . PHP_EOL
95 .
'offer_question_hints,' . PHP_EOL
96 .
'answer_feedback_points,' . PHP_EOL
97 .
'answer_feedback,' . PHP_EOL
98 .
'specific_feedback,' . PHP_EOL
99 .
'instant_verification,' . PHP_EOL
100 .
'force_inst_fb,' . PHP_EOL
101 .
'inst_fb_answer_fixation,' . PHP_EOL
102 .
'follow_qst_answer_fixation,' . PHP_EOL
103 .
'use_previous_answers,' . PHP_EOL
104 .
'suspend_test_allowed,' . PHP_EOL
105 .
'sequence_settings,' . PHP_EOL
106 .
'usr_pass_overview_mode,' . PHP_EOL
107 .
'show_marker,' . PHP_EOL
108 .
'show_questionlist,' . PHP_EOL
109 .
'enable_examview,' . PHP_EOL
110 .
'showfinalstatement,' . PHP_EOL
111 .
'finalstatement,' . PHP_EOL
112 .
'concluding_remarks_page_id,' . PHP_EOL
113 .
'redirection_mode,' . PHP_EOL
114 .
'redirection_url,' . PHP_EOL
115 .
'mailnotification,' . PHP_EOL
116 .
'mailnottype,' . PHP_EOL
117 .
'skill_service' . PHP_EOL
118 .
'FROM ' . self::TABLE_NAME . PHP_EOL
121 $res = $this->db->query($query);
123 if ($this->db->numRows(
$res) == 0) {
124 throw new \Exception(
'Mo main settings for: ' . $where_part);
127 $row = $this->db->fetchAssoc(
$res);
129 $test_id = (
int) $row[
'test_id'];
133 (
int) $row[
'obj_fi'],
136 $row[
'question_set_type'],
137 (
bool) $row[
'anonymity']
141 (
bool) $row[
'intro_enabled'],
142 $row[
'introduction'],
143 $row[
'introduction_page_id'],
144 (
bool) $row[
'conditions_checkbox_enabled'],
148 (
bool) $row[
'starting_time_enabled'],
149 $row[
'starting_time'] !== 0
150 ? \DateTimeImmutable::createFromFormat(
'U', (
string) $row[
'starting_time'])
152 (
bool) $row[
'ending_time_enabled'],
153 $row[
'ending_time'] !== 0
154 ? \DateTimeImmutable::createFromFormat(
'U', (
string) $row[
'ending_time'])
156 (
bool) $row[
'password_enabled'],
158 $row[
'ip_range_from'],
160 (
bool) $row[
'fixed_participants'],
165 (
bool) $row[
'block_after_passed'],
166 $row[
'pass_waiting'],
167 (
bool) $row[
'enable_processing_time'],
168 $row[
'processing_time'],
169 (
bool) $row[
'reset_processing_time'],
171 (
bool) $row[
'examid_in_test_pass']
175 (
int) $row[
'title_output'],
176 (
bool) $row[
'autosave'],
177 $row[
'autosave_ival'],
178 (
bool) $row[
'shuffle_questions'],
179 (
bool) $row[
'offer_question_hints'],
180 (
bool) $row[
'answer_feedback_points'],
181 (
bool) $row[
'answer_feedback'],
182 (
bool) $row[
'specific_feedback'],
183 (
bool) $row[
'instant_verification'],
184 (
bool) $row[
'force_inst_fb'],
185 (
bool) $row[
'inst_fb_answer_fixation'],
186 (
bool) $row[
'follow_qst_answer_fixation']
190 (
bool) $row[
'use_previous_answers'],
191 (
bool) $row[
'suspend_test_allowed'],
192 (
bool) $row[
'sequence_settings'],
193 $row[
'usr_pass_overview_mode'],
194 (
bool) $row[
'show_marker'],
195 (
bool) $row[
'show_questionlist']
199 (
bool) $row[
'enable_examview'],
200 (
bool) $row[
'showfinalstatement'],
201 $row[
'finalstatement'],
202 $row[
'concluding_remarks_page_id'],
203 $row[
'redirection_mode'],
204 $row[
'redirection_url'],
205 $row[
'mailnotification'],
206 (
bool) $row[
'mailnottype'],
210 (
bool) $row[
'skill_service'],
211 (
bool) $row[
'hide_info_tab']
220 $values = array_merge(
234 [
'test_id' => [
'integer', $settings->
getTestId()]]
236 unset($this->instances_by_test_fi[$settings->
getTestId()]);
237 unset($this->instances_by_obj_fi[$settings->
getObjId()]);
getTestBehaviourSettings()
__construct(\ilDBInterface $db)
doSelect(string $where_part)
store(MainSettings $settings)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getParticipantFunctionalitySettings()
array $instances_by_obj_fi
getIntroductionSettings()
getQuestionBehaviourSettings()
array $instances_by_test_fi
const STORAGE_DATE_FORMAT