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

Division by Zero When Showing the Results of an Empty Choice Module

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.9.16
    • Fix Version/s: None
    • Component/s: Choice
    • Labels:
      None
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      Create a "Choice" activity in a course
      Update choice
      -> Under miscellaneous settings, set "Publish Results" to "Always show results to students"
      Click "Save and Display"

      Show
      Create a "Choice" activity in a course Update choice -> Under miscellaneous settings, set "Publish Results" to "Always show results to students" Click "Save and Display"
    • Affected Branches:
      MOODLE_19_STABLE

      Description

      Getting a division by zero error on line 551 of /mod/choice/lib.php

      Seems like $totalresponsecount needs checking for a zero value.

        Gliffy Diagrams

          Activity

          Hide
          salvetore Michael de Raadt added a comment -

          Thanks for reporting this.

          I'm closing this issue because I believe it affects only Moodle 1.9, which is now unsupported (except for serious security issues). This issue will remain here in case other users have the same problem.

          Show
          salvetore Michael de Raadt added a comment - Thanks for reporting this. I'm closing this issue because I believe it affects only Moodle 1.9, which is now unsupported (except for serious security issues). This issue will remain here in case other users have the same problem.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: