Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions components/ILIAS/Test/classes/class.ilMyTestResultsGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,10 @@
*/
class ilMyTestResultsGUI
{
private const EVALGUI_CMD_SHOW_PASS_OVERVIEW = 'outUserResultsOverview';

public function __construct(
private readonly ?ilObjTest $test_obj,
private readonly ilTestAccess $test_access,
private readonly ilTestObjectiveOrientedContainer $objective_parent,
private readonly ilObjUser $user,
private readonly ilLanguage $lng,
private readonly ilCtrlInterface $ctrl,
private readonly ilGlobalTemplateInterface $tpl,
Expand All @@ -54,28 +51,26 @@ public function __construct(
public function executeCommand(): void
{
switch ($this->ctrl->getNextClass()) {
case "iltestevaluationgui":
case strtolower(ilTestEvaluationGUI::class):
$gui = new ilTestEvaluationGUI($this->test_obj);
$gui->setObjectiveOrientedContainer($this->objective_parent);
$gui->setTestAccess($this->test_access);
if ($this->ctrl->getCmd() === '') {
$gui->{self::EVALGUI_CMD_SHOW_PASS_OVERVIEW}();
$gui->outUserResultsOverview();
break;
}
$this->ctrl->forwardCommand($gui);
break;

case 'ilassquestionpagegui':
$forwarder = new ilAssQuestionPageCommandForwarder(
case strtolower(ilAssQuestionPageGUI::class):
(new ilAssQuestionPageCommandForwarder(
$this->test_obj,
$this->lng,
$this->ctrl,
$this->tpl,
$this->questionrepository,
$this->testrequest,
$this->user->getId()
);
$forwarder->forward();
$this->testrequest
))->forward();
break;
}
}
Expand Down
77 changes: 0 additions & 77 deletions components/ILIAS/Test/classes/class.ilMyTestSolutionsGUI.php

This file was deleted.

28 changes: 5 additions & 23 deletions components/ILIAS/Test/classes/class.ilTestResultsGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
*
* @ilCtrl_Calls ilTestResultsGUI: ilMyTestResultsGUI
* @ilCtrl_Calls ilTestResultsGUI: ilTestEvalObjectiveOrientedGUI
* @ilCtrl_Calls ilTestResultsGUI: ilMyTestSolutionsGUI
* @ilCtrl_Calls ilTestResultsGUI: ilTestToplistGUI
* @ilCtrl_Calls ilTestResultsGUI: ilTestSkillEvaluationGUI
*/
Expand Down Expand Up @@ -88,13 +87,16 @@ public function executeCommand(): void
ilObjTestGUI::accessViolationRedirect();
}

$this->test_tabs->activateSubTab(TabsManager::SUBTAB_ID_MY_RESULTS);
$this->test_tabs->activateSubTab(
$this->ctrl->getCmd() === 'outUserListOfAnswerPasses'
? TabsManager::SUBTAB_ID_MY_SOLUTIONS
: TabsManager::SUBTAB_ID_MY_RESULTS
);

$gui = new ilMyTestResultsGUI(
$this->test_object,
$this->test_access,
$this->objective_parent,
$this->user,
$this->lng,
$this->ctrl,
$this->main_tpl,
Expand All @@ -116,26 +118,6 @@ public function executeCommand(): void
$this->ctrl->forwardCommand($gui);
break;

case 'ilmytestsolutionsgui':
if (!$this->test_tabs->needsYourSolutionsSubTab()) {
ilObjTestGUI::accessViolationRedirect();
}

$this->test_tabs->activateSubTab(TabsManager::SUBTAB_ID_MY_SOLUTIONS);

$gui = new ilMyTestSolutionsGUI(
$this->test_object,
$this->test_access,
$this->objective_parent,
$this->lng,
$this->ctrl,
$this->main_tpl,
$this->questionrepository,
$this->testrequest
);
$this->ctrl->forwardCommand($gui);
break;

case 'iltesttoplistgui':
if (!$this->test_tabs->needsHighSoreSubTab()) {
ilObjTestGUI::accessViolationRedirect();
Expand Down
19 changes: 9 additions & 10 deletions components/ILIAS/Test/src/Presentation/TabsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -724,15 +724,11 @@ public function needsYourResultsTab(): bool

protected function getYourResultsTabTarget(): string
{
if ($this->needsLoResultsSubTab()) {
return $this->ctrl->getLinkTargetByClass([\ilObjTestGUI::class, \ilTestResultsGUI::class, \ilTestEvalObjectiveOrientedGUI::class]);
}

if ($this->needsYourSolutionsSubTab()) {
return $this->ctrl->getLinkTargetByClass([\ilTestResultsGUI::class, \ilMyTestSolutionsGUI::class, \ilTestEvaluationGUI::class]);
}

return $this->ctrl->getLinkTargetByClass([\ilTestResultsGUI::class, \ilMyTestResultsGUI::class, \ilTestEvaluationGUI::class]);
return $this->ctrl->getLinkTargetByClass(
$this->needsLoResultsSubTab()
? [\ilObjTestGUI::class, \ilTestResultsGUI::class, \ilTestEvalObjectiveOrientedGUI::class]
: [\ilTestResultsGUI::class, \ilMyTestResultsGUI::class, \ilTestEvaluationGUI::class]
);
}

protected function needsYourResultsSubTab(): bool
Expand Down Expand Up @@ -816,7 +812,10 @@ public function getYourResultsSubTabs(): void
$this->tabs->addSubTab(
self::SUBTAB_ID_MY_SOLUTIONS,
$this->lng->txt('tst_list_of_answers_show'),
$this->ctrl->getLinkTargetByClass([\ilTestResultsGUI::class, \ilMyTestSolutionsGUI::class, \ilTestEvaluationGUI::class])
$this->ctrl->getLinkTargetByClass(
[\ilTestResultsGUI::class, \ilMyTestResultsGUI::class, \ilTestEvaluationGUI::class],
'outUserListOfAnswerPasses'
)
);
}
}
Expand Down
1 change: 0 additions & 1 deletion components/ILIAS/Test/tests/ilMyTestResultsGUITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ protected function setUp(): void
$this->test,
$this->access,
$this->objective_parent,
$this->createMock(ilObjUser::class),
$this->createMock(ilLanguage::class),
$this->createMock(ilCtrlInterface::class),
$this->createMock(ilGlobalTemplateInterface::class),
Expand Down
55 changes: 0 additions & 55 deletions components/ILIAS/Test/tests/ilMyTestSolutionsGUITest.php

This file was deleted.