ILIAS  release_8 Revision v8.24
ilObjTestSettingsResultDetails Class Reference
+ Inheritance diagram for ilObjTestSettingsResultDetails:
+ Collaboration diagram for ilObjTestSettingsResultDetails:

Public Member Functions

 __construct (int $test_id)
 
 toForm (\ilLanguage $lng, FieldFactory $f, Refinery $refinery, array $environment=null)
 
 toStorage ()
 
 getPrintBestSolutionWithResult ()
 
 withPrintBestSolutionWithResult (bool $print_bs_with_res)
 
 getResultsPresentation ()
 
 withResultsPresentation (int $results_presentation)
 
 getShowExamIdInTestResults ()
 
 withShowExamIdInTestResults (bool $examid_in_test_res)
 
 getShowPassDetails ()
 
 withShowPassDetails (bool $flag)
 
 getShowSolutionDetails ()
 
 withShowSolutionDetails (bool $flag)
 
 getShowSolutionPrintview ()
 
 withShowSolutionPrintview (bool $flag)
 
 getShowSolutionFeedback ()
 
 withShowSolutionFeedback (bool $flag)
 
 getShowSolutionAnswersOnly ()
 
 withShowSolutionAnswersOnly (bool $flag)
 
 getShowSolutionSignature ()
 
 withShowSolutionSignature (bool $flag)
 
 getShowSolutionSuggested ()
 
 withShowSolutionSuggested (bool $flag)
 
 getShowSolutionListComparison ()
 
 withShowSolutionListComparison (bool $flag)
 
 getShowSolutionListOwnAnswers ()
 
 withShowSolutionListOwnAnswers (bool $flag)
 
 getExportSettings ()
 
 withExportSettings (int $exportsettings)
 
 getExportSettingsSingleChoiceShort ()
 
 withExportSettingsSingleChoiceShort (bool $flag)
 
 getTaxonomyFilterIds ()
 
 withTaxonomyFilterIds (array $taxonomy_filter_ids)
 
- Public Member Functions inherited from TestSettings
 __construct (int $test_id)
 
 getTestId ()
 
 withTestId (int $test_id)
 
 toForm (\ilLanguage $lng, FieldFactory $f, Refinery $refinery, array $environment=null)
 
 toStorage ()
 

Data Fields

const RESULTPRES_BIT_PASS_DETAILS = 1
 
const RESULTPRES_BIT_SOLUTION_DETAILS = 2
 
const RESULTPRES_BIT_SOLUTION_PRINTVIEW = 4
 
const RESULTPRES_BIT_SOLUTION_FEEDBACK = 8
 
const RESULTPRES_BIT_SOLUTION_ANSWERS_ONLY = 16
 
const RESULTPRES_BIT_SOLUTION_SIGNATURE = 32
 
const RESULTPRES_BIT_SOLUTION_SUGGESTED = 64
 
const RESULTPRES_BIT_SOLUTION_LISTCOMPARE = 128
 
const RESULTPRES_BIT_SOLUTION_LISTOWNANSWERS = 256
 
const EXPORT_BIT_SINGLECHOICE_SHORT = 1
 

Protected Member Functions

 compareResultPresentation (int $bit)
 
 modifyResultPresentation (int $bit, bool $flag)
 
 compareExportSetting (int $bit)
 
 modifyExportSetting (int $bit, bool $flag)
 

Protected Attributes

bool $print_bs_with_res = true
 
bool $examid_in_test_res = true
 
int $exportsettings = 0
 
int $results_presentation = 0
 
array $taxonomy_filter_ids = []
 
- Protected Attributes inherited from TestSettings
int $test_id
 

Detailed Description

Definition at line 25 of file ilObjTestSettingsResultDetails.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjTestSettingsResultDetails::__construct ( int  $test_id)

Reimplemented from TestSettings.

Definition at line 46 of file ilObjTestSettingsResultDetails.php.

47 {
49 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References TestSettings\$test_id, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ compareExportSetting()

ilObjTestSettingsResultDetails::compareExportSetting ( int  $bit)
protected

Definition at line 324 of file ilObjTestSettingsResultDetails.php.

324 : bool
325 {
326 return ($this->exportsettings & $bit) > 0;
327 }

◆ compareResultPresentation()

ilObjTestSettingsResultDetails::compareResultPresentation ( int  $bit)
protected

Definition at line 213 of file ilObjTestSettingsResultDetails.php.

213 : bool
214 {
215 return ($this->results_presentation & $bit) > 0;
216 }

◆ getExportSettings()

ilObjTestSettingsResultDetails::getExportSettings ( )

Definition at line 314 of file ilObjTestSettingsResultDetails.php.

◆ getExportSettingsSingleChoiceShort()

ilObjTestSettingsResultDetails::getExportSettingsSingleChoiceShort ( )

Definition at line 343 of file ilObjTestSettingsResultDetails.php.

343 : bool
344 {
345 return $this->compareExportSetting(self::EXPORT_BIT_SINGLECHOICE_SHORT);
346 }

◆ getPrintBestSolutionWithResult()

ilObjTestSettingsResultDetails::getPrintBestSolutionWithResult ( )

Definition at line 180 of file ilObjTestSettingsResultDetails.php.

◆ getResultsPresentation()

ilObjTestSettingsResultDetails::getResultsPresentation ( )

Definition at line 191 of file ilObjTestSettingsResultDetails.php.

◆ getShowExamIdInTestResults()

ilObjTestSettingsResultDetails::getShowExamIdInTestResults ( )

Definition at line 202 of file ilObjTestSettingsResultDetails.php.

◆ getShowPassDetails()

ilObjTestSettingsResultDetails::getShowPassDetails ( )

Definition at line 233 of file ilObjTestSettingsResultDetails.php.

233 : bool
234 {
235 return $this->compareResultPresentation(self::RESULTPRES_BIT_PASS_DETAILS);
236 }

Referenced by ilObjTestScoreSettings\__construct().

+ Here is the caller graph for this function:

◆ getShowSolutionAnswersOnly()

ilObjTestSettingsResultDetails::getShowSolutionAnswersOnly ( )

Definition at line 269 of file ilObjTestSettingsResultDetails.php.

269 : bool
270 {
271 return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_ANSWERS_ONLY);
272 }

◆ getShowSolutionDetails()

ilObjTestSettingsResultDetails::getShowSolutionDetails ( )

Definition at line 242 of file ilObjTestSettingsResultDetails.php.

242 : bool
243 {
244 return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_DETAILS);
245 }

◆ getShowSolutionFeedback()

ilObjTestSettingsResultDetails::getShowSolutionFeedback ( )

Definition at line 260 of file ilObjTestSettingsResultDetails.php.

260 : bool
261 {
262 return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_FEEDBACK);
263 }

◆ getShowSolutionListComparison()

ilObjTestSettingsResultDetails::getShowSolutionListComparison ( )

Definition at line 296 of file ilObjTestSettingsResultDetails.php.

296 : bool
297 {
298 return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_LISTCOMPARE);
299 }

◆ getShowSolutionListOwnAnswers()

ilObjTestSettingsResultDetails::getShowSolutionListOwnAnswers ( )

Definition at line 305 of file ilObjTestSettingsResultDetails.php.

305 : bool
306 {
307 return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_LISTOWNANSWERS);
308 }

◆ getShowSolutionPrintview()

ilObjTestSettingsResultDetails::getShowSolutionPrintview ( )

Definition at line 251 of file ilObjTestSettingsResultDetails.php.

251 : bool
252 {
253 return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_PRINTVIEW);
254 }

◆ getShowSolutionSignature()

ilObjTestSettingsResultDetails::getShowSolutionSignature ( )

Definition at line 278 of file ilObjTestSettingsResultDetails.php.

278 : bool
279 {
280 return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_SIGNATURE);
281 }

◆ getShowSolutionSuggested()

ilObjTestSettingsResultDetails::getShowSolutionSuggested ( )

Definition at line 287 of file ilObjTestSettingsResultDetails.php.

287 : bool
288 {
289 return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_SUGGESTED);
290 }

◆ getTaxonomyFilterIds()

ilObjTestSettingsResultDetails::getTaxonomyFilterIds ( )

Definition at line 352 of file ilObjTestSettingsResultDetails.php.

352 : array
353 {
355 }

◆ modifyExportSetting()

ilObjTestSettingsResultDetails::modifyExportSetting ( int  $bit,
bool  $flag 
)
protected

Definition at line 328 of file ilObjTestSettingsResultDetails.php.

328 : self
329 {
330 $clone = clone $this;
331 $v = $clone->exportsettings;
332
333 if ($flag) {
334 $v = $v | $bit;
335 } else {
336 if ($this->compareExportSetting($bit)) {
337 $v = $v ^ $bit;
338 }
339 }
340 $clone->exportsettings = $v;
341 return $clone;
342 }

◆ modifyResultPresentation()

ilObjTestSettingsResultDetails::modifyResultPresentation ( int  $bit,
bool  $flag 
)
protected

Definition at line 217 of file ilObjTestSettingsResultDetails.php.

217 : self
218 {
219 $clone = clone $this;
220 $v = $clone->results_presentation;
221
222 if ($flag) {
223 $v = $v | $bit;
224 } else {
225 if ($this->compareResultPresentation($bit)) {
226 $v = $v ^ $bit;
227 }
228 }
229 $clone->results_presentation = $v;
230 return $clone;
231 }

◆ toForm()

ilObjTestSettingsResultDetails::toForm ( \ilLanguage  $lng,
FieldFactory  $f,
Refinery  $refinery,
array  $environment = null 
)

Reimplemented from TestSettings.

Definition at line 51 of file ilObjTestSettingsResultDetails.php.

56 : FormInput {
57 $bool_with_optional_addition = $refinery->custom()->transformation(
58 function ($v) {
59 if (!$v) {
60 return [false, false]; //[enabled, show_best_solution]
61 }
62 return [true, array_shift($v)];
63 }
64 );
65
66 $optgroup_lists = $f->optionalGroup(
67 [
68 $f->checkbox(
69 $lng->txt('tst_results_print_best_solution'),
70 $lng->txt('tst_results_print_best_solution_info')
71 )->withValue($this->getShowSolutionListComparison())
72 ],
73 $lng->txt('tst_show_solution_details'),
74 $lng->txt('tst_show_solution_details_desc')
75 )->withAdditionalTransformation($bool_with_optional_addition);
76
77 if (!$this->getShowSolutionListOwnAnswers()) {
78 $optgroup_lists = $optgroup_lists->withValue(null);
79 }
80
81 $optgroup_singlepage = $f->optionalGroup(
82 [
83 $f->checkbox(
84 $lng->txt('tst_results_print_best_solution_singlepage'),
85 $lng->txt('tst_results_print_best_solution_singlepage_info')
86 )->withValue($this->getPrintBestSolutionWithResult())
87 ],
88 $lng->txt('tst_show_solution_details_singlepage'),
89 $lng->txt('tst_show_solution_details_singlepage_desc')
90 )->withAdditionalTransformation($bool_with_optional_addition);
91 if (!$this->getShowSolutionDetails()) {
92 $optgroup_singlepage = $optgroup_singlepage->withValue(null);
93 }
94
95
96 $taxonomy_options = $environment['taxonomy_options'];
97 $taxonomy_ids = $f->multiselect(
98 $lng->txt('tst_results_tax_filters'),
99 $taxonomy_options,
100 ''
101 );
102
103 $fields = [
104 'solution_details' => $optgroup_lists,
105 'solution_details_singlepage' => $optgroup_singlepage,
106
107 'solution_feedback' => $f->checkbox(
108 $lng->txt('tst_show_solution_feedback'),
109 $lng->txt('tst_show_solution_feedback_desc')
111 'solution_suggested' => $f->checkbox(
112 $lng->txt('tst_show_solution_suggested'),
113 $lng->txt('tst_show_solution_suggested_desc')
115 'solution_printview' => $f->checkbox(
116 $lng->txt('tst_show_solution_printview'),
117 $lng->txt('tst_show_solution_printview_desc')
119 'solution_hide_page' => $f->checkbox(
120 $lng->txt('tst_hide_pagecontents'),
121 $lng->txt('tst_hide_pagecontents_desc')
123
124 'solution_signature' => $f->checkbox(
125 $lng->txt('tst_show_solution_signature'),
126 $lng->txt('tst_show_solution_signature_desc')
127 )
129 //TODO ?->withDisabled($anonymity)
130 ,
131 'examid_in_test_res' => $f->checkbox(
132 $lng->txt('examid_in_test_res'),
133 $lng->txt('examid_in_test_res_desc')
135 'exp_sc_short' => $f->checkbox(
136 $lng->txt('tst_exp_sc_short'),
137 $lng->txt('tst_exp_sc_short_desc')
139 'result_tax_filters' => $taxonomy_ids
141 ];
142
143 return $f->section($fields, $lng->txt('tst_results_details_options'))
145 $refinery->custom()->transformation(
146 function ($v) {
147 list($solution_list_details, $solution_list_best_solution) = $v['solution_details'];
148 list($solution_sp_details, $solution_sp_best_solution) = $v['solution_details_singlepage'];
149 return (clone $this)
150 ->withShowSolutionListOwnAnswers($solution_list_details)
151 ->withShowSolutionListComparison($solution_list_best_solution)
152 ->withShowSolutionDetails($solution_sp_details)
153 ->withPrintBestSolutionWithResult($solution_sp_best_solution)
154 ->withShowSolutionFeedback($v['solution_feedback'])
155 ->withShowSolutionSuggested($v['solution_suggested'])
156 ->withShowSolutionPrintview($v['solution_printview'])
157 ->withShowSolutionAnswersOnly($v['solution_hide_page'])
158 ->withShowSolutionSignature($v['solution_signature'])
159 ->withShowExamIdInTestResults($v["examid_in_test_res"])
160 ->withExportSettingsSingleChoiceShort($v["exp_sc_short"])
161 ->withTaxonomyFilterIds($v["result_tax_filters"] ?? []);
162 }
163 )
164 );
165 }
This describes inputs that can be used in forms.
Definition: FormInput.php:32
Refinery Factory $refinery
withAdditionalTransformation(Transformation $trafo)
@inheritDoc
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:59
$lng

◆ toStorage()

ilObjTestSettingsResultDetails::toStorage ( )

Reimplemented from TestSettings.

Definition at line 167 of file ilObjTestSettingsResultDetails.php.

167 : array
168 {
169 return [
170 'print_bs_with_res' => ['integer', (int) $this->getPrintBestSolutionWithResult()],
171 'results_presentation' => ['integer', $this->getResultsPresentation()],
172 'examid_in_test_res' => ['integer', (int) $this->getShowExamIdInTestResults()],
173 'exportsettings' => ['integer', (int) $this->getExportSettings()],
174 'results_presentation' => ['integer', (int) $this->getResultsPresentation()],
175 'result_tax_filters' => ['string', serialize($this->getTaxonomyFilterIds())]
176 ];
177 }

References ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ withExportSettings()

ilObjTestSettingsResultDetails::withExportSettings ( int  $exportsettings)

Definition at line 318 of file ilObjTestSettingsResultDetails.php.

318 : self
319 {
320 $clone = clone $this;
321 $clone->exportsettings = $exportsettings;
322 return $clone;
323 }

◆ withExportSettingsSingleChoiceShort()

ilObjTestSettingsResultDetails::withExportSettingsSingleChoiceShort ( bool  $flag)

Definition at line 347 of file ilObjTestSettingsResultDetails.php.

347 : self
348 {
349 return $this->modifyExportSetting(self::EXPORT_BIT_SINGLECHOICE_SHORT, $flag);
350 }

◆ withPrintBestSolutionWithResult()

ilObjTestSettingsResultDetails::withPrintBestSolutionWithResult ( bool  $print_bs_with_res)

Definition at line 184 of file ilObjTestSettingsResultDetails.php.

184 : self
185 {
186 $clone = clone $this;
187 $clone->print_bs_with_res = $print_bs_with_res;
188 return $clone;
189 }

◆ withResultsPresentation()

ilObjTestSettingsResultDetails::withResultsPresentation ( int  $results_presentation)

Definition at line 195 of file ilObjTestSettingsResultDetails.php.

195 : self
196 {
197 $clone = clone $this;
198 $clone->results_presentation = $results_presentation;
199 return $clone;
200 }

◆ withShowExamIdInTestResults()

ilObjTestSettingsResultDetails::withShowExamIdInTestResults ( bool  $examid_in_test_res)

Definition at line 206 of file ilObjTestSettingsResultDetails.php.

206 : self
207 {
208 $clone = clone $this;
209 $clone->examid_in_test_res = $examid_in_test_res;
210 return $clone;
211 }

◆ withShowPassDetails()

ilObjTestSettingsResultDetails::withShowPassDetails ( bool  $flag)

Definition at line 237 of file ilObjTestSettingsResultDetails.php.

237 : self
238 {
239 return $this->modifyResultPresentation(self::RESULTPRES_BIT_PASS_DETAILS, $flag);
240 }

◆ withShowSolutionAnswersOnly()

ilObjTestSettingsResultDetails::withShowSolutionAnswersOnly ( bool  $flag)

Definition at line 273 of file ilObjTestSettingsResultDetails.php.

273 : self
274 {
275 return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_ANSWERS_ONLY, $flag);
276 }

◆ withShowSolutionDetails()

ilObjTestSettingsResultDetails::withShowSolutionDetails ( bool  $flag)

Definition at line 246 of file ilObjTestSettingsResultDetails.php.

246 : self
247 {
248 return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_DETAILS, $flag);
249 }

◆ withShowSolutionFeedback()

ilObjTestSettingsResultDetails::withShowSolutionFeedback ( bool  $flag)

Definition at line 264 of file ilObjTestSettingsResultDetails.php.

264 : self
265 {
266 return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_FEEDBACK, $flag);
267 }

◆ withShowSolutionListComparison()

ilObjTestSettingsResultDetails::withShowSolutionListComparison ( bool  $flag)

Definition at line 300 of file ilObjTestSettingsResultDetails.php.

300 : self
301 {
302 return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_LISTCOMPARE, $flag);
303 }

◆ withShowSolutionListOwnAnswers()

ilObjTestSettingsResultDetails::withShowSolutionListOwnAnswers ( bool  $flag)

Definition at line 309 of file ilObjTestSettingsResultDetails.php.

309 : self
310 {
311 return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_LISTOWNANSWERS, $flag);
312 }

◆ withShowSolutionPrintview()

ilObjTestSettingsResultDetails::withShowSolutionPrintview ( bool  $flag)

Definition at line 255 of file ilObjTestSettingsResultDetails.php.

255 : self
256 {
257 return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_PRINTVIEW, $flag);
258 }

◆ withShowSolutionSignature()

ilObjTestSettingsResultDetails::withShowSolutionSignature ( bool  $flag)

Definition at line 282 of file ilObjTestSettingsResultDetails.php.

282 : self
283 {
284 return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_SIGNATURE, $flag);
285 }

◆ withShowSolutionSuggested()

ilObjTestSettingsResultDetails::withShowSolutionSuggested ( bool  $flag)

Definition at line 291 of file ilObjTestSettingsResultDetails.php.

291 : self
292 {
293 return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_SUGGESTED, $flag);
294 }

◆ withTaxonomyFilterIds()

ilObjTestSettingsResultDetails::withTaxonomyFilterIds ( array  $taxonomy_filter_ids)

Definition at line 356 of file ilObjTestSettingsResultDetails.php.

356 : self
357 {
358 $clone = clone $this;
359 $clone->taxonomy_filter_ids = $taxonomy_filter_ids;
360 return $clone;
361 }

Field Documentation

◆ $examid_in_test_res

bool ilObjTestSettingsResultDetails::$examid_in_test_res = true
protected

Definition at line 40 of file ilObjTestSettingsResultDetails.php.

◆ $exportsettings

int ilObjTestSettingsResultDetails::$exportsettings = 0
protected

Definition at line 41 of file ilObjTestSettingsResultDetails.php.

◆ $print_bs_with_res

bool ilObjTestSettingsResultDetails::$print_bs_with_res = true
protected

Definition at line 39 of file ilObjTestSettingsResultDetails.php.

◆ $results_presentation

int ilObjTestSettingsResultDetails::$results_presentation = 0
protected

Definition at line 42 of file ilObjTestSettingsResultDetails.php.

◆ $taxonomy_filter_ids

array ilObjTestSettingsResultDetails::$taxonomy_filter_ids = []
protected

Definition at line 43 of file ilObjTestSettingsResultDetails.php.

◆ EXPORT_BIT_SINGLECHOICE_SHORT

const ilObjTestSettingsResultDetails::EXPORT_BIT_SINGLECHOICE_SHORT = 1

Definition at line 37 of file ilObjTestSettingsResultDetails.php.

◆ RESULTPRES_BIT_PASS_DETAILS

const ilObjTestSettingsResultDetails::RESULTPRES_BIT_PASS_DETAILS = 1

Definition at line 27 of file ilObjTestSettingsResultDetails.php.

◆ RESULTPRES_BIT_SOLUTION_ANSWERS_ONLY

const ilObjTestSettingsResultDetails::RESULTPRES_BIT_SOLUTION_ANSWERS_ONLY = 16

Definition at line 31 of file ilObjTestSettingsResultDetails.php.

◆ RESULTPRES_BIT_SOLUTION_DETAILS

const ilObjTestSettingsResultDetails::RESULTPRES_BIT_SOLUTION_DETAILS = 2

Definition at line 28 of file ilObjTestSettingsResultDetails.php.

◆ RESULTPRES_BIT_SOLUTION_FEEDBACK

const ilObjTestSettingsResultDetails::RESULTPRES_BIT_SOLUTION_FEEDBACK = 8

Definition at line 30 of file ilObjTestSettingsResultDetails.php.

◆ RESULTPRES_BIT_SOLUTION_LISTCOMPARE

const ilObjTestSettingsResultDetails::RESULTPRES_BIT_SOLUTION_LISTCOMPARE = 128

Definition at line 34 of file ilObjTestSettingsResultDetails.php.

◆ RESULTPRES_BIT_SOLUTION_LISTOWNANSWERS

const ilObjTestSettingsResultDetails::RESULTPRES_BIT_SOLUTION_LISTOWNANSWERS = 256

Definition at line 35 of file ilObjTestSettingsResultDetails.php.

◆ RESULTPRES_BIT_SOLUTION_PRINTVIEW

const ilObjTestSettingsResultDetails::RESULTPRES_BIT_SOLUTION_PRINTVIEW = 4

Definition at line 29 of file ilObjTestSettingsResultDetails.php.

◆ RESULTPRES_BIT_SOLUTION_SIGNATURE

const ilObjTestSettingsResultDetails::RESULTPRES_BIT_SOLUTION_SIGNATURE = 32

Definition at line 32 of file ilObjTestSettingsResultDetails.php.

◆ RESULTPRES_BIT_SOLUTION_SUGGESTED

const ilObjTestSettingsResultDetails::RESULTPRES_BIT_SOLUTION_SUGGESTED = 64

Definition at line 33 of file ilObjTestSettingsResultDetails.php.


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