Repository navigation
Conversation
…centage - Each mark schedules the next review: failed — tomorrow, partial — in 3 days, passed — 7 → 21 → 60 → 150 days; a worse answer resets the streak. Reviews fall due at the start of the Moscow day. The same mark before the due date is a no-op. - question_completions gets stage and next_review_at (migration backfills them from existing marks); new question_attempts table keeps the grade history. - Readiness: passed 1, partial 0.5, failed 0, halved for every missed interval; stats and stats-by-category return readiness and due_count in the same single query. - /me/progress returns due_ids, the list accepts progress=due, PUT mastery returns next_review_at. - Frontend: readiness in the questions overview and profile, "На сегодня" chip and filter, "Пора повторить" in list rows, the next-question panel serves due reviews first; on a due question the same grade re-reviews instead of clearing the mark. The partial/failed filter is renamed "Слабые".
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Что сделано
Интервальные повторения и «готовность» вместо голого процента пройденных вопросов. Раньше отметка «Прошёл» закрывала вопрос навсегда, хотя через месяц ответ забывается. Теперь каждая оценка назначает следующее повторение, а прогресс показывает, что человек помнит сейчас.
Расписание (
app/services/spaced_repetition.py)FOR UPDATE, параллельные запросы продвигают серию один раз (есть тест).Данные
question_completions:stage(ступень серии) иnext_review_at+ индекс(user_id, next_review_at).question_attempts— история оценок. Пока только копится; потом из неё можно показать динамику «был 4/10 → стал 8/10».d9e7a3b61f05проставляет сроки существующим отметкам по тем же правилам и заполняет историю текущими отметками. Downgrade удаляет таблицу и колонки, сами отметки не трогает.Готовность
0.5 ** (просрочка / интервал).completion/statsиstats-by-categoryотдаютreadinessиdue_countв том же одном SQL-запросе (бюджет запросов вtest_sql_budgetне изменился).overall_percentageостался как был.API
GET /me/progress→due_ids.GET /questions/?progress=due— вопросы, которые пора повторить.PUT /questions/{id}/mastery→next_review_at.openapi.json,api.generated.tsиdocs/api.mdпересобраны.Фронтенд
due_idsсразу при новой оценке.Что учесть при выкладке
После миграции старые отметки, которым больше 1–7 дней, сразу попадут в «На сегодня». Так задумано: их давно пора повторить.
Проверка
tests/test_spaced_repetition.py: правила расписания, идемпотентность, очередь, готовность с забыванием, параллельные повторения; миграция совпадает с моделями).tsc, ESLint чисто, vitest 169 passed.