Skip to content

Commit bc5afe5

Browse files
[Survey] Fix incorrect redirect results (ILIAS-eLearning#12023)
* fix: Incorrect redirect to results view * fix: Control the appraisees when doing the redirectioN
1 parent e852824 commit bc5afe5

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

components/ILIAS/Survey/classes/class.ilObjSurveyGUI.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -783,15 +783,25 @@ public static function _goto(
783783
$ctrl->redirectByClass("ilObjSurveyGUI", "run");
784784
}
785785

786-
// read permission, evaluation access and finished run -> evaluation
786+
// read permission and evaluation access -> evaluation
787787
if ($ilAccess->checkAccess("visible", "", $ref_id) ||
788788
$ilAccess->checkAccess("read", "", $ref_id)) {
789789
if ($ilAccess->checkAccess("read", "", $ref_id)) {
790790
$domain_service = $DIC->survey()->internal()->domain();
791791
$am = $domain_service->access($ref_id, $DIC->user()->getId());
792792
$survey = new ilObjSurvey($ref_id);
793-
$run_manager = $domain_service->execution()->run($survey, $DIC->user()->getId());
794-
if ($am->canAccessEvaluation()) {
793+
$appraisee_id = $request->getAppraiseeId();
794+
$run_manager = $domain_service->execution()->run(
795+
$survey,
796+
$DIC->user()->getId(),
797+
$appraisee_id
798+
);
799+
if ($domain_service->modeFeatureConfig($survey->getMode())->usesAppraisees()) {
800+
$has_finished_run = $appraisee_id > 0 && $run_manager->hasFinished();
801+
} else {
802+
$has_finished_run = $run_manager->hasFinished();
803+
}
804+
if ($am->canAccessEvaluation() && $has_finished_run) {
795805
$ctrl->setParameterByClass("ilObjSurveyGUI", "ref_id", $ref_id);
796806
$ctrl->redirectByClass(["ilObjSurveyGUI", "ilSurveyEvaluationGUI"], "openEvaluation");
797807
}

0 commit comments

Comments
 (0)