Moodle

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

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: Quiz
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    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

Activity

Hide
Tim Hunt added a comment -

Fix checked in. Thanks Derek.

Show
Tim Hunt added a comment - Fix checked in. Thanks Derek.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: