ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
ILIAS\Test\Settings\SettingsFactory Class Reference
+ Collaboration diagram for ILIAS\Test\Settings\SettingsFactory:

Public Member Functions

 createMainSettingsFromDBRow (array $row)
 
 createDefaultMainSettings ()
 
 createScoreSettingsFromDBRow (array $row)
 
 createTemplateFromDBRow (array $row)
 

Detailed Description

Definition at line 41 of file SettingsFactory.php.

Member Function Documentation

◆ createDefaultMainSettings()

ILIAS\Test\Settings\SettingsFactory::createDefaultMainSettings ( )

Definition at line 116 of file SettingsFactory.php.

116 : MainSettings
117 {
118 return new MainSettings(
119 0,
120 new SettingsGeneral(),
121 new SettingsIntroduction(),
122 new SettingsAccess(),
123 new SettingsTestBehaviour(),
124 new SettingsQuestionBehaviour(
125 0,
126 false,
127 0,
128 false,
129 false,
130 false,
131 false,
132 false,
133 false,
134 false,
135 false
136 ),
137 new SettingsParticipantFunctionality(),
138 new SettingsFinishing(),
139 new SettingsAdditional()
140 );
141 }

◆ createMainSettingsFromDBRow()

ILIAS\Test\Settings\SettingsFactory::createMainSettingsFromDBRow ( array  $row)

Definition at line 43 of file SettingsFactory.php.

43 : MainSettings
44 {
45 return new MainSettings(
46 $row['id'],
47 new SettingsGeneral(
48 $row['question_set_type'],
49 (bool) $row['anonymity']
50 ),
51 new SettingsIntroduction(
52 (bool) $row['intro_enabled'],
53 $row['introduction_page_id'],
54 (bool) $row['conditions_checkbox_enabled'],
55 ),
56 new SettingsAccess(
57 (bool) $row['starting_time_enabled'],
58 $row['starting_time'] !== 0
59 ? \DateTimeImmutable::createFromFormat('U', (string) $row['starting_time'])
60 : null,
61 (bool) $row['ending_time_enabled'],
62 $row['ending_time'] !== 0
63 ? \DateTimeImmutable::createFromFormat('U', (string) $row['ending_time'])
64 : null,
65 (bool) $row['password_enabled'],
66 $row['password'],
67 $row['ip_range_from'],
68 $row['ip_range_to'],
69 (bool) $row['fixed_participants'],
70 ),
71 new SettingsTestBehaviour(
72 $row['nr_of_tries'],
73 (bool) $row['block_after_passed'],
74 $row['pass_waiting'],
75 (bool) $row['enable_processing_time'],
76 $row['processing_time'],
77 (bool) $row['reset_processing_time'],
78 $row['kiosk'],
79 (bool) $row['examid_in_test_pass']
80 ),
81 new SettingsQuestionBehaviour(
82 (int) $row['title_output'],
83 (bool) $row['autosave'],
84 $row['autosave_ival'],
85 (bool) $row['shuffle_questions'],
86 (bool) $row['answer_feedback_points'],
87 (bool) $row['answer_feedback'],
88 (bool) $row['specific_feedback'],
89 (bool) $row['instant_verification'],
90 (bool) $row['force_inst_fb'],
91 (bool) $row['inst_fb_answer_fixation'],
92 (bool) $row['follow_qst_answer_fixation']
93 ),
94 new SettingsParticipantFunctionality(
95 (bool) $row['use_previous_answers'],
96 (bool) $row['suspend_test_allowed'],
97 (bool) $row['sequence_settings'],
98 $row['usr_pass_overview_mode'],
99 (bool) $row['show_marker'],
100 (bool) $row['show_questionlist']
101 ),
102 new SettingsFinishing(
103 (bool) $row['enable_examview'],
104 (bool) $row['showfinalstatement'],
105 $row['concluding_remarks_page_id'],
106 RedirectionModes::tryFrom($row['redirection_mode']) ?? RedirectionModes::NONE,
107 $row['redirection_url']
108 ),
109 new SettingsAdditional(
110 (bool) $row['skill_service'],
111 (bool) $row['hide_info_tab']
112 )
113 );
114 }

◆ createScoreSettingsFromDBRow()

ILIAS\Test\Settings\SettingsFactory::createScoreSettingsFromDBRow ( array  $row)

Definition at line 143 of file SettingsFactory.php.

143 : ScoreSettings
144 {
145 return new ScoreSettings(
146 $row['id'],
147 (new SettingsScoring())
148 ->withCountSystem((int) $row['count_system'])
149 ->withScoreCutting((int) $row['score_cutting'])
150 ->withPassScoring((int) $row['pass_scoring']),
151 (new SettingsResultSummary())
152 ->withScoreReporting(ScoreReportingTypes::from($row['score_reporting']))
153 ->withReportingDate(!empty($row['reporting_date'])
154 ? \DateTimeImmutable::createFromFormat('U', (string) $row['reporting_date'])
155 : null)
156 ->withShowGradingStatusEnabled((bool) $row['show_grading_status'])
157 ->withShowGradingMarkEnabled((bool) $row['show_grading_mark'])
158 ->withPassDeletionAllowed((bool) $row['pass_deletion_allowed']),
159 //->withShowPassDetails derived from results_presentation with bit RESULTPRES_BIT_PASS_DETAILS
160 (new SettingsResultDetails())
161 ->withResultsPresentation((int) $row['results_presentation'])
162 ->withShowExamIdInTestResults((bool) $row['examid_in_test_res'])
163 ->withExportSettings((int) $row['exportsettings']),
164 (new SettingsGamification())
165 ->withHighscoreEnabled((bool) $row['highscore_enabled'])
166 ->withHighscoreAnon((bool) $row['highscore_anon'])
167 ->withHighscoreAchievedTS((bool) $row['highscore_achieved_ts'])
168 ->withHighscoreScore((bool) $row['highscore_score'])
169 ->withHighscorePercentage((bool) $row['highscore_percentage'])
170 ->withHighscoreWTime((bool) $row['highscore_wtime'])
171 ->withHighscoreOwnTable((bool) $row['highscore_own_table'])
172 ->withHighscoreTopTable((bool) $row['highscore_top_table'])
173 ->withHighscoreTopNum((int) $row['highscore_top_num'])
174 );
175 }

References ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\from().

+ Here is the call graph for this function:

◆ createTemplateFromDBRow()

ILIAS\Test\Settings\SettingsFactory::createTemplateFromDBRow ( array  $row)

Definition at line 177 of file SettingsFactory.php.

177 : PersonalSettingsTemplate
178 {
179 return new PersonalSettingsTemplate(
180 $row['test_defaults_id'],
181 $row['user_fi'],
182 $row['name'],
183 $row['description'] ?? '',
184 $row['author'] ?? '',
185 \DateTimeImmutable::createFromFormat('U', (string) $row['tstamp']),
186 $row['settings_id'] ?? -1,
187 );
188 }

The documentation for this class was generated from the following file: