Skip to content

feat: implement spaced repetition scheduler (#1178)#1188

Open
anushkagupta200615-jpg wants to merge 1 commit into
Charushi06:mainfrom
anushkagupta200615-jpg:feat/issue-1178-revision-scheduler
Open

feat: implement spaced repetition scheduler (#1178)#1188
anushkagupta200615-jpg wants to merge 1 commit into
Charushi06:mainfrom
anushkagupta200615-jpg:feat/issue-1178-revision-scheduler

Conversation

@anushkagupta200615-jpg

Copy link
Copy Markdown

Related Issue

Closes #ISSUE_NUMBER

Summary

Brief explanation of the contribution.

Changes Made

  • Bullet list of implemented changes.
  • ...

Testing

Explain how the changes were tested.

Screenshots

Add screenshots if UI changes exist.

Checklist

  • Code follows project style
  • Tested locally
  • No unrelated changes included
  • Documentation updated (if applicable)

Description

Resolves #1178.

This PR introduces a Smart Revision Scheduler that brings spaced repetition directly into the StudyPlan task workflow. It automatically schedules retention-focused revisions after a task is completed and adapts future intervals based on user feedback.

Key Features & Changes

  • Database Schema Update: Introduced a new revision_stage integer column to the tasks table to track the repetition level of a task (Stage 0 = regular task, Stage 1+ = revision tasks).
  • Automated Revision Creation: When a regular task is marked as Done, the system now automatically generates a follow-up revision task due the next day.
  • Revision Quality Feedback: Added a new sleek UI Modal (#revision-modal) that prompts the user whenever a Revision task is completed. It asks the user to rate the difficulty of recalling the concept:
    • 🟢 Easy: Increments the interval to the next stage.
    • 🟡 Medium: Keeps the current stage interval.
    • 🔴 Hard: Drops the task back down a stage for quicker repetition.
  • Smart Intervals: Built an interval algorithm mapping stages to days (1, 3, 7, 14, 30) for optimal memory retention.
  • UI Indicators: Added a 🔁 Stage X badge to the task list view so users can easily distinguish active spaced repetition items from regular tasks.

Technical Details

  • Updated initDb in database.js to run an ALTER TABLE to append the new column seamlessly.
  • Updated POST /api/tasks and PUT /api/tasks/:id endpoints in server.js to persist revision_stage.
  • Integrated the feedback event listeners and interval logic into js/app.js and js/store.js.

How to Test

  1. Create a normal task and check the box to mark it as 'Done'.
  2. Verify that a new task titled Revision: [Your Task Name] immediately appears, scheduled for tomorrow.
  3. Check the box on the new Revision task.
  4. The Revision Feedback Modal should appear. Click "Medium" and verify the next revision is created for +3 days.
Screenshot 2026-06-24 032623

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Smart Revision Scheduler using Spaced Repetition

1 participant