Rebuild CCS case workflow
This commit is contained in:
@@ -54,8 +54,8 @@ func load_cases() -> void:
|
||||
_send("cases", HTTPClient.METHOD_GET, "/cases")
|
||||
|
||||
|
||||
func create_attempt(case_external_id: String, mode: String) -> void:
|
||||
_send("attempt", HTTPClient.METHOD_POST, "/attempts", {"caseExternalId": case_external_id, "mode": mode})
|
||||
func create_attempt(case_external_id: String, _mode: String = "timed") -> void:
|
||||
_send("attempt", HTTPClient.METHOD_POST, "/attempts", {"caseExternalId": case_external_id, "mode": "timed"})
|
||||
|
||||
|
||||
func load_active() -> void:
|
||||
@@ -77,6 +77,15 @@ func send_command(type: String, code: String = "", minutes: int = 0) -> void:
|
||||
"minutes": minutes
|
||||
})
|
||||
|
||||
func send_batch(commands: Array) -> void:
|
||||
if attempt.is_empty() or commands.is_empty():
|
||||
return
|
||||
_send("attempt", HTTPClient.METHOD_POST, "/attempts/%s/commands/batch" % str(attempt.get("id", "")).uri_encode(), {
|
||||
"commandId": "%d-%d" % [Time.get_ticks_usec(), randi()],
|
||||
"expectedRevision": int(attempt.get("revision", 0)),
|
||||
"commands": commands
|
||||
})
|
||||
|
||||
|
||||
func search_orders(query: String) -> void:
|
||||
if query.strip_edges().length() < 2:
|
||||
@@ -169,7 +178,20 @@ func abandon() -> void:
|
||||
|
||||
|
||||
func deadline_unix() -> float:
|
||||
var value := str(attempt.get("finalOrdersDeadlineUtc", attempt.get("deadlineUtc", "")))
|
||||
var raw: Variant = attempt.get("finalOrdersDeadlineUtc", null)
|
||||
if raw == null or str(raw).is_empty() or str(raw) == "<null>":
|
||||
raw = attempt.get("deadlineUtc", "")
|
||||
var value := str(raw)
|
||||
return 0.0 if value.is_empty() or value == "<null>" else float(Time.get_unix_time_from_datetime_string(value))
|
||||
|
||||
|
||||
func hard_deadline_unix() -> float:
|
||||
var raw: Variant = attempt.get("hardDeadlineUtc", null)
|
||||
if raw == null or str(raw).is_empty() or str(raw) == "<null>":
|
||||
raw = attempt.get("finalOrdersDeadlineUtc", null)
|
||||
if raw == null or str(raw).is_empty() or str(raw) == "<null>":
|
||||
raw = attempt.get("deadlineUtc", "")
|
||||
var value := str(raw)
|
||||
return 0.0 if value.is_empty() or value == "<null>" else float(Time.get_unix_time_from_datetime_string(value))
|
||||
|
||||
|
||||
|
||||
@@ -398,7 +398,7 @@ func _case_cell(item: Dictionary, dark: bool) -> Control:
|
||||
title.add_theme_color_override("font_color", Brand.text_color(dark))
|
||||
column.add_child(title)
|
||||
var mode := Label.new()
|
||||
mode.text = "Timed case"
|
||||
mode.text = "Legacy practice case" if str(item.get("mode", "timed")) == "practice" else "Timed case"
|
||||
_style_muted_label(mode, dark, 12)
|
||||
column.add_child(mode)
|
||||
return column
|
||||
|
||||
+867
-577
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -905,7 +905,7 @@ func _toggle_app_menu() -> void:
|
||||
menu_exit_button.visible = (current_screen_name == "player" and BlockSessionService.block_started) or current_screen_name in ["ccs_player", "flashcards_study"]
|
||||
if menu_exit_button.visible:
|
||||
menu_exit_button.text = (
|
||||
"Leave Case" if current_screen_name == "ccs_player"
|
||||
"Abandon CCS Case" if current_screen_name == "ccs_player"
|
||||
else "Exit Study Session" if current_screen_name == "flashcards_study"
|
||||
else "Leave (timer continues)" if BlockSessionService.session_kind == "simulation"
|
||||
else "Exit Run")
|
||||
|
||||
Reference in New Issue
Block a user