Click here to see cookie implementation with sign-in, dashboard and class period creation (shown to persist and properly redirect in video).
Functionality
Dashboard
The dashboard page utilizes the new dashboard-specific backend ClassPeriod method:
fetch(deployed + '/api/class_period/dashboard', {
method: 'GET',
mode: 'cors', // no-cors, *cors, same-origin
cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
credentials: 'include', // include, *same-origin, omit
headers: {
"content-type": "application/json",
},
})
// skipping existing content for new catch error
.catch(error => {
console.error('There was a problem with the fetch operation:', error);
window.location.replace("{{site.baseurl}}/sign-in/");
});
The new catch error functionality expects that, if data could not be found with the JWT-based request, the user has not logged in or, if logged in, has some problem with the login credentials, so it sends the user back to the sign-in screen.
Class Creation
The main change was removing the email line used for test creation, as the JWT is now used to identify the user. As seen in the code below, if credentials and info are proper, the user will be redirected to the class info page to edit it further (after future implementation).
Styling overhaul of dashboard (may not be immediate)
Styling on class period creation and period data screen (waiting on wireframe)
If assignments are empty, no container should be present; an option to create the first assignment should be in its place (waiting on further assignment implementation)
A new menu should be implemented that would allow the teacher to dynamically search for and invite students to their class
Runtime
Video Demonstration
Click here to see cookie implementation with sign-in, dashboard and class period creation (shown to persist and properly redirect in video).
Functionality
Dashboard
The dashboard page utilizes the new dashboard-specific backend ClassPeriod method:
The new catch error functionality expects that, if data could not be found with the JWT-based request, the user has not logged in or, if logged in, has some problem with the login credentials, so it sends the user back to the sign-in screen.
Class Creation
The main change was removing the email line used for test creation, as the JWT is now used to identify the user. As seen in the code below, if credentials and info are proper, the user will be redirected to the class info page to edit it further (after future implementation).
Future Improvements