Complete CCS results and rating flow

This commit is contained in:
hz
2026-07-15 11:08:13 -05:00
parent 9f379cda5c
commit 52d435fa2e
14 changed files with 402 additions and 47 deletions
+12
View File
@@ -12,6 +12,7 @@ var outcome_consent: CheckBox
var outcome_status: Label
var outcome_delete_button: Button
var outcome_grid: GridContainer
var ccs_rating_label: Label
func _ready() -> void:
set_anchors_preset(Control.PRESET_FULL_RECT)
@@ -29,6 +30,9 @@ func _ready() -> void:
content.size_flags_horizontal = Control.SIZE_EXPAND_FILL
content.add_theme_constant_override("separation", 14)
scroll.add_child(content)
ccs_rating_label = Label.new()
Style.set_label(ccs_rating_label, 20, Style.CYAN)
content.add_child(ccs_rating_label)
var panel := PanelContainer.new()
panel.add_theme_stylebox_override("panel", Style.panel_box(Color("172337"), Color("405475")))
@@ -80,12 +84,15 @@ func _ready() -> void:
ExamSimulationService.outcome_changed.connect(_refresh_outcome)
if not ExamSimulationService.request_failed.is_connected(_on_outcome_request_failed):
ExamSimulationService.request_failed.connect(_on_outcome_request_failed)
if not CCSService.rating_changed.is_connected(_refresh_ccs_rating):
CCSService.rating_changed.connect(_refresh_ccs_rating)
resized.connect(_refresh_outcome_layout)
_refresh_outcome_layout()
func on_show(_payload: Variant = null) -> void:
_reset_qbank_confirmation()
_refresh_ccs_rating()
var profile := ProfileService.get_profile()
var text := "[b]Overall ELO %d[/b]\n%d rated questions\nCurrent streak: %d\nBest streak: %d\nToday: %d/%d questions\n\n[b]Category ELO[/b]\n" % [
QuestionBankService.overall_elo,
@@ -123,10 +130,15 @@ func on_show(_payload: Variant = null) -> void:
block.get("total", 0)
]
profile_text.text = text
CCSService.load_rating()
outcome_status.text = "Loading official outcome..."
ExamSimulationService.load_outcome()
func _refresh_ccs_rating() -> void:
ccs_rating_label.text = "CCS ELO %d | %d rated cases" % [CCSService.rating.get("elo", 1000), CCSService.rating.get("ratedCaseCount", 0)]
func _build_outcome_panel(parent: VBoxContainer) -> void:
var panel := PanelContainer.new()
panel.add_theme_stylebox_override("panel", Style.panel_box(Color("172337"), Color("405475")))