Skip to content

Commit

Permalink
Merge branch 'MDL-71915-master-v8' of https://github.com/sharidas/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
snake committed Dec 6, 2021
2 parents c1e72a3 + 1cdab24 commit 1388a85
Show file tree
Hide file tree
Showing 199 changed files with 2,993 additions and 1,049 deletions.
28 changes: 14 additions & 14 deletions admin/tool/behat/tests/behat/i_am_on_page.feature
Expand Up @@ -22,18 +22,18 @@ Feature: Use core page resolvers for the I am on the page steps
Then I should see "<shouldsee>"

Examples:
| description | identifier | type | shouldsee |
| Course Category idnumber | CAT1 | category | Add a new course |
| Course Category name | "Cat 1" | Category | Add a new course |
| Course Full name | "Economics 101" | course | Fundamentals of Economics |
| Course Short name | ECON101 | COURSE | Fundamentals of Economics |
| Course idnumber | "2021-econ101" | Course | Fundamentals of Economics |
| Forum idnumber | fundamentalsofeconomics | Activity | Add a new discussion |
| Generic activity editing | fundamentalsofeconomics | "Activity editing" | Updating: Forum |
| Forum name | "Fundamentals of Economics" | "Forum activity" | Add a new discussion |
| Forum name editing | "Fundamentals of Economics" | "Forum activity editing" | Updating: Forum |
| Forum name permissions | "Fundamentals of Economics" | "Forum activity permissions" | Permissions in Forum: Fun |
| Forum name roles | "Fundamentals of Economics" | "Forum activity roles" | Assign roles in Forum: Fun |
| description | identifier | type | shouldsee |
| Course Category idnumber | CAT1 | category | Add a new course |
| Course Category name | "Cat 1" | Category | Add a new course |
| Course Full name | "Economics 101" | course | Fundamentals of Economics |
| Course Short name | ECON101 | COURSE | Fundamentals of Economics |
| Course idnumber | "2021-econ101" | Course | Fundamentals of Economics |
| Forum idnumber | fundamentalsofeconomics | Activity | Add discussion topic |
| Generic activity editing | fundamentalsofeconomics | "Activity editing" | Updating: Forum |
| Forum name | "Fundamentals of Economics" | "Forum activity" | Add discussion topic |
| Forum name editing | "Fundamentals of Economics" | "Forum activity editing" | Updating: Forum |
| Forum name permissions | "Fundamentals of Economics" | "Forum activity permissions" | Permissions in Forum: Fun |
| Forum name roles | "Fundamentals of Economics" | "Forum activity roles" | Assign roles in Forum: Fun |

