feat(ui/quiz): implement real-time global chapter quiz generation, submit results to database, and display dynamic statistics on dashboard

This commit is contained in:
2026-05-25 10:23:38 +02:00
parent 1c6ee82d01
commit f8d1ceabd3
18 changed files with 1198 additions and 45 deletions
@@ -5,6 +5,7 @@ namespace NexusReader.Application.DTOs.User;
public record UserProfileDto
{
public string Email { get; init; } = string.Empty;
public string UserId { get; init; } = string.Empty;
public int AITokensUsed { get; init; }
public Guid TenantId { get; init; }
@@ -15,11 +16,11 @@ public record UserProfileDto
public int AverageQuizScore { get; init; }
/// <summary>
/// Summary of the last read book.
/// </summary>
public string? DisplayName { get; init; }
public int BooksReadCount { get; init; }
public int ConceptsMappedCount { get; init; }
public LastReadBookDto? LastReadBook { get; init; }
public IReadOnlyList<QuizResultDto> RecentQuizzes { get; init; } = Array.Empty<QuizResultDto>();
public string[] Roles { get; init; } = Array.Empty<string>();
// Helper properties for UI compatibility
@@ -40,3 +41,13 @@ public record LastReadBookDto
public string? Description { get; init; }
public bool IsReadyForReading { get; init; }
}
public record QuizResultDto
{
public Guid Id { get; init; }
public string Topic { get; init; } = string.Empty;
public int Score { get; init; }
public int TotalQuestions { get; init; }
public double Percentage { get; init; }
public DateTime CompletedDate { get; init; }
}