Why (should?) the actual time elapsed be greater than the duration?
The example shows an actual time elapsed (10.4s) that is greater than the specified duration (10s). This is expected. We can only check how much time has elapsed when the player successfully answers a question and so time may have “expired” while they were in the process of answering an equation, i.e. they started before time “expired”, but did not finish until afterwards. I want to point your attention this note in the lab:
A note about timing: Because we are doing the timing outside of the
query_equationfunction, time will NOT expire until the user gets the answer right. That is the actual time elapsed for the game will be longer than the specified duration (and could be quite a bit longer). This is OK and how I expect your implementation to work. That is keep presenting new questions to the player as long as time has not “expired”. While there are mechanisms to cutoff the game the moment time expires, doing so is outside the scope of this course.