Implement persistent review queue
This commit is contained in:
@@ -27,6 +27,7 @@ var core_status_message := ""
|
||||
var simulation_block_index := 0
|
||||
var simulation_total_blocks := 12
|
||||
var simulation_deadline_unix := 0.0
|
||||
var review_first_submission_recorded := false
|
||||
|
||||
const CORE_MIN_TARGET_SECONDS := 45.0
|
||||
const CORE_MAX_TARGET_SECONDS := 150.0
|
||||
@@ -107,6 +108,38 @@ func replace_bookmark_question(question: Dictionary) -> bool:
|
||||
return true
|
||||
|
||||
|
||||
func start_review_question(question: Dictionary) -> bool:
|
||||
if question.is_empty():
|
||||
return false
|
||||
system_name = str(question.get("system", "All Systems"))
|
||||
mode = "Tutor"
|
||||
session_kind = "review"
|
||||
active_questions = [_prepare_question_choices(question)]
|
||||
answers = [null]
|
||||
current_index = 0
|
||||
seconds_remaining = 0.0
|
||||
session_initial_seconds = 90.0
|
||||
current_question_started_at = Time.get_ticks_msec() / 1000.0
|
||||
current_question_pause_started_at = 0.0
|
||||
review_first_submission_recorded = false
|
||||
block_started = true
|
||||
session_changed.emit()
|
||||
return true
|
||||
|
||||
|
||||
func replace_review_question(question: Dictionary) -> bool:
|
||||
if session_kind != "review" or question.is_empty():
|
||||
return false
|
||||
active_questions = [_prepare_question_choices(question)]
|
||||
answers = [null]
|
||||
current_index = 0
|
||||
current_question_started_at = Time.get_ticks_msec() / 1000.0
|
||||
current_question_pause_started_at = 0.0
|
||||
review_first_submission_recorded = false
|
||||
session_changed.emit()
|
||||
return true
|
||||
|
||||
|
||||
func start_simulation_block(questions: Array, block_index: int, total_blocks: int, deadline_unix: float) -> void:
|
||||
system_name = "All Systems"
|
||||
mode = "Simulation"
|
||||
@@ -239,6 +272,32 @@ func submit_bookmark_attempt(choice_id: String, eliminated: Array, flagged: bool
|
||||
return {"answer": answer, "is_correct": bool(answer.is_correct), "final": bool(answer.is_correct)}
|
||||
|
||||
|
||||
func submit_review_attempt(choice_id: String, eliminated: Array, flagged: bool) -> Dictionary:
|
||||
var question := get_current_question()
|
||||
if session_kind != "review" or question.is_empty():
|
||||
return {}
|
||||
var first_submission := not review_first_submission_recorded
|
||||
var answer := {
|
||||
"question": question.duplicate(true),
|
||||
"selected_choice_id": choice_id,
|
||||
"is_correct": choice_id == str(question.get("correct_choice_id", "")),
|
||||
"eliminated_choice_ids": eliminated.duplicate(),
|
||||
"flagged": flagged,
|
||||
"elapsed_seconds": get_current_elapsed_seconds(),
|
||||
"target_seconds": 0.0
|
||||
}
|
||||
review_first_submission_recorded = true
|
||||
if bool(answer.is_correct):
|
||||
answers[current_index] = answer
|
||||
session_changed.emit()
|
||||
return {
|
||||
"answer": answer,
|
||||
"is_correct": bool(answer.is_correct),
|
||||
"final": bool(answer.is_correct),
|
||||
"first_submission": first_submission
|
||||
}
|
||||
|
||||
|
||||
func skip_bookmark_question(eliminated: Array, flagged: bool) -> Dictionary:
|
||||
var question := get_current_question()
|
||||
if session_kind != "bookmark" or question.is_empty():
|
||||
@@ -316,7 +375,7 @@ func get_progress_text() -> String:
|
||||
|
||||
|
||||
func finish_block() -> Dictionary:
|
||||
if session_kind in ["core", "bookmark"]:
|
||||
if session_kind in ["core", "bookmark", "review"]:
|
||||
block_started = false
|
||||
session_changed.emit()
|
||||
return {}
|
||||
@@ -435,19 +494,20 @@ func get_session_timer_ratio() -> float:
|
||||
|
||||
|
||||
func pause_current_question_timer() -> void:
|
||||
if session_kind == "core" and current_question_pause_started_at <= 0.0:
|
||||
if session_kind in ["core", "review"] and current_question_pause_started_at <= 0.0:
|
||||
var now := Time.get_ticks_msec() / 1000.0
|
||||
current_question_pause_started_at = now
|
||||
_pause_core_question_total_timer(now)
|
||||
if session_kind == "core":
|
||||
_pause_core_question_total_timer(now)
|
||||
|
||||
|
||||
func resume_current_question_timer() -> void:
|
||||
if session_kind == "core" and current_question_pause_started_at > 0.0:
|
||||
if session_kind in ["core", "review"] and current_question_pause_started_at > 0.0:
|
||||
var now := Time.get_ticks_msec() / 1000.0
|
||||
var paused_duration := now - current_question_pause_started_at
|
||||
current_question_started_at += paused_duration
|
||||
current_question_pause_started_at = 0.0
|
||||
if not core_question_total_frozen:
|
||||
if session_kind == "core" and not core_question_total_frozen:
|
||||
core_question_total_active_since = now
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user