Browse Source

Quiz: Add link to user profile in test results header table

Yannick Warnier 6 years ago
parent
commit
6075671b78
1 changed files with 5 additions and 1 deletions
  1. 5 1
      main/exercise/exercise.class.php

+ 5 - 1
main/exercise/exercise.class.php

@@ -6019,9 +6019,13 @@ class Exercise
 
         $array = [];
         if (!empty($user_data)) {
+            $userFullName = $user_data['complete_name'];
+            if (api_is_teacher() || api_is_platform_admin(true, true)) {
+                $userFullName = '<a href="'.$user_data['profile_url'].'" title="'.get_lang('GoToStudentDetails').'">'.$user_data['complete_name'].'</a>';
+            }
             $array[] = [
                 'title' => get_lang('Name'),
-                'content' => $user_data['complete_name'],
+                'content' => $userFullName,
             ];
             $array[] = [
                 'title' => get_lang('Username'),