Skip to content

Commit ca8186b

Browse files
committed
Add setting 'hide_user_info_in_quiz_result' see BT#13185
Hide user information in the quiz result's page $_configuration['hide_user_info_in_quiz_result'] = false;
1 parent 40bb7d3 commit ca8186b

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

main/exercise/exercise.class.php

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5863,11 +5863,16 @@ public function show_exercise_result_header(
58635863
$duration = null,
58645864
$ip = null
58655865
) {
5866-
$array = array();
5867-
5866+
$array = [];
58685867
if (!empty($user_data)) {
5869-
$array[] = array('title' => get_lang('Name'), 'content' => $user_data['complete_name']);
5870-
$array[] = array('title' => get_lang('Username'), 'content' => $user_data['username']);
5868+
$array[] = array(
5869+
'title' => get_lang('Name'),
5870+
'content' => $user_data['complete_name']
5871+
);
5872+
$array[] = array(
5873+
'title' => get_lang('Username'),
5874+
'content' => $user_data['username']
5875+
);
58715876
if (!empty($user_data['official_code'])) {
58725877
$array[] = array(
58735878
'title' => get_lang('OfficialCode'),
@@ -5895,7 +5900,12 @@ public function show_exercise_result_header(
58955900
$array[] = array('title' => get_lang('IP'), 'content' => $ip);
58965901
}
58975902

5898-
$icon = Display::return_icon('test-quiz.png', get_lang('Result'), null, ICON_SIZE_MEDIUM);
5903+
$icon = Display::return_icon(
5904+
'test-quiz.png',
5905+
get_lang('Result'),
5906+
null,
5907+
ICON_SIZE_MEDIUM
5908+
);
58995909

59005910
$html = '<div class="question-result">';
59015911

@@ -5908,7 +5918,12 @@ public function show_exercise_result_header(
59085918
);
59095919
}
59105920

5911-
$html .= Display::description($array);
5921+
$hide = api_get_configuration_value('hide_user_info_in_quiz_result');
5922+
5923+
if ($hide === false) {
5924+
$html .= Display::description($array);
5925+
}
5926+
59125927
$html .= "</div>";
59135928
return $html;
59145929
}

main/install/configuration.dist.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,8 @@
504504
//$_configuration['allow_notification_setting_per_exercise'] = false;
505505
// Hide free/oral/annotation question result see BT#12613
506506
//$_configuration['hide_free_question_score'] = false;
507+
// Hide user information in the quiz result's page
508+
//$_configuration['hide_user_info_in_quiz_result'] = false;
507509

508510
// Score model
509511
// Allow to convert a score into a text/color label

0 commit comments

Comments
 (0)