ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 ()
 
 getResultsPresentation ()
 
 withResultsPresentation (int $results_presentation)
 
 getShowExamIdInTestResults ()
 
 withShowExamIdInTestResults (bool $examid_in_test_res)
 
 getShowPassDetails ()
 
 withShowPassDetails (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)
 
 getExportSettings ()
 
 withExportSettings (int $exportsettings)
 
- 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
 

Protected Member Functions

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

Protected Attributes

bool $examid_in_test_res = true
 
int $exportsettings = 0
 
int $results_presentation = 0
 
- 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)

Definition at line 42 of file ilObjTestSettingsResultDetails.php.

References ILIAS\MetaData\Repository\Validation\Data\__construct().

43  {
45  }
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ compareExportSetting()

ilObjTestSettingsResultDetails::compareExportSetting ( int  $bit)
protected

Definition at line 231 of file ilObjTestSettingsResultDetails.php.

Referenced by modifyExportSetting().

231  : bool
232  {
233  return ($this->exportsettings & $bit) > 0;
234  }
+ Here is the caller graph for this function:

◆ compareResultPresentation()

ilObjTestSettingsResultDetails::compareResultPresentation ( int  $bit)
protected

Definition at line 138 of file ilObjTestSettingsResultDetails.php.

Referenced by getShowPassDetails(), getShowSolutionAnswersOnly(), getShowSolutionFeedback(), getShowSolutionListComparison(), getShowSolutionPrintview(), getShowSolutionSignature(), getShowSolutionSuggested(), and modifyResultPresentation().

138  : bool
139  {
140  return ($this->results_presentation & $bit) > 0;
141  }
+ Here is the caller graph for this function:

◆ getExportSettings()

ilObjTestSettingsResultDetails::getExportSettings ( )

Definition at line 221 of file ilObjTestSettingsResultDetails.php.

References $exportsettings.

Referenced by toStorage().

221  : int
222  {
223  return $this->exportsettings;
224  }
+ Here is the caller graph for this function:

◆ getResultsPresentation()

ilObjTestSettingsResultDetails::getResultsPresentation ( )

Definition at line 116 of file ilObjTestSettingsResultDetails.php.

References $results_presentation.

Referenced by toStorage().

116  : int
117  {
119  }
+ Here is the caller graph for this function:

◆ getShowExamIdInTestResults()

ilObjTestSettingsResultDetails::getShowExamIdInTestResults ( )

Definition at line 127 of file ilObjTestSettingsResultDetails.php.

References $examid_in_test_res.

Referenced by toForm(), and toStorage().

127  : bool
128  {
130  }
+ Here is the caller graph for this function:

◆ getShowPassDetails()

ilObjTestSettingsResultDetails::getShowPassDetails ( )

Definition at line 158 of file ilObjTestSettingsResultDetails.php.

References compareResultPresentation().

Referenced by ilObjTestScoreSettings\__construct().

