Add user progress dashboard

This commit is contained in:
hz
2026-07-18 23:45:38 -05:00
parent 2e52a7ea0a
commit 2dcac51452
26 changed files with 983 additions and 17 deletions
@@ -0,0 +1,54 @@
namespace QuestionsApi.Models;
public sealed class DashboardResponse
{
public int QuestionBankRating { get; set; } = 1000;
public int RatedQuestionCount { get; set; }
public int CcsRating { get; set; } = 1000;
public int RatedCcsCaseCount { get; set; }
public int FirstAttemptAccuracy { get; set; }
public int AccuracySampleSize { get; set; }
public int QuestionsThisWeek { get; set; }
public int StudyTimeSecondsThisWeek { get; set; }
public int CurrentStreak { get; set; }
public int MissedQuestionCount { get; set; }
public int BookmarkCount { get; set; }
public int NoteCount { get; set; }
public List<DashboardTrendPoint> PerformanceTrend { get; set; } = [];
public List<DashboardSystemPerformance> Systems { get; set; } = [];
public List<DashboardActivityDay> WeeklyActivity { get; set; } = [];
public List<DashboardRecentActivity> RecentActivity { get; set; } = [];
}
public sealed class DashboardTrendPoint
{
public DateTime DateUtc { get; set; }
public int Correct { get; set; }
public int Total { get; set; }
public int Accuracy { get; set; }
}
public sealed class DashboardSystemPerformance
{
public string System { get; set; } = "General";
public int Correct { get; set; }
public int Total { get; set; }
public int Accuracy { get; set; }
}
public sealed class DashboardActivityDay
{
public DateTime DateUtc { get; set; }
public int Questions { get; set; }
public int CcsCases { get; set; }
public int StudyTimeSeconds { get; set; }
}
public sealed class DashboardRecentActivity
{
public string Type { get; set; } = "question";
public string Title { get; set; } = "";
public string Detail { get; set; } = "";
public DateTime OccurredUtc { get; set; }
public string Route { get; set; } = "";
}
@@ -16,6 +16,7 @@ public class QuestionAttempt
public bool TracksPresentation { get; set; }
public bool IsCorrect { get; set; }
public bool IsSkip { get; set; }
public int DurationSeconds { get; set; }
public int CounterBucket { get; set; }
public bool? RatingApplied { get; set; }
public string RatingLeaseOwner { get; set; } = "";
@@ -43,4 +43,5 @@ public class FirstQuestionAttemptRequest
public string QuestionExternalId { get; set; } = "";
public string ChoiceId { get; set; } = "";
public List<string> PresentedChoiceIds { get; set; } = [];
public int DurationSeconds { get; set; }
}