Complete CCS results and rating flow

This commit is contained in:
hz
2026-07-15 11:08:13 -05:00
parent 9f379cda5c
commit 52d435fa2e
14 changed files with 402 additions and 47 deletions
+57
View File
@@ -92,6 +92,7 @@ public class CcsCaseEvent
public class CcsScoringCriterion
{
public string Id { get; set; } = "";
public string Title { get; set; } = "";
public string ActionType { get; set; } = "order";
public string TargetCode { get; set; } = "";
public List<string> TargetCodes { get; set; } = [];
@@ -127,6 +128,8 @@ public class CcsAttempt
public DateTime UpdatedUtc { get; set; } = DateTime.UtcNow;
public DateTime? CompletedUtc { get; set; }
public CcsCaseScore? Score { get; set; }
public bool RatingEligible { get; set; }
public CcsRatingChange? Rating { get; set; }
}
public class CcsAttemptAction
@@ -163,6 +166,11 @@ public class CcsCaseScore
public class CcsCriterionResult
{
public string CriterionId { get; set; } = "";
public string Title { get; set; } = "";
public string ActionType { get; set; } = "";
public string ExpectedAction { get; set; } = "";
public string ObservedAction { get; set; } = "";
public int? ObservedMinute { get; set; }
public string Status { get; set; } = "missed";
public int Points { get; set; }
public string Rationale { get; set; } = "";
@@ -231,6 +239,7 @@ public class CcsAttemptResponse
public List<CcsExamDefinition> AvailableExams { get; set; } = [];
public List<string> AllowedLocations { get; set; } = [];
public CcsCaseScore? Score { get; set; }
public CcsRatingChange? Rating { get; set; }
public List<QuestionReference> References { get; set; } = [];
}
@@ -242,9 +251,57 @@ public class CcsHistoryItem
public string Mode { get; set; } = "";
public string State { get; set; } = "";
public double? Score { get; set; }
public CcsRatingChange? Rating { get; set; }
public DateTime CreatedUtc { get; set; }
}
public class CcsUserRating
{
[BsonId, BsonRepresentation(BsonType.ObjectId)] public string? Id { get; set; }
public string UserId { get; set; } = "";
public int Elo { get; set; } = 1000;
public int RatedCaseCount { get; set; }
public DateTime UpdatedUtc { get; set; } = DateTime.UtcNow;
}
public class CcsCaseRating
{
[BsonId, BsonRepresentation(BsonType.ObjectId)] public string? Id { get; set; }
public string CaseExternalId { get; set; } = "";
public int Elo { get; set; } = 1000;
public int RatedAttemptCount { get; set; }
public DateTime UpdatedUtc { get; set; } = DateTime.UtcNow;
}
public class CcsRatedCaseResult
{
[BsonId, BsonRepresentation(BsonType.ObjectId)] public string? Id { get; set; }
public string UserId { get; set; } = "";
public string CaseExternalId { get; set; } = "";
[BsonRepresentation(BsonType.ObjectId)] public string AttemptId { get; set; } = "";
public DateTime CreatedUtc { get; set; } = DateTime.UtcNow;
}
public class CcsRatingChange
{
public bool Rated { get; set; }
public string Reason { get; set; } = "";
public int UserEloBefore { get; set; }
public int UserElo { get; set; }
public int UserEloDelta { get; set; }
public int CaseEloBefore { get; set; }
public int CaseElo { get; set; }
public int CaseEloDelta { get; set; }
public double ActualScore { get; set; }
public DateTime? AppliedUtc { get; set; }
}
public class CcsRatingProfileResponse
{
public int Elo { get; set; } = 1000;
public int RatedCaseCount { get; set; }
}
public class CcsPredictionResponse
{
public double? CcsScore { get; set; }