19 declare(strict_types=1);
37 $where_part =
'WHERE obj_fi = ' . $this->db->quote($obj_fi,
'integer');
43 $where_part =
'WHERE test_id = ' . $this->db->quote($test_id,
'integer');
49 $query =
'SELECT ' . PHP_EOL
50 .
'question_set_type,' . PHP_EOL
51 .
'anonymity,' . PHP_EOL
52 .
'test_id,' . PHP_EOL
53 .
'intro_enabled,' . PHP_EOL
54 .
'hide_info_tab,' . PHP_EOL
55 .
'conditions_checkbox_enabled,' . PHP_EOL
56 .
'introduction,' . PHP_EOL
57 .
'introduction_page_id,' . PHP_EOL
58 .
'starting_time_enabled,' . PHP_EOL
59 .
'starting_time,' . PHP_EOL
60 .
'ending_time_enabled,' . PHP_EOL
61 .
'ending_time,' . PHP_EOL
62 .
'password_enabled,' . PHP_EOL
63 .
'password,' . PHP_EOL
64 .
'fixed_participants,' . PHP_EOL
65 .
'nr_of_tries,' . PHP_EOL
66 .
'block_after_passed,' . PHP_EOL
67 .
'pass_waiting,' . PHP_EOL
68 .
'enable_processing_time,' . PHP_EOL
69 .
'processing_time,' . PHP_EOL
70 .
'reset_processing_time,' . PHP_EOL
72 .
'examid_in_test_pass,' . PHP_EOL
73 .
'title_output,' . PHP_EOL
74 .
'autosave,' . PHP_EOL
75 .
'autosave_ival,' . PHP_EOL
76 .
'shuffle_questions,' . PHP_EOL
77 .
'offer_question_hints,' . PHP_EOL
78 .
'answer_feedback_points,' . PHP_EOL
79 .
'answer_feedback,' . PHP_EOL
80 .
'specific_feedback,' . PHP_EOL
81 .
'instant_verification,' . PHP_EOL
82 .
'force_inst_fb,' . PHP_EOL
83 .
'inst_fb_answer_fixation,' . PHP_EOL
84 .
'follow_qst_answer_fixation,' . PHP_EOL
85 .
'obligations_enabled,' . PHP_EOL
86 .
'use_previous_answers,' . PHP_EOL
87 .
'suspend_test_allowed,' . PHP_EOL
88 .
'sequence_settings,' . PHP_EOL
89 .
'usr_pass_overview_mode,' . PHP_EOL
90 .
'show_marker,' . PHP_EOL
91 .
'show_questionlist,' . PHP_EOL
92 .
'enable_examview,' . PHP_EOL
93 .
'showfinalstatement,' . PHP_EOL
94 .
'finalstatement,' . PHP_EOL
95 .
'concluding_remarks_page_id,' . PHP_EOL
96 .
'redirection_mode,' . PHP_EOL
97 .
'redirection_url,' . PHP_EOL
98 .
'mailnotification,' . PHP_EOL
99 .
'mailnottype,' . PHP_EOL
100 .
'skill_service' . PHP_EOL
101 .
'FROM ' . self::TABLE_NAME . PHP_EOL
104 $res = $this->db->query($query);
106 if ($this->db->numRows(
$res) == 0) {
107 throw new \Exception(
'Mo main settings for: ' . $where_part);
110 $row = $this->db->fetchAssoc(
$res);
112 $test_id = (
int) $row[
'test_id'];
118 $row[
'question_set_type'],
119 (
bool) $row[
'anonymity']
123 (
bool) $row[
'intro_enabled'],
124 $row[
'introduction'],
125 $row[
'introduction_page_id'],
126 (
bool) $row[
'conditions_checkbox_enabled'],
130 (
bool) $row[
'starting_time_enabled'],
131 $row[
'starting_time'] !== 0
132 ? DateTimeImmutable::createFromFormat(
'U', (
string) $row[
'starting_time'])
134 (
bool) $row[
'ending_time_enabled'],
135 $row[
'ending_time'] !== 0
136 ? DateTimeImmutable::createFromFormat(
'U', (
string) $row[
'ending_time'])
138 (
bool) $row[
'password_enabled'],
140 (
bool) $row[
'fixed_participants'],
145 (
bool) $row[
'block_after_passed'],
146 $row[
'pass_waiting'],
147 (
bool) $row[
'enable_processing_time'],
148 $row[
'processing_time'],
149 (
bool) $row[
'reset_processing_time'],
151 (
bool) $row[
'examid_in_test_pass']
155 (
int) $row[
'title_output'],
156 (
bool) $row[
'autosave'],
157 $row[
'autosave_ival'],
158 (
bool) $row[
'shuffle_questions'],
159 (
bool) $row[
'offer_question_hints'],
160 (
bool) $row[
'answer_feedback_points'],
161 (
bool) $row[
'answer_feedback'],
162 (
bool) $row[
'specific_feedback'],
163 (
bool) $row[
'instant_verification'],
164 (
bool) $row[
'force_inst_fb'],
165 (
bool) $row[
'inst_fb_answer_fixation'],
166 (
bool) $row[
'follow_qst_answer_fixation'],
167 (
bool) $row[
'obligations_enabled']
171 (
bool) $row[
'use_previous_answers'],
172 (
bool) $row[
'suspend_test_allowed'],
173 (
bool) $row[
'sequence_settings'],
174 $row[
'usr_pass_overview_mode'],
175 (
bool) $row[
'show_marker'],
176 (
bool) $row[
'show_questionlist']
180 (
bool) $row[
'enable_examview'],
181 (
bool) $row[
'showfinalstatement'],
182 $row[
'finalstatement'],
183 $row[
'concluding_remarks_page_id'],
184 $row[
'redirection_mode'],
185 $row[
'redirection_url'],
186 $row[
'mailnotification'],
187 (
bool) $row[
'mailnottype'],
191 (
bool) $row[
'skill_service'],
192 (
bool) $row[
'hide_info_tab']
201 $values = array_merge(
215 [
'test_id' => [
'integer', $settings->
getTestId()]]
store(ilObjTestMainSettings $settings)
const STORAGE_DATE_FORMAT
getQuestionBehaviourSettings()
doSelect(string $where_part)
getIntroductionSettings()
__construct(ilDBInterface $db)
getTestBehaviourSettings()
getParticipantFunctionalitySettings()