Reason: Cause it is beautiful with another button in there
It is a big component. But all linked.
It is divided in 3 phases.
Create New page component
Update to MyExercises
Creation of Exercises button in the NavigationRail
Create new Page component
Location:
Cohorts > Exercises Page <------------------- New folder
Name of Files:
ExercisesPage.js
exercisesPage.css
New Routes:
/exercises
/exercises/:cohortId
Two Routes are necessary because the Student user will only be able to navigate to the exercises of his cohort, while the Teacher will be redirect to a list of all exercises available.
Update to MyExercises
Must include a check if user role is Teacher or Student.
If TEACHER:
Header must be changed to "Exercises" - Suggestion only
Show all Exercises from Institution
API endpoint: /exercises
if STUDENT:
Header stays the same
Show only Exercises of the user cohort.
API endpoint: /cohorts/${user.cohortId}/cohortExercises
Creation of Exercises button in the NavigationRail
In the NavigationRail, create a new button using the same structure of the previous buttons.
Link the onClick of the button to a new function called exercisesPressed() in which takes the user to the respective based on its role (Check cohortPressed for condition example in the same file)
Add an Icon from Google Icons and update necessary CSS
Reason: Cause it is beautiful with another button in there It is a big component. But all linked. It is divided in 3 phases.
New page
componentMyExercises
Create new Page component
Location:
Name of Files:
New Routes:
Two Routes are necessary because the Student user will only be able to navigate to the exercises of his cohort, while the Teacher will be redirect to a list of all exercises available.
Update to MyExercises
Must include a check if
user
role is Teacher or Student.If
TEACHER
:/exercises
if
STUDENT
:user
cohort./cohorts/${user.cohortId}/cohortExercises
Useful link to the API documentation:
Creation of Exercises button in the NavigationRail
In the NavigationRail, create a new button using the same structure of the previous buttons.
Link the onClick of the button to a new function called based on its role (Check
exercisesPressed()
in which takes the user to the respectivecohortPressed
for condition example in the same file)Add an Icon from Google Icons and update necessary CSS