ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilAssQuestionSkillAssignmentsGUI.php
Go to the documentation of this file.
1<?php
2
22
38{
39 public const CMD_SHOW_SKILL_QUEST_ASSIGNS = 'showSkillQuestionAssignments';
40 public const CMD_SHOW_SKILL_SELECT = 'showSkillSelection';
41 public const CMD_UPDATE_SKILL_QUEST_ASSIGNS = 'updateSkillQuestionAssignments';
42 public const CMD_SHOW_SKILL_QUEST_ASSIGN_PROPERTIES_FORM = 'showSkillQuestionAssignmentPropertiesForm';
43 public const CMD_SAVE_SKILL_QUEST_ASSIGN_PROPERTIES_FORM = 'saveSkillQuestionAssignmentPropertiesForm';
44 public const CMD_SAVE_SKILL_POINTS = 'saveSkillPoints';
45 public const CMD_SHOW_SYNC_ORIGINAL_CONFIRMATION = 'showSyncOriginalConfirmation';
46 public const CMD_SYNC_ORIGINAL = 'syncOriginal';
47
48 public const PARAM_SKILL_SELECTION = 'skill_ids';
49
54
59
60
62
64
72 public function __construct(
73 private ilCtrl $ctrl,
74 private ilAccessHandler $access,
75 private ilGlobalTemplateInterface $tpl,
76 private ilLanguage $lng,
77 private ilDBInterface $db
78 ) {
79
80 $local_dic = QuestionPoolDIC::dic();
81 $this->request_data_collector = $local_dic['request_data_collector'];
82
83 global $DIC;
84 $this->skillUsageService = $DIC->skills()->usage();
85 }
86
87 public function getQuestionOrderSequence(): ?array
88 {
90 }
91
92 public function getAssignmentConfigurationHintMessage(): ?string
93 {
95 }
96
97 public function setAssignmentConfigurationHintMessage(?string $assignmentConfigurationHintMessage): void
98 {
99 $this->assignment_configuration_hint_message = $assignmentConfigurationHintMessage;
100 }
101
106 {
107 $this->questionOrderSequence = $questionOrderSequence;
108 }
109
114 {
116 }
117
121 public function setQuestionList($questionList): void
122 {
123 $this->question_list = $questionList;
124 }
125
129 public function getQuestionContainerId(): int
130 {
132 }
133
137 public function setQuestionContainerId($questionContainerId): void
138 {
139 $this->question_container_id = $questionContainerId;
140 }
141
145 public function isAssignmentEditingEnabled(): bool
146 {
148 }
149
153 public function setAssignmentEditingEnabled($assignmentEditingEnabled): void
154 {
155 $this->assignment_editing_enabled = $assignmentEditingEnabled;
156 }
157
158 public function executeCommand(): void
159 {
160 $nextClass = $this->ctrl->getNextClass();
161
162 $command = $this->ctrl->getCmd(self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
163
164 if ($this->isAvoidManipulationRedirectRequired($command)) {
165 $this->ctrl->redirect($this, self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
166 }
167
168 switch ($nextClass) {
169 case strtolower(__CLASS__):
170 case '':
171
172 $command .= 'Cmd';
173 $this->$command();
174 break;
175
176 default:
177
178 throw new ilTestQuestionPoolException('unsupported next class in ctrl flow');
179 }
180 }
181
182 private function isAvoidManipulationRedirectRequired($command): bool
183 {
184 if ($this->isAssignmentEditingEnabled()) {
185 return false;
186 }
187
188 switch ($command) {
191
192 return true;
193 }
194
195 return false;
196 }
197
198 private function saveSkillPointsCmd(): void
199 {
200 $success = true;
201 $skill_points = $this->request_data_collector->raw('skill_points');
202
203 for ($i = 0; $i < 2; $i++) {
204 foreach ($skill_points as $assignment_key => $skill_point) {
205 $assignment_key = explode(':', $assignment_key);
206 $skillBaseId = (int) $assignment_key[0];
207 $skillTrefId = (int) $assignment_key[1];
208 $questionId = (int) $assignment_key[2];
209
210 if ($this->isTestQuestion($questionId)) {
211 $assignment = new ilAssQuestionSkillAssignment($this->db);
212
213 if ($i === 0) {
214 if (!$assignment->isValidSkillPoint($skill_point)) {
215 $success = false;
216 break 2;
217 }
218 continue;
219 }
220
221 $assignment->setParentObjId($this->getQuestionContainerId());
222 $assignment->setQuestionId($questionId);
223 $assignment->setSkillBaseId($skillBaseId);
224 $assignment->setSkillTrefId($skillTrefId);
225
226 if ($assignment->dbRecordExists()) {
227 $assignment->loadFromDb();
228
229 if (!$assignment->hasEvalModeBySolution()) {
230 $assignment->setSkillPoints($skill_point);
231 $assignment->saveToDb();
232
233 // add skill usage
234 $this->skillUsageService->addUsage($this->getQuestionContainerId(), $skillBaseId, $skillTrefId);
235 }
236 }
237 }
238
239 }
240 }
241
242 if ($success) {
243 $this->tpl->setOnScreenMessage('success', $this->lng->txt('tst_msg_skl_qst_assign_points_saved'), true);
244 $this->ctrl->redirect($this, self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
245 return;
246 }
247
248 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('tst_msg_skl_qst_assign_points_not_saved'));
250 }
251
252 private function updateSkillQuestionAssignmentsCmd(): void
253 {
254 $question_id = $this->request_data_collector->getQuestionId();
255
256 if ($this->isTestQuestion($question_id)) {
257 $assignmentList = new ilAssQuestionSkillAssignmentList($this->db);
258 $assignmentList->setParentObjId($this->getQuestionContainerId());
259 $assignmentList->loadFromDb();
260
261 $handledSkills = [];
262
263 $sgui = $this->buildSkillSelectorExplorerGUI([]);
264 $skillIds = $sgui->getSelectedSkills();
265
266 foreach ($skillIds as $skillId) {
267 $skill = explode(':', $skillId);
268 $skillBaseId = (int) $skill[0];
269 $skillTrefId = (int) $skill[1];
270
271 if ($skillBaseId) {
272 if (!$assignmentList->isAssignedToQuestionId($skillBaseId, $skillTrefId, $question_id)) {
273 $assignment = new ilAssQuestionSkillAssignment($this->db);
274
275 $assignment->setParentObjId($this->getQuestionContainerId());
276 $assignment->setQuestionId($question_id);
277 $assignment->setSkillBaseId($skillBaseId);
278 $assignment->setSkillTrefId($skillTrefId);
279
282 $assignment->saveToDb();
283
284 // add skill usage
285 $this->skillUsageService->addUsage($this->getQuestionContainerId(), $skillBaseId, $skillTrefId);
286 }
287
288 $handledSkills[$skillId] = $skill;
289 }
290 }
291
292 foreach ($assignmentList->getAssignmentsByQuestionId($question_id) as $assignment) {
293 if (isset($handledSkills["{$assignment->getSkillBaseId()}:{$assignment->getSkillTrefId()}"])) {
294 continue;
295 }
296
297 $assignment->deleteFromDb();
298
299 // remove skill usage
300 if (!$assignment->isSkillUsed()) {
301 $this->skillUsageService->removeUsage(
302 $assignment->getParentObjId(),
303 $assignment->getSkillBaseId(),
304 $assignment->getSkillTrefId()
305 );
306 }
307 }
308
309 $this->tpl->setOnScreenMessage('success', $this->lng->txt('qpl_qst_skl_assigns_updated'), true);
310
311 if ($this->isSyncOriginalPossibleAndAllowed($question_id)) {
313 $this->ctrl->redirect($this, self::CMD_SHOW_SYNC_ORIGINAL_CONFIRMATION);
314 }
315 }
316
317 $this->ctrl->redirect($this, self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
318 }
319
320 private function showSkillSelectionCmd(): void
321 {
322 $this->ctrl->saveParameter($this, 'q_id');
323 $question_id = $this->request_data_collector->getQuestionId();
324
325 $assignmentList = new ilAssQuestionSkillAssignmentList($this->db);
326 $assignmentList->setParentObjId($this->getQuestionContainerId());
327 $assignmentList->loadFromDb();
328
329 $skillSelectorExplorerGUI = $this->buildSkillSelectorExplorerGUI(
330 $assignmentList->getAssignmentsByQuestionId($question_id)
331 );
332
333 if (!$skillSelectorExplorerGUI->handleCommand()) {
334 $tpl = new ilTemplate('tpl.qpl_qst_skl_assign_selection.html', false, false, 'components/ILIAS/TestQuestionPool');
335
336 $tpl->setVariable('SKILL_SELECTOR_HEADER', $this->getSkillSelectorHeader($question_id));
337
338 $skillSelectorToolbarGUI = $this->buildSkillSelectorToolbarGUI();
339
340 $skillSelectorToolbarGUI->setOpenFormTag(true);
341 $skillSelectorToolbarGUI->setCloseFormTag(false);
342 $skillSelectorToolbarGUI->setLeadingImage(ilUtil::getImagePath("nav/arrow_upright.svg"), " ");
343 $tpl->setVariable('SKILL_SELECTOR_TOOLBAR_TOP', $this->ctrl->getHTML($skillSelectorToolbarGUI));
344
345 $tpl->setVariable('SKILL_SELECTOR_EXPLORER', $this->ctrl->getHTML($skillSelectorExplorerGUI));
346
347 $skillSelectorToolbarGUI->setOpenFormTag(false);
348 $skillSelectorToolbarGUI->setCloseFormTag(true);
349 $skillSelectorToolbarGUI->setLeadingImage(ilUtil::getImagePath("nav/arrow_downright.svg"), " ");
350 $tpl->setVariable('SKILL_SELECTOR_TOOLBAR_BOTTOM', $this->ctrl->getHTML($skillSelectorToolbarGUI));
351
352 $this->tpl->setContent($tpl->get());
353 }
354 }
355
357 ?assQuestionGUI $question_gui = null,
358 ?ilAssQuestionSkillAssignment $assignment = null,
359 ?ilPropertyFormGUI $form = null
360 ): void {
362
364
365 if ($question_gui === null) {
366 $question_gui = assQuestionGUI::_getQuestionGUI('', $this->request_data_collector->getQuestionId());
367 }
368
369 if ($assignment === null) {
370 $assignment = $this->buildQuestionSkillAssignment(
371 $this->request_data_collector->getQuestionId(),
372 $this->request_data_collector->int('skill_base_id'),
373 $this->request_data_collector->int('skill_tref_id')
374 );
375 }
376
377 if ($form === null) {
378 $form = $this->buildSkillQuestionAssignmentPropertiesForm($question_gui->getObject(), $assignment);
379 }
380
381 $this->tpl->setContent($form->getHTML() . '<br />' . $this->buildQuestionPage($question_gui));
382 }
383
385 {
386 $question_id = $this->request_data_collector->getQuestionId();
387
388 if ($this->isTestQuestion($question_id)) {
389 $question_gui = assQuestionGUI::_getQuestionGUI('', $question_id);
390
391 $assignment = $this->buildQuestionSkillAssignment(
392 $question_id,
393 $this->request_data_collector->int('skill_base_id'),
394 $this->request_data_collector->int('skill_tref_id')
395 );
396
397 $this->keepAssignmentParameters();
398 $form = $this->buildSkillQuestionAssignmentPropertiesForm($question_gui->getObject(), $assignment);
399 if (!$form->checkInput()
400 || !$this->checkPointsAreInt($form)) {
401 $form->setValuesByPost();
402 $this->showSkillQuestionAssignmentPropertiesFormCmd($question_gui, $assignment, $form);
403 return;
404 }
405 $form->setValuesByPost();
406
407 if ($form->getItemByPostVar('eval_mode')) {
408 $assignment->setEvalMode($form->getItemByPostVar('eval_mode')->getValue());
409 } else {
411 }
412
413 if ($assignment->hasEvalModeBySolution()) {
414 $sol_cmp_expr_input = $form->getItemByPostVar('solution_compare_expressions');
415
416 if (!$this->checkSolutionCompareExpressionInput($sol_cmp_expr_input, $question_gui->getObject())) {
417 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('form_input_not_valid'));
418 $this->showSkillQuestionAssignmentPropertiesFormCmd($question_gui, $assignment, $form);
419 return;
420 }
421
422 $assignment->initSolutionComparisonExpressionList();
423 $assignment->getSolutionComparisonExpressionList()->reset();
424
425 foreach ($sol_cmp_expr_input->getValues() as $expression) {
426 $assignment->getSolutionComparisonExpressionList()->add($expression);
427 }
428 } else {
429 $assignment->setSkillPoints($form->getItemByPostVar('q_res_skill_points')->getValue());
430 }
431
432 $assignment->saveToDb();
433
434 // add skill usage
435 $this->skillUsageService->addUsage(
436 $this->getQuestionContainerId(),
437 $this->request_data_collector->int('skill_base_id'),
438 $this->request_data_collector->int('skill_tref_id')
439 );
440
441 $this->tpl->setOnScreenMessage('success', $this->lng->txt('qpl_qst_skl_assign_properties_modified'), true);
442
443 if ($this->isSyncOriginalPossibleAndAllowed($question_id)) {
444 $this->ctrl->redirect($this, self::CMD_SHOW_SYNC_ORIGINAL_CONFIRMATION);
445 }
446 }
447
448 $this->ctrl->redirect($this, self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
449 }
450
452 assQuestion $question,
456 $form->setQuestion($question);
457 $form->setAssignment($assignment);
458 $form->setManipulationEnabled($this->isAssignmentEditingEnabled());
459 $form->build();
460
461 return $form;
462 }
463
464 private function showSkillQuestionAssignmentsCmd($loadSkillPointsFromRequest = false): void
465 {
466 $this->handleAssignmentConfigurationHintMessage();
467
468 $table = $this->buildTableGUI();
469 $table->loadSkillPointsFromRequest($loadSkillPointsFromRequest);
470
471 $assignmentList = $this->buildSkillQuestionAssignmentList();
472 $assignmentList->loadFromDb();
473 $assignmentList->loadAdditionalSkillData();
474 $table->setSkillQuestionAssignmentList($assignmentList);
475 $table->setData($this->orderQuestionData($this->question_list->getQuestionDataArray()));
476
477 $this->tpl->setContent($table->getHTML());
478 }
479
480 private function isSyncOriginalPossibleAndAllowed($questionId): bool
481 {
482 $questionData = $this->question_list->getDataArrayForQuestionId($questionId);
483
484 if (!$questionData['original_id']) {
485 return false;
486 }
487
488 $parentObjId = assQuestion::lookupParentObjId($questionData['original_id']);
489
490 if ($parentObjId === null || !$this->doesObjectTypeMatch($parentObjId)) {
491 return false;
492 }
493
494 foreach (ilObject::_getAllReferences($parentObjId) as $parentRefId) {
495 if ($this->access->checkAccess('write', '', $parentRefId)) {
496 return true;
497 }
498 }
499
500 return false;
501 }
502
503 private function showSyncOriginalConfirmationCmd(): void
504 {
505 $confirmation = new ilConfirmationGUI();
506 $confirmation->setHeaderText($this->lng->txt('qpl_sync_quest_skl_assigns_confirmation'));
507
508 $confirmation->setFormAction($this->ctrl->getFormAction($this));
509 $confirmation->addHiddenItem('q_id', $this->request_data_collector->getQuestionId());
510 $confirmation->setConfirm($this->lng->txt('yes'), self::CMD_SYNC_ORIGINAL);
511 $confirmation->setCancel($this->lng->txt('no'), self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
512
513 $this->tpl->setContent($this->ctrl->getHTML($confirmation));
514 }
515
516 private function syncOriginalCmd(): void
517 {
518 $question_id = $this->request_data_collector->getQuestionId();
519 if ($this->isTestQuestion($question_id) && $this->isSyncOriginalPossibleAndAllowed($question_id)) {
520 $question = assQuestion::instantiateQuestion($question_id);
521
522 $question->syncSkillAssignments(
523 $question->getObjId(),
524 $question->getId(),
525 $question->lookupParentObjId($question->getOriginalId()),
526 $question->getOriginalId()
527 );
528
529 $this->tpl->setOnScreenMessage('success', $this->lng->txt('qpl_qst_skl_assign_synced_to_orig'), true);
530 }
531
532 $this->ctrl->redirect($this, self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
533 }
534
536 {
537 $table = new ilAssQuestionSkillAssignmentsTableGUI($this, self::CMD_SHOW_SKILL_QUEST_ASSIGNS, $this->ctrl, $this->lng);
538 $table->setManipulationsEnabled($this->isAssignmentEditingEnabled());
539 $table->init();
540
541 return $table;
542 }
543
545 {
546 $assignmentList = new ilAssQuestionSkillAssignmentList($this->db);
547 $assignmentList->setParentObjId($this->getQuestionContainerId());
548
549 return $assignmentList;
550 }
551
555 private function buildSkillSelectorExplorerGUI($assignments): ilSkillSelectorGUI
556 {
557 $skillSelectorExplorerGUI = new ilSkillSelectorGUI(
558 $this,
559 self::CMD_SHOW_SKILL_SELECT,
560 $this,
561 self::CMD_UPDATE_SKILL_QUEST_ASSIGNS,
562 self::PARAM_SKILL_SELECTION
563 );
564
565 $skillSelectorExplorerGUI->setSelectMode(self::PARAM_SKILL_SELECTION, true);
566 //$skillSelectorExplorerGUI->setNodeOnclickEnabled(false);
567
568 // parameter name for skill selection is actually taken from value passed to constructor,
569 // but passing a non empty name to setSelectMode is neccessary to keep input fields enabled
570
571 foreach ($assignments as $assignment) {
572 $id = "{$assignment->getSkillBaseId()}:{$assignment->getSkillTrefId()}";
573 //$skillSelectorExplorerGUI->setNodeSelected($id);
574 $skillSelectorExplorerGUI->setSkillSelected($id);
575 }
576
577 return $skillSelectorExplorerGUI;
578 }
579
584 {
585 $skillSelectorToolbarGUI = new ilToolbarGUI();
586
587 $skillSelectorToolbarGUI->setFormAction($this->ctrl->getFormAction($this));
588 $skillSelectorToolbarGUI->addFormButton($this->lng->txt('qpl_save_skill_assigns_update'), self::CMD_UPDATE_SKILL_QUEST_ASSIGNS);
589 $skillSelectorToolbarGUI->addFormButton($this->lng->txt('qpl_cancel_skill_assigns_update'), self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
590
591 return $skillSelectorToolbarGUI;
592 }
593
594 private function buildQuestionPage(assQuestionGUI $question_gui)
595 {
596 $this->tpl->addCss('./assets/css/content.css');
597
598 $page_gui = new ilAssQuestionPageGUI($question_gui->getObject()->getId());
599 $page_gui->setFileDownloadLink($question_gui->buildFileDownloadLink());
600 $page_gui->setOutputMode("presentation");
601 $page_gui->setRenderPageContainer(true);
602
603 $page_gui->setPresentationTitle($question_gui->getObject()->getTitleForHTMLOutput());
604
605 $question = $question_gui->getObject();
606 $question->setShuffle(false); // dirty, but works ^^
607 $question_gui->setObject($question);
608 $page_gui->setQuestionHTML([
609 $question_gui->getObject()->getId() => $question_gui->getSolutionOutput(0, 0, false, false, true, false, true, false, true)
610 ]);
611
612 return preg_replace("/src=\"\\.\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $page_gui->presentation());
613
614 }
615
620 int $question_id,
621 int $skill_base_id,
622 int $skill_tref_id
624 $assignment = new ilAssQuestionSkillAssignment($this->db);
625
626 $assignment->setParentObjId($this->getQuestionContainerId());
627 $assignment->setQuestionId($question_id);
628 $assignment->setSkillBaseId($skill_base_id);
629 $assignment->setSkillTrefId($skill_tref_id);
630
631 $assignment->loadFromDb();
632 $assignment->loadAdditionalSkillData();
633
634 return $assignment;
635 }
636
637 private function isTestQuestion($questionId): bool
638 {
639 return $this->question_list->isInList($questionId);
640 }
641
642 private function checkSolutionCompareExpressionInput($input, assQuestion $question): bool
643 {
644 $errors = [];
645
646 foreach ($input->getValues() as $expression) {
647 $result = $this->validateSolutionCompareExpression($expression, $question);
648
649 if ($result !== true) {
650 $errors[] = "{$this->lng->txt('ass_lac_expression')} {$expression->getOrderIndex()}: {$result}";
651 }
652 }
653
654 if (count($errors)) {
655 $alert = $this->lng->txt('ass_lac_validation_error');
656 $alert .= '<br />' . implode('<br />', $errors);
657 $input->setAlert($alert);
658 return false;
659 }
660
661 return true;
662 }
663
664 private function checkPointsAreInt(ilPropertyFormGUI $form): bool
665 {
666 $points_result = $form->getInput('q_res_skill_points');
667 $invalid_values_solution = array_filter(
668 $form->getInput('solution_compare_expressions')['points'],
669 fn(string $v): bool => $v != (int) $v
670 );
671 if ($points_result == (int) $points_result
672 && $invalid_values_solution === []) {
673 return true;
674 }
675 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('numeric_only'));
676 return false;
677 }
678
680 {
681 try {
682 $question_provider = new ilAssLacQuestionProvider();
683 $question_provider->setQuestion($question);
684 (new ilAssLacCompositeValidator($question_provider))->validate(
685 (new ilAssLacConditionParser())->parse($expression->getExpression())
686 );
687 } catch (ilAssLacException $e) {
688 if ($e instanceof ilAssLacFormAlertProvider) {
689 return $e->getFormAlert($this->lng);
690 }
691
692 throw $e;
693 }
694
695 return true;
696 }
697
698 private function keepAssignmentParameters(): void
699 {
700 $this->ctrl->saveParameter($this, 'q_id');
701 $this->ctrl->saveParameter($this, 'skill_base_id');
702 $this->ctrl->saveParameter($this, 'skill_tref_id');
703 }
704
705 private function orderQuestionData($questionData)
706 {
707 $orderedQuestionsData = [];
708
709 if ($this->getQuestionOrderSequence()) {
710 foreach ($this->getQuestionOrderSequence() as $questionId) {
711 $orderedQuestionsData[$questionId] = $questionData[$questionId];
712 }
713
714 return $orderedQuestionsData;
715 }
716
717 foreach ($questionData as $questionId => $data) {
718 $orderedQuestionsData[$questionId] = $data['title'];
719 }
720
721 $orderedQuestionsData = $this->sortAlphabetically($orderedQuestionsData);
722
723 foreach ($orderedQuestionsData as $questionId => $questionTitle) {
724 $orderedQuestionsData[$questionId] = $questionData[$questionId];
725 }
726
727 return $orderedQuestionsData;
728 }
729
731 {
732 if ($this->getAssignmentConfigurationHintMessage()) {
733 $this->tpl->setOnScreenMessage('info', $this->getAssignmentConfigurationHintMessage());
734 }
735 }
736
737 private function getSkillSelectorHeader($questionId): string
738 {
739 $questionData = $this->question_list->getDataArrayForQuestionId($questionId);
740
741 return sprintf($this->lng->txt('qpl_qst_skl_selection_for_question_header'), $questionData['title']);
742 }
743
744 private function sortAlphabetically($array)
745 {
746 $flags = SORT_REGULAR;
747
748 if (defined('SORT_NATURAL')) {
749 $flags = SORT_NATURAL;
750 } elseif (defined('SORT_STRING')) {
751 $flags = SORT_STRING;
752 }
753
754 if (defined('SORT_FLAG_CASE')) {
755 $flags = $flags | SORT_FLAG_CASE;
756 }
757
758 asort($array, $flags);
759
760 return $array;
761 }
762
763 protected function doesObjectTypeMatch($objectId): bool
764 {
765 return ilObject::_lookupType($objectId) == 'qpl';
766 }
767}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static _getQuestionGUI(string $question_type='', int $question_id=-1)
Creates a question gui representation and returns the alias to the question gui.
setObject(assQuestion $question)
getSolutionOutput(int $active_id, ?int $pass=null, bool $graphical_output=false, bool $result_output=false, bool $show_question_only=true, bool $show_feedback=false, bool $show_correct_solution=false, bool $show_manual_scoring=false, bool $show_question_text=true, bool $show_inline_feedback=true)
static lookupParentObjId(int $question_id)
syncSkillAssignments(int $srcParentId, int $srcQuestionId, int $trgParentId, int $trgQuestionId)
setShuffle(?bool $shuffle=true)
static instantiateQuestion(int $question_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Question page GUI class.
checkSolutionCompareExpressionInput($input, assQuestion $question)
__construct(private ilCtrl $ctrl, private ilAccessHandler $access, private ilGlobalTemplateInterface $tpl, private ilLanguage $lng, private ilDBInterface $db)
setAssignmentConfigurationHintMessage(?string $assignmentConfigurationHintMessage)
showSkillQuestionAssignmentPropertiesFormCmd(?assQuestionGUI $question_gui=null, ?ilAssQuestionSkillAssignment $assignment=null, ?ilPropertyFormGUI $form=null)
buildQuestionSkillAssignment(int $question_id, int $skill_base_id, int $skill_tref_id)
validateSolutionCompareExpression(ilAssQuestionSolutionComparisonExpression $expression, $question)
showSkillQuestionAssignmentsCmd($loadSkillPointsFromRequest=false)
buildSkillQuestionAssignmentPropertiesForm(assQuestion $question, ilAssQuestionSkillAssignment $assignment)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrl provides processing control methods.
language handling
static _lookupType(int $id, bool $reference=false)
static _getAllReferences(int $id)
get all reference ids for object ID
This class represents a property form user interface.
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
Explorer class that works on tree objects (Services/Tree)
special template class to simplify handling of ITX/PEAR
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
Interface ilDBInterface.
global $lng
Definition: privfeed.php:31
global $DIC
Definition: shib_login.php:26