Scenario Outline: When I am on an instance logged in as
Given the following "categories" exist:
Expand All @@ -58,9 +58,9 @@ Feature: Use core page resolvers for the I am on the page steps
| Course Full name | "Economics 101" | course | Fundamentals of Economics |
| Course Short name | ECON101 | COURSE | Fundamentals of Economics |
| Course idnumber | "2021-econ101" | Course | Fundamentals of Economics |
| Forum idnumber | fundamentalsofeconomics | Activity | Add a new discussion |
| Forum idnumber | fundamentalsofeconomics | Activity | Add discussion topic |
| Generic activity editing | fundamentalsofeconomics | "Activity editing" | Updating: Forum |
| Forum name | "Fundamentals of Economics" | "Forum activity" | Add a new discussion |
| Forum name | "Fundamentals of Economics" | "Forum activity" | Add discussion topic |
| Forum name editing | "Fundamentals of Economics" | "Forum activity editing" | Updating: Forum |
| Forum name permissions | "Fundamentals of Economics" | "Forum activity permissions" | Permissions in Forum: Fun |
| Forum name roles | "Fundamentals of Economics" | "Forum activity roles" | Assign roles in Forum: Fun |
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/recyclebin/tests/behat/backup_user_data.feature
Expand Up @@ -43,7 +43,7 @@ Feature: Backup user data
| Feedback for the response 'False'. | So you think it is false |
And I log out
When I am on the "Quiz 1" "quiz activity" page logged in as student1
And I press "Attempt quiz now"
And I follow "Attempt quiz"
And I click on "True" "radio" in the "First question" "question"
And I click on "False" "radio" in the "Second question" "question"
And I press "Finish attempt"
Expand Down
2 changes: 1 addition & 1 deletion badges/tests/behat/criteria_activity.feature
Expand Up @@ -57,7 +57,7 @@ Feature: Award badges based on activity completion
And the "Receive a passing grade" completion condition of "Test quiz name" is displayed as "failed"
And the "Receive a pass grade or complete all available attempts" completion condition of "Test quiz name" is displayed as "todo"
When I am on the "Test quiz name" "quiz activity" page
And I press "Re-attempt quiz"
And I follow "Attempt quiz"
And I set the field "False" to "1"
And I press "Finish attempt ..."
And I press "Submit all and finish"
Expand Down
Expand Up @@ -16,79 +16,90 @@ Feature: Change number of discussions displayed
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Add a new discussion topic"
And I turn editing mode on
And I click on "Social forum" "link"
And I follow "Add discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 10 |
| Message | This is forum post ten |
And I press "Post to forum"
And I wait to be redirected
And I am on "Course 1" course homepage
And I wait "1" seconds
And I follow "Add a new discussion topic"
And I click on "Social forum" "link"
And I follow "Add discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 9 |
| Message | This is forum post nine |
And I press "Post to forum"
And I wait to be redirected
And I am on "Course 1" course homepage
And I wait "1" seconds
And I follow "Add a new discussion topic"
And I click on "Social forum" "link"
And I follow "Add discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 8 |
| Message | This is forum post eight |
And I press "Post to forum"
And I wait to be redirected
And I am on "Course 1" course homepage
And I wait "1" seconds
And I follow "Add a new discussion topic"
And I click on "Social forum" "link"
And I follow "Add discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 7 |
| Message | This is forum post seven |
And I press "Post to forum"
And I wait to be redirected
And I am on "Course 1" course homepage
And I wait "1" seconds
And I follow "Add a new discussion topic"
And I click on "Social forum" "link"
And I follow "Add discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 6 |
| Message | This is forum post six |
And I press "Post to forum"
And I wait to be redirected
And I am on "Course 1" course homepage
And I wait "1" seconds
And I follow "Add a new discussion topic"
And I click on "Social forum" "link"
And I follow "Add discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 5 |
| Message | This is forum post five |
And I press "Post to forum"
And I wait to be redirected
And I am on "Course 1" course homepage
And I wait "1" seconds
And I follow "Add a new discussion topic"
And I click on "Social forum" "link"
And I follow "Add discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 4 |
| Message | This is forum post four |
And I press "Post to forum"
And I wait to be redirected
And I am on "Course 1" course homepage
And I wait "1" seconds
And I follow "Add a new discussion topic"
And I click on "Social forum" "link"
And I follow "Add discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 3 |
| Message | This is forum post three |
And I press "Post to forum"
And I wait to be redirected
And I am on "Course 1" course homepage
And I wait "1" seconds
And I follow "Add a new discussion topic"
And I click on "Social forum" "link"
And I follow "Add discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 2 |
| Message | This is forum post two |
And I press "Post to forum"
And I wait to be redirected
And I am on "Course 1" course homepage
And I wait "1" seconds
And I follow "Add a new discussion topic"
And I click on "Social forum" "link"
And I follow "Add discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 1 |
| Message | This is forum post one |
Expand Down
2 changes: 1 addition & 1 deletion course/tests/behat/course_creation.feature
Expand Up @@ -21,7 +21,7 @@ Feature: Managers can create courses
And I am on "Course 1" course homepage with editing mode on
And I add the "Latest announcements" block
And I am on the Announcements "forum activity" page
And "Add a new topic" "link" should exist
And "Add discussion topic" "link" should exist
And "Subscription mode > Forced subscription" "link" should not exist in current page administration
And "Subscription mode > Forced subscription" "text" should exist in current page administration
And I log out
Expand Down
8 changes: 4 additions & 4 deletions grade/report/grader/tests/behat/ajax_grader.feature
Expand Up @@ -118,6 +118,10 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe
And I set the field "ajaxgrade" to "33"
And I set the field "ajaxfeedback" to "Student 2 VU feedback"
And I press the enter key
And I click on student "Student 2" for grade item "Item SU"
And I set the field "ajaxgrade" to "Very good"
And I set the field "ajaxfeedback" to "Student 2 SU feedback"
And I press the enter key
And I click on student "Student 3" for grade item "Item VL"
And I should not see a grade field for "Student 3" and grade item "Item VL"
And I should not see a feedback field for "Student 3" and grade item "Item VL"
Expand All @@ -126,10 +130,6 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe
And I should see a feedback field for "Student 3" and grade item "Item TU"
And I set the field "ajaxfeedback" to "Student 3 TU feedback"
And I press the enter key
And I click on student "Student 2" for grade item "Item SU"
And I set the field "ajaxgrade" to "Very good"
And I set the field "ajaxfeedback" to "Student 2 SU feedback"
And I press the enter key
# Reload grader report:
And I navigate to "View > User report" in the course gradebook
And I navigate to "View > Grader report" in the course gradebook
Expand Down
4 changes: 2 additions & 2 deletions lib/form/tests/behat/modgrade_validation.feature
Expand Up @@ -75,7 +75,7 @@ Feature: Using the activity grade form element
| Group mode | No groups |
And I log out
And I am on the "Test forum name" "forum activity" page logged in as student1
And I click on "Add a new discussion topic" "link"
And I click on "Add discussion topic" "link"
And I set the following fields to these values:
| Subject | Discussion subject |
| Message | Discussion message |
Expand Down Expand Up @@ -135,7 +135,7 @@ Feature: Using the activity grade form element
And I press "Save and return to course"
And I log out
And I am on the "Test forum name" "forum activity" page logged in as student1
And I click on "Add a new discussion topic" "link"
And I click on "Add discussion topic" "link"
And I set the following fields to these values:
| Subject | Discussion subject |
| Message | Discussion message |
Expand Down
7 changes: 2 additions & 5 deletions lib/tests/behat/action_modal.feature
Expand Up @@ -13,7 +13,7 @@ Feature: Close modals by clicking outside them
| activity | name | intro | course | idnumber |
| quiz | Test quiz name | Test quiz description | C1 | quiz1 |
And I am on the "quiz1" "Activity" page logged in as "admin"
And I click on "Edit quiz" "button"
And I follow "Add question"
And I click on "Add" "link"
And I click on "a new question" "link"
# Cannot use the normal ‘I click on’ here, because the pop-up gets in the way.
Expand Down Expand Up @@ -42,8 +42,5 @@ Feature: Close modals by clicking outside them
| activity | name | intro | course | idnumber |
| quiz | Test quiz name | Test quiz description | C1 | quiz1 |
And I am on the "quiz1" "Activity" page logged in as "admin"
And I click on "Edit quiz" "button"
And I click on "Help with Editing quiz" "icon"
And I should see "More help"
And I click on "body" "css_element"
And I follow "Add question"
Then I should not see "More help"
40 changes: 20 additions & 20 deletions lib/tests/behat/locking.feature
Expand Up @@ -39,22 +39,22 @@ Feature: Context freezing apply to child contexts
Scenario: Freeze course module module should freeze just that module
Given I am on the "courseaa1" "Course" page logged in as "admin"
And I follow "faa1"
And "Add a new discussion topic" "link" should exist
And "Add discussion topic" "link" should exist
When I follow "Freeze this context"
And I click on "Continue" "button"
Then "Add a new discussion topic" "link" should not exist
Then "Add discussion topic" "link" should not exist
When I am on "courseaa1" course homepage
Then edit mode should be available on the current page
When I follow "faa1b"
Then "Add a new discussion topic" "link" should exist
Then "Add discussion topic" "link" should exist
When I am on "courseaa2" course homepage
Then edit mode should be available on the current page
When I follow "faa2"
Then "Add a new discussion topic" "link" should exist
Then "Add discussion topic" "link" should exist
When I am on "courseb" course homepage
Then edit mode should be available on the current page
When I follow "fb"
Then "Add a new discussion topic" "link" should exist
Then "Add discussion topic" "link" should exist

