Ability for teacher to add custom rewards to the shop that are purchasable by students
Shop page for teachers
This won't display the typical shop items, but instead just display the custom rewards created by the teacher.
Add shop page for teacher
Create a new component ShopTeacher and make a route for it in TeacherView, and add a corresponding navbar link in listItems
Reward creation modal
Add a button in ShopTeacher that opens a modal for creating a new reward. We want the fields:
Name
Description
Cost
(If you have time) Choosing between a set of preset sprites to represent the reward! These can be fun so take a look through our sprite assets and see if anything looks cute. Lmk if you need help finding all the sprites we have
See db diagram for how to store these in the database. The isActive field should be true by default.
Display/manage created rewards (teacher)
ShopTeacher should display the rewards in customShopItems from the database (listen to these with a snapshot).
Allow editing of rewards (name, description, and cost)
Allow toggling rewards between active/inactive
Allow deleting of rewards
Display created rewards (student)
Rename Shop to ShopStudent and update the routing in StudentView accordingly: <Route path='shop' element={<ShopStudent classroom={classroom} player={player} />} />
Add a new tab to ShopStudent that lists custom rewards that have the isActive = true. (Don't display inactive rewards)
Allow purchasing of rewards, which will deduct the current cost from the student's account and add a document to rewardRequests in the DB with rewardName, rewardDescription, rewardCost, rewardIcon (if implemented), and user fields.
Note that we're not synchronizing name, description, and cost between customShopItems and rewardRequests! This simplifies the logic for teachers editing rewards after the student purchases the reward; the edits simply do not carry over to purchases that are already made.
Confirm reward requests (teacher)
Add a new tab to Requests page for teacher that displays data from rewardRequests. The only option is to confirm these requests, which will delete the corresponding document from rewardRequests in the database (do this by ID, since there can be duplicate purchases!)
Custom Shop Rewards
Overview
Ability for teacher to add custom rewards to the shop that are purchasable by students
Shop page for teachers
Add shop page for teacher
ShopTeacher
and make a route for it inTeacherView
, and add a corresponding navbar link inlistItems
Reward creation modal
ShopTeacher
that opens a modal for creating a new reward. We want the fields:isActive
field should be true by default.Display/manage created rewards (teacher)
ShopTeacher
should display the rewards incustomShopItems
from the database (listen to these with a snapshot).Display created rewards (student)
Shop
toShopStudent
and update the routing inStudentView
accordingly:<Route path='shop' element={<ShopStudent classroom={classroom} player={player} />} />
ShopStudent
that lists custom rewards that have theisActive
= true. (Don't display inactive rewards)rewardRequests
in the DB withrewardName
,rewardDescription
,rewardCost
,rewardIcon
(if implemented), anduser
fields.customShopItems
andrewardRequests
! This simplifies the logic for teachers editing rewards after the student purchases the reward; the edits simply do not carry over to purchases that are already made.Confirm reward requests (teacher)
Requests
page for teacher that displays data fromrewardRequests
. The only option is to confirm these requests, which will delete the corresponding document fromrewardRequests
in the database (do this by ID, since there can be duplicate purchases!)