Improve dynamic question learning loop

This commit is contained in:
hz
2026-07-23 16:50:53 -05:00
parent c91e70deb5
commit 32c455bba0
14 changed files with 422 additions and 16 deletions
+4
View File
@@ -244,6 +244,10 @@ func _render_review(data: Dictionary) -> void:
missed_action.disabled = missed_count <= 0 or pending_review_launch
missed_action.pressed.connect(_start_review_queue)
review_list.add_child(missed_action)
var dynamic_due := int(data.get("dynamicReviewsDue", 0))
review_list.add_child(_review_action(
"%d dynamic concepts due" % dynamic_due if dynamic_due > 0 else "Dynamic concepts up to date",
"activity", Brand.PURPLE if dynamic_due > 0 else Brand.ROYAL_BLUE, "dynamic_questions"))
var flashcards_due := int(data.get("flashcardsDue", 0))
review_list.add_child(_review_action(
"%d flashcards due" % flashcards_due if flashcards_due > 0 else "Flashcards up to date",
+9 -5
View File
@@ -28,7 +28,7 @@ func _ready() -> void:
description.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
card.add_child(description)
status_label = Label.new()
status_label.text = "Checking available objectives…"
status_label.text = "Checking available objectives..."
status_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
card.add_child(status_label)
start_button = Button.new()
@@ -44,7 +44,7 @@ func _ready() -> void:
func on_show(_payload: Variant = null) -> void:
start_button.disabled = true
status_label.text = "Checking available objectives…"
status_label.text = "Checking available objectives..."
DynamicQuestionService.load_status()
@@ -52,8 +52,12 @@ func _on_status(status: Dictionary) -> void:
var available := bool(status.get("available", false))
var count := int(status.get("publishedObjectives", 0))
var attempts := int(status.get("totalAttempts", 0))
status_label.text = "%d objectives • %d attempts • mastery %d" % [
count, attempts, int(status.get("averageObjectiveElo", 1000))]
var due := int(status.get("reviewsDue", 0))
var coverage := 0
if count > 0:
coverage = int(round(float(status.get("attemptedObjectives", 0)) * 100.0 / float(count)))
status_label.text = "%d objectives | %d%% explored | %d reviews due | %d attempts" % [
count, coverage, due, attempts]
start_button.disabled = not available
if not available:
status_label.text = "Dynamic question content has not been published yet."
@@ -61,7 +65,7 @@ func _on_status(status: Dictionary) -> void:
func _start() -> void:
start_button.disabled = true
start_button.text = "Generating…"
start_button.text = "Generating..."
DynamicQuestionService.reset_run()
DynamicQuestionService.load_next()