File tree Expand file tree Collapse file tree
components/ILIAS/Test/src/Participants Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -243,8 +243,16 @@ public function isScoringFinalized(): bool
243243 return $ this ->scoring_finalized ;
244244 }
245245
246- public function getDisplayName (Language $ language ): string
246+ public function getDisplayName (Language $ language, bool $ anonymous_test = false ): string
247247 {
248+ if ($ this ->user_id === ANONYMOUS_USER_ID && $ this ->importname !== null && $ this ->importname !== '' ) {
249+ return "{$ this ->importname } ( {$ language ->txt ('imported ' )}) " ;
250+ }
251+
252+ if ($ anonymous_test ) {
253+ return $ language ->txt ('anonymous ' );
254+ }
255+
248256 $ display_name = '' ;
249257
250258 if ($ this ->firstname ) {
@@ -254,8 +262,6 @@ public function getDisplayName(Language $language): string
254262 $ display_name .= $ this ->lastname ;
255263 }
256264
257- return $ this ->user_id === ANONYMOUS_USER_ID && $ this ->importname !== null && $ this ->importname !== ''
258- ? "{$ this ->importname } ( {$ language ->txt ('imported ' )}) "
259- : $ display_name ;
265+ return $ display_name ;
260266 }
261267}
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ public function getRows(
108108 $ total_duration = $ record ->getTotalDuration ($ processing_time );
109109 $ status_of_attempt = $ record ->getAttemptOverviewInformation ()?->getStatusOfAttempt() ?? StatusOfAttempt::NOT_YET_STARTED ;
110110 $ row = [
111- 'name ' => $ record ->getDisplayName ($ this ->lng ),
111+ 'name ' => $ record ->getDisplayName ($ this ->lng , $ this -> test_object -> getAnonymity () ),
112112 'login ' => $ record ->getLogin (),
113113 'matriculation ' => $ record ->getMatriculation (),
114114 'total_time_on_task ' => $ record ->getAttemptOverviewInformation ()?->getHumanReadableTotalTimeOnTask() ?? '' ,
You can’t perform that action at this time.
0 commit comments