Improve question review and image handling

This commit is contained in:
hz
2026-07-14 16:02:14 -05:00
parent 7529ed5863
commit 8aaf7d61e9
8 changed files with 391 additions and 17 deletions
+16
View File
@@ -7,6 +7,7 @@ func _initialize() -> void:
_test_reference_normalization()
_test_reference_url_filter()
_test_correct_feedback_does_not_auto_advance()
_test_correct_review_locks_answer_interactions()
quit(1 if failures > 0 else 0)
@@ -58,6 +59,21 @@ func _test_correct_feedback_does_not_auto_advance() -> void:
player.free()
func _test_correct_review_locks_answer_interactions() -> void:
var player = load("res://scripts/ui/question_player.gd").new()
player.current_answer = {"is_correct": true}
player.selected_choice = "A"
player.presented_choices = [{"id": "A", "text": "First"}, {"id": "B", "text": "Second"}]
player._select_choice(1)
_assert(player.selected_choice == "A", "correct review should reject answer selection changes")
var right_click := InputEventMouseButton.new()
right_click.button_index = MOUSE_BUTTON_RIGHT
right_click.pressed = true
player._choice_gui_input(right_click, 1)
_assert(player.eliminated.is_empty(), "correct review should reject answer strike-through changes")
player.free()
func _assert(condition: bool, message: String) -> void:
if condition:
return