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

Division by zero in Gradebook User Report

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.8.7
    • Fix Version/s: 2.8.8, 2.9.2
    • Component/s: Gradebook
    • Labels:
    • Testing Instructions:
      Hide
      1. Make sure you have a course created in your Moodle instance.
      2. When viewing the course, click on "Grades" (under "Course administration").
      3. From the drop menu at the top of the page, choose "Categories and items".
      4. Click "Add grade item".
      5. Set "Maximum grade" to 0.
      6. Set "Minimum grade" to -1.
      7. Click "Save changes".
      8. Under "Administration" > "Grade administration" in the side navigation, click "User report".
      9. View your PHP error log and ensure there is no "PHP Warning: Divion by zero" message.
      Show
      Make sure you have a course created in your Moodle instance. When viewing the course, click on "Grades" (under "Course administration"). From the drop menu at the top of the page, choose "Categories and items". Click "Add grade item". Set "Maximum grade" to 0. Set "Minimum grade" to -1. Click "Save changes". Under "Administration" > "Grade administration" in the side navigation, click "User report". View your PHP error log and ensure there is no "PHP Warning: Divion by zero" message.
    • Affected Branches:
      MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE, MOODLE_29_STABLE
    • Pull Master Branch:
      mdl-50957

      Description

      When using "sum of grades" and $grademax is zero, a division by zero error occurs in fill_contributions_column() in grade/report/user/lib.php.

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/Sep/15