Skip to content

Commit

Permalink
MDL-77141 gradebook: Correct course name in user report
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaboesch committed Feb 24, 2023
1 parent a31f583 commit c7d9fa6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
Expand Up @@ -35,5 +35,5 @@
<i class="icon fa fa-chevron-{{arrow}} fa-fw" title="{{#str}} expand, core {{/str}}" role="img" aria-label="{{#str}} expand, core {{/str}}"></i>
</span>
</a>
<span>{{categoryname}}</span>
<span>{{{categoryname}}}</span>
</div>
23 changes: 11 additions & 12 deletions grade/report/user/tests/behat/user_view.feature
Expand Up @@ -6,8 +6,8 @@ Feature: View the user report as the student will see it

Background:
Given the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
| fullname | shortname | category | groupmode |
| <span class="multilang" lang="en">Course</span><span class="multilang" lang="de">Kurs</span> 1 & '" | C1 | 0 | 1 |
And the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | teacher1@example.com | t1 |
Expand All @@ -30,8 +30,9 @@ Feature: View the user report as the student will see it
| activity | course | idnumber | name | intro | grade |
| assign | C1 | a5 | Test assignment five | Submit something! | 100 |
| assign | C1 | a6 | Test assignment six | Submit something! | 100 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
When I am on the "C1" "Course" page logged in as "teacher1"
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I hide the grade item "Test assignment six"
And I hide the grade item "Sub category 2"
Expand All @@ -50,6 +51,8 @@ Feature: View the user report as the student will see it
Scenario: View the report as the teacher themselves
When I navigate to "View > User report" in the course gradebook
And I click on "Student 1" in the "user" search widget
And I should see "Course 1 & '\""
And I should not see "Course 1 &amp; '\""
And I set the field "View report as" to "Myself"
Then the following should exist in the "user-grade" table:
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
Expand Down Expand Up @@ -83,8 +86,7 @@ Feature: View the user report as the student will see it
| Sub category 2 total |
| Test assignment six |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "C1" "Course" page logged in as "student1"
And I navigate to "User report" in the course gradebook
Then the following should exist in the "user-grade" table:
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
Expand Down Expand Up @@ -123,8 +125,7 @@ Feature: View the user report as the student will see it
| Sub category 2 total |
| Test assignment six |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "C1" "Course" page logged in as "student1"
And I navigate to "User report" in the course gradebook
Then the following should exist in the "user-grade" table:
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
Expand Down Expand Up @@ -161,8 +162,7 @@ Feature: View the user report as the student will see it
| Sub category 2 total |
| Test assignment six |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "C1" "Course" page logged in as "student1"
And I navigate to "User report" in the course gradebook
Then the following should exist in the "user-grade" table:
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
Expand All @@ -185,8 +185,7 @@ Feature: View the user report as the student will see it
| capability | permission |
| moodle/grade:viewhidden | Allow |
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I am on the "C1" "Course" page logged in as "teacher1"
And I navigate to "Setup > Course grade settings" in the course gradebook
And I set the field with xpath "//select[@name='report_user_showtotalsifcontainhidden']" to "Show totals excluding hidden items"
And I press "Save changes"
Expand Down

0 comments on commit c7d9fa6

Please sign in to comment.