And I log out
When I am on the "courseaa1" "Course" page logged in as "teacher"
Expand All @@ -63,29 +63,29 @@ Feature: Context freezing apply to child contexts
When I am on "courseaa1" course homepage
Then edit mode should be available on the current page
When I follow "faa1b"
Then "Add a new discussion topic" "link" should exist
Then "Add discussion topic" "link" should exist
When I am on "courseaa2" course homepage
Then edit mode should be available on the current page
When I follow "faa2"
Then "Add a new discussion topic" "link" should exist
Then "Add discussion topic" "link" should exist
When I am on "courseb" course homepage
Then edit mode should be available on the current page
When I follow "fb"
And "Add a new discussion topic" "link" should exist
And "Add discussion topic" "link" should exist

And I log out
When I am on the "courseaa1" "Course" page logged in as "student1"
And I follow "faa1"
Then "Add a new discussion topic" "link" should not exist
When I am on "courseaa1" course homepage
When I follow "faa1b"
Then "Add a new discussion topic" "link" should exist
Then "Add discussion topic" "link" should exist
When I am on "courseaa2" course homepage
When I follow "faa2"
Then "Add a new discussion topic" "link" should exist
Then "Add discussion topic" "link" should exist
When I am on "courseb" course homepage
When I follow "fb"
Then "Add a new discussion topic" "link" should exist
Then "Add discussion topic" "link" should exist

