Merge branch 'MDL-71392-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE

This commit is contained in:
Sara Arjona 2021-04-26 11:52:54 +02:00
commit 6a5b32a584
2 changed files with 12 additions and 1 deletions

View file

@ -30,3 +30,13 @@ Feature: Display of information before starting a quiz
| TF1 | 1 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
Then I should see "Grade to pass: 60.00 out of 100.00"
Scenario: Check the pass grade is not displayed if not set
Given the following "activities" exist:
| activity | name | intro | course | idnumber | gradepass |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | |
And quiz "Quiz 1" contains the following questions:
| question | page |
| TF1 | 1 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
Then I should not see "Grade to pass: 0.00"

View file

@ -187,7 +187,8 @@ if ($quiz->attempts != 1) {
quiz_get_grading_option_name($quiz->grademethod));
}
if ($item && $item->gradepass) {
// Inform user of the grade to pass if non-zero.
if ($item && grade_floats_different($item->gradepass, 0)) {
$a = new stdClass();
$a->grade = quiz_format_grade($quiz, $item->gradepass);
$a->maxgrade = quiz_format_grade($quiz, $quiz->grade);