Add a setting to turn off follow-up questions
The optional "FOLLOW-UP QUESTIONS" reinforcement section shown during answer review is now gated behind a Settings toggle (on by default), persisted locally the same way as dark mode and interface sounds.
This commit is contained in:
@@ -29,6 +29,7 @@ var simulation_total_blocks := 12
|
||||
var simulation_deadline_unix := 0.0
|
||||
var review_first_submission_recorded := false
|
||||
var core_block_size := DEFAULT_CORE_BLOCK_SIZE
|
||||
var show_review_followups := true
|
||||
|
||||
const CORE_MIN_TARGET_SECONDS := 45.0
|
||||
const CORE_MAX_TARGET_SECONDS := 150.0
|
||||
@@ -39,10 +40,12 @@ const CORE_BLOCK_SIZE_MAX := 40
|
||||
const SETTINGS_PATH := "user://settings.cfg"
|
||||
const SETTINGS_SECTION := "session"
|
||||
const SETTINGS_KEY_CORE_BLOCK_SIZE := "core_block_size"
|
||||
const SETTINGS_KEY_SHOW_REVIEW_FOLLOWUPS := "show_review_followups"
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
_load_core_block_size()
|
||||
_load_show_review_followups()
|
||||
|
||||
|
||||
func set_core_block_size(value: int) -> void:
|
||||
@@ -57,6 +60,17 @@ func set_core_block_size(value: int) -> void:
|
||||
push_warning("Unable to save core question block size preference.")
|
||||
|
||||
|
||||
func set_show_review_followups(value: bool) -> void:
|
||||
if show_review_followups == value:
|
||||
return
|
||||
show_review_followups = value
|
||||
var config := ConfigFile.new()
|
||||
config.load(SETTINGS_PATH)
|
||||
config.set_value(SETTINGS_SECTION, SETTINGS_KEY_SHOW_REVIEW_FOLLOWUPS, show_review_followups)
|
||||
if config.save(SETTINGS_PATH) != OK:
|
||||
push_warning("Unable to save follow-up question preference.")
|
||||
|
||||
|
||||
func _load_core_block_size() -> void:
|
||||
var config := ConfigFile.new()
|
||||
if config.load(SETTINGS_PATH) == OK:
|
||||
@@ -65,6 +79,12 @@ func _load_core_block_size() -> void:
|
||||
CORE_BLOCK_SIZE_MIN, CORE_BLOCK_SIZE_MAX)
|
||||
|
||||
|
||||
func _load_show_review_followups() -> void:
|
||||
var config := ConfigFile.new()
|
||||
if config.load(SETTINGS_PATH) == OK:
|
||||
show_review_followups = bool(config.get_value(SETTINGS_SECTION, SETTINGS_KEY_SHOW_REVIEW_FOLLOWUPS, true))
|
||||
|
||||
|
||||
func start_dynamic_question(question: Dictionary) -> bool:
|
||||
if question.is_empty():
|
||||
return false
|
||||
|
||||
@@ -1811,6 +1811,9 @@ func _render_review_followups() -> void:
|
||||
if review_followups_content == null:
|
||||
return
|
||||
_clear_container_children(review_followups_content)
|
||||
if not BlockSessionService.show_review_followups:
|
||||
review_followups_section.visible = false
|
||||
return
|
||||
var question := BlockSessionService.get_current_question()
|
||||
var authored: Array = question.get("review_followups", [])
|
||||
if review_followup_states.size() != authored.size():
|
||||
|
||||
@@ -9,6 +9,7 @@ const CORE_BLOCK_SIZE_STEP := 5
|
||||
var main: Control
|
||||
var theme_toggle: CheckButton
|
||||
var sound_toggle: CheckButton
|
||||
var followups_toggle: CheckButton
|
||||
var question_scale_value_label: Label
|
||||
var ccs_scale_value_label: Label
|
||||
var core_block_size_value_label: Label
|
||||
@@ -59,6 +60,13 @@ func _ready() -> void:
|
||||
sound_toggle.toggled.connect(UISoundService.set_sounds_enabled)
|
||||
content.add_child(sound_toggle)
|
||||
|
||||
followups_toggle = CheckButton.new()
|
||||
followups_toggle.text = "Follow-up questions"
|
||||
followups_toggle.tooltip_text = "Optional reinforcement questions shown after you answer"
|
||||
followups_toggle.custom_minimum_size = Vector2(0, 52)
|
||||
followups_toggle.toggled.connect(BlockSessionService.set_show_review_followups)
|
||||
content.add_child(followups_toggle)
|
||||
|
||||
content.add_child(_build_text_scale_row("Question bank text size", "question"))
|
||||
content.add_child(_build_text_scale_row("CCS case text size", "ccs"))
|
||||
content.add_child(_build_core_block_size_row())
|
||||
@@ -93,6 +101,7 @@ func _ready() -> void:
|
||||
func on_show(_payload: Variant = null) -> void:
|
||||
theme_toggle.set_pressed_no_signal(UIThemeService.is_dark_mode())
|
||||
sound_toggle.set_pressed_no_signal(UISoundService.are_sounds_enabled())
|
||||
followups_toggle.set_pressed_no_signal(BlockSessionService.show_review_followups)
|
||||
_refresh_text_scale_labels()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user