Skip to content

Commit

Permalink
Merge branch 'MDL-78320' of https://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed May 25, 2023
2 parents b67930a + b2dd8a3 commit 428e604
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
9 changes: 7 additions & 2 deletions mod/quiz/report/overview/report.php
Expand Up @@ -135,7 +135,9 @@ public function display($quiz, $cm, $course) {
$quiz, $groupstudentsjoins);
if ($currentgroup) {
$a= new stdClass();
$a->groupname = groups_get_group_name($currentgroup);
$a->groupname = format_string(groups_get_group_name($currentgroup), true, [
'context' => $this->context,
]);
$a->coursestudents = get_string('participants');
$a->countregradeneeded = $regradesneeded;
$regradealldrydolabel =
Expand Down Expand Up @@ -231,7 +233,10 @@ public function display($quiz, $cm, $course) {
if ($DB->record_exists_sql($sql, $groupstudentsjoins->params)) {
$data = quiz_report_grade_bands($bandwidth, $bands, $quiz->id, $groupstudentsjoins);
$chart = self::get_chart($labels, $data);
$graphname = get_string('overviewreportgraphgroup', 'quiz_overview', groups_get_group_name($currentgroup));
$groupname = format_string(groups_get_group_name($currentgroup), true, [
'context' => $this->context,
]);
$graphname = get_string('overviewreportgraphgroup', 'quiz_overview', $groupname);
// Numerical range data should display in LTR even for RTL languages.
echo $output->chart($chart, $graphname, ['dir' => 'ltr']);
}
Expand Down
24 changes: 21 additions & 3 deletions mod/quiz/report/overview/tests/behat/basic.feature
Expand Up @@ -5,7 +5,9 @@ Feature: Basic use of the Grades report
I need to use the Grades report

Background:
Given the following "custom profile fields" exist:
Given the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
And the following "custom profile fields" exist:
| datatype | shortname | name |
| text | fruit | Fruit |
And the following "users" exist:
Expand All @@ -23,12 +25,21 @@ Feature: Basic use of the Grades report
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
And the following "groups" exist:
| course | idnumber | name |
| C1 | G1 | <span class="multilang" lang="en">English</span><span class="multilang" lang="es">Spanish</span> |
| C1 | G2 | Group 2 |
And the following "group members" exist:
| group | user |
| G1 | student1 |
| G1 | student2 |
| G2 | student3 |
And the following "question categories" exist:
| contextlevel | reference | name |
| Course | C1 | Test questions |
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 |
| activity | name | intro | course | idnumber | groupmode |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | 2 |
And the following "questions" exist:
| questioncategory | qtype | name | questiontext |
| Test questions | description | Intro | Welcome to this quiz |
Expand All @@ -48,6 +59,7 @@ Feature: Basic use of the Grades report
| 2 | True |
| 3 | True |

@javascript
Scenario: Using the Grades report
# Basic check of the Grades report
When I am on the "Quiz 1" "quiz activity" page logged in as teacher1
Expand Down Expand Up @@ -87,6 +99,12 @@ Feature: Basic use of the Grades report
# Check student2's grade
And I should see "100.00" in the "S2 Student2" "table_row"

# Verify groups are displayed correctly.
And I set the field "Visible groups" to "English"
And "Full regrade for group 'English'" "button" should exist
And "Dry run a full regrade for group 'English'" "button" should exist
And I should see "Number of students in group 'English' achieving grade ranges"

@javascript
Scenario: View custom user profile fields in the grades report
Given the following config values are set as admin:
Expand Down

0 comments on commit 428e604

Please sign in to comment.