174 lines
4.4 KiB
C#
174 lines
4.4 KiB
C#
using System.Text.Json;
|
|
using Tiku.Domain.Content;
|
|
using Tiku.Domain.Learning;
|
|
|
|
namespace Tiku.Application.Learning;
|
|
|
|
public sealed record LearningActor(Guid TenantId, Guid UserId);
|
|
|
|
public sealed record LearningList<TItem>(IReadOnlyCollection<TItem> Items);
|
|
|
|
public sealed record SubmitAnswerCommand(
|
|
Guid QuestionId,
|
|
Guid? PracticeSessionId,
|
|
IReadOnlyCollection<string>? SelectedOptions,
|
|
string? AnswerText,
|
|
bool? SelfJudgedCorrect);
|
|
|
|
public sealed record QuestionActionCommand(Guid QuestionId, bool? Favorite);
|
|
|
|
public sealed record WordProgressCommand(
|
|
Guid WordId,
|
|
string? Status,
|
|
int? CorrectDelta,
|
|
int? WrongDelta,
|
|
DateTimeOffset? NextReviewAt);
|
|
|
|
public sealed record FavoriteWordCommand(Guid WordId, bool? Favorite, string? Note);
|
|
|
|
public sealed record LearningLimitFilter(int? Limit = null, string? Status = null, Guid? UnitId = null);
|
|
|
|
public sealed record PracticeSessionCommand(
|
|
string? Mode,
|
|
string? TargetType,
|
|
Guid? TargetId,
|
|
Guid? BlueprintId,
|
|
Guid? CollectionId,
|
|
Guid? EntryId,
|
|
Guid? ContentNodeId,
|
|
int? QuestionLimit,
|
|
int? DurationMinutes,
|
|
decimal? TotalScore,
|
|
JsonElement Metadata);
|
|
|
|
public sealed record PracticeSessionFilter(
|
|
Guid? PracticeSessionId = null,
|
|
Guid? BlueprintId = null,
|
|
string? Mode = null,
|
|
string? Status = null,
|
|
int? Limit = null);
|
|
|
|
public sealed record AnswerRecordItem(
|
|
Guid Id,
|
|
Guid QuestionId,
|
|
Guid? QuestionVersionId,
|
|
Guid? PracticeSessionId,
|
|
JsonElement SelectedOptions,
|
|
string? AnswerText,
|
|
bool? IsCorrect,
|
|
DateTimeOffset AnsweredAt);
|
|
|
|
public sealed record FavoriteQuestionItem(
|
|
Guid QuestionId,
|
|
string Source,
|
|
DateTimeOffset CreatedAt);
|
|
|
|
public sealed record WrongQuestionItem(
|
|
Guid QuestionId,
|
|
int WrongCount,
|
|
DateTimeOffset LastWrongAt,
|
|
DateTimeOffset? ResolvedAt);
|
|
|
|
public sealed record WordProgressItem(
|
|
Guid WordId,
|
|
WordProgressStatus Status,
|
|
int CorrectCount,
|
|
int WrongCount,
|
|
DateTimeOffset? LastReviewAt,
|
|
DateTimeOffset? NextReviewAt,
|
|
int ReviewCount,
|
|
int CorrectStreak,
|
|
WordReviewResult? LastResult,
|
|
WordDueLevel DueLevel,
|
|
JsonElement Metadata);
|
|
|
|
public sealed record FavoriteWordItem(
|
|
Guid WordId,
|
|
string? Note,
|
|
DateTimeOffset? FavoritedAt);
|
|
|
|
public sealed record LearningActionResult(bool Ok, bool? IsFavorite = null);
|
|
|
|
public sealed record PracticeSessionItem(
|
|
Guid Id,
|
|
string Mode,
|
|
string? TargetType,
|
|
Guid? TargetId,
|
|
Guid? BlueprintId,
|
|
Guid? CollectionId,
|
|
Guid? EntryId,
|
|
Guid? ContentNodeId,
|
|
JsonElement QuestionIds,
|
|
int QuestionCount,
|
|
int? DurationMinutes,
|
|
decimal? TotalScore,
|
|
PracticeAccessMode AccessMode,
|
|
Guid? AccessEntitlementId,
|
|
int ConsumedFreeQuota,
|
|
JsonElement AccessSnapshot,
|
|
DateTimeOffset StartedAt,
|
|
DateTimeOffset? FinishedAt,
|
|
DateTimeOffset? ExpiresAt,
|
|
JsonElement Metadata,
|
|
string Status);
|
|
|
|
public sealed record PracticeSessionDetailItem(
|
|
PracticeSessionItem Session,
|
|
IReadOnlyCollection<PracticeSessionQuestionItem> Questions,
|
|
IReadOnlyDictionary<Guid, AnswerRecordItem> AnswersByQuestion);
|
|
|
|
public sealed record PracticeSessionQuestionItem(
|
|
Guid Id,
|
|
string Type,
|
|
string? TypeLabel,
|
|
int? Difficulty,
|
|
JsonElement Tags,
|
|
Guid? VersionId,
|
|
string? Content,
|
|
JsonElement Options,
|
|
string? Explanation);
|
|
|
|
public sealed record PracticeSessionReportItem(
|
|
Guid Id,
|
|
Guid PracticeSessionId,
|
|
Guid? BlueprintId,
|
|
Guid? CollectionId,
|
|
string Mode,
|
|
int TotalQuestions,
|
|
int AnsweredCount,
|
|
int CorrectCount,
|
|
int WrongCount,
|
|
int UnansweredCount,
|
|
decimal Score,
|
|
decimal TotalScore,
|
|
decimal Accuracy,
|
|
int DurationSeconds,
|
|
DateTimeOffset? StartedAt,
|
|
DateTimeOffset SubmittedAt,
|
|
JsonElement SectionStats,
|
|
JsonElement QuestionResults,
|
|
JsonElement WrongQuestionIds,
|
|
JsonElement Metadata);
|
|
|
|
public sealed record PracticeHistoryItem(
|
|
Guid Id,
|
|
string Mode,
|
|
string? TargetType,
|
|
Guid? TargetId,
|
|
Guid? BlueprintId,
|
|
Guid? CollectionId,
|
|
Guid? EntryId,
|
|
Guid? ContentNodeId,
|
|
int QuestionCount,
|
|
int AnsweredCount,
|
|
int CorrectCount,
|
|
int WrongCount,
|
|
DateTimeOffset StartedAt,
|
|
DateTimeOffset? FinishedAt,
|
|
DateTimeOffset? ExpiresAt,
|
|
string Status,
|
|
Guid? ReportId,
|
|
decimal? Score,
|
|
decimal? ReportTotalScore,
|
|
decimal? Accuracy);
|