Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add educator service stubs and tests #943

Open
alee opened this issue Jun 11, 2024 · 1 comment
Open

add educator service stubs and tests #943

alee opened this issue Jun 11, 2024 · 1 comment
Assignees
Labels
server Server Side

Comments

@alee
Copy link
Member

alee commented Jun 11, 2024

Educators should be able to:

  1. create a classroom
  2. add students to a classroom
  3. generate a unique classroom auth code
  4. generate a unique password for themselves server side (still in flux)

Students should be able to:

  1. join a classroom
  2. generate a unique auth code which they can use to rejoin their classroom or running game (CURRENT TASK)

Jest test stubs currently in test/services/educator.test.ts

Jest documentation:

https://jestjs.io/docs/getting-started

@alee alee added the server Server Side label Jun 11, 2024
sgfost added a commit to saachibm/port-of-mars that referenced this issue Jun 11, 2024
ref virtualcommons#943

Co-authored-by: Sabrina Nelson <slnels16@asu.edu>
Co-authored-by: Kelly Tran <kellytea@users.noreply.github.com>
Co-authored-by: Allen Lee <alee@users.noreply.github.com>
@sgfost
Copy link
Contributor

sgfost commented Jun 11, 2024

classroom.authToken (game code):

should be short (4/5 characters)

student.rejoinCode:

should be a bit longer due to needing more of them but still easily memorized or transcribed by a student

teacher.password:

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)

sgfost added a commit to sgfost/port-of-mars that referenced this issue Jun 18, 2024
ref virtualcommons#943

Co-authored-by: Sabrina Nelson <slnels16@asu.edu>
Co-authored-by: Kelly Tran <kellytea@users.noreply.github.com>
Co-authored-by: Allen Lee <alee@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
server Server Side
Projects
None yet
Development

No branches or pull requests

3 participants