Getting the following error when grading a quiz containing a 0 point question. 0/0 leads to NAN and breaks the database query.
Message PDOException: SQLSTATE[01000]: Warning: 1265 Data truncated for column 'score' at row 1: UPDATE {quiz_long_answer_user_answers} SET score=:db_update_placeholder_0, is_evaluated=:db_update_placeholder_1, answer_feedback=:db_update_placeholder_2, answer_feedback_format=:db_update_placeholder_3 WHERE ( (result_answer_id = :db_condition_placeholder_0) ); Array ( [:db_update_placeholder_0] => [:db_update_placeholder_1] => 1 [:db_update_placeholder_2] => [:db_update_placeholder_3] => full_html [:db_condition_placeholder_0] => 11619 ) in long_answer_score_an_answer() (line 115 of /app/www/sites/all/modules/quiz/question_types/long_answer/long_answer.module).
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | quiz_nan-when-scoring-long-short-answers-2999514.patch | 1.45 KB | andyg5000 |
Comments
Comment #2
andyg5000Comment #3
djdevinLooks good, thanks!
Fixed.