Skip to content

Commit

Permalink
Exercise - Hide column IP when user is anonymous in overview page - r…
Browse files Browse the repository at this point in the history
…efs CT#4183
  • Loading branch information
cfasanando committed Feb 24, 2022
1 parent 8884d75 commit dce4784
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main/exercise/overview.php
Expand Up @@ -312,6 +312,9 @@
'date' => api_convert_and_format_date($attempt_result['start_date'], DATE_TIME_FORMAT_LONG),
'userIp' => $attempt_result['user_ip'],
];
if (api_is_anonymous()) {
unset($row['userIp']);
}
$attempt_link .= PHP_EOL.$teacher_revised;

if (in_array(
Expand Down Expand Up @@ -433,6 +436,9 @@
}
break;
}
if (api_is_anonymous()) {
unset($header_names[2]); // It removes the 3rd column related to IP
}
$column = 0;
foreach ($header_names as $item) {
$table->setHeaderContents(0, $column, $item);
Expand Down

0 comments on commit dce4784

Please sign in to comment.