19 declare(strict_types=1);
32 private ProcessLockModes $process_lock_mode = ProcessLockModes::ASS_PROC_LOCK_MODE_NONE,
33 private string $image_map_line_color =
'FF0000',
35 private int $skill_triggering_number_of_answers = 1,
36 private bool $export_essay_questions_as_html =
false,
37 private array $disabled_question_types = [],
38 private bool $manual_scoring_enabled =
false,
39 private bool $adjusting_questions_with_results_allowed =
false,
40 private bool $page_editor_enabled =
false 53 $ff = $ui_factory->input()->field();
56 static fn(array $v):
int => $v[
'question_type_id'],
59 fn(array $v):
bool => !in_array($v[
'question_type_id'], $this->disabled_question_types)
65 'global_settings' => $ff->group([
71 $enabled_question_types
73 ])->withAdditionalTransformation($trafo)
79 return $this->process_lock_mode;
85 $clone->process_lock_mode = $process_lock_mode;
91 return $this->image_map_line_color;
97 $clone->image_map_line_color = $image_map_line_color;
103 return $this->user_identifier;
108 $clone = clone $this;
109 $clone->user_identifier = $user_identifier;
115 return $this->skill_triggering_number_of_answers;
120 $clone = clone $this;
121 $clone->skill_triggering_number_of_answers = $skill_triggering_number_of_answers;
127 return $this->export_essay_questions_as_html;
132 $clone = clone $this;
133 $clone->export_essay_questions_as_html = $export_essay_questions_as_html;
142 return $this->disabled_question_types;
150 $clone = clone $this;
151 $clone->disabled_question_types = $disabled_question_types;
157 return $this->manual_scoring_enabled;
162 $clone = clone $this;
163 $clone->manual_scoring_enabled = $manual_scoring_enabled;
169 return $this->adjusting_questions_with_results_allowed;
174 $clone = clone $this;
175 $clone->adjusting_questions_with_results_allowed = $adjusting_questions_with_results_allowed;
181 return $this->page_editor_enabled;
186 $clone = clone $this;
187 $clone->page_editor_enabled = $page_editor_enabled;
193 array $all_question_types
195 return $refinery->custom()->transformation(
196 static function ($vs) use ($all_question_types):
self {
197 $process_lock_mode = ProcessLockModes::ASS_PROC_LOCK_MODE_NONE;
198 if ($vs[
'general_settings'][
'process_lock_mode'] !==
null) {
203 substr($vs[
'general_settings'][
'image_map_line_color']->asHex(), 1),
205 $vs[
'general_settings'][
'skill_triggering_number_of_answers'],
206 $vs[
'general_settings'][
'export_essay_questions_as_html'],
209 static function (array
$c, array $v) use ($vs): array {
210 if (!in_array($v[
'question_type_id'], $vs[
'question_settings'][
'enabled_question_types'])) {
211 $c[] = $v[
'question_type_id'];
217 $vs[
'question_settings'][
'manual_scoring_enabled'],
218 $vs[
'question_settings'][
'adjusting_questions_with_results_allowed']
231 'process_lock_mode' => $ff->optionalGroup(
233 $ff->radio($lng->
txt(
'ass_process_lock_mode'))
235 ProcessLockModes::ASS_PROC_LOCK_MODE_FILE->value,
236 $lng->
txt(
'ass_process_lock_mode_file'),
237 $lng->
txt(
'ass_process_lock_mode_file_desc')
240 $lng->
txt(
'ass_process_lock_mode_db'),
241 $lng->
txt(
'ass_process_lock_mode_db_desc')
244 $lng->
txt(
'ass_process_lock')
245 )->withByline($lng->
txt(
'ass_process_lock_desc'))
246 ->
withValue($this->process_lock_mode === ProcessLockModes::ASS_PROC_LOCK_MODE_NONE ?
null : [$this->process_lock_mode->value]),
247 'image_map_line_color' => $ff->colorSelect($lng->
txt(
'imap_line_color'))
248 ->
withValue(
'#' . $this->image_map_line_color),
249 'user_identifier' => $ff->select(
250 $lng->
txt(
'user_criteria'),
252 UserIdentifiers::cases(),
254 $c[$v->value] = $v->value;
259 )->withRequired(
true)
260 ->withByline($lng->
txt(
'user_criteria_desc'))
261 ->
withValue($this->user_identifier->value),
262 'skill_triggering_number_of_answers' => $ff->numeric($lng->
txt(
'tst_skill_triggerings_num_req_answers'))
264 ->withByline($lng->
txt(
'tst_skill_triggerings_num_req_answers_desc'))
265 ->
withValue($this->skill_triggering_number_of_answers),
266 'export_essay_questions_as_html' => $ff->checkbox($lng->
txt(
'export_essay_qst_with_html'))
267 ->withByline($lng->
txt(
'export_essay_qst_with_html_desc'))
268 ->
withValue($this->export_essay_questions_as_html)
270 $lng->
txt(
'settings')
277 array $all_question_types,
278 array $enabled_question_types
282 'enabled_question_types' => $ff->multiSelect(
283 $lng->
txt(
'assf_allowed_questiontypes'),
285 array_keys($all_question_types),
286 function (array
$c,
string $v) use ($all_question_types): array {
287 $c[$all_question_types[$v][
'question_type_id']] = $v;
292 )->withByline($lng->
txt(
'assf_allowed_questiontypes_desc'))
294 'manual_scoring_enabled' => $ff->checkbox($lng->
txt(
'activate_manual_scoring'))
295 ->withByline($lng->
txt(
'activate_manual_scoring_desc'))
297 'adjusting_questions_with_results_allowed' => $ff->checkbox($lng->
txt(
'assessment_scoring_adjust'))
298 ->withByline($lng->
txt(
'assessment_scoring_adjust_desc'))
301 $lng->
txt(
'assf_questiontypes')
getSkillTriggeringNumberOfAnswers()
buildGeneralSettingsInputs(FieldFactory $ff, Refinery $refinery, \ilLanguage $lng)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
withDisabledQuestionTypes(array $disabled_question_types)
withSkillTriggeringNumberOfAnswers(int $skill_triggering_number_of_answers)
getExportEssayQuestionsAsHtml()
buildQuestionSettingsInputs(FieldFactory $ff, \ilLanguage $lng, array $all_question_types, array $enabled_question_types)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
buildGlobalSettingsBuilderTrafo(Refinery $refinery, array $all_question_types)
withUserIdentifier(UserIdentifiers $user_identifier)
__construct(private ProcessLockModes $process_lock_mode=ProcessLockModes::ASS_PROC_LOCK_MODE_NONE, private string $image_map_line_color='FF0000', private UserIdentifiers $user_identifier=UserIdentifiers::USER_ID, private int $skill_triggering_number_of_answers=1, private bool $export_essay_questions_as_html=false, private array $disabled_question_types=[], private bool $manual_scoring_enabled=false, private bool $adjusting_questions_with_results_allowed=false, private bool $page_editor_enabled=false)
getDisabledQuestionTypes()
withProcessLockMode(ProcessLockModes $process_lock_mode)
withExportEssayQuestionsAsHtml(bool $export_essay_questions_as_html)
withManualScoringEnabled(bool $manual_scoring_enabled)
withAdjustingQuestionsWithResultsAllowed(bool $adjusting_questions_with_results_allowed)
toForm(UIFactory $ui_factory, Refinery $refinery, \ilLanguage $lng)
withPageEditorEnabled(bool $page_editor_enabled)
withImageMapLineColor(string $image_map_line_color)
isAdjustingQuestionsWithResultsAllowed()
static _getQuestionTypes($all_tags=false, $fixOrder=false, $withDeprecatedTypes=true)