Open alee opened 4 weeks ago
should be short (4/5 characters)
should be a bit longer due to needing more of them but still easily memorized or transcribed by a student
considerably longer just for better security
something to note is that a helper function can be shared between generation functions if the strategy for creating the code is similar by taking in some parameter to determine the length, i.e. a word count or character count
all should be guaranteed to be unique by attempting to generate a code, checking for uniqueness in the db, then trying again in case of a collision. Alternatively, these all have a unique constraint in the db so inserting a non-unique value will raise an error, which can be taken advantage of with a try...catch
if that error is unique (we wouldn't want to keep trying if the error was something else that went wrong)
Educators should be able to:
Students should be able to:
Jest test stubs currently in
test/services/educator.test.ts
Jest documentation:
https://jestjs.io/docs/getting-started