From 5b5741de37bb3cad8a4b9a2c299a81850a46d6e0 Mon Sep 17 00:00:00 2001 From: hz Date: Thu, 23 Jul 2026 15:54:28 -0500 Subject: [PATCH] Show selection percentages on unselected distractors during review Previously only the correct choice and any choice the student actually selected got a percentage badge once reviewing; never-selected distractors were left blank. Now every choice shows its selection percentage as soon as the question is answered, matching the earlier change that made unselected distractors render red like the rest of the review UI. --- scripts/ui/question_player.gd | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/ui/question_player.gd b/scripts/ui/question_player.gd index 6e0f183..ea3f578 100644 --- a/scripts/ui/question_player.gd +++ b/scripts/ui/question_player.gd @@ -3098,7 +3098,8 @@ func _set_choice_button_text(index: int, choice: Dictionary) -> void: choice_badges[index].text = display_label _set_choice_percent_label(index, "") _set_choice_top_label(index, "") - if locked_wrong_choice_ids.has(choice_id) or _should_show_correct_choice_percentage(choice_id): + var reviewing := pending_correct_advance or not current_answer.is_empty() + if locked_wrong_choice_ids.has(choice_id) or reviewing: var percentage := _get_choice_selection_percentage(choice_id) if percentage >= 0: _set_choice_percent_label(index, "%d%%" % percentage) @@ -3188,11 +3189,6 @@ func _get_choice_selection_percentage(choice_id: String) -> int: return clamp(int(percentages.get(choice_id, -1)), 0, 100) -func _should_show_correct_choice_percentage(choice_id: String) -> bool: - var question := BlockSessionService.get_current_question() - return choice_id == str(question.get("correct_choice_id", "")) and (pending_correct_advance or not current_answer.is_empty()) - - func _apply_correct_answer_preview() -> void: var question := BlockSessionService.get_current_question() var correct_id := str(question.get("correct_choice_id", ""))