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

Viewing quiz reports/statistics can result in sql error when variable is Not A Number

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0
    • 2.0
    • Quiz
    • None
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE

    Description

      It has been noted that quiz reports/statistics can generate an sql error if there is an issue attempting to store a value that is Not A Number in the database. After discussing with tim, changes made to check revelant fields for NAN and replace by null.

      sql query noted causing error:

      INSERT INTO mdl_quiz_statistics ( ID, QUIZID, GROUPID, ALLATTEMPTS, TIMEMODIFIED, FIRSTATTEMPTSCOUNT, ALLATTEMPTSCOUNT, FIRSTATTEMPTSAVG, ALLATTEMPTSAVG, MEDIAN, STANDARDDEVIATION, CIC, ERRORRATIO, STANDARDERROR ) VALUES ( 182, 3418, 87398, 0, 1255266520, 108, 108, 0, 0, 0, 0, 114.28571428571, NAN, NAN )

      Patch attached

      Attachments

        Activity

          People

            timhunt Tim Hunt
            derekw Derek Woolhead
            Nobody Nobody
            Tim Hunt, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              24/Nov/10