19declare(strict_types=1);
55 array $environment =
null
60 return [
false,
false];
62 return [
true, array_shift($v)];
66 $optgroup_lists =
$f->optionalGroup(
69 $lng->txt(
'tst_results_print_best_solution'),
70 $lng->txt(
'tst_results_print_best_solution_info')
73 $lng->txt(
'tst_show_solution_details'),
74 $lng->txt(
'tst_show_solution_details_desc')
78 $optgroup_lists = $optgroup_lists->withValue(
null);
81 $optgroup_singlepage =
$f->optionalGroup(
84 $lng->txt(
'tst_results_print_best_solution_singlepage'),
85 $lng->txt(
'tst_results_print_best_solution_singlepage_info')
88 $lng->txt(
'tst_show_solution_details_singlepage'),
89 $lng->txt(
'tst_show_solution_details_singlepage_desc')
92 $optgroup_singlepage = $optgroup_singlepage->withValue(
null);
96 $taxonomy_options = $environment[
'taxonomy_options'];
97 $taxonomy_ids =
$f->multiselect(
98 $lng->txt(
'tst_results_tax_filters'),
104 'solution_details' => $optgroup_lists,
105 'solution_details_singlepage' => $optgroup_singlepage,
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')
124 'solution_signature' =>
$f->checkbox(
125 $lng->txt(
'tst_show_solution_signature'),
126 $lng->txt(
'tst_show_solution_signature_desc')
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
143 return $f->section($fields,
$lng->txt(
'tst_results_details_options'))
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'];
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"] ?? []);
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())]
182 return $this->print_bs_with_res;
186 $clone = clone $this;
187 $clone->print_bs_with_res = $print_bs_with_res;
193 return $this->results_presentation;
197 $clone = clone $this;
198 $clone->results_presentation = $results_presentation;
204 return $this->examid_in_test_res;
208 $clone = clone $this;
209 $clone->examid_in_test_res = $examid_in_test_res;
215 return ($this->results_presentation & $bit) > 0;
219 $clone = clone $this;
220 $v = $clone->results_presentation;
225 if ($this->compareResultPresentation($bit)) {
229 $clone->results_presentation = $v;
235 return $this->compareResultPresentation(self::RESULTPRES_BIT_PASS_DETAILS);
239 return $this->modifyResultPresentation(self::RESULTPRES_BIT_PASS_DETAILS, $flag);
244 return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_DETAILS);
248 return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_DETAILS, $flag);
253 return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_PRINTVIEW);
257 return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_PRINTVIEW, $flag);
262 return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_FEEDBACK);
266 return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_FEEDBACK, $flag);
271 return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_ANSWERS_ONLY);
275 return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_ANSWERS_ONLY, $flag);
280 return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_SIGNATURE);
284 return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_SIGNATURE, $flag);
289 return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_SUGGESTED);
293 return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_SUGGESTED, $flag);
298 return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_LISTCOMPARE);
302 return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_LISTCOMPARE, $flag);
307 return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_LISTOWNANSWERS);
311 return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_LISTOWNANSWERS, $flag);
316 return $this->exportsettings;
320 $clone = clone $this;
321 $clone->exportsettings = $exportsettings;
326 return ($this->exportsettings & $bit) > 0;
330 $clone = clone $this;
331 $v = $clone->exportsettings;
336 if ($this->compareExportSetting($bit)) {
340 $clone->exportsettings = $v;
345 return $this->compareExportSetting(self::EXPORT_BIT_SINGLECHOICE_SHORT);
349 return $this->modifyExportSetting(self::EXPORT_BIT_SINGLECHOICE_SHORT, $flag);
354 return $this->taxonomy_filter_ids;
358 $clone = clone $this;
359 $clone->taxonomy_filter_ids = $taxonomy_filter_ids;
static return function(ContainerConfigurator $containerConfigurator)
withShowSolutionSuggested(bool $flag)
const RESULTPRES_BIT_SOLUTION_FEEDBACK
getShowSolutionListComparison()
toForm(\ilLanguage $lng, FieldFactory $f, Refinery $refinery, array $environment=null)
withTaxonomyFilterIds(array $taxonomy_filter_ids)
const RESULTPRES_BIT_SOLUTION_SUGGESTED
compareResultPresentation(int $bit)
getShowSolutionSignature()
withShowSolutionListComparison(bool $flag)
getShowExamIdInTestResults()
withShowPassDetails(bool $flag)
const EXPORT_BIT_SINGLECHOICE_SHORT
const RESULTPRES_BIT_SOLUTION_LISTOWNANSWERS
withExportSettings(int $exportsettings)
const RESULTPRES_BIT_SOLUTION_SIGNATURE
withShowSolutionSignature(bool $flag)
getShowSolutionAnswersOnly()
withPrintBestSolutionWithResult(bool $print_bs_with_res)
getShowSolutionFeedback()
const RESULTPRES_BIT_PASS_DETAILS
withShowSolutionFeedback(bool $flag)
__construct(int $test_id)
withResultsPresentation(int $results_presentation)
getPrintBestSolutionWithResult()
withShowSolutionDetails(bool $flag)
withShowSolutionPrintview(bool $flag)
const RESULTPRES_BIT_SOLUTION_LISTCOMPARE
const RESULTPRES_BIT_SOLUTION_DETAILS
withShowExamIdInTestResults(bool $examid_in_test_res)
withShowSolutionAnswersOnly(bool $flag)
modifyExportSetting(int $bit, bool $flag)
compareExportSetting(int $bit)
withExportSettingsSingleChoiceShort(bool $flag)
const RESULTPRES_BIT_SOLUTION_PRINTVIEW
getShowSolutionSuggested()
const RESULTPRES_BIT_SOLUTION_ANSWERS_ONLY
array $taxonomy_filter_ids
getExportSettingsSingleChoiceShort()
getShowSolutionPrintview()
int $results_presentation
modifyResultPresentation(int $bit, bool $flag)
withShowSolutionListOwnAnswers(bool $flag)
getShowSolutionListOwnAnswers()
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Refinery Factory $refinery