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 .
'answer_feedback_points,' . PHP_EOL
96 .
'answer_feedback,' . PHP_EOL
97 .
'specific_feedback,' . PHP_EOL
98 .
'instant_verification,' . PHP_EOL
99 .
'force_inst_fb,' . PHP_EOL
100 .
'inst_fb_answer_fixation,' . PHP_EOL
101 .
'follow_qst_answer_fixation,' . PHP_EOL
102 .
'use_previous_answers,' . PHP_EOL
103 .
'suspend_test_allowed,' . PHP_EOL
104 .
'sequence_settings,' . PHP_EOL
105 .
'usr_pass_overview_mode,' . PHP_EOL
106 .
'show_marker,' . PHP_EOL
107 .
'show_questionlist,' . PHP_EOL
108 .
'enable_examview,' . PHP_EOL
109 .
'showfinalstatement,' . PHP_EOL
110 .
'finalstatement,' . PHP_EOL
111 .
'concluding_remarks_page_id,' . PHP_EOL
112 .
'redirection_mode,' . PHP_EOL
113 .
'redirection_url,' . PHP_EOL
114 .
'mailnotification,' . PHP_EOL
115 .
'mailnottype,' . PHP_EOL
116 .
'skill_service' . PHP_EOL
117 .
'FROM ' . self::TABLE_NAME . PHP_EOL
120 $res = $this->db->query($query);
122 if ($this->db->numRows(
$res) == 0) {
123 throw new \Exception(
'Mo main settings for: ' . $where_part);
126 $row = $this->db->fetchAssoc(
$res);
128 $test_id = (
int) $row[
'test_id'];
132 (
int) $row[
'obj_fi'],
135 $row[
'question_set_type'],
136 (
bool) $row[
'anonymity']
140 (
bool) $row[
'intro_enabled'],
141 $row[
'introduction'],
142 $row[
'introduction_page_id'],
143 (
bool) $row[
'conditions_checkbox_enabled'],
147 (
bool) $row[
'starting_time_enabled'],
148 $row[
'starting_time'] !== 0
149 ? \DateTimeImmutable::createFromFormat(
'U', (
string) $row[
'starting_time'])
151 (
bool) $row[
'ending_time_enabled'],
152 $row[
'ending_time'] !== 0
153 ? \DateTimeImmutable::createFromFormat(
'U', (
string) $row[
'ending_time'])
155 (
bool) $row[
'password_enabled'],
157 $row[
'ip_range_from'],
159 (
bool) $row[
'fixed_participants'],
164 (
bool) $row[
'block_after_passed'],
165 $row[
'pass_waiting'],
166 (
bool) $row[
'enable_processing_time'],
167 $row[
'processing_time'],
168 (
bool) $row[
'reset_processing_time'],
170 (
bool) $row[
'examid_in_test_pass']
174 (
int) $row[
'title_output'],
175 (
bool) $row[
'autosave'],
176 $row[
'autosave_ival'],
177 (
bool) $row[
'shuffle_questions'],
178 (
bool) $row[
'answer_feedback_points'],
179 (
bool) $row[
'answer_feedback'],
180 (
bool) $row[
'specific_feedback'],
181 (
bool) $row[
'instant_verification'],
182 (
bool) $row[
'force_inst_fb'],
183 (
bool) $row[
'inst_fb_answer_fixation'],
184 (
bool) $row[
'follow_qst_answer_fixation']
188 (
bool) $row[
'use_previous_answers'],
189 (
bool) $row[
'suspend_test_allowed'],
190 (
bool) $row[
'sequence_settings'],
191 $row[
'usr_pass_overview_mode'],
192 (
bool) $row[
'show_marker'],
193 (
bool) $row[
'show_questionlist']
197 (
bool) $row[
'enable_examview'],
198 (
bool) $row[
'showfinalstatement'],
199 $row[
'finalstatement'],
200 $row[
'concluding_remarks_page_id'],
201 $row[
'redirection_mode'],
202 $row[
'redirection_url'],
203 $row[
'mailnotification'],
204 (
bool) $row[
'mailnottype'],
208 (
bool) $row[
'skill_service'],
209 (
bool) $row[
'hide_info_tab']
218 $values = array_merge(
232 [
'test_id' => [
'integer', $settings->
getTestId()]]
234 unset($this->instances_by_test_fi[$settings->
getTestId()]);
235 unset($this->instances_by_obj_fi[$settings->
getObjId()]);
getTestBehaviourSettings()
__construct(\ilDBInterface $db)
doSelect(string $where_part)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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