Files
step3/api/QuestionsApi/Models/ExamSimulation.cs
T
2026-07-30 16:54:12 -05:00

191 lines
6.6 KiB
C#

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 bool IsSample { get; set; }
public List<ExamSimulationItem> Items { get; set; } = [];
public List<ExamSimulationResponse> 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<string, int> BlueprintTargets { get; set; } = [];
public Dictionary<string, int> BlueprintActual { get; set; } = [];
}
public class ExamSimulationItem
{
public string QuestionExternalId { get; set; } = "";
public int BlockIndex { get; set; }
public int Position { get; set; }
public List<string> PresentedChoiceIds { get; set; } = [];
public int QuestionElo { get; set; } = 1000;
public int QuestionDifficulty { get; set; }
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<string> EliminatedChoiceIds { get; set; } = [];
public bool Flagged { get; set; }
public int ElapsedSeconds { get; set; }
public bool? IsSubmitted { 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 RawAccuracy { get; set; }
public double DifficultyAdjustedAccuracy { get; set; }
public double? AbilityElo { get; set; }
public Dictionary<string, ExamSimulationCategoryScore> 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<string> EliminatedChoiceIds { get; set; } = [];
public bool Flagged { get; set; }
public int ElapsedSeconds { get; set; }
public bool IsSubmitted { get; set; }
}
public class ExamSimulationQuestionResponse
{
public string ExternalId { get; set; } = "";
public string Stem { get; set; } = "";
public string LeadIn { get; set; } = "";
public List<QuestionChoice> Choices { get; set; } = [];
public string Discipline { get; set; } = "";
public string System { get; set; } = "";
public string PerformanceCategory { get; set; } = "";
public List<QuestionLab> Labs { get; set; } = [];
public List<string> 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 DateTime CreatedUtc { get; set; }
public DateTime UpdatedUtc { get; set; }
public List<ExamSimulationQuestionResponse> Questions { get; set; } = [];
public List<ExamSimulationResponse> Responses { get; set; } = [];
public ExamSimulationScore? Score { get; set; }
public Dictionary<string, int> BlueprintTargets { get; set; } = [];
public Dictionary<string, int> BlueprintActual { get; set; } = [];
public List<QuestionResponse> 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 CompletedExamSimulationSummary
{
public string Id { get; set; } = "";
public DateTime CompletedUtc { get; set; }
public int PredictedScore { get; set; }
public int RangeLow { get; set; }
public int RangeHigh { get; set; }
public int Correct { get; set; }
public int Total { get; set; }
public int SeenCount { get; set; }
}
public class CompletedExamSimulationPage
{
public List<CompletedExamSimulationSummary> Items { get; set; } = [];
public DateTime? NextBefore { get; set; }
}
public class ExamSimulationHistorySummary
{
public string Id { get; set; } = "";
public string State { get; set; } = "";
public bool IsSample { get; set; }
public DateTime CreatedUtc { get; set; }
public DateTime UpdatedUtc { get; set; }
public DateTime? CompletedUtc { get; set; }
public int CurrentBlock { get; set; }
public int TotalBlocks { get; set; } = 12;
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 class ExamSimulationHistoryPage
{
public List<ExamSimulationHistorySummary> Items { get; set; } = [];
public DateTime? NextBefore { get; set; }
public string? NextCursor { 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; }
}