Open benloh opened 5 years ago
In GitLab by @daveseah on Oct 31, 2019, 13:59
I'm leaning toward creating an internal login table that generates teacher tokens based on the teachers data table. Otherwise they'd have to be manually created somewhere.
Modifications:
In GitLab by @daveseah on Oct 31, 2019, 17:47
I've made the following modifications:
GENERATING TEACHER TOKENS
AdmTeacherSelector.jsx
in the dropdown rather than create a whole new table infrastructureSESSION.MakeTeacherToken(teacherName,{groupId:0,teacherId})
creates this token. It's called by AdmTeacherSelector.jsxCHECKING TEACHER LOGGED IN STATE
SESSION.LoggedInProps()
returns an object that is either has { studentName, groupId, classroomId } or { teacherName, teacherId } defined, based on who is logged-in. SESSION.IsTeacher()
and SESSION.IsStudent()
return true/false. Also accessible from UR.IsTeacherLoggedIn()
SESSION.LoggedInName()
is a shortcut method for returning the logged-in nameCHANGED FILES
ModelSelect.jsx
now imports SESSION and calls ADM.GetModelsByTeacher()
if a teacher is logged inadm-data.js
has the new GetModelsByTeacher(token)
AdmTeacherSelector.jsx
has teacher token generation hacked in
In GitLab by @daveseah on Oct 31, 2019, 13:29
After talking to Ben about it the app needs, I'm thinking it's fundamentally this:
BACKGROUND
Here's how the system currently works:
A valid user token is submitted from a client. The token encodes the groupid and classroomid with the name, with some non-cryptographic hashing to make it possible to validate a legit user token from a made-up one.
Once a student provides their user token, it is sent to URSYS NET into
PKT_SessionLogin()
, which validates the user token. If a valid token is received, an access key is generated and sent back to the client logging-in. The key is unique across connections, even ones with the same user login.This access key is validated ONLY by PMC Model, which is accessed through UR.DBQuery and UR.DBTryLock/DBTryRelease calls. If the key is missing or doesn't match, the calls fail.
For all other accesses, the access key is currently not used.
TEACHER ACCESS
The commenting system is technically part of the PMC Model, which means for teachers to use it: