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

PHP7 - question/type/multianswer with zero grade for all subquestions breaks quiz statistics

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.3.2, 3.4, 3.6.4, 3.7
    • Fix Version/s: None
    • Component/s: Questions, Quiz
    • Labels:
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE

      Description

      When creating a quizz, only use cloze sub-question with 0 as a grade.

      In /question/type/multianswer/question.php, you get a division by zero in get_max_fraction().

      Then when starting the quizz, you get a database error :

      Default exception handler: Error writing to database Debug: Unknown column 'NAN' in 'field list'\nINSERT INTO mdl_question_attempts[...]

       

      It only happens with PHP 7.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              ligned David Ligne
              Participants:
              Component watchers:
              Tim Hunt, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Tim Hunt, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              6 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated: