19declare(strict_types=1);
29use Psr\Http\Message\ServerRequestInterface;
38 private readonly UIFactory $ui_factory,
53 return $this->test_access->checkManageParticipantsAccess()
54 && $this->test_obj->evalTotalPersons() > 0;
64 $this->
lng->txt(
'delete_user_data'),
66 ->withParameter($action_token, self::
ACTION_ID)
74 array $selected_participants,
75 bool $all_participants_selected
78 $this->
lng->txt(
'confirm'),
79 $this->resolveMessage($all_participants_selected),
80 $url_builder->buildURI()->__toString()
84 (string) $v->getUserId(),
85 $this->test_obj->getAnonymity()
86 ? $this->
lng->txt(
'anonymous')
87 : \
ilObjUser::_lookupFullname($v->getUserId())
89 $selected_participants
96 ServerRequestInterface $request,
97 array $selected_participants,
98 bool $all_participants_selected
100 if (!$this->test_access->checkManageParticipantsAccess()) {
101 $this->tpl->setOnScreenMessage(
103 $this->
lng->txt(
'no_permission'),
109 $access_filter = $this->participant_access_filter_factory
110 ->getManageParticipantsUserFilter($this->test_obj->getRefId());
111 $participant_data = new \ilTestParticipantData($this->db, $this->
lng);
112 $participant_data->setParticipantAccessFilter($access_filter);
113 $participant_data->setActiveIdsFilter(
116 $selected_participants
119 $participant_data->load($this->test_obj->getTestId());
120 $this->test_obj->removeTestResults($participant_data);
122 $this->tpl->setOnScreenMessage(
124 $this->
lng->txt(
'tst_selected_user_data_deleted'),
137 if ($all_participants_selected) {
138 return $this->
lng->txt(
'delete_all_user_data_confirmation');
141 return $this->
lng->txt(
'delete_selected_user_data_confirmation');
146 return $this->
lng->txt(
'delete_result_no_valid_participants_selected');
Builds a Color from either hex- or rgb values.
allowActionForRecord(Participant $record)
__construct(private readonly Language $lng, private readonly \ilGlobalTemplateInterface $tpl, private readonly UIFactory $ui_factory, private readonly \ilDBInterface $db, private readonly \ilTestParticipantAccessFilterFactory $participant_access_filter_factory, private readonly \ilTestAccess $test_access, private readonly \ilObjTest $test_obj)
getTableAction(URLBuilder $url_builder, URLBuilderToken $row_id_token, URLBuilderToken $action_token, URLBuilderToken $action_type_token)
getModal(URLBuilder $url_builder, array $selected_participants, bool $all_participants_selected)
getSelectionErrorMessage()
onSubmit(URLBuilder $url_builder, ServerRequestInterface $request, array $selected_participants, bool $all_participants_selected)
resolveMessage(bool $all_participants_selected)
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const MESSAGE_TYPE_SUCCESS
const MESSAGE_TYPE_FAILURE
This describes commonalities between the different modals.
modal(string $title="", string $cancel_label="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(!file_exists('../ilias.ini.php'))