heigvd-teaching-tools / online-test-platform

EVAL is an educational platform for managing training exercises and exams, featuring specialized question types for software engineering education and training.
Apache License 2.0
5 stars 0 forks source link

Scope all the urls with the group name #123

Closed Ovich closed 10 months ago

Ovich commented 10 months ago

@bchapuis

Google Recommandations

https://developers.google.com/search/docs/crawling-indexing/url-structure?hl=fr

GitHub Org creation

Image

It seem like the url part is generated by:

I would also lowercase entire url. As per google recommendations.

We have more risks of having duplicate group labels. For example, one prof of ASD would like to call his group as ASD. I think its a good approach to display the generated url to the user, as is in this github example, as well as the check that represents the existing duplcates.

However, i would still avoid using labels as primary keys, we would have a separate column to store the url part in the group model, we could think of using the url part as primary key or stay with auto generated uniqid.

Ovich commented 10 months ago

@bchapuis

Current state of the pages

Page Description Access Role
/collections/ List Collections in group [Professor]
/collections/[collectionId] Collection compose [Professor]
/groups/ List all user groups [Professor]
/jam-sessions List Jam Session in group [Professor]
/jam-sessions/new Create new jam session [Professor]
/jam-sessions/[jamSessionId] Student Dispatch (entry) page [Student]
/jam-sessions/[jamSessionId]/wait Student dispatched to wait [Student]
/jam-sessions/[jamSessionId]/join Student dispatched to join [Student]
/jam-sessions/[jamSessionId]/take/[pageId] Student dispatched to take jam session [Student]
/jam-sessions/[jamSessionId]/consult/[questionPage] Student dispatched to consult [Student]
/jam-sessions/[jamSessionId]/analytics Jam Session Live Analytics [Professor]
/jam-sessions/[jamSessionId]/consult/student/[userEmail]/[questionPage] Professor consult student answers [Professor]
/jam-sessions/[jamSessionId]/draft Jam session draft phase [Professor]
/jam-sessions/[jamSessionId]/finished Jam session finished phase [Professor]
/jam-sessions/[jamSessionId]/grading/[activeQuestion] Jam Session grading phase [Professor]
/jam-sessions/[jamSessionId]/in-progress Jam Session in-progress phase [Professor]
/questions List all questions in group [Professor]
/questions/[questionId] Question Update page [Professor]

We might also consider to move the student pages into a separate scope. Just by reading the structure it is not always easy to identify the pages that are for students and the ones that are for professors.

A proposal to the student scope

Page Description Access Role
/student/jam-sessions/[jamSessionId] Student Dispatch (entry) page [Student]
/student/jam-sessions/[jamSessionId]/wait Student dispatched to wait [Student]
/student/jam-sessions/[jamSessionId]/join Student dispatched to join [Student]
/student/jam-sessions/[jamSessionId]/take/[pageId] Student dispatched to take jam session [Student]
/student/jam-sessions/[jamSessionId]/consult/[questionPage] Student dispatched to consult [Student]

I am not sure at this point if the student pages should also be group scoped. The students are not subscribed to a group, they are subscribed to a jam session.

Variables

Variable Name Description
jamSessionId` Jam Session cuid
collectionId` Collection cuid
questionId` Question cuid
userEmail` User email string
questionPage` Page index Integer
activeQuestion` Question index Integer
pageId` Page index Integer

We can also homogenize the last 3 variables into a single one, pageIndex. They all serve the paging purpose. This is not externally visible, but its good to have the same naming convention for internal variables.

Scoping the pages under the group namespace

We can scope the pages under the group namespace, as a reminder the group namespace is generated as follows:

For example, the group Cours de Programmation will be scoped as cours-de-progremmation.

The group namespace is used to scope the pages, for example the page /jam-sessions/[jamSessionId] will become /cours-de-progremmation/jam-sessions/[jamSessionId].

State of the pages after the scoping

Professor pages

Page Description Access Role
/groups List all user groups [Professor]
/cours-de-progremmation/collections/ List Collections in group [Professor]
/cours-de-progremmation/collections/[collectionId] Collection compose [Professor]
/cours-de-progremmation/jam-sessions List Jam Session in group [Professor]
/cours-de-progremmation/jam-sessions/new Create new jam session [Professor]
/cours-de-progremmation/jam-sessions/[jamSessionId]/analytics Jam Session Live Analytics [Professor]
/cours-de-progremmation/jam-sessions/[jamSessionId]/consult/student/[userEmail]/[questionPage] Professor consult student answers [Professor]
/cours-de-progremmation/jam-sessions/[jamSessionId]/draft Jam session draft phase [Professor]
/cours-de-progremmation/jam-sessions/[jamSessionId]/finished Jam session finished phase [Professor]
/cours-de-progremmation/jam-sessions/[jamSessionId]/grading/[activeQuestion] Jam Session grading phase [Professor]
/cours-de-progremmation/jam-sessions/[jamSessionId]/in-progress Jam Session in-progress phase [Professor]
/cours-de-progremmation/questions List all questions in group [Professor]
/cours-de-progremmation/questions/[questionId] Question Update page [Professor]

Student pages

Page Description Access Role
/student/jam-sessions/[jamSessionId] Student Dispatch (entry) page [Student]
/student/jam-sessions/[jamSessionId]/wait Student dispatched to wait [Student]
/student/jam-sessions/[jamSessionId]/join Student dispatched to join [Student]
/student/jam-sessions/[jamSessionId]/take/[pageId] Student dispatched to take jam session [Student]
/student/jam-sessions/[jamSessionId]/consult/[questionPage] Student dispatched to consult [Student]

Concerns

bchapuis commented 10 months ago

@bchapuis

Google Recommandations

https://developers.google.com/search/docs/crawling-indexing/url-structure?hl=fr

GitHub Org creation

Image

It seem like the url part is generated by:

  • suppressing any special character
  • replacing any whitespace with "-"
  • series of special characters and white spaces all result into single "-" (except if they are in the end of the url part, in this case they are just removed)
  • replacing any accentuated character to asci representation

I would also lowercase entire url. As per google recommendations.

We have more risks of having duplicate group labels. For example, one prof of ASD would like to call his group as ASD. I think its a good approach to display the generated url to the user, as is in this github example, as well as the check that represents the existing duplcates.

However, i would still avoid using labels as primary keys, we would have a separate column to store the url part in the group model, we could think of using the url part as primary key or stay with auto generated uniqid.

I agree with your recommandations regarding group names in URLs. My idea was to add a unique constraint on the sanitized group name, as it is the case on github. If the name "amt" is already used by a professor, another professor cannot reuse this name. As on github, we could have the name and the url friendly name. Notice that uniqueness can be enforced with a constraint, it does not require the field to become a primary key.

bchapuis commented 10 months ago

As discussed, we will replace jam-session by evaluation.

Ovich commented 10 months ago

@bchapuis Implemented, api endpoints scoped as well.

bchapuis commented 10 months ago

Great, thank you!

Ovich commented 10 months ago

@bchapuis We have a separate entry for the rename of jam session to evaluation.

It requires a carefully executed database migration.

I am doing some refactoring and code organisation and will soon start with the renaming of jam session.