Scenario: Freeze course should freeze all children
Given I am on the "courseaa1" "Course" page logged in as "admin"
Expand All @@ -103,11 +103,11 @@ Feature: Context freezing apply to child contexts
When I am on "courseaa2" course homepage
Then edit mode should be available on the current page
When I follow "faa2"
Then "Add a new discussion topic" "link" should exist
Then "Add discussion topic" "link" should exist
When I am on "courseb" course homepage
Then edit mode should be available on the current page
When I follow "fb"
Then "Add a new discussion topic" "link" should exist
Then "Add discussion topic" "link" should exist

And I log out
When I am on the "courseaa1" "Course" page logged in as "teacher"
Expand All @@ -120,11 +120,11 @@ Feature: Context freezing apply to child contexts
When I am on "courseaa2" course homepage
Then edit mode should be available on the current page
When I follow "faa2"
Then "Add a new discussion topic" "link" should exist
Then "Add discussion topic" "link" should exist
When I am on "courseb" course homepage
Then edit mode should be available on the current page
When I follow "fb"
Then "Add a new discussion topic" "link" should exist
Then "Add discussion topic" "link" should exist

And I log out
When I am on the "courseaa1" "Course" page logged in as "student1"
Expand All @@ -135,10 +135,10 @@ Feature: Context freezing apply to child contexts
Then "Add a new discussion topic" "link" should not exist
When I am on "courseaa2" course homepage
When I follow "faa2"
Then "Add a new discussion topic" "link" should exist
Then "Add discussion topic" "link" should exist
When I am on "courseb" course homepage
When I follow "fb"
Then "Add a new discussion topic" "link" should exist
Then "Add discussion topic" "link" should exist

Scenario: Freeze course category should freeze all children
Given I log in as "admin"
Expand All @@ -162,7 +162,7 @@ Feature: Context freezing apply to child contexts
When I am on "courseb" course homepage
Then edit mode should be available on the current page
When I follow "fb"
Then "Add a new discussion topic" "link" should exist
Then "Add discussion topic" "link" should exist

And I log out
When I am on the "courseaa1" "Course" page logged in as "teacher"
Expand All @@ -180,7 +180,7 @@ Feature: Context freezing apply to child contexts
When I am on "courseb" course homepage
Then edit mode should be available on the current page
When I follow "fb"
Then "Add a new discussion topic" "link" should exist
Then "Add discussion topic" "link" should exist

And I log out
When I am on the "courseaa1" "Course" page logged in as "student1"
Expand All @@ -194,4 +194,4 @@ Feature: Context freezing apply to child contexts
Then "Add a new discussion topic" "link" should not exist
When I am on "courseb" course homepage
When I follow "fb"
Then "Add a new discussion topic" "link" should exist
Then "Add discussion topic" "link" should exist
2 changes: 1 addition & 1 deletion mod/forum/classes/local/renderers/discussion.php
Expand Up @@ -417,7 +417,7 @@ private function get_notifications($user) : array {
if ($this->capabilitymanager->must_post_before_viewing_discussion($user, $discussion)) {
$notifications[] = (new notification(
get_string('qandanotify', 'forum')
))->set_show_closebutton(true);
))->set_show_closebutton(true)->set_extra_classes(['mt-3']);
}
}

Expand Down

0 comments on commit 1388a85

Please sign in to comment.