19declare(strict_types=1);
50 ?array $environment =
null
53 'solution_best_solution' =>
55 $lng->txt(
'tst_results_print_best_solution'),
56 $lng->txt(
'tst_results_print_best_solution_info')
58 'solution_feedback' =>
$f->checkbox(
59 $lng->txt(
'tst_show_solution_feedback'),
60 $lng->txt(
'tst_show_solution_feedback_desc')
62 'solution_suggested' =>
$f->checkbox(
63 $lng->txt(
'tst_show_solution_suggested'),
64 $lng->txt(
'tst_show_solution_suggested_desc')
66 'solution_printview' =>
$f->checkbox(
67 $lng->txt(
'tst_show_solution_printview'),
68 $lng->txt(
'tst_show_solution_printview_desc')
70 'solution_hide_page' =>
$f->checkbox(
71 $lng->txt(
'tst_hide_pagecontents'),
72 $lng->txt(
'tst_hide_pagecontents_desc')
75 'solution_signature' =>
$f->checkbox(
76 $lng->txt(
'tst_show_solution_signature'),
77 $lng->txt(
'tst_show_solution_signature_desc')
82 'examid_in_test_res' =>
$f->checkbox(
83 $lng->txt(
'examid_in_test_res'),
84 $lng->txt(
'examid_in_test_res_desc')
88 return $f->section($fields,
$lng->txt(
'tst_results_details_options'))
89 ->withAdditionalTransformation(
108 'results_presentation' => [
'integer', $this->getResultsPresentation()],
109 'examid_in_test_res' => [
'integer', (
int) $this->getShowExamIdInTestResults()],
110 'exportsettings' => [
'integer', $this->getExportSettings()]
136 return $this->results_presentation;
140 $clone = clone $this;
141 $clone->results_presentation = $results_presentation;
147 return $this->examid_in_test_res;
151 $clone = clone $this;
152 $clone->examid_in_test_res = $examid_in_test_res;
158 return ($this->results_presentation & $bit) > 0;
162 $clone = clone $this;
163 $v = $clone->results_presentation;
168 if ($this->compareResultPresentation($bit)) {
172 $clone->results_presentation = $v;
178 return $this->compareResultPresentation(self::RESULTPRES_BIT_PASS_DETAILS);
182 return $this->modifyResultPresentation(self::RESULTPRES_BIT_PASS_DETAILS, $flag);
187 return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_PRINTVIEW);
191 return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_PRINTVIEW, $flag);
196 return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_FEEDBACK);
200 return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_FEEDBACK, $flag);
205 return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_ANSWERS_ONLY);
209 return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_ANSWERS_ONLY, $flag);
214 return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_SIGNATURE);
218 return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_SIGNATURE, $flag);
223 return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_SUGGESTED);
227 return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_SUGGESTED, $flag);
232 return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_LISTCOMPARE);
236 return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_LISTCOMPARE, $flag);
241 return $this->exportsettings;
245 $clone = clone $this;
246 $clone->exportsettings = $exportsettings;
251 return ($this->exportsettings & $bit) > 0;
255 $clone = clone $this;
256 $v = $clone->exportsettings;
261 if ($this->compareExportSetting($bit)) {
265 $clone->exportsettings = $v;
272 'results_presentation' => $this->getResultsPresentation(),
273 'examid_in_test_res' => $this->getShowExamIdInTestResults(),
274 'exportsettings' => $this->getExportSettings()
281 ->withResultsPresentation((
int)
$data[
'results_presentation'])
282 ->withShowExamIdInTestResults((
bool)
$data[
'examid_in_test_res'])
283 ->withExportSettings((
int)
$data[
'exportsettings']);
compareResultPresentation(int $bit)
modifyResultPresentation(int $bit, bool $flag)
withExportSettings(int $exportsettings)
toLog(AdditionalInformationGenerator $additional_info)
withShowSolutionPrintview(bool $flag)
getShowSolutionPrintview()
toForm(\ilLanguage $lng, FieldFactory $f, Refinery $refinery, ?array $environment=null)
const RESULTPRES_BIT_SOLUTION_FEEDBACK
withShowPassDetails(bool $flag)
const RESULTPRES_BIT_PASS_DETAILS
withShowSolutionSignature(bool $flag)
const RESULTPRES_BIT_SOLUTION_LISTCOMPARE
const RESULTPRES_BIT_SOLUTION_LISTOWNANSWERS
compareExportSetting(int $bit)
withShowSolutionAnswersOnly(bool $flag)
getShowSolutionListComparison()
getShowSolutionSignature()
getShowSolutionSuggested()
withShowSolutionListComparison(bool $flag)
modifyExportSetting(int $bit, bool $flag)
static fromExport(array $data)
Creates an instance of the object from an array.
const RESULTPRES_BIT_SOLUTION_SUGGESTED
getShowSolutionFeedback()
int $results_presentation
getShowExamIdInTestResults()
withResultsPresentation(int $results_presentation)
getShowSolutionAnswersOnly()
const RESULTPRES_BIT_SOLUTION_SIGNATURE
withShowSolutionFeedback(bool $flag)
toExport()
Transform the object into a simple, associative array.
withShowSolutionSuggested(bool $flag)
withShowExamIdInTestResults(bool $examid_in_test_res)
const RESULTPRES_BIT_SOLUTION_PRINTVIEW
const RESULTPRES_BIT_SOLUTION_ANSWERS_ONLY
const RESULTPRES_BIT_SOLUTION_DETAILS
This interface allows an object to define its own transformation into a language-neutral,...