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

PHP 7 - Cloze questions with zero grades break quizzes

    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
                Reporter:
                ligned David Ligne
                Participants:
                Component watchers:
                Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              • Votes:
                4 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated: