ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ILIAS\Test\Participants\ParticipantTableShowResultsAction Class Reference
+ Inheritance diagram for ILIAS\Test\Participants\ParticipantTableShowResultsAction:
+ Collaboration diagram for ILIAS\Test\Participants\ParticipantTableShowResultsAction:

Public Member Functions

 __construct (private readonly Language $lng, private readonly UIFactory $ui_factory, private readonly \ilTestAccess $test_access, private readonly \ilCtrl $ctrl, private readonly \ilObjTest $test_obj)
 
 getActionId ()
 
 isAvailable ()
 
 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)
 
 onSubmit (URLBuilder $url_builder, ServerRequestInterface $request, array $selected_participants, bool $all_participants_selected)
 
 allowActionForRecord (Participant $record)
 
 getSelectionErrorMessage ()
 

Data Fields

const ACTION_ID = 'show_results'
 

Detailed Description

Definition at line 31 of file ParticipantTableShowResultsAction.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Test\Participants\ParticipantTableShowResultsAction::__construct ( private readonly Language  $lng,
private readonly UIFactory  $ui_factory,
private readonly \ilTestAccess  $test_access,
private readonly \ilCtrl  $ctrl,
private readonly \ilObjTest  $test_obj 
)

Definition at line 35 of file ParticipantTableShowResultsAction.php.

41  {
42  }

Member Function Documentation

◆ allowActionForRecord()

ILIAS\Test\Participants\ParticipantTableShowResultsAction::allowActionForRecord ( Participant  $record)

Implements ILIAS\Test\Participants\TableAction.

Definition at line 119 of file ParticipantTableShowResultsAction.php.

References ILIAS\Test\Participants\Participant\getActiveId(), and null.

119  : bool
120  {
121  return $record->getActiveId() !== null && $this->test_access->checkResultsAccessForActiveId(
122  $record->getActiveId(),
123  $this->test_obj->getTestId()
124  );
125  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getActionId()

ILIAS\Test\Participants\ParticipantTableShowResultsAction::getActionId ( )

Implements ILIAS\Test\Participants\TableAction.

Definition at line 44 of file ParticipantTableShowResultsAction.php.

44  : string
45  {
46  return self::ACTION_ID;
47  }

◆ getModal()

ILIAS\Test\Participants\ParticipantTableShowResultsAction::getModal ( URLBuilder  $url_builder,
array  $selected_participants,
bool  $all_participants_selected 
)
Parameters
array<Participant>$selected_participants

Implements ILIAS\Test\Participants\TableAction.

Definition at line 70 of file ParticipantTableShowResultsAction.php.

References null.

74  : ?Modal {
75  return null;
76  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ getSelectionErrorMessage()

ILIAS\Test\Participants\ParticipantTableShowResultsAction::getSelectionErrorMessage ( )

Implements ILIAS\Test\Participants\TableAction.

Definition at line 127 of file ParticipantTableShowResultsAction.php.

References null.

127  : ?string
128  {
129  return null;
130  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ getTableAction()

ILIAS\Test\Participants\ParticipantTableShowResultsAction::getTableAction ( URLBuilder  $url_builder,
URLBuilderToken  $row_id_token,
URLBuilderToken  $action_token,
URLBuilderToken  $action_type_token 
)

Implements ILIAS\Test\Participants\TableAction.

Definition at line 55 of file ParticipantTableShowResultsAction.php.

References ILIAS\Repository\lng(), ILIAS\Test\Participants\ParticipantTableActions\SUBMIT_ACTION, and ILIAS\UI\URLBuilder\withParameter().

60  : Action {
61  return $this->ui_factory->table()->action()->standard(
62  $this->lng->txt(self::ACTION_ID),
63  $url_builder
64  ->withParameter($action_token, self::ACTION_ID)
65  ->withParameter($action_type_token, ParticipantTableActions::SUBMIT_ACTION),
66  $row_id_token
67  );
68  }
+ Here is the call graph for this function:

◆ isAvailable()

ILIAS\Test\Participants\ParticipantTableShowResultsAction::isAvailable ( )

Implements ILIAS\Test\Participants\TableAction.

Definition at line 49 of file ParticipantTableShowResultsAction.php.

49  : bool
50  {
51  return $this->test_access->checkParticipantsResultsAccess()
52  && $this->test_obj->evalTotalPersons() > 0;
53  }

◆ onSubmit()

ILIAS\Test\Participants\ParticipantTableShowResultsAction::onSubmit ( URLBuilder  $url_builder,
ServerRequestInterface  $request,
array  $selected_participants,
bool  $all_participants_selected 
)
Parameters
array<Participant>$selected_participants

Implements ILIAS\Test\Participants\TableAction.

Definition at line 78 of file ParticipantTableShowResultsAction.php.

References $c, ILIAS\Repository\ctrl(), ILIAS\Test\Participants\Participant\getActiveId(), ILIAS\Repository\lng(), ILIAS\UICore\GlobalTemplate\MESSAGE_TYPE_FAILURE, and null.

83  : ?Modal {
84  if ($selected_participants === []) {
85  return null;
86  }
87  foreach ($selected_participants as $participant) {
88  if (!$this->test_access->checkResultsAccessForActiveId(
89  $participant->getActiveId(),
90  $this->test_obj->getTestId()
91  )) {
92  $this->tpl->setOnScreenMessage(
94  $this->lng->txt('no_permission'),
95  true
96  );
97  return null;
98  }
99  }
100  $this->ctrl->setParameterByClass(
101  \ilTestEvaluationGUI::class,
102  'active_ids',
103  array_reduce(
104  $selected_participants,
105  static function (string $c, Participant $v): string {
106  if ($c === '') {
107  return (string) $v->getActiveId();
108  }
109  $c .= ",{$v->getActiveId()}";
110  return $c;
111  },
112  ''
113  )
114  );
115 
116  $this->ctrl->redirectByClass(\ilTestEvaluationGUI::class, 'showResults');
117  }
$c
Definition: deliver.php:25
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

Field Documentation

◆ ACTION_ID

const ILIAS\Test\Participants\ParticipantTableShowResultsAction::ACTION_ID = 'show_results'

Definition at line 33 of file ParticipantTableShowResultsAction.php.


The documentation for this class was generated from the following file: