ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
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 40 of file SettingsFactory.php.

Member Function Documentation

◆ createDefaultMainSettings()

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

Definition at line 115 of file SettingsFactory.php.

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

◆ createMainSettingsFromDBRow()

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

Definition at line 42 of file SettingsFactory.php.

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

◆ createScoreSettingsFromDBRow()

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

Definition at line 142 of file SettingsFactory.php.

142 : ScoreSettings
143 {
144 return new ScoreSettings(
145 $row['id'],
146 (new SettingsScoring())
147 ->withCountSystem((int) $row['count_system'])
148 ->withScoreCutting((int) $row['score_cutting'])
149 ->withPassScoring((int) $row['pass_scoring']),
150 (new SettingsResultSummary())
151 ->withScoreReporting(ScoreReportingTypes::from($row['score_reporting']))
152 ->withReportingDate(!empty($row['reporting_date'])
153 ? \DateTimeImmutable::createFromFormat('U', (string) $row['reporting_date'])
154 : null)
155 ->withShowGradingStatusEnabled((bool) $row['show_grading_status'])
156 ->withShowGradingMarkEnabled((bool) $row['show_grading_mark'])
157 ->withPassDeletionAllowed((bool) $row['pass_deletion_allowed']),
158 //->withShowPassDetails derived from results_presentation with bit RESULTPRES_BIT_PASS_DETAILS
159 (new SettingsResultDetails())
160 ->withResultsPresentation((int) $row['results_presentation'])
161 ->withShowExamIdInTestResults((bool) $row['examid_in_test_res'])
162 ->withExportSettings((int) $row['exportsettings']),
163 );
164 }

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 166 of file SettingsFactory.php.

166 : PersonalSettingsTemplate
167 {
168 return new PersonalSettingsTemplate(
169 $row['test_defaults_id'],
170 $row['user_fi'],
171 $row['name'],
172 $row['description'] ?? '',
173 $row['author'] ?? '',
174 \DateTimeImmutable::createFromFormat('U', (string) $row['tstamp']),
175 $row['settings_id'] ?? -1,
176 );
177 }

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