Fix Last Man Standing Scoreboard and Statistics Slides crashing before/directy after the first question
During the diagnostic test of module 2 this year, Quizzard crashed on the very first statistics slide of Last Man Standing. At that point, we concluded that this has something to do with an uninitialized statistics state. However, during my testing, it proved a little bit more specific.
The organizer view would crash if all of the following circumstances apply at the same time:
- The quiz run is Last Man Standing
- There is no previous answered question in the quiz run
- The statistics slide is directly placed after the (first) question, without an explanation slide in between or the scoreboard is opened before the first question is answered.
In these circumstances, the correct answer of the previous question is null
in the LMS Statistics State, causing the whole React component to crash. This bug was certainly introduced as part of !161 (merged), but was never discovered because of the specific circumstances mentioned above. Until Marieke decided to first place a statistics slide before the explanation slide.
The bug is a really easy fix to detect if the answers in the statistics state are null
, in that case a simple place holder message is shown. This fixes the statistics slides and the scoreboard, as these use the same components to draw statistics (slides).