158  : bool
159  {
160  return $this->compareResultPresentation(self::RESULTPRES_BIT_PASS_DETAILS);
161  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getShowSolutionAnswersOnly()

ilObjTestSettingsResultDetails::getShowSolutionAnswersOnly ( )

Definition at line 185 of file ilObjTestSettingsResultDetails.php.

References compareResultPresentation().

Referenced by toForm().

185  : bool
186  {
187  return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_ANSWERS_ONLY);
188  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getShowSolutionFeedback()

ilObjTestSettingsResultDetails::getShowSolutionFeedback ( )

Definition at line 176 of file ilObjTestSettingsResultDetails.php.

References compareResultPresentation().

Referenced by toForm().

176  : bool
177  {
178  return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_FEEDBACK);
179  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getShowSolutionListComparison()

ilObjTestSettingsResultDetails::getShowSolutionListComparison ( )

Definition at line 212 of file ilObjTestSettingsResultDetails.php.

References compareResultPresentation().

Referenced by toForm().

212  : bool
213  {
214  return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_LISTCOMPARE);
215  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getShowSolutionPrintview()

ilObjTestSettingsResultDetails::getShowSolutionPrintview ( )

Definition at line 167 of file ilObjTestSettingsResultDetails.php.

References compareResultPresentation().

Referenced by toForm().

167  : bool
168  {
169  return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_PRINTVIEW);
170  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getShowSolutionSignature()

ilObjTestSettingsResultDetails::getShowSolutionSignature ( )

Definition at line 194 of file ilObjTestSettingsResultDetails.php.

References compareResultPresentation().

Referenced by toForm().

194  : bool
195  {
196  return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_SIGNATURE);
197  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getShowSolutionSuggested()

ilObjTestSettingsResultDetails::getShowSolutionSuggested ( )

Definition at line 203 of file ilObjTestSettingsResultDetails.php.

References compareResultPresentation().

Referenced by toForm().

203  : bool
204  {
205  return $this->compareResultPresentation(self::RESULTPRES_BIT_SOLUTION_SUGGESTED);
206  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ modifyExportSetting()

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

Definition at line 235 of file ilObjTestSettingsResultDetails.php.

References compareExportSetting().

235  : self
236  {
237  $clone = clone $this;
238  $v = $clone->exportsettings;
239 
240  if ($flag) {
241  $v = $v | $bit;
242  } else {
243  if ($this->compareExportSetting($bit)) {
244  $v = $v ^ $bit;
245  }
246  }
247  $clone->exportsettings = $v;
248  return $clone;
249  }
+ Here is the call graph for this function:

◆ modifyResultPresentation()

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

Definition at line 142 of file ilObjTestSettingsResultDetails.php.

References compareResultPresentation().

Referenced by withShowPassDetails(), withShowSolutionAnswersOnly(), withShowSolutionFeedback(), withShowSolutionListComparison(), withShowSolutionPrintview(), withShowSolutionSignature(), and withShowSolutionSuggested().

142  : self
143  {
144  $clone = clone $this;
145  $v = $clone->results_presentation;
146 
147  if ($flag) {
148  $v = $v | $bit;
149  } else {
150  if ($this->compareResultPresentation($bit)) {
151  $v = $v ^ $bit;
152  }
153  }
154  $clone->results_presentation = $v;
155  return $clone;
156  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toForm()

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

Definition at line 47 of file ilObjTestSettingsResultDetails.php.

References getShowExamIdInTestResults(), getShowSolutionAnswersOnly(), getShowSolutionFeedback(), getShowSolutionListComparison(), getShowSolutionPrintview(), getShowSolutionSignature(), getShowSolutionSuggested(), ilLanguage\txt(), ILIAS\UI\Implementation\Component\Input\ViewControl\withAdditionalTransformation(), withShowExamIdInTestResults(), withShowSolutionAnswersOnly(), withShowSolutionFeedback(), withShowSolutionListComparison(), withShowSolutionPrintview(), withShowSolutionSignature(), withShowSolutionSuggested(), and ILIAS\UI\Implementation\Component\Input\withValue().

52  : FormInput {
53  $fields = [
54  'solution_best_solution' =>
55  $f->checkbox(
56  $lng->txt('tst_results_print_best_solution'),
57  $lng->txt('tst_results_print_best_solution_info')
59  'solution_feedback' => $f->checkbox(
60  $lng->txt('tst_show_solution_feedback'),
61  $lng->txt('tst_show_solution_feedback_desc')
63  'solution_suggested' => $f->checkbox(
64  $lng->txt('tst_show_solution_suggested'),
65  $lng->txt('tst_show_solution_suggested_desc')
67  'solution_printview' => $f->checkbox(
68  $lng->txt('tst_show_solution_printview'),
69  $lng->txt('tst_show_solution_printview_desc')
71  'solution_hide_page' => $f->checkbox(
72  $lng->txt('tst_hide_pagecontents'),
73  $lng->txt('tst_hide_pagecontents_desc')
75 
76  'solution_signature' => $f->checkbox(
77  $lng->txt('tst_show_solution_signature'),
78  $lng->txt('tst_show_solution_signature_desc')
79  )
81  //TODO ?->withDisabled($anonymity)
82  ,
83  'examid_in_test_res' => $f->checkbox(
84  $lng->txt('examid_in_test_res'),
85  $lng->txt('examid_in_test_res_desc')
87  ];
88 
89  return $f->section($fields, $lng->txt('tst_results_details_options'))
91  $refinery->custom()->transformation(
92  function ($v) {
93  return (clone $this)
94  ->withShowSolutionListComparison($v['solution_best_solution'])
95  ->withShowSolutionFeedback($v['solution_feedback'])
96  ->withShowSolutionSuggested($v['solution_suggested'])
97  ->withShowSolutionPrintview($v['solution_printview'])
98  ->withShowSolutionAnswersOnly($v['solution_hide_page'])
99  ->withShowSolutionSignature($v['solution_signature'])
100  ->withShowExamIdInTestResults($v["examid_in_test_res"]);
101  }
102  )
103  );
104  }
withShowExamIdInTestResults(bool $examid_in_test_res)
$lng
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:58
This describes inputs that can be used in forms.
Definition: FormInput.php:31
Refinery Factory $refinery
+ Here is the call graph for this function:

◆ toStorage()

ilObjTestSettingsResultDetails::toStorage ( )

Definition at line 106 of file ilObjTestSettingsResultDetails.php.

References getExportSettings(), getResultsPresentation(), getShowExamIdInTestResults(), and ILIAS\Repository\int().

106  : array
107  {
108  return [
109  'results_presentation' => ['integer', $this->getResultsPresentation()],
110  'examid_in_test_res' => ['integer', (int) $this->getShowExamIdInTestResults()],
111  'exportsettings' => ['integer', (int) $this->getExportSettings()],
112  'results_presentation' => ['integer', (int) $this->getResultsPresentation()]
113  ];
114  }
+ Here is the call graph for this function:

◆ withExportSettings()

ilObjTestSettingsResultDetails::withExportSettings ( int  $exportsettings)

Definition at line 225 of file ilObjTestSettingsResultDetails.php.

References $exportsettings.

225  : self
226  {
227  $clone = clone $this;
228  $clone->exportsettings = $exportsettings;
229  return $clone;
230  }

◆ withResultsPresentation()

ilObjTestSettingsResultDetails::withResultsPresentation ( int  $results_presentation)

Definition at line 120 of file ilObjTestSettingsResultDetails.php.

References $results_presentation.

120  : self
121  {
122  $clone = clone $this;
123  $clone->results_presentation = $results_presentation;
124  return $clone;
125  }

◆ withShowExamIdInTestResults()

ilObjTestSettingsResultDetails::withShowExamIdInTestResults ( bool  $examid_in_test_res)

Definition at line 131 of file ilObjTestSettingsResultDetails.php.

References $examid_in_test_res.

Referenced by toForm().

131  : self
132  {
133  $clone = clone $this;
134  $clone->examid_in_test_res = $examid_in_test_res;
135  return $clone;
136  }
+ Here is the caller graph for this function:

◆ withShowPassDetails()

ilObjTestSettingsResultDetails::withShowPassDetails ( bool  $flag)

Definition at line 162 of file ilObjTestSettingsResultDetails.php.

References modifyResultPresentation().

162  : self
163  {
164  return $this->modifyResultPresentation(self::RESULTPRES_BIT_PASS_DETAILS, $flag);
165  }
+ Here is the call graph for this function:

◆ withShowSolutionAnswersOnly()

ilObjTestSettingsResultDetails::withShowSolutionAnswersOnly ( bool  $flag)

Definition at line 189 of file ilObjTestSettingsResultDetails.php.

References modifyResultPresentation().

Referenced by toForm().

189  : self
190  {
191  return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_ANSWERS_ONLY, $flag);
192  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ withShowSolutionFeedback()

ilObjTestSettingsResultDetails::withShowSolutionFeedback ( bool  $flag)

Definition at line 180 of file ilObjTestSettingsResultDetails.php.

References modifyResultPresentation().

Referenced by toForm().

180  : self
181  {
182  return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_FEEDBACK, $flag);
183  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ withShowSolutionListComparison()

ilObjTestSettingsResultDetails::withShowSolutionListComparison ( bool  $flag)

Definition at line 216 of file ilObjTestSettingsResultDetails.php.

References modifyResultPresentation().

Referenced by toForm().

216  : self
217  {
218  return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_LISTCOMPARE, $flag);
219  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ withShowSolutionPrintview()

ilObjTestSettingsResultDetails::withShowSolutionPrintview ( bool  $flag)

Definition at line 171 of file ilObjTestSettingsResultDetails.php.

References modifyResultPresentation().

Referenced by toForm().

171  : self
172  {
173  return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_PRINTVIEW, $flag);
174  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ withShowSolutionSignature()

ilObjTestSettingsResultDetails::withShowSolutionSignature ( bool  $flag)

Definition at line 198 of file ilObjTestSettingsResultDetails.php.

References modifyResultPresentation().

Referenced by toForm().

198  : self
199  {
200  return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_SIGNATURE, $flag);
201  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ withShowSolutionSuggested()

ilObjTestSettingsResultDetails::withShowSolutionSuggested ( bool  $flag)

Definition at line 207 of file ilObjTestSettingsResultDetails.php.

References modifyResultPresentation().

Referenced by toForm().

207  : self
208  {
209  return $this->modifyResultPresentation(self::RESULTPRES_BIT_SOLUTION_SUGGESTED, $flag);
210  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $examid_in_test_res

bool ilObjTestSettingsResultDetails::$examid_in_test_res = true
protected

◆ $exportsettings

int ilObjTestSettingsResultDetails::$exportsettings = 0
protected

Definition at line 38 of file ilObjTestSettingsResultDetails.php.

Referenced by getExportSettings(), and withExportSettings().

◆ $results_presentation

int ilObjTestSettingsResultDetails::$results_presentation = 0
protected

◆ 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: