Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-85246

Quiz 'Highest grade' feedback broken after MDL-84232 was applied

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 4.4 regressions, 4.4.8, 4.5 regressions, 4.5.4, 5.0 regressions, 5.0
    • Quiz
    • MOODLE_404_STABLE, MOODLE_405_STABLE, MOODLE_500_STABLE
    • MDL-85246-405
    • MDL-85246-500
    • MDL-85246-main
    • Hide

      Pre-test setup

      For this test, log in as admin and:

      1. Create a course with completion tracking enabled.
      2. Create a quiz with the following settings:
        • Grade > Grading method > Highest grade. (Any grading method should work).
        • Completion Conditions > Add Requirements > Receive a grade > Any grade.
      3.  Add atleast one question to the quiz.
      4. Enrol a user as a student in the course.
      5. Set the "Recover grades default" (recovergradesdefault) to no (unchecked).
        • Site administration > Grades > General settings

      Testing steps

      Test 1

      1. Log in as the test student and access the test course.
      2. Complete the quiz, getting all or some of the questions correct. (Its important to get a score > 0).
      3. Finish the review.
      4. Verify that you see "Done: Receive a grade" as the completion status and "Highest grade" is not 0.
        • Both highest grade and grade scores should be the same.
        • The quiz is marked complete.

      Test 2

      1. Log in as admin user and unenroll the test student from the course.
      2. Enroll the test student back in the course as a student.
      3. Log in as the test student and access the test course.
      4. Access the quiz page.
      5. Verify that you see "To do: Receive a grade" as the completion status and "Highest grade" is 0.
        • The completion status is still incomplete and the grade is 0.
        • No previous grade was recovered.

      Test 3

      1. Log in as admin user.
      2. Set the "Recover grades default" (recovergradesdefault) to yes (checked).
      3. Unenroll the test student from the course.
      4. Enroll the test student back in the course as a student.
      5. Log in as the test student and access the test course.
      6. Access the quiz page.
      7. Verify that you see "Done: Receive a grade" as the completion status and "Highest grade" is not 0.
        • The quiz is marked complete and the grade is not 0. The previous grade was recovered.
      Show
      Pre-test setup For this test, log in as admin and: Create a course with completion tracking enabled. Create a quiz with the following settings: Grade > Grading method > Highest grade. (Any grading method should work). Completion Conditions > Add Requirements > Receive a grade > Any grade.  Add atleast one question to the quiz. Enrol a user as a student in the course. Set the "Recover grades default" ( recovergradesdefault ) to no (unchecked). Site administration > Grades > General settings Testing steps Test 1 Log in as the test student and access the test course. Complete the quiz, getting all or some of the questions correct. (Its important to get a score > 0). Finish the review. Verify that you see "Done: Receive a grade" as the completion status and "Highest grade" is not 0. Both highest grade and grade scores should be the same. The quiz is marked complete . Test 2 Log in as admin user and unenroll the test student from the course. Enroll the test student back in the course as a student. Log in as the test student and access the test course. Access the quiz page. Verify that you see "To do: Receive a grade" as the completion status and "Highest grade" is 0. The completion status is still incomplete and the grade is 0 . No previous grade was recovered. Test 3 Log in as admin user. Set the "Recover grades default" ( recovergradesdefault ) to yes (checked). Unenroll the test student from the course. Enroll the test student back in the course as a student. Log in as the test student and access the test course. Access the quiz page. Verify that you see "Done: Receive a grade" as the completion status and "Highest grade" is not 0. The quiz is marked complete and the grade is not 0. The previous grade was recovered.
    • Hide

      Code verified against automated checks.

      Checked MDL-85246 using repository: https://github.com/rjnl/moodle.git

      More information about this report

      Built on: Mon May 19 23:18:28 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-85246 using repository: https://github.com/rjnl/moodle.git MOODLE_405_STABLE (0 errors / 0 warnings) [branch: MDL-85246-405 | CI Job ] MOODLE_500_STABLE (0 errors / 0 warnings) [branch: MDL-85246-500 | CI Job ] main (0 errors / 0 warnings) [branch: MDL-85246-main | CI Job ] More information about this report Built on: Mon May 19 23:18:28 UTC 2025
    • Show
      Launching automatic jobs for branch MDL-85246 -405 https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/19384/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/66260/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/66261/ Behat (Firefox - boost) Launching automatic jobs for branch MDL-85246 -500 https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/19385/ PHPUnit (sqlsrv) -> random failure, please ignore. https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/66262/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/66263/ Behat (Firefox - boost) Launching automatic jobs for branch MDL-85246 -main https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/19386/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/66264/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/66265/ Behat (Firefox - boost) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/66266/ Behat (Firefox - classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/66267/ App tests (stable app version) Built on: Tue May 20 00:30:21 UTC 2025

      Regression caused by MDL-84232

      Steps to test and reproduce:

      1. Build a Moodle 4.5 instance pre 4.5.4+ (Build: 20250417)
      2. Add a quiz
      3. Preview the quiz getting a non-zero score
      4. Check that the two feedback items on grades show the same grade
      5. Update to 4.5.4+ (Build: 20250417)
      6. Check that now, the bigger feedback item above the table shows a zero score
      7. Edit /mod/quiz/view.php reversing https://github.com/moodle/moodle/commit/d87b86d997917090aa7b12bb6149a2ab78964f11
      8. Check that the two feedback items on grades show the same grade again

       

            rajneel.totaram@moodle.com Rajneel Totaram
            adamj Adam Jenkins
            Jayce Birrell Jayce Birrell
            Tim Hunt Tim Hunt
            Votes:
            20 Vote for this issue
            Watchers:
            25 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 13 minutes
                2h 13m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.