Closed IsoPhoenix closed 1 year ago
Addendum for functionality when teacher edits a task by changing the due date:
When a teacher edits the due date of a task: If the new due date is in the future, you should transfer all player IDs from the expired
array back to the assigned
array. This covers retroactive action of a teacher giving an "extension" by changing due date.
This functionality should happen when the task is actually edited (i.e. do the checking and/or moving when the edit is confirmed, not when the due date is just being changed in the edit modal).
Due Dates
Overview
Enforce due dates on tasks. Tasks should expire and no longer be completable past the due date
Frontend
Backend
mutations.js
that given an array of task IDs and a player ID, will remove the player ID from theassigned
array and add it to theexpired
array for every taskuseEffect()
hook to implement due date checking when a student loads a classroom (inMain.js
) and when a teaher opens the modal that will show a student's completed tasks (ClassTeacherModal.js
).now()
) is past the due date, append the task ID to a temp arraytasks
collection in theonSnapshot()
call for thetasks
collection may cause an infinite loop. To be efficient with code and avoid writing anotheronSnapshot
just for due date checking, you will need to be smart/careful about how you use state variables,onSnapshot()
,useEffect()
, and possibly async functions. If you are unsure about this let me know so I can help you out.onSnapshot()
call. Write one call for all the tasks in the classroom and then sort the result using Javascript to categorize various tasks (All Quests, Requested, Confirmed, Overdue). (This means you may need to modify existing onSnapshot calls if they do not ask for enough).