19 declare(strict_types=1);
109 switch ($this->
ctrl->getNextClass($this)) {
110 case "iltestevaluationgui":
114 case 'ilassquestionpagegui':
117 $forwarder->forward();
122 $command = $this->
ctrl->getCmd(self::CMD_SHOW_PARTICIPANTS) .
'Cmd';
131 return $this->
http->wrapper()->post()->retrieve(
134 $this->refinery->kindlyTo()->listOf($this->
refinery->kindlyTo()->int()),
145 $this->
tabs->clearTargets();
146 $this->
tabs->clearSubTabs();
147 $this->
ctrl->forwardCommand($gui);
154 self::CMD_SHOW_PARTICIPANTS,
158 $table_gui->setTitle($this->
lng->txt(
'tst_tbl_results_grades'));
167 $this->main_tpl->setOnScreenMessage(
172 $this->main_tpl->setOnScreenMessage(
178 $manage_participant_filter = $this->participant_access_filter_factory->getManageParticipantsUserFilter(
181 $access_results_filter = $this->participant_access_filter_factory->getAccessResultsUserFilter(
185 $full_participant_list = $this->
getTestObj()->getActiveParticipantList();
186 $participantList = $full_participant_list->getAccessFilteredList($manage_participant_filter);
187 $access_to_results_participants = $full_participant_list->getAccessFilteredList($access_results_filter);
188 foreach ($access_to_results_participants as $participant) {
189 if (!$participantList->isActiveIdInList($participant->getActiveId())) {
190 $participantList->addParticipant($participant);
194 $scored_participant_list = $participantList->getScoredParticipantList();
199 $table_gui->setAccessResultsCommandsEnabled(
203 $table_gui->setManageResultsCommandsEnabled(
207 if ($this->test_access->checkManageParticipantsAccess()
208 && $scored_participant_list->hasScorings()) {
215 $table_gui->initColumns();
216 $table_gui->initCommands();
218 $table_gui->setData($participantList->getScoringsTableRows());
220 $this->main_tpl->setContent($table_gui->getHTML());
225 $delete_all_results_btn = $this->ui_factory->button()->standard($this->
lng->txt(
'delete_all_user_data'), $this->
ctrl->getLinkTarget($this,
'deleteAllUserResults'));
235 $cgui->setFormAction($this->
ctrl->getFormAction($this));
236 $cgui->setHeaderText($this->
lng->txt(
"delete_all_user_data_confirmation"));
237 $cgui->setCancel($this->
lng->txt(
"cancel"), self::CMD_SHOW_PARTICIPANTS);
238 $cgui->setConfirm($this->
lng->txt(
"proceed"), self::CMD_PERFORM_DELETE_ALL_USER_RESULTS);
240 $this->main_tpl->setContent($cgui->getHTML());
248 $access_filter = $this->participant_access_filter_factory->getManageParticipantsUserFilter(
253 $participant_data->setParticipantAccessFilter($access_filter);
254 $participant_data->load($this->
getTestObj()->getTestId());
256 $this->
getTestObj()->removeTestResults($participant_data);
258 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"tst_all_user_data_deleted"),
true);
259 $this->
ctrl->redirect($this, self::CMD_SHOW_PARTICIPANTS);
268 if ($usr_ids === []) {
269 $this->main_tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"select_one_user"),
true);
270 $this->
ctrl->redirect($this);
274 $cgui->setHeaderText($this->
lng->txt(
"confirm_delete_single_user_data"));
276 $cgui->setFormAction($this->
ctrl->getFormAction($this));
277 $cgui->setCancel($this->
lng->txt(
"cancel"), self::CMD_SHOW_PARTICIPANTS);
278 $cgui->setConfirm($this->
lng->txt(
"confirm"), self::CMD_PERFORM_DELETE_SELECTED_USER_RESULTS);
280 $access_filter = $this->participant_access_filter_factory->getManageParticipantsUserFilter($this->
getTestObj()->getRefId());
283 $participant_data->setParticipantAccessFilter($access_filter);
285 $participant_data->setActiveIdsFilter($usr_ids);
287 $participant_data->load($this->
getTestObj()->getTestId());
289 foreach ($participant_data->getActiveIds() as $active_id) {
290 if ($this->test_obj->getAnonymity()) {
291 $username = $this->
lng->txt(
'anonymous');
293 $username = $participant_data->getFormatedFullnameByActiveId($active_id);
301 $this->
lng->txt(
"usr")
305 $this->main_tpl->setContent($cgui->getHTML());
314 if ($usr_ids !== []) {
315 $access_filter = $this->participant_access_filter_factory->getManageParticipantsUserFilter($this->
getTestObj()->getRefId());
318 $participant_data->setParticipantAccessFilter($access_filter);
319 $participant_data->setActiveIdsFilter($usr_ids);
321 $participant_data->load($this->
getTestObj()->getTestId());
323 $this->
getTestObj()->removeTestResults($participant_data);
325 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"tst_selected_user_data_deleted"),
true);
328 $this->
ctrl->redirect($this, self::CMD_SHOW_PARTICIPANTS);
337 if ($usr_ids === []) {
338 $this->main_tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'select_one_user'),
true);
339 $this->
ctrl->redirect($this);
343 $results_href = $this->
ctrl->getLinkTargetByClass(
344 [ilTestResultsGUI::class, ilParticipantsTestResultsGUI::class, ilTestEvaluationGUI::class],
345 'multiParticipantsPassDetails' 347 $this->
ctrl->redirectToURL($results_href);
356 if ($usr_ids !== []) {
368 if ($usr_ids !== []) {
377 private function showUserResults($show_pass_details, $show_answers, $show_reached_points =
false): void
379 $this->
tabs->clearTargets();
380 $this->
tabs->clearSubTabs();
384 if (!is_array($show_user_results) || count($show_user_results) === 0) {
385 $this->main_tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"select_one_user"),
true);
386 $this->
ctrl->redirect($this, self::CMD_SHOW_PARTICIPANTS);
392 $show_reached_points,
397 $this->main_tpl->setVariable(
"ADM_CONTENT", $template->get());
399 if ($this->
getTestObj()->getShowSolutionAnswersOnly()) {
400 $this->main_tpl->addCss(
409 bool $show_pass_details,
411 bool $show_reached_points,
412 array $show_user_results
414 $this->
tabs->setBackTarget(
415 $this->
lng->txt(
'back'),
416 $this->
ctrl->getLinkTarget($this, self::CMD_SHOW_PARTICIPANTS)
421 $this->
tabs->setBack2Target($this->
lng->txt(
'back_to_objective_container'), $courseLink);
424 $template =
new ilTemplate(
"tpl.il_as_tst_participants_result_output.html",
true,
true,
"Modules/Test");
429 if ($this->testrequest->isset(
'show_best_solutions')) {
431 } elseif ($this->testrequest->isset(
'hide_best_solutions')) {
433 } elseif (
ilSession::get(
'tst_results_show_best_solutions') !== null) {
438 $this->
ctrl->setParameter($this,
'hide_best_solutions',
'1');
439 $toolbar->setHideBestSolutionsLinkTarget($this->
ctrl->getLinkTarget($this, $this->ctrl->getCmd()));
440 $this->
ctrl->setParameter($this,
'hide_best_solutions',
'');
442 $this->
ctrl->setParameter($this,
'show_best_solutions',
'1');
443 $toolbar->setShowBestSolutionsLinkTarget($this->
ctrl->getLinkTarget($this, $this->ctrl->getCmd()));
444 $this->
ctrl->setParameterByClass(
'',
'show_best_solutions',
'');
449 $participant_data->setParticipantAccessFilter(
450 $this->participant_access_filter_factory->getAccessResultsUserFilter($this->getTestObj()->getRefId())
453 $participant_data->setActiveIdsFilter($show_user_results);
455 $participant_data->load($this->
getTestObj()->getTestId());
456 $toolbar->setParticipantSelectorOptions($participant_data->getOptionArray());
459 $template->setVariable(
'RESULTS_TOOLBAR', $toolbar->getHTML());
463 $service_gui->setParticipantData($participant_data);
468 foreach ($show_user_results as
$key => $active_id) {
469 if (!in_array($active_id, $participant_data->getActiveIds())) {
475 if ($active_id > 0) {
476 $results = $service_gui->getResultsOfUserOutput(
477 $testSessionFactory->getSession((
int) $active_id),
487 if ($count < count($show_user_results)) {
488 $template->touchBlock(
"break");
490 $template->setCurrentBlock(
"user_result");
491 $template->setVariable(
"USER_RESULT",
$results);
492 $template->parseCurrentBlock();
static get(string $a_var)
const CMD_CONFIRM_DELETE_ALL_USER_RESULTS
ilParticipantsTestResultsGUI: ilTestEvaluationGUI ilParticipantsTestResultsGUI: ilAssQuestionPageGUI...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
deleteSingleUserResultsCmd()
Asks for a confirmation to delete selected user data of the test object.
Class ChatMainBarProvider .
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
ilTestObjectiveOrientedContainer $objective_parent
setObjectiveParent(ilTestObjectiveOrientedContainer $objective_parent)
showUserResults($show_pass_details, $show_answers, $show_reached_points=false)
Shows the pass overview of the scored pass for one ore more users.
static getStyleSheetLocation(string $mode="output", string $a_css_name="", string $a_css_location="")
get full style sheet file name (path inclusive) of current user
static http()
Fetches the global http state from ILIAS.
addDeleteAllTestResultsButton(ilToolbarGUI $toolbar)
setQuestionSetConfig(ilTestQuestionSetConfig $question_set_config)
ilTestAccess $test_access
const CMD_PERFORM_DELETE_SELECTED_USER_RESULTS
showUserAnswersCmd()
Shows the answers of one ore more users for the scored pass.
static _getResultPass($active_id)
Retrieves the pass number that should be counted for a given user.
deleteAllUserResultsCmd()
Asks for a confirmation to delete all user data of the test object.
Output class for assessment test evaluation.
setTestAccess(ilTestAccess $test_access)
confirmDeleteSelectedUserDataCmd()
Deletes the selected user data for the test object.
createUserResults(bool $show_pass_details, bool $show_answers, bool $show_reached_points, array $show_user_results)
const CMD_SHOW_PARTICIPANTS
const CMD_CONFIRM_DELETE_SELECTED_USER_RESULTS
const CMD_PERFORM_DELETE_ALL_USER_RESULTS
showDetailedResultsCmd()
Shows the pass overview and the answers of one ore more users for the scored pass.
Service GUI class for tests.
__construct(private ilCtrlInterface $ctrl, private ilLanguage $lng, private ilDBInterface $db, private ilObjUser $user, private ilTabsGUI $tabs, private ilToolbarGUI $toolbar, private ilGlobalTemplateInterface $main_tpl, private UIFactory $ui_factory, private UIRenderer $ui_renderer, private ilTestParticipantAccessFilterFactory $participant_access_filter_factory, private InternalRequestService $testrequest, private \ILIAS\HTTP\GlobalHttpState $http, private \ILIAS\Refinery\Factory $refinery,)
setTestObj(ilObjTest $test_obj)
static clear(string $a_var)
static set(string $a_var, $a_val)
Set a value.
showPassOverviewCmd()
Shows the pass overview of the scored pass for one ore more users.
confirmDeleteAllUserResultsCmd()
Deletes all user data for the test object.
ilTestQuestionSetConfig $question_set_config
Refinery Factory $refinery