Add full-length Step 3 Day 1 simulation
This commit is contained in:
@@ -20,6 +20,9 @@ var core_current_had_wrong_attempt := false
|
||||
var current_question_started_at := 0.0
|
||||
var current_question_pause_started_at := 0.0
|
||||
var core_status_message := ""
|
||||
var simulation_block_index := 0
|
||||
var simulation_total_blocks := 12
|
||||
var simulation_deadline_unix := 0.0
|
||||
|
||||
const CORE_MIN_TARGET_SECONDS := 45.0
|
||||
const CORE_MAX_TARGET_SECONDS := 150.0
|
||||
@@ -65,6 +68,45 @@ func start_core_run() -> bool:
|
||||
return true
|
||||
|
||||
|
||||
func start_simulation_block(questions: Array, block_index: int, total_blocks: int, deadline_unix: float) -> void:
|
||||
system_name = "All Systems"
|
||||
mode = "Simulation"
|
||||
session_kind = "simulation"
|
||||
active_questions = questions.duplicate(true)
|
||||
for index in range(active_questions.size()):
|
||||
active_questions[index] = _prepare_question_choices(active_questions[index])
|
||||
answers.clear()
|
||||
answers.resize(active_questions.size())
|
||||
current_index = 0
|
||||
simulation_block_index = block_index
|
||||
simulation_total_blocks = total_blocks
|
||||
simulation_deadline_unix = deadline_unix
|
||||
seconds_remaining = maxf(0.0, deadline_unix - Time.get_unix_time_from_system())
|
||||
block_started = true
|
||||
current_question_started_at = Time.get_ticks_msec() / 1000.0
|
||||
session_changed.emit()
|
||||
|
||||
|
||||
func restore_simulation_responses(saved_responses: Array) -> void:
|
||||
if session_kind != "simulation":
|
||||
return
|
||||
for response in saved_responses:
|
||||
if typeof(response) != TYPE_DICTIONARY:
|
||||
continue
|
||||
var question_id := str(response.get("questionExternalId", ""))
|
||||
for index in range(active_questions.size()):
|
||||
if str(active_questions[index].get("id", "")) == question_id:
|
||||
answers[index] = {
|
||||
"question": active_questions[index].duplicate(true),
|
||||
"selected_choice_id": str(response.get("choiceId", "")),
|
||||
"is_correct": false,
|
||||
"eliminated_choice_ids": response.get("eliminatedChoiceIds", []).duplicate(),
|
||||
"flagged": bool(response.get("flagged", false)),
|
||||
"elapsed_seconds": int(response.get("elapsedSeconds", 0))
|
||||
}
|
||||
break
|
||||
|
||||
|
||||
func get_current_question() -> Dictionary:
|
||||
if active_questions.is_empty() or current_index < 0 or current_index >= active_questions.size():
|
||||
return {}
|
||||
@@ -86,6 +128,11 @@ func answer_current(choice_id: String, eliminated: Array, flagged: bool) -> Dict
|
||||
"target_seconds": core_target_seconds if session_kind == "core" else 0.0
|
||||
}
|
||||
answers[current_index] = answer
|
||||
if session_kind == "simulation":
|
||||
answer["is_correct"] = false
|
||||
answers[current_index] = answer
|
||||
session_changed.emit()
|
||||
return answer
|
||||
if session_kind == "core":
|
||||
_apply_core_answer_rewards(answer)
|
||||
session_changed.emit()
|
||||
@@ -184,6 +231,8 @@ func move_to(index: int) -> bool:
|
||||
func get_progress_text() -> String:
|
||||
if session_kind == "core":
|
||||
return str(core_answer_count + 1)
|
||||
if session_kind == "simulation":
|
||||
return "Block %d/%d | Question %d/%d" % [simulation_block_index + 1, simulation_total_blocks, current_index + 1, active_questions.size()]
|
||||
return "%d / %d" % [min(current_index + 1, active_questions.size()), active_questions.size()]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user