72 lines
1.6 KiB
TypeScript
72 lines
1.6 KiB
TypeScript
// Review 系統統一資料介面定義
|
|
|
|
export interface ReviewCardData {
|
|
id: string
|
|
word: string
|
|
definition: string
|
|
example: string
|
|
translation: string
|
|
pronunciation?: string
|
|
synonyms: string[]
|
|
cefr: string
|
|
exampleTranslation: string
|
|
filledQuestionText?: string
|
|
exampleImage?: string
|
|
// 學習相關欄位
|
|
masteryLevel?: number
|
|
timesReviewed?: number
|
|
isFavorite?: boolean
|
|
}
|
|
|
|
export interface BaseReviewProps {
|
|
cardData: ReviewCardData
|
|
onAnswer: (answer: string) => void
|
|
onReportError: () => void
|
|
disabled?: boolean
|
|
}
|
|
|
|
// 特定測試類型的額外 Props
|
|
export interface ChoiceTestProps extends BaseReviewProps {
|
|
options: string[]
|
|
}
|
|
|
|
export interface ConfidenceTestProps extends BaseReviewProps {
|
|
onConfidenceSubmit: (level: number) => void
|
|
}
|
|
|
|
export interface FillTestProps extends BaseReviewProps {
|
|
// 填空測試特定屬性
|
|
}
|
|
|
|
export interface ReorderTestProps extends BaseReviewProps {
|
|
// 重排測試特定屬性
|
|
}
|
|
|
|
export interface ListeningTestProps extends BaseReviewProps {
|
|
// 聽力測試特定屬性
|
|
}
|
|
|
|
export interface SpeakingTestProps extends BaseReviewProps {
|
|
// 口說測試特定屬性
|
|
}
|
|
|
|
// 答案回饋類型
|
|
export interface AnswerFeedback {
|
|
isCorrect: boolean
|
|
userAnswer: string
|
|
correctAnswer: string
|
|
explanation?: string
|
|
}
|
|
|
|
// 信心度等級
|
|
export type ConfidenceLevel = 1 | 2 | 3 | 4 | 5
|
|
|
|
// 測試結果
|
|
export interface ReviewResult {
|
|
cardId: string
|
|
testType: string
|
|
isCorrect: boolean
|
|
confidence?: ConfidenceLevel
|
|
timeSpent: number
|
|
userAnswer: string
|
|
} |