Skip to content

Commit d17754a

Browse files
Print forum anonymity info
1 parent ff82bc1 commit d17754a

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

lang/en/moodleoverflow.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,12 @@
408408
// Anonymous Feature
409409
$string['anonymous'] = 'Anonymous';
410410
$string['anonymous_help'] = 'This will hide username from all question (and answers).<br>WARNING: Once the questions (and answers) are anonymized, this cannot be reversed.<br>The setting can only be changed to a higher degree of anonymity.';
411-
$string['anonymous:only_questions'] = 'Only questions (Irreversible!)';
412-
$string['anonymous:everything'] = 'Questions and answers (Irreversible!)';
411+
$string['anonymous:only_questions'] = 'Only questioners (Irreversible!)';
412+
$string['anonymous:everything'] = 'Questioners and answerers (Irreversible!)';
413413
$string['anonym_you'] = 'Anonymous (You)';
414414
$string['allowanonymous'] = 'Allow anonymous';
415415
$string['allowanonymous_desc'] = 'Allow teachers to put moodleoverflow forums into anonymous question or full anonymous mode';
416416
$string['questioner'] = 'Questioner';
417417
$string['answerer'] = 'Answerer #{$a}';
418+
$string['desc:only_questions'] = 'The name of questioners will not be displayed in their question and comments.';
419+
$string['desc:anonymous'] = 'No names will be displayed.';

view.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@
9191
// Show the name of the instance.
9292
echo $OUTPUT->heading(format_string($moodleoverflow->name), 2);
9393

94+
if ($moodleoverflow->anonymous > 0) {
95+
$strkeys = [
96+
\mod_moodleoverflow\anonymous::QUESTION_ANONYMOUS => 'desc:only_questions',
97+
\mod_moodleoverflow\anonymous::EVERYTHING_ANONYMOUS => 'desc:anonymous'
98+
];
99+
echo html_writer::tag('p', get_string($strkeys[$moodleoverflow->anonymous], 'moodleoverflow'));
100+
}
101+
94102
// Show the description of the instance.
95103
if (!empty($moodleoverflow->intro)) {
96104
echo $OUTPUT->box(format_module_intro('moodleoverflow', $moodleoverflow, $cm->id), 'generalbox', 'intro');
@@ -100,7 +108,6 @@
100108
$SESSION->fromdiscussion = qualified_me();
101109

102110
// Print the discussions.
103-
echo '<br />';
104111
moodleoverflow_print_latest_discussions($moodleoverflow, $cm, $page, get_config('moodleoverflow', 'manydiscussions'));
105112

106113
// Finish the page.

0 commit comments

Comments
 (0)