mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merge branch 'MDL-72450-master-1' of git://github.com/mihailges/moodle
This commit is contained in:
commit
731b069c4d
7 changed files with 92 additions and 4 deletions
|
@ -0,0 +1,67 @@
|
||||||
|
@format @format_singleactivity
|
||||||
|
Feature: Activity navigation in a single activity course
|
||||||
|
In order to quickly switch to another activity in a single activity course with multiple (hidden) activities
|
||||||
|
As a teacher
|
||||||
|
I need to use the activity navigation controls in activities
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the following "users" exist:
|
||||||
|
| username | firstname | lastname | email |
|
||||||
|
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||||
|
| student1 | Student | 1 | student1@example.com |
|
||||||
|
And the following "courses" exist:
|
||||||
|
| fullname | shortname | format | activitytype |
|
||||||
|
| Course 1 | C1 | singleactivity | forum |
|
||||||
|
And the following "course enrolments" exist:
|
||||||
|
| user | course | role |
|
||||||
|
| student1 | C1 | student |
|
||||||
|
| teacher1 | C1 | editingteacher |
|
||||||
|
And the following "activities" exist:
|
||||||
|
| activity | name | intro | course | idnumber | section |
|
||||||
|
| assign | Assignment 1 | Test assignment description | C1 | assign1 | 0 |
|
||||||
|
| chat | Chat 1 | Test chat description | C1 | chat1 | 0 |
|
||||||
|
| forum | Forum 1 | Test forum description | C1 | forum1 | 0 |
|
||||||
|
|
||||||
|
Scenario: Step through hidden activities in the course as a teacher.
|
||||||
|
Given I log in as "teacher1"
|
||||||
|
When I am on "Course 1" course homepage
|
||||||
|
# The first activity (Forum 1) won't have the previous activity link.
|
||||||
|
Then "#prev-activity-link" "css_element" should not exist
|
||||||
|
And I should see "Assignment 1 (hidden)" in the "#next-activity-link" "css_element"
|
||||||
|
And I follow "Assignment 1 (hidden)"
|
||||||
|
And I should see "Forum 1" in the "#prev-activity-link" "css_element"
|
||||||
|
And I should see "Chat 1 (hidden)" in the "#next-activity-link" "css_element"
|
||||||
|
And I follow "Chat 1 (hidden)"
|
||||||
|
And I should see "Assignment 1 (hidden)" in the "#prev-activity-link" "css_element"
|
||||||
|
And "#next-activity-link" "css_element" should not exist
|
||||||
|
|
||||||
|
Scenario: Jump to a hidden activity as a teacher
|
||||||
|
Given I log in as "teacher1"
|
||||||
|
When I am on "Course 1" course homepage
|
||||||
|
Then "Jump to..." "field" should exist
|
||||||
|
# The current activity (Forum 1) will not be listed.
|
||||||
|
And the "Jump to..." select box should not contain "Forum 1"
|
||||||
|
# Check drop down menu contents.
|
||||||
|
And the "Jump to..." select box should contain "Assignment 1 (hidden)"
|
||||||
|
And the "Jump to..." select box should contain "Chat 1 (hidden)"
|
||||||
|
# Jump to a hidden activity somewhere in the middle.
|
||||||
|
When I select "Assignment 1 (hidden)" from the "Jump to..." singleselect
|
||||||
|
Then I should see "Assignment 1"
|
||||||
|
And I should see "Forum 1" in the "#prev-activity-link" "css_element"
|
||||||
|
And I should see "Chat 1 (hidden)" in the "#next-activity-link" "css_element"
|
||||||
|
# Jump to the first activity.
|
||||||
|
And I select "Forum 1" from the "Jump to..." singleselect
|
||||||
|
And I should see "Assignment 1 (hidden)" in the "#next-activity-link" "css_element"
|
||||||
|
But "#prev-activity-link" "css_element" should not exist
|
||||||
|
# Jump to the last activity.
|
||||||
|
And I select "Chat 1 (hidden)" from the "Jump to..." singleselect
|
||||||
|
And I should see "Assignment 1 (hidden)" in the "#prev-activity-link" "css_element"
|
||||||
|
But "#next-activity-link" "css_element" should not exist
|
||||||
|
|
||||||
|
Scenario: The activity navigation controls are not available as a student.
|
||||||
|
Given I log in as "student1"
|
||||||
|
And I am on "Course 1" course homepage
|
||||||
|
# The first activity won't have the previous activity link.
|
||||||
|
Then "#prev-activity-link" "css_element" should not exist
|
||||||
|
And "#next-activity-link" "css_element" should not exist
|
||||||
|
And "Jump to..." "field" should not exist
|
|
@ -677,6 +677,12 @@ class theme_config {
|
||||||
*/
|
*/
|
||||||
public $precompiledcsscallback = null;
|
public $precompiledcsscallback = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the theme uses course index.
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
public $usescourseindex = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the config.php file for a particular theme, and return an instance
|
* Load the config.php file for a particular theme, and return an instance
|
||||||
* of this class. (That is, this is a factory method.)
|
* of this class. (That is, this is a factory method.)
|
||||||
|
@ -754,7 +760,7 @@ class theme_config {
|
||||||
'rendererfactory', 'csspostprocess', 'editor_sheets', 'editor_scss', 'rarrow', 'larrow', 'uarrow', 'darrow',
|
'rendererfactory', 'csspostprocess', 'editor_sheets', 'editor_scss', 'rarrow', 'larrow', 'uarrow', 'darrow',
|
||||||
'hidefromselector', 'doctype', 'yuicssmodules', 'blockrtlmanipulations', 'blockrendermethod',
|
'hidefromselector', 'doctype', 'yuicssmodules', 'blockrtlmanipulations', 'blockrendermethod',
|
||||||
'scss', 'extrascsscallback', 'prescsscallback', 'csstreepostprocessor', 'addblockposition',
|
'scss', 'extrascsscallback', 'prescsscallback', 'csstreepostprocessor', 'addblockposition',
|
||||||
'iconsystem', 'precompiledcsscallback', 'haseditswitch');
|
'iconsystem', 'precompiledcsscallback', 'haseditswitch', 'usescourseindex');
|
||||||
|
|
||||||
foreach ($config as $key=>$value) {
|
foreach ($config as $key=>$value) {
|
||||||
if (in_array($key, $configurable)) {
|
if (in_array($key, $configurable)) {
|
||||||
|
|
|
@ -955,8 +955,17 @@ class core_renderer extends renderer_base {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get a list of all the activities in the course.
|
|
||||||
$course = $this->page->cm->get_course();
|
$course = $this->page->cm->get_course();
|
||||||
|
$courseformat = course_get_format($course);
|
||||||
|
|
||||||
|
// If the theme implements course index and the current course format uses course index and the current
|
||||||
|
// page layout is not 'frametop' (this layout does not support course index), show no links.
|
||||||
|
if ($this->page->theme->usescourseindex && $courseformat->uses_course_index() &&
|
||||||
|
$this->page->pagelayout !== 'frametop') {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get a list of all the activities in the course.
|
||||||
$modules = get_fast_modinfo($course->id)->get_cms();
|
$modules = get_fast_modinfo($course->id)->get_cms();
|
||||||
|
|
||||||
// Put the modules into an array in order by the position they are shown in the course.
|
// Put the modules into an array in order by the position they are shown in the course.
|
||||||
|
|
|
@ -158,3 +158,4 @@ $THEME->requiredblocks = '';
|
||||||
$THEME->addblockposition = BLOCK_ADDBLOCK_POSITION_FLATNAV;
|
$THEME->addblockposition = BLOCK_ADDBLOCK_POSITION_FLATNAV;
|
||||||
$THEME->iconsystem = \core\output\icon_system::FONTAWESOME;
|
$THEME->iconsystem = \core\output\icon_system::FONTAWESOME;
|
||||||
$THEME->haseditswitch = true;
|
$THEME->haseditswitch = true;
|
||||||
|
$THEME->usescourseindex = true;
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
"features": [
|
"features": [
|
||||||
"lib/tests/behat/action_menu.feature",
|
"lib/tests/behat/action_menu.feature",
|
||||||
"blocks/tests/behat/hide_blocks.feature",
|
"blocks/tests/behat/hide_blocks.feature",
|
||||||
"blocks/tests/behat/move_blocks.feature"
|
"blocks/tests/behat/move_blocks.feature",
|
||||||
|
"course/tests/behat/activity_navigation.feature",
|
||||||
|
"course/tests/behat/activity_navigation_with_restrictions.feature"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,6 @@
|
||||||
|
|
||||||
defined('MOODLE_INTERNAL') || die();
|
defined('MOODLE_INTERNAL') || die();
|
||||||
|
|
||||||
$plugin->version = 2021052505;
|
$plugin->version = 2021052506;
|
||||||
$plugin->requires = 2021052500;
|
$plugin->requires = 2021052500;
|
||||||
$plugin->component = 'theme_boost';
|
$plugin->component = 'theme_boost';
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
This files describes API changes in /theme/* themes,
|
This files describes API changes in /theme/* themes,
|
||||||
information provided here is intended especially for theme designer.
|
information provided here is intended especially for theme designer.
|
||||||
|
|
||||||
|
=== 4.0 ===
|
||||||
|
* A new theme config 'usescourseindex' allows a theme to specify whether it implements and uses course index.
|
||||||
|
|
||||||
=== 3.11 ===
|
=== 3.11 ===
|
||||||
* The classname 'viewmode-cobmined' in course/management.php has been changed to 'viewmode-combined'
|
* The classname 'viewmode-cobmined' in course/management.php has been changed to 'viewmode-combined'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue