diff --git a/blocks/recent_activity/tests/behat/structural_changes.feature b/blocks/recent_activity/tests/behat/structural_changes.feature index 067b5730dad..973b10c1dfb 100644 --- a/blocks/recent_activity/tests/behat/structural_changes.feature +++ b/blocks/recent_activity/tests/behat/structural_changes.feature @@ -61,7 +61,7 @@ Feature: View structural changes in recent activity block And I add a "Forum" to section "1" and I fill the form with: | name | ForumHidden | | Description | No description | - | Visible | 0 | + | Availability | 0 | And I add a "Forum" to section "1" and I fill the form with: | name | ForumNoGroups | | Description | No description | diff --git a/blocks/site_main_menu/tests/behat/edit_activities.feature b/blocks/site_main_menu/tests/behat/edit_activities.feature index 6cb07df4712..c577b9f1412 100644 --- a/blocks/site_main_menu/tests/behat/edit_activities.feature +++ b/blocks/site_main_menu/tests/behat/edit_activities.feature @@ -51,14 +51,13 @@ Feature: Edit activities in main menu block And "My forum name" activity in site main menu block should have "Show" editing icon And "My forum name" activity in site main menu block should not have "Make available" editing icon And "My forum name" activity in site main menu block should have "Make unavailable" editing icon - # Make sure that "Visible" dropdown in the edit menu has three options. + # Make sure that "Availability" dropdown in the edit menu has three options. And I open "My forum name" actions menu in site main menu block And I click on "Edit settings" "link" in the "My forum name" activity in site main menu block And I expand all fieldsets - And the "Visible" select box should contain "Show" - And the "Visible" select box should contain "Hidden from students" - And the "Visible" select box should not contain "Hide" - And the field "Visible" matches value "Available but not displayed on course page" + And the "Availability" select box should contain "Show on course page" + And the "Availability" select box should contain "Hide from students" + And the field "Availability" matches value "Make available but not shown on course page" And I press "Save and return to course" And "My forum name" activity in site main menu block should be available but hidden from course page And I navigate to "Turn editing off" node in "Front page settings" diff --git a/blocks/social_activities/tests/behat/edit_activities.feature b/blocks/social_activities/tests/behat/edit_activities.feature index a29b0666fe3..a72fa872390 100644 --- a/blocks/social_activities/tests/behat/edit_activities.feature +++ b/blocks/social_activities/tests/behat/edit_activities.feature @@ -66,14 +66,13 @@ Feature: Edit activities in social activities block And "My forum name" activity in social activities block should have "Show" editing icon And "My forum name" activity in social activities block should not have "Make available" editing icon And "My forum name" activity in social activities block should have "Make unavailable" editing icon - # Make sure that "Visible" dropdown in the edit menu has three options. + # Make sure that "Availability" dropdown in the edit menu has three options. And I open "My forum name" actions menu in social activities block And I click on "Edit settings" "link" in the "My forum name" activity in social activities block And I expand all fieldsets - And the "Visible" select box should contain "Show" - And the "Visible" select box should contain "Hidden from students" - And the "Visible" select box should not contain "Hide" - And the field "Visible" matches value "Available but not displayed on course page" + And the "Availability" select box should contain "Show on course page" + And the "Availability" select box should contain "Hide from students" + And the field "Availability" matches value "Make available but not shown on course page" And I press "Save and return to course" And "My forum name" activity in social activities block should be available but hidden from course page And I turn editing mode off diff --git a/course/lib.php b/course/lib.php index 980173f8307..f259315bd74 100644 --- a/course/lib.php +++ b/course/lib.php @@ -1800,7 +1800,7 @@ function course_get_cm_edit_actions(cm_info $mod, $indent = -1, $sr = null) { if (!isset($str)) { $str = get_strings(array('delete', 'move', 'moveright', 'moveleft', - 'editsettings', 'duplicate', 'hide', 'makeavailable', 'makeunavailable', 'show'), 'moodle'); + 'editsettings', 'duplicate', 'modhide', 'makeavailable', 'makeunavailable', 'modshow'), 'moodle'); $str->assign = get_string('assignroles', 'role'); $str->groupsnone = get_string('clicktochangeinbrackets', 'moodle', get_string("groupsnone")); $str->groupsseparate = get_string('clicktochangeinbrackets', 'moodle', get_string("groupsseparate")); @@ -1880,16 +1880,16 @@ function course_get_cm_edit_actions(cm_info $mod, $indent = -1, $sr = null) { if ($displayedoncoursepage) { $actions['hide'] = new action_menu_link_secondary( new moodle_url($baseurl, array('hide' => $mod->id)), - new pix_icon('t/hide', $str->hide, 'moodle', array('class' => 'iconsmall', 'title' => '')), - $str->hide, + new pix_icon('t/hide', $str->modhide, 'moodle', array('class' => 'iconsmall', 'title' => '')), + $str->modhide, array('class' => 'editing_hide', 'data-action' => 'hide') ); } else if (!$displayedoncoursepage && $sectionvisible) { // Offer to "show" only if the section is visible. $actions['show'] = new action_menu_link_secondary( new moodle_url($baseurl, array('show' => $mod->id)), - new pix_icon('t/show', $str->show, 'moodle', array('class' => 'iconsmall', 'title' => '')), - $str->show, + new pix_icon('t/show', $str->modshow, 'moodle', array('class' => 'iconsmall', 'title' => '')), + $str->modshow, array('class' => 'editing_show', 'data-action' => 'show') ); } diff --git a/course/moodleform_mod.php b/course/moodleform_mod.php index f98c1fddbe3..1886a28785f 100644 --- a/course/moodleform_mod.php +++ b/course/moodleform_mod.php @@ -557,8 +557,16 @@ abstract class moodleform_mod extends moodleform { $section = get_fast_modinfo($COURSE)->get_section_info($this->_section); $allowstealth = !empty($CFG->allowstealth) && $this->courseformat->allow_stealth_module_visibility($this->_cm, $section); - $mform->addElement('modvisible', 'visible', get_string('visible'), null, + if ($allowstealth && $section->visible) { + $modvisiblelabel = 'modvisiblewithstealth'; + } else if ($section->visible) { + $modvisiblelabel = 'modvisible'; + } else { + $modvisiblelabel = 'modvisiblehiddensection'; + } + $mform->addElement('modvisible', 'visible', get_string($modvisiblelabel), null, array('allowstealth' => $allowstealth, 'sectionvisible' => $section->visible, 'cm' => $this->_cm)); + $mform->addHelpButton('visible', $modvisiblelabel); if (!empty($this->_cm)) { $context = context_module::instance($this->_cm->id); if (!has_capability('moodle/course:activityvisibility', $context)) { diff --git a/course/tests/behat/activities_visibility_icons.feature b/course/tests/behat/activities_visibility_icons.feature index a89880c5a3a..6df1c37a828 100644 --- a/course/tests/behat/activities_visibility_icons.feature +++ b/course/tests/behat/activities_visibility_icons.feature @@ -23,7 +23,7 @@ Feature: Toggle activities visibility from the course page And I add a "Forum" to section "1" and I fill the form with: | Forum name | Test forum name | | Description | Test forum description | - | Visible | Show | + | Availability | Show on course page | When I open "Test forum name" actions menu Then "Test forum name" actions menu should not have "Show" item And "Test forum name" actions menu should not have "Make available" item @@ -45,14 +45,13 @@ Feature: Toggle activities visibility from the course page And "Test forum name" activity should be hidden And I reload the page And "Test forum name" activity should be hidden - # Make sure that "Visible" dropdown in the edit menu has two options: Show/Hide. + # Make sure that "Availability" dropdown in the edit menu has two options: Show/Hide. And I open "Test forum name" actions menu And I click on "Edit settings" "link" in the "Test forum name" activity And I expand all fieldsets - And the "Visible" select box should not contain "Hidden from students" - And the "Visible" select box should not contain "Available but not displayed on course page" - And the "Visible" select box should contain "Show" - And the field "Visible" matches value "Hide" + And the "Availability" select box should contain "Show on course page" + And the "Availability" select box should not contain "Make available but not shown on course page" + And the field "Availability" matches value "Hide from students" And I press "Save and return to course" And "Test forum name" activity should be hidden And I turn editing mode off @@ -84,7 +83,7 @@ Feature: Toggle activities visibility from the course page And I add a "Forum" to section "2" and I fill the form with: | Forum name | Test forum name | | Description | Test forum description | - | Visible | Show | + | Availability | Show on course page | When I hide section "2" Then "Test forum name" activity should be hidden And I open "Test forum name" actions menu @@ -99,15 +98,14 @@ Feature: Toggle activities visibility from the course page And "Test forum name" actions menu should not have "Make available" item And I click on "Make unavailable" "link" in the "Test forum name" activity And "Test forum name" activity should be hidden - # Make sure that "Visible" dropdown in the edit menu has three options. + # Make sure that "Availability" dropdown in the edit menu has three options. And I open "Test forum name" actions menu And I click on "Edit settings" "link" in the "Test forum name" activity And I expand all fieldsets - And the "Visible" select box should contain "Hidden from students" - And the "Visible" select box should contain "Available but not displayed on course page" - And the "Visible" select box should not contain "Hide" - And the "Visible" select box should not contain "Show" - And I set the field "Visible" to "Available but not displayed on course page" + And the "Availability" select box should contain "Hide from students" + And the "Availability" select box should contain "Make available but not shown on course page" + And the "Availability" select box should not contain "Show on course page" + And I set the field "Availability" to "Make available but not shown on course page" And I press "Save and return to course" And "Test forum name" activity should be available but hidden from course page And I turn editing mode off @@ -139,7 +137,7 @@ Feature: Toggle activities visibility from the course page And I add a "Forum" to section "2" and I fill the form with: | Forum name | Test forum name | | Description | Test forum description | - | Visible | Show | + | Availability | Show on course page | When I click on ".reduce-sections" "css_element" Then "Test forum name" activity should be visible And I open "Test forum name" actions menu @@ -179,7 +177,7 @@ Feature: Toggle activities visibility from the course page And I add a "Assignment" to section "2" and I fill the form with: | Assignment name | Test assignment name | | Description | Test assignment description | - | Visible | Show | + | Availability | Show on course page | When I open "Test assignment name" actions menu Then "Test assignment name" actions menu should not have "Show" item And "Test assignment name" actions menu should have "Hide" item @@ -193,14 +191,13 @@ Feature: Toggle activities visibility from the course page And "Test assignment name" actions menu should not have "Make unavailable" item And I click on "Make available" "link" in the "Test assignment name" activity And "Test assignment name" activity should be available but hidden from course page - # Make sure that "Visible" dropdown in the edit menu has three options. + # Make sure that "Availability" dropdown in the edit menu has three options. And I open "Test assignment name" actions menu And I click on "Edit settings" "link" in the "Test assignment name" activity And I expand all fieldsets - And the "Visible" select box should contain "Show" - And the "Visible" select box should contain "Hidden from students" - And the "Visible" select box should not contain "Hide" - And the field "Visible" matches value "Available but not displayed on course page" + And the "Availability" select box should contain "Show on course page" + And the "Availability" select box should contain "Hide from students" + And the field "Availability" matches value "Make available but not shown on course page" And I press "Save and return to course" And "Test assignment name" activity should be available but hidden from course page And I turn editing mode off diff --git a/course/tests/behat/section_visibility.feature b/course/tests/behat/section_visibility.feature index f1360eb9fcd..b9f781a0d78 100644 --- a/course/tests/behat/section_visibility.feature +++ b/course/tests/behat/section_visibility.feature @@ -23,27 +23,27 @@ Feature: Show/hide course sections And I add a "Forum" to section "1" and I fill the form with: | Forum name | Test hidden forum 11 name | | Description | Test hidden forum 11 description | - | Visible | Hide | + | Availability | Hide from students | And I add a "Forum" to section "1" and I fill the form with: | Forum name | Test hidden forum 12 name | | Description | Test hidden forum 12 description | - | Visible | Show | + | Availability | Show on course page | And I add a "Forum" to section "2" and I fill the form with: | Forum name | Test hidden forum 21 name | | Description | Test hidden forum 21 description | - | Visible | Hide | + | Availability | Hide from students | And I add a "Forum" to section "2" and I fill the form with: | Forum name | Test hidden forum 22 name | | Description | Test hidden forum 22 description | - | Visible | Show | + | Availability | Show on course page | And I add a "Forum" to section "3" and I fill the form with: | Forum name | Test hidden forum 31 name | | Description | Test hidden forum 31 description | - | Visible | Hide | + | Availability | Hide from students | And I add a "Forum" to section "3" and I fill the form with: | Forum name | Test hidden forum 32 name | | Description | Test hidden forum 32 description | - | Visible | Show | + | Availability | Show on course page | And I follow "Course 1" When I hide section "1" Then section "1" should be hidden diff --git a/lang/en/moodle.php b/lang/en/moodle.php index 24fa36d7ec9..e3e74ffee5a 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -133,8 +133,8 @@ $string['alllogs'] = 'All logs'; $string['allmods'] = 'All {$a}'; $string['allow'] = 'Allow'; $string['allowinternal'] = 'Allow internal methods as well'; -$string['allowstealthmodules'] = 'Allow hidden but available activities'; -$string['allowstealthmodules_help'] = 'If enabled, activities can be marked as hidden on the course page but available by following a link from elsewhere. These activities are listed in the gradebook and other reports'; +$string['allowstealthmodules'] = 'Allow activities to be available but not shown in visible sections of course page'; +$string['allowstealthmodules_help'] = 'If enabled, the Availability setting in Common module settings may have three options, rather than two - \'Show on course page\', \'Hide from students\' and \'Make available but not shown on course page\'. If an activity or resource is made available but not shown on the course page, a link to it must be provided from elsewhere, such as from a page resource. The activity would still be listed in the gradebook and other reports.'; $string['allownone'] = 'Allow none'; $string['allownot'] = 'Do not allow'; $string['allparticipants'] = 'All participants'; @@ -930,7 +930,8 @@ $string['hiddensectionsinvisible'] = 'Hidden sections are completely invisible'; $string['hide'] = 'Hide'; $string['hideadvancedsettings'] = 'Hide advanced settings'; $string['hidechartdata'] = 'Hide chart data'; -$string['hideonfrontpage'] = 'Hide from front page'; +$string['hidefromstudents'] = 'Hide from students'; +$string['hideoncoursepage'] = 'Make available but not shown on course page'; $string['hidepicture'] = 'Hide picture'; $string['hidesection'] = 'Hide section {$a}'; $string['hidesettings'] = 'Hide settings'; @@ -1176,6 +1177,18 @@ $string['missingteacher'] = 'Must choose something'; $string['missingurl'] = 'Missing URL'; $string['missingusername'] = 'Missing username'; $string['moddoesnotsupporttype'] = 'Module {$a->modname} does not support uploads of type {$a->type}'; +$string['modhide'] = 'Hide'; +$string['modshow'] = 'Show'; +$string['modvisible'] = 'Availability'; +$string['modvisible_help'] = 'If the availability is set to \'Show on course page\', the activity or resource is available to students (subject to any access restrictions which may be set).

+If the availability is set to \'Hide from students\', the activity or resource is only available to users with permission to view hidden activities (by default, users with the role of teacher or non-editing teacher).'; +$string['modvisiblewithstealth'] = 'Availability'; +$string['modvisiblewithstealth_help'] = 'If the availability is set to \'Show on course page\', the activity or resource is available to students (subject to any access restrictions which may be set).

+If the availability is set to \'Hide from students\', the activity or resource is only available to users with permission to view hidden activities (by default, users with the role of teacher or non-editing teacher).

+If the course contains many activities or resources, the course page may be simplified by setting the availability to \'Make available but not shown on course page\'. In this case, a link to the activity or resource must be provided from elsewhere, such as from a page resource. The activity would still be listed in the gradebook and other reports.'; +$string['modvisiblehiddensection'] = 'Availability'; +$string['modvisiblehiddensection_help'] = 'If the availability is set to \'Hide from students\', the activity or resource is only available to users with permission to view hidden activities (by default, users with the role of teacher or non-editing teacher).

+If the course contains many activities or resources, the course page may be simplified by setting the availability to \'Make available but not shown on course page\'. In this case, a link to the activity or resource must be provided from elsewhere, such as from a page resource. The activity would still be listed in the gradebook and other reports.'; $string['moodlelogo'] = 'Moodle logo'; $string['month'] = 'Month'; $string['months'] = 'Months'; @@ -1715,6 +1728,7 @@ $string['showingacourses'] = 'Showing all {$a} courses'; $string['showingxofycourses'] = 'Showing courses {$a->start} to {$a->end} of {$a->total} courses'; $string['showlistofcourses'] = 'Show list of courses'; $string['showmodulecourse'] = 'Show list of courses containing activity'; +$string['showoncoursepage'] = 'Show on course page'; $string['showonly'] = 'Show only'; $string['showperpage'] = 'Show {$a} per page'; $string['showpopoverwindow'] = 'Show popover window'; diff --git a/lib/form/modvisible.php b/lib/form/modvisible.php index d8b68dcb4fd..8a3fadcea9f 100644 --- a/lib/form/modvisible.php +++ b/lib/form/modvisible.php @@ -89,20 +89,18 @@ class MoodleQuickForm_modvisible extends MoodleQuickForm_select{ $choices = array(); if (!$sectionvisible) { // If section is not visible the activity is hidden by default but it can also be made available. - $choices[self::HIDE] = get_string('hiddenfromstudents'); + $choices[self::HIDE] = get_string('hidefromstudents'); if (!$cm || $cm->has_view()) { - $choices[self::SHOW] = get_string('hiddenoncoursepage'); + $choices[self::SHOW] = get_string('hideoncoursepage'); } - } else if (!empty($options['allowstealth']) && (!$cm || $cm->has_view())) { - // If allowed in this course/section, add a third visibility option - // "Available but not displayed on course page". - $choices[self::SHOW] = get_string('show'); - $choices[self::HIDE] = get_string('hiddenfromstudents'); - $choices[self::STEALTH] = get_string('hiddenoncoursepage'); } else { - // In the visible section without "stealth" activities allowed it's just "Show" or "Hide". - $choices[self::SHOW] = get_string('show'); - $choices[self::HIDE] = get_string('hide'); + $choices[self::SHOW] = get_string('showoncoursepage'); + $choices[self::HIDE] = get_string('hidefromstudents'); + if (!empty($options['allowstealth']) && (!$cm || $cm->has_view())) { + // If allowed in this course/section, add a third visibility option + // "Available but not displayed on course page". + $choices[self::STEALTH] = get_string('hideoncoursepage'); + } } $this->load($choices); break; diff --git a/mod/forum/tests/behat/forum_subscriptions_availability.feature b/mod/forum/tests/behat/forum_subscriptions_availability.feature index 06c8292368c..cb271de38e4 100644 --- a/mod/forum/tests/behat/forum_subscriptions_availability.feature +++ b/mod/forum/tests/behat/forum_subscriptions_availability.feature @@ -70,7 +70,7 @@ Feature: As a teacher I need to see an accurate list of subscribed users | Forum type | Standard forum for general use | | Description | Test forum description | | Subscription mode | Forced subscription | - | Visible | Show | + | Availability | Show on course page | And I follow "Forced Forum 2" And I navigate to "Show/edit current subscribers" in current page administration Then I should see "Teacher Teacher" @@ -85,7 +85,7 @@ Feature: As a teacher I need to see an accurate list of subscribed users | Forum type | Standard forum for general use | | Description | Test forum description | | Subscription mode | Forced subscription | - | Visible | Hide | + | Availability | Hide from students | And I follow "Forced Forum 2" And I navigate to "Show/edit current subscribers" in current page administration Then I should see "Teacher Teacher" diff --git a/mod/label/tests/behat/label_visibility.feature b/mod/label/tests/behat/label_visibility.feature index 326dc8c0e9c..0512241e3b2 100644 --- a/mod/label/tests/behat/label_visibility.feature +++ b/mod/label/tests/behat/label_visibility.feature @@ -23,7 +23,7 @@ Feature: Check label visibility works And I turn editing mode on When I add a "label" to section "1" and I fill the form with: | Label text | Swanky label | - | Visible | Hide | + | Availability | Hide from students | Then "Swanky label" activity should be hidden And I turn editing mode off And "Swanky label" activity should be hidden @@ -51,7 +51,7 @@ Feature: Check label visibility works And I turn editing mode on When I add a "label" to section "1" and I fill the form with: | Label text | Swanky label | - | Visible | Show | + | Availability | Show on course page | Then "Swanky label" activity should be visible And I log out And I log in as "student" @@ -77,7 +77,7 @@ Feature: Check label visibility works And I turn editing mode on When I add a "label" to section "1" and I fill the form with: | Label text | Swanky label | - | Visible | Show | + | Availability | Show on course page | And I hide section "1" Then "Swanky label" activity should be dimmed And I open "Swanky label" actions menu @@ -87,10 +87,9 @@ Feature: Check label visibility works And "Swanky label" actions menu should not have "Make unavailable" item And I click on "Edit settings" "link" in the "Swanky label" activity And I expand all fieldsets - And the "Visible" select box should contain "Hidden from students" - And the "Visible" select box should not contain "Available but not displayed on course page" - And the "Visible" select box should not contain "Hide" - And the "Visible" select box should not contain "Show" + And the "Availability" select box should contain "Hide from students" + And the "Availability" select box should not contain "Make available but not shown on course page" + And the "Availability" select box should not contain "Show on course page" And I log out And I log in as "student" And I follow "Test"