feat(vocab): implement SRS features and enhance vocabulary management
All checks were successful
Deploy to production / deploy (push) Successful in 2m49s
All checks were successful
Deploy to production / deploy (push) Successful in 2m49s
- Added new endpoints in vocabController for retrieving SRS due items and reviewing SRS items, improving spaced repetition support. - Updated vocabService to handle SRS item creation and scheduling, ensuring effective tracking of vocabulary exposure. - Enhanced vocabRouter with new routes for SRS functionalities, facilitating user interaction with spaced repetition features. - Modified VocabPracticeDialog and VocabCourseView to integrate SRS due items, providing users with timely review opportunities. - Updated translations and UI elements to reflect new SRS features, enhancing user experience and accessibility.
This commit is contained in:
@@ -3602,6 +3602,23 @@ export default {
|
||||
normalizeVocab(s) {
|
||||
return this.normalizeComparableText(s);
|
||||
},
|
||||
reportSrsReviewForCurrentQuestion(isCorrect) {
|
||||
if (!this.currentVocabQuestion?.vocab || !this.courseId) {
|
||||
return;
|
||||
}
|
||||
const vocab = this.currentVocabQuestion.vocab;
|
||||
apiClient.post('/api/vocab/srs/review', {
|
||||
courseId: this.courseId,
|
||||
lessonId: vocab.lessonId || this.lessonId,
|
||||
itemKey: vocab.itemKey || null,
|
||||
learning: vocab.learning,
|
||||
reference: vocab.reference,
|
||||
direction: this.vocabTrainerDirection,
|
||||
correct: Boolean(isCorrect)
|
||||
}).catch((error) => {
|
||||
console.warn('[VocabLessonView] SRS review could not be saved:', error);
|
||||
});
|
||||
},
|
||||
checkVocabAnswer() {
|
||||
if (!this.currentVocabQuestion) return;
|
||||
|
||||
@@ -3638,6 +3655,7 @@ export default {
|
||||
stats.wrong++;
|
||||
this.queueFailedVocab(this.currentVocabQuestion.vocab);
|
||||
}
|
||||
this.reportSrsReviewForCurrentQuestion(this.vocabTrainerLastCorrect);
|
||||
|
||||
this.vocabTrainerAnswered = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user