using MongoDB.Bson; using MongoDB.Bson.Serialization.Attributes; using QuestionsApi.Services; namespace QuestionsApi.Models; public static class ExamSimulationStates { public const string BetweenBlocks = "between_blocks"; public const string BlockActive = "block_active"; public const string Completed = "completed"; public const string Abandoned = "abandoned"; } public class ExamSimulation { [BsonId] [BsonRepresentation(BsonType.ObjectId)] public string? Id { get; set; } public string UserId { get; set; } = ""; public string State { get; set; } = ExamSimulationStates.BetweenBlocks; public string ModelVersion { get; set; } = ExamSimulationScoring.ModelVersion; public List Items { get; set; } = []; public List Responses { get; set; } = []; public int CurrentBlock { get; set; } = -1; public int BreakSecondsRemaining { get; set; } = 3300; public DateTime? BlockDeadlineUtc { get; set; } public DateTime CreatedUtc { get; set; } = DateTime.UtcNow; public DateTime UpdatedUtc { get; set; } = DateTime.UtcNow; public DateTime? CompletedUtc { get; set; } public ExamSimulationScore? Score { get; set; } public Dictionary BlueprintTargets { get; set; } = []; public Dictionary BlueprintActual { get; set; } = []; } public class ExamSimulationItem { public string QuestionExternalId { get; set; } = ""; public int BlockIndex { get; set; } public int Position { get; set; } public List PresentedChoiceIds { get; set; } = []; public int QuestionElo { get; set; } = 1000; public bool WasSeen { get; set; } public string BlueprintCategory { get; set; } = "Other"; } public class ExamSimulationResponse { public string QuestionExternalId { get; set; } = ""; public string ChoiceId { get; set; } = ""; public List EliminatedChoiceIds { get; set; } = []; public bool Flagged { get; set; } public int ElapsedSeconds { get; set; } public DateTime UpdatedUtc { get; set; } = DateTime.UtcNow; } public class ExamSimulationScore { public int PredictedScore { get; set; } public int RangeLow { get; set; } public int RangeHigh { get; set; } public double PassProbability { get; set; } public int Correct { get; set; } public int Total { get; set; } public int SeenCount { get; set; } public double AbilityElo { get; set; } public Dictionary Categories { get; set; } = []; } public class ExamSimulationCategoryScore { public int Correct { get; set; } public int Total { get; set; } } public class SaveSimulationResponseRequest { public string QuestionExternalId { get; set; } = ""; public string ChoiceId { get; set; } = ""; public List EliminatedChoiceIds { get; set; } = []; public bool Flagged { get; set; } public int ElapsedSeconds { get; set; } } public class ExamSimulationQuestionResponse { public string ExternalId { get; set; } = ""; public string Stem { get; set; } = ""; public string LeadIn { get; set; } = ""; public List Choices { get; set; } = []; public string Discipline { get; set; } = ""; public string System { get; set; } = ""; public string PerformanceCategory { get; set; } = ""; public List Labs { get; set; } = []; public List Media { get; set; } = []; } public class ExamSimulationStateResponse { public string Id { get; set; } = ""; public string State { get; set; } = ""; public int CurrentBlock { get; set; } public int TotalBlocks { get; set; } = 12; public int BreakSecondsRemaining { get; set; } public DateTime? BlockDeadlineUtc { get; set; } public List Questions { get; set; } = []; public List Responses { get; set; } = []; public ExamSimulationScore? Score { get; set; } public Dictionary BlueprintTargets { get; set; } = []; public Dictionary BlueprintActual { get; set; } = []; public List ReviewQuestions { get; set; } = []; } public class ExamSimulationReadinessResponse { public bool Ready { get; set; } public int AvailableQuestions { get; set; } public int RequiredQuestions { get; set; } = 232; public bool HasActiveSimulation { get; set; } } public class Step3Outcome { [BsonId] [BsonRepresentation(BsonType.ObjectId)] public string? Id { get; set; } public string UserId { get; set; } = ""; public int OfficialScore { get; set; } public DateTime ExamDate { get; set; } public DateTime ConsentUtc { get; set; } public DateTime UpdatedUtc { get; set; } } public class UpsertStep3OutcomeRequest { public int OfficialScore { get; set; } public DateTime ExamDate { get; set; } public bool Consent { get; set; } }