Redesign exam and CCS experiences
This commit is contained in:
@@ -17,6 +17,7 @@ var simulation := {}
|
||||
var outcome := {}
|
||||
var history: Array = []
|
||||
var history_next_before := ""
|
||||
var history_next_cursor := ""
|
||||
var is_loading := false
|
||||
var pending_action := ""
|
||||
var request_queue: Array = []
|
||||
@@ -40,11 +41,11 @@ func load_active() -> void:
|
||||
_send("active", HTTPClient.METHOD_GET, "/active")
|
||||
|
||||
|
||||
func load_history(before: String = "") -> void:
|
||||
var suffix := "/history?limit=20"
|
||||
if not before.is_empty():
|
||||
suffix += "&before=%s" % before.uri_encode()
|
||||
_send("history_append" if not before.is_empty() else "history", HTTPClient.METHOD_GET, suffix)
|
||||
func load_history(cursor: String = "", status: String = "all", sort_order: String = "newest") -> void:
|
||||
var suffix := "/history?limit=20&status=%s&sort=%s" % [status.uri_encode(), sort_order.uri_encode()]
|
||||
if not cursor.is_empty():
|
||||
suffix += "&cursor=%s" % cursor.uri_encode()
|
||||
_send("history_append" if not cursor.is_empty() else "history", HTTPClient.METHOD_GET, suffix)
|
||||
|
||||
|
||||
func load_simulation(simulation_id: String) -> void:
|
||||
@@ -175,6 +176,8 @@ func _on_request_completed(result: int, response_code: int, _headers: PackedStri
|
||||
history = history + items if action == "history_append" else items
|
||||
var next_before: Variant = parsed.get("nextBefore", null)
|
||||
history_next_before = "" if next_before == null else str(next_before)
|
||||
var next_cursor: Variant = parsed.get("nextCursor", null)
|
||||
history_next_cursor = "" if next_cursor == null else str(next_cursor)
|
||||
history_changed.emit()
|
||||
return
|
||||
if action.begins_with("outcome_"):
|
||||
|
||||
Reference in New Issue
Block a user