19declare(strict_types=1);
37 private readonly UIFactory $ui_factory,
39 private readonly \
ilCtrl $ctrl
46 $this->ui_factory->table()->presentation(
47 $this->
lng->txt(
'qpl_skl_sub_tab_quest_assign'),
48 $this->getViewControls($skill_assignment_view_control_mode),
57 $assignment_details = [];
59 $assignment_details[$skill_assignment->getSkillTitle()] = $this->ui_factory
62 ->withProperty($this->
lng->txt(
'tree'), $skill_assignment->getSkillPath())
64 $this->
lng->txt(
'tst_comp_eval_mode'),
66 $skill_assignment->hasEvalModeBySolution()
67 ?
'qpl_skill_point_eval_mode_solution_compare'
68 :
'qpl_skill_point_eval_mode_quest_result'
71 ->withProperty($this->
lng->txt(
'tst_comp_points'), (
string) $skill_assignment->getMaxSkillPoints());
76 ->withSubheadline($record->
getQuestion()[
'description'])
78 $this->ui_factory->symbol()->icon()->standard(
'ques',
'')
81 $assignment_details !== []
82 ? $this->ui_factory->listing()->descriptive($assignment_details)
83 : $this->ui_factory->legacy()->content($this->lng->txt(
'ui_table_no_records'))
86 $this->ui_factory->button()->standard(
87 $this->lng->txt(
'tst_manage_competence_assigns'),
92 $assignments = $this->assignment_list->getAssignmentsByQuestionId($record->
getQuestion()[
'question_id']);
93 if ($assignments === []) {
98 $this->
lng->txt(
'tst_competence') => implode(
111 foreach ($this->question_list->getQuestionDataArray() as $question_id => $question_data) {
112 $assignments_by_question_id = $this->assignment_list->getAssignmentsByQuestionId($question_id);
114 $skill_assignment_view_control_mode === SkillAssignmentViewControlMode::ASSIGNED
115 && $assignments_by_question_id === []
121 $skill_assignment_view_control_mode === SkillAssignmentViewControlMode::UNASSIGNED
122 && $assignments_by_question_id !== []
127 $records[] =
new SkillAssignments($question_data, $assignments_by_question_id);
138 $labeled_actions = [];
139 foreach (SkillAssignmentViewControlMode::cases() as $value) {
140 $this->
ctrl->setParameterByClass(
141 \ilAssQuestionSkillAssignmentsGUI::class,
142 self::VIEW_CONTROL_QUERY_PARAM,
145 $labeled_actions[$this->
lng->txt($value->getLabel())] = $this->
ctrl->getLinkTargetByClass(
146 \ilAssQuestionSkillAssignmentsGUI::class,
152 $this->ui_factory->viewControl()->mode($labeled_actions, $this->
lng->txt(
'qpl_skl_view_control_mode_aria'))
153 ->withActive($this->
lng->txt($skill_assignment_view_control_mode->getLabel())),
Builds a Color from either hex- or rgb values.
The scope of this class is split ilias-conform URI's into components.
withParameter(string $key, $value)
Get URI with modified parameters.
getComponents(URI $edit_uri, SkillAssignmentViewControlMode $skill_assignment_view_control_mode=SkillAssignmentViewControlMode::ALL)
const string ROW_ID_PARAMETER
__construct(private readonly \ilAssQuestionList $question_list, private readonly \ilAssQuestionSkillAssignmentList $assignment_list, private readonly UIFactory $ui_factory, private readonly \ilLanguage $lng, private readonly \ilCtrl $ctrl)
retrieveRecords(SkillAssignmentViewControlMode $skill_assignment_view_control_mode=SkillAssignmentViewControlMode::ALL)
mapRow(PresentationRow $row, SkillAssignments $record, URI $edit_uri)
getViewControls(SkillAssignmentViewControlMode $skill_assignment_view_control_mode=SkillAssignmentViewControlMode::ALL)
const string VIEW_CONTROL_QUERY_PARAM
const CMD_SHOW_SKILL_QUEST_ASSIGNS
Class ilCtrl provides processing control methods.
@ ALL
event string being used if
This describes a Row used in Presentation Table.
withImportantFields(array $fields)
Get a row like this with the record-fields and labels to be shown in the collapsed row.
withHeadline(string $headline)
Get a row like this with the given headline.
SkillAssignmentViewControlMode
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples