@@ -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