forked from gongxuegit/tiku-backend.net
feat: enforce tenant isolation and shared question bank
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Text.Json;
|
||||
using Tiku.Domain.Content;
|
||||
using Tiku.Domain.Learning;
|
||||
using Tiku.Application.QuestionBanks;
|
||||
|
||||
namespace Tiku.Application.Learning;
|
||||
|
||||
@@ -9,13 +10,12 @@ public sealed record LearningActor(Guid TenantId, Guid UserId);
|
||||
public sealed record LearningList<TItem>(IReadOnlyCollection<TItem> Items);
|
||||
|
||||
public sealed record SubmitAnswerCommand(
|
||||
Guid QuestionId,
|
||||
Guid? PracticeSessionId,
|
||||
Guid SessionQuestionId,
|
||||
IReadOnlyCollection<string>? SelectedOptions,
|
||||
string? AnswerText,
|
||||
bool? SelfJudgedCorrect);
|
||||
|
||||
public sealed record QuestionActionCommand(Guid QuestionId, bool? Favorite);
|
||||
public sealed record QuestionActionCommand(QuestionLocator Locator, bool? Favorite);
|
||||
|
||||
public sealed record WordProgressCommand(
|
||||
Guid WordId,
|
||||
@@ -55,7 +55,11 @@ public sealed record LearningLeaderboardResult(
|
||||
LearningLeaderboardItem? CurrentUser,
|
||||
DateTimeOffset GeneratedAt);
|
||||
|
||||
public sealed record WrongQuestionReviewPlanItem(Guid QuestionId, int WrongCount, DateTimeOffset LastWrongAt);
|
||||
public sealed record WrongQuestionReviewPlanItem(
|
||||
Guid QuestionReferenceId,
|
||||
QuestionLocator Locator,
|
||||
int WrongCount,
|
||||
DateTimeOffset LastWrongAt);
|
||||
|
||||
public sealed record WrongQuestionReviewPlan(
|
||||
IReadOnlyCollection<WrongQuestionReviewPlanItem> Items,
|
||||
@@ -106,21 +110,21 @@ public sealed record PracticeSessionFilter(
|
||||
|
||||
public sealed record AnswerRecordItem(
|
||||
Guid Id,
|
||||
Guid QuestionId,
|
||||
Guid? QuestionVersionId,
|
||||
Guid? PracticeSessionId,
|
||||
Guid SessionQuestionId,
|
||||
Guid PracticeSessionId,
|
||||
JsonElement SelectedOptions,
|
||||
string? AnswerText,
|
||||
bool? IsCorrect,
|
||||
DateTimeOffset AnsweredAt);
|
||||
|
||||
public sealed record FavoriteQuestionItem(
|
||||
Guid QuestionId,
|
||||
string Source,
|
||||
Guid QuestionReferenceId,
|
||||
QuestionLocator Locator,
|
||||
DateTimeOffset CreatedAt);
|
||||
|
||||
public sealed record WrongQuestionItem(
|
||||
Guid QuestionId,
|
||||
Guid QuestionReferenceId,
|
||||
QuestionLocator Locator,
|
||||
int WrongCount,
|
||||
DateTimeOffset LastWrongAt,
|
||||
DateTimeOffset? ResolvedAt);
|
||||
@@ -154,7 +158,6 @@ public sealed record PracticeSessionItem(
|
||||
Guid? CollectionId,
|
||||
Guid? EntryId,
|
||||
Guid? ContentNodeId,
|
||||
JsonElement QuestionIds,
|
||||
int QuestionCount,
|
||||
int? DurationMinutes,
|
||||
decimal? TotalScore,
|
||||
@@ -171,10 +174,13 @@ public sealed record PracticeSessionItem(
|
||||
public sealed record PracticeSessionDetailItem(
|
||||
PracticeSessionItem Session,
|
||||
IReadOnlyCollection<PracticeSessionQuestionItem> Questions,
|
||||
IReadOnlyDictionary<Guid, AnswerRecordItem> AnswersByQuestion);
|
||||
IReadOnlyDictionary<Guid, AnswerRecordItem> AnswersBySessionQuestion);
|
||||
|
||||
public sealed record PracticeSessionQuestionItem(
|
||||
Guid Id,
|
||||
Guid SessionQuestionId,
|
||||
Guid QuestionReferenceId,
|
||||
QuestionLocator Locator,
|
||||
Guid QuestionId,
|
||||
string Type,
|
||||
string? TypeLabel,
|
||||
int? Difficulty,
|
||||
|
||||
Reference in New Issue
Block a user