Simplify resolved wrong-answer explanation cards per design feedback
Drop the redundant header row (duplicate percentage badge + collapse chevron), the "Why this is appropriate/less appropriate:"/"Why this is incorrect:" heading labels, and the nested sub-box - now that these cards live inside their own choice's colored border, all of that was repeating what the color and position already say. Both the selected-wrong-choice resolved follow-up and the never-selected distractor cards now just show the plain explanation sentence, with the leading "Correct."/"Incorrect." verdict word stripped too. Removing the toggle chevron removes the only way to reach the collapse/expand behavior, so that machinery (_collapse_resolved_followups, _toggle_followup_state, the "collapsed" state field) comes out too rather than linger unreachable.
This commit is contained in:
@@ -13,10 +13,9 @@ func _initialize() -> void:
|
||||
_test_eliminated_choice_uses_rich_text_strikeout()
|
||||
_test_eliminated_choice_that_is_also_locked_wrong_still_strikes_through()
|
||||
_test_explanation_highlighting_has_no_status_heading()
|
||||
_test_collapsed_followup_review_expands()
|
||||
_test_resolved_followup_has_no_header_or_verdict_prefix()
|
||||
_test_review_content_normalization()
|
||||
_test_followup_attempt_order_is_stable()
|
||||
_test_answer_review_collapses_nested_wrong_followups()
|
||||
_test_review_followup_is_optional_and_single_attempt()
|
||||
_test_question_failure_retry_classification()
|
||||
_test_transient_question_failure_keeps_player_waiting()
|
||||
@@ -178,7 +177,7 @@ func _test_explanation_highlighting_has_no_status_heading() -> void:
|
||||
player.free()
|
||||
|
||||
|
||||
func _test_collapsed_followup_review_expands() -> void:
|
||||
func _test_resolved_followup_has_no_header_or_verdict_prefix() -> void:
|
||||
var player = load("res://scripts/ui/question_player.gd").new()
|
||||
var panel := PanelContainer.new()
|
||||
var content := VBoxContainer.new()
|
||||
@@ -193,14 +192,16 @@ func _test_collapsed_followup_review_expands() -> void:
|
||||
player.followup_states["B"] = {
|
||||
"choice_id": "B", "choice_text": "Wrong answer", "prompt": "Why?",
|
||||
"selected_option_text": "Finding", "was_correct": false,
|
||||
"teaching_point": "Review the finding.", "resolved": true, "collapsed": true
|
||||
"teaching_point": "Incorrect. Review the finding.", "resolved": true
|
||||
}
|
||||
player._render_followup_state("B")
|
||||
var review_button := content.find_child("FollowupToggle", true, false) as Button
|
||||
_assert(review_button != null, "collapsed follow-up should render a toggle button")
|
||||
if review_button != null:
|
||||
review_button.pressed.emit()
|
||||
_assert(not bool(player.followup_states["B"].get("collapsed", true)), "review button should expand the resolved follow-up")
|
||||
_assert(content.find_child("FollowupToggle", true, false) == null, "a resolved follow-up should not render a collapse toggle")
|
||||
var explanation_text := ""
|
||||
for child in content.get_children():
|
||||
if child is Label:
|
||||
explanation_text += child.text
|
||||
_assert(not explanation_text.contains("Why this is"), "a resolved follow-up should not repeat a 'Why this is...' heading")
|
||||
_assert(not explanation_text.begins_with("Incorrect."), "a resolved follow-up explanation should not repeat the verdict prefix")
|
||||
player.choice_buttons[0].free()
|
||||
player.choice_percent_labels[0].free()
|
||||
player.choice_top_labels[0].free()
|
||||
@@ -248,16 +249,6 @@ func _test_followup_attempt_order_is_stable() -> void:
|
||||
player.free()
|
||||
|
||||
|
||||
func _test_answer_review_collapses_nested_wrong_followups() -> void:
|
||||
var player = load("res://scripts/ui/question_player.gd").new()
|
||||
player.followup_states["C"] = {"resolved": true, "collapsed": false, "is_main_correct": false}
|
||||
player.followup_attempt_order = ["C"]
|
||||
player._ensure_answer_review_followups()
|
||||
_assert(bool(player.followup_states["C"].get("collapsed", false)), "resolved distractor remediation should collapse for final review")
|
||||
_assert(not player.followup_states.has("B"), "the correct answer should not become a distractor-remediation card")
|
||||
player.free()
|
||||
|
||||
|
||||
func _test_review_followup_is_optional_and_single_attempt() -> void:
|
||||
var session = root.get_node("BlockSessionService")
|
||||
var prior_questions: Array = session.active_questions.duplicate(true)
|
||||
|
||||
Reference in New Issue
Block a user