Fix simulated exam question flow

This commit is contained in:
hz
2026-07-30 04:26:18 -05:00
parent 18802f4e8d
commit bf56f4192f
2 changed files with 37 additions and 10 deletions
+8
View File
@@ -341,6 +341,14 @@ func _test_revisitable_navigation_prefers_unanswered_questions() -> void:
session.answers[1] = {"selected_choice_id": "B"}
session.current_index = 2
_assert(player._next_revisitable_index() == 0, "skip should wrap rather than reload the same unanswered question")
session.answers = [{"selected_choice_id": "A"}, null, {"selected_choice_id": "C"}]
session.current_index = 2
_assert(player._next_pending_simulation_index() == 1, "simulation should cycle an earlier skipped question back")
session.answers[1] = {"selected_choice_id": "B"}
_assert(player._next_pending_simulation_index() == -1, "simulation should submit only after every question has an answer")
session.answers[2] = {"selected_choice_id": ""}
session.current_index = 2
_assert(player._next_pending_simulation_index() == 2, "the only skipped simulation question should remain pending")
player.free()
session.active_questions = prior_questions
session.answers = prior_answers