comp90018-2020/smart-broccoli

Gameplay: correctAnswer contains record: null

Closed this issue · 0 comments

In a self-paced solo quiz, if a user does not answer a question, the payload of correctAnswer is such that record is null.

Example:

{
  "answer": {
    "question": 1,
    "MCSelection": [
      0,
      1
    ],
    "TFSelection": null
  },
  "record": null
}

The record field should under no circumstances be null; this breaks the front end. The record should always be of the form:

{
    oldPos: <nullable>, 
    newPos: <nullable>, 
    bonusPoints: <NOT NULLABLE>, 
    points: <NOT NULLABLE>, 
    streak: <NOT NULLABLE>
}