Ability for teachers to create repeatable tasks. Students can complete repeatables, with enforced limits on completions/resets as set in the task parameters
Frontend
Create repeatable:
Implement a MUI Select in the Create Task modal (at the top) to allow teacher to select what kind of task to implement: One-Time or Repeatable
Options that can be set for Repeatable:
Name
Description
Reward (can't be edited once changed)
Max Completions per Week (refreshes on Sunday)
View/edit/delete repeatable:
In teacher view tasks page, implement MUI tabs that toggle between displaying the table of regular tasks and repeatable tasks
Implement repeatable tasks the same as regular tasks in terms of showing in the table, editing, deletion
Rewards for repeatables should be non-editable
Backend
Whenever repeatables are loaded, run a function to enforce refreshing of repeatables:
Fetch the student's lastRefresh and completions and the maxCompletions from the database.
If the student has no lastRefresh, then it is their first time opening the repeatable. They would also have no completions. Set completions to 0 and lastRefresh to the most recent Sunday midnight for that student in the database.
Else, if more than a week has passed since the student's lastRefresh (which should be some Sunday midnight), set the lastRefresh to the most recent Sunday and set completions to 0.
On the student view, whenever displaying repeatables, filter out the ones where the student's completions equal the maxCompletions.
Completion of repeatables works the same as with regular tasks, but when the teacher confirms student completion of a repeatable also increment the streaks counter accordingly
Repeatable Tasks
Overview
Ability for teachers to create repeatable tasks. Students can complete repeatables, with enforced limits on completions/resets as set in the task parameters
Frontend
Backend
lastRefresh
andcompletions
and themaxCompletions
from the database.lastRefresh
, then it is their first time opening the repeatable. They would also have nocompletions
. Setcompletions
to 0 andlastRefresh
to the most recent Sunday midnight for that student in the database.lastRefresh
(which should be some Sunday midnight), set thelastRefresh
to the most recent Sunday and setcompletions
to 0.maxCompletions
.streaks
counter accordingly