Skip to content

Commit f9b6fc1

Browse files
committed
Review changes
1 parent 76bdc1b commit f9b6fc1

7 files changed

+29
-22
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Changes
66

77
### Unreleased
88

9+
* 2024-04-20 - Improvement: Add hint that notifications don't work within forums for hidden courses, resolves #98.
910
* 2024-04-20 - Cleanup: Add proper JS promise error handling, resolves #435.
1011

1112
### v4.3-r11

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,10 @@ In this tab there are the following settings:
545545

546546
With this setting a hint will appear in the course header if the user has switched the role in the course.
547547

548+
###### Show hint for forum notifications in hidden courses
549+
550+
With this setting a hint will not only appear in the course header but also in forums as long as the visibility of the course is hidden.
551+
548552
###### Show hint in hidden courses
549553

550554
With this setting a hint will appear in the course header as long as the visibility of the course is hidden.

lang/en/theme_boost_union.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -933,10 +933,10 @@
933933
$string['showhintcoursehiddensetting_desc'] = 'With this setting a hint will appear in the course header as long as the visibility of the course is hidden. This helps to identify the visibility state of a course at a glance without the need for looking at the course settings.';
934934
$string['showhintcoursehiddengeneral'] = 'This course is currently <strong>hidden</strong>. Only enrolled teachers can access this course when hidden.';
935935
$string['showhintcoursehiddensettingslink'] = 'You can change the visibility in the <a href="{$a->url}">course settings</a>.';
936-
// ... ... Setting: Show hint that notifications don't work within forums for hidden courses.
937-
$string['showhintforumnotificationssetting'] = 'Show hint regarding notifications in hidden courses';
938-
$string['showhintforumnotificationssetting_desc'] = 'When a course is hidden notifications within a forum are not send to students. To clarify this a hint will appear on forums within a hidden course to help the teachers understand this circumstance.';
939-
$string['showhintforumnotifications'] = 'This course is currently <strong>hidden</strong>. Please note that this means that <strong>students will not be notified</strong> online or by email of any messages you post in this forum.';
936+
// ... ... Setting: Show hint for forum notifications in hidden courses.
937+
$string['showhintforumnotificationssetting'] = 'Show hint for forum notifications in hidden courses';
938+
$string['showhintforumnotificationssetting_desc'] = 'With this setting a hint will not only appear in the course header but also in forums as long as the visibility of the course is hidden. This is to clarify that notifications within a forum are not send to students and to help the teachers understand this circumstance.';
939+
$string['showhintforumnotifications'] = 'This course is currently <strong>hidden</strong>. This means that <strong>students will not be notified</strong> online or by email of any messages you post in this forum.';
940940
// ... ... Setting: Show hint for guest access.
941941
$string['showhintcoursguestaccesssetting'] = 'Show hint for guest access';
942942
$string['showhintcourseguestaccesssetting_desc'] = 'With this setting a hint will appear in the course header when a user is accessing it with the guest access feature. If the course provides an active self enrolment, a link to that page is also presented to the user.';

locallib.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ function theme_boost_union_get_course_related_hints() {
5959
// If the setting showhintcoursehiddennotifications is set too and we view a forum (e.g. announcement) within a hidden
6060
// course a hint will be shown that no notifications via forums will be sent out to students.
6161
if (get_config('theme_boost_union', 'showhintforumnotifications') == THEME_BOOST_UNION_SETTING_SELECT_YES
62-
&& $PAGE->url->compare(new moodle_url('/mod/forum/view.php'), URL_MATCH_BASE)) {
62+
&& ($PAGE->url->compare(new moodle_url('/mod/forum/view.php'), URL_MATCH_BASE) ||
63+
$PAGE->url->compare(new moodle_url('/mod/forum/discuss.php'), URL_MATCH_BASE) ||
64+
$PAGE->url->compare(new moodle_url('/mod/forum/post.php'), URL_MATCH_BASE))) {
6365
// Use the specialized hint text for hidden courses on forum pages.
6466
$hintcoursehiddentext = get_string('showhintforumnotifications', 'theme_boost_union');
6567
}

settings.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2527,14 +2527,14 @@
25272527
$setting = new admin_setting_configselect($name, $title, $description, THEME_BOOST_UNION_SETTING_SELECT_NO, $yesnooption);
25282528
$tab->add($setting);
25292529

2530-
// Setting: Show hint at forums within hidden courses that notifications are not send.
2530+
// Setting: Show hint for forum notifications in hidden courses.
25312531
$name = 'theme_boost_union/showhintforumnotifications';
25322532
$title = get_string('showhintforumnotificationssetting', 'theme_boost_union', null, true);
25332533
$description = get_string('showhintforumnotificationssetting_desc', 'theme_boost_union', null, true);
25342534
$setting = new admin_setting_configselect($name, $title, $description, THEME_BOOST_UNION_SETTING_SELECT_NO, $yesnooption);
25352535
$tab->add($setting);
25362536
$page->hide_if('theme_boost_union/showhintforumnotifications', 'theme_boost_union/showhintcoursehidden', 'neq',
2537-
THEME_BOOST_UNION_SETTING_SELECT_YES);
2537+
THEME_BOOST_UNION_SETTING_SELECT_YES);
25382538

25392539
// Setting: Show hint guest for access.
25402540
$name = 'theme_boost_union/showhintcourseguestaccess';

tests/behat/theme_boost_union_functionalitysettings_courses.feature

+14-14
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ Feature: Configuring the theme_boost_union plugin for the "Courses" tab on the "
1616
| user | course | role |
1717
| teacher1 | C1 | editingteacher |
1818
| student1 | C1 | student |
19-
And the following "activity" exists:
20-
| course | C1 |
21-
| activity | forum |
22-
| idnumber | Announcements |
23-
| name | Announcements |
2419

2520
Scenario: Setting: Show hint for switched role - Enable the setting
2621
Given the following config values are set as admin:
@@ -41,38 +36,43 @@ Feature: Configuring the theme_boost_union plugin for the "Courses" tab on the "
4136
| showhintcoursehidden | yes | theme_boost_union |
4237
When I log in as "teacher1"
4338
And I am on "Course 1" course homepage
44-
When I navigate to "Settings" in current page administration
39+
And I navigate to "Settings" in current page administration
4540
And I set the following fields to these values:
4641
| Course visibility | Hide |
4742
And I click on "Save and display" "button"
4843
Then I should see "This course is currently hidden. Only enrolled teachers can access this course when hidden." in the ".course-hint-hidden" "css_element"
4944
When I am on "Course 1" course homepage
50-
When I navigate to "Settings" in current page administration
45+
And I navigate to "Settings" in current page administration
5146
And I set the following fields to these values:
5247
| Course visibility | Show |
5348
And I click on "Save and display" "button"
5449
Then I should not see "This course is currently hidden. Only enrolled teachers can access this course when hidden."
5550
And ".course-hint-hidden" "css_element" should not exist
5651

57-
Scenario: Setting: Show hint at forums in hidden courses that notifications do not work - Enable the setting
58-
Given the following config values are set as admin:
52+
Scenario: Setting: Show hint for forum notifications in hidden courses - Enable the setting
53+
Given the following "activity" exists:
54+
| course | C1 |
55+
| activity | forum |
56+
| idnumber | Announcements |
57+
| name | Announcements |
58+
And the following config values are set as admin:
5959
| config | value | plugin |
6060
| showhintcoursehidden | yes | theme_boost_union |
6161
| showhintforumnotifications | yes | theme_boost_union |
6262
When I log in as "teacher1"
6363
And I am on "Course 1" course homepage
64-
When I navigate to "Settings" in current page administration
64+
And I navigate to "Settings" in current page administration
6565
And I set the following fields to these values:
6666
| Course visibility | Hide |
6767
And I click on "Save and display" "button"
68-
When I am on the "Announcements" "forum activity" page
69-
Then I should see "This course is currently hidden. Please note that this means that students will not be notified online or by email of any messages you post in this forum." in the ".course-hint-hidden" "css_element"
68+
And I am on the "Announcements" "forum activity" page
69+
Then I should see "This course is currently hidden. This means that students will not be notified online or by email of any messages you post in this forum." in the ".course-hint-hidden" "css_element"
7070
When I am on "Course 1" course homepage
71-
When I navigate to "Settings" in current page administration
71+
And I navigate to "Settings" in current page administration
7272
And I set the following fields to these values:
7373
| Course visibility | Show |
7474
And I click on "Save and display" "button"
75-
Then I should not see "This course is currently hidden. Please note that this means that students will not be notified online or by email of any messages you post in this forum."
75+
Then I should not see "This course is currently hidden. This means that students will not be notified online or by email of any messages you post in this forum."
7676
And ".course-hint-hidden" "css_element" should not exist
7777

7878
Scenario: Setting: Show hint guest for access - Enable the setting

version.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
defined('MOODLE_INTERNAL') || die();
2626

2727
$plugin->component = 'theme_boost_union';
28-
$plugin->version = 2023102033;
28+
$plugin->version = 2023102034;
2929
$plugin->release = 'v4.3-r11';
3030
$plugin->requires = 2023100900;
3131
$plugin->supported = [403, 403];

0 commit comments

Comments
 (0)