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 usergroups to users page which map users to scenarios #439

Open
6 of 7 tasks
iripiri opened this issue Aug 30, 2024 · 2 comments
Open
6 of 7 tasks

Add usergroups to users page which map users to scenarios #439

iripiri opened this issue Aug 30, 2024 · 2 comments

Comments

@iripiri
Copy link
Contributor

iripiri commented Aug 30, 2024

Motivation:

For a student course, each student (= user) needs access to a set of scenarios for different exercises.
To achieve this, existing scenario(s) are either duplicated for each user and/or all users of a group are added to a shared scenario.
Since the whole group of users/students needs access to the same scenarios, the concept of usergroups was introduced. A usergroup has a name, scenario mappings and a list of users.


Usage:

An admin user (teaching assistant) will give their course participants access to VILLASweb scenarios via a user group.

sequenceDiagram
    Admin->>+VILLASweb: create UserGroup with ScenarioMappings
    loop for each user/student
        Admin->>+VILLASweb: add course student as User
        Admin->>+VILLASweb: add User to UserGroup
        VILLASweb->>-User: add User to Scenario(s), duplicate Scenario(s)
    end

Loading

Backend usergroups API:

The backend is extended with usergroups endpoints [WIP], see VILLASframework/web-backend#144
usergroups_endpoints

The following enpoints will be added as well:

PUT /usergroups/{usergroupID}/user -> Add a user to a user group
DELETE /usergroups/{usergroupID}/user -> Delete a user from a user group
GET /usergroups/{usergroupID}/users -> Get users of a user group


TODOs:

  • Users page: on load, get usergroups from backend and display groups in separate table (Figure 1)
  • extend Users table with a "User Groups" column (Figure 1)
  • add a button to add a user group, including matching tooltip (Figure 1)
  • on button click, open modal window to add user group (Figures 2 & 3)
    • display existing scenarios to select for a new scenario mapping
    • select whether to add or duplicate the scenario (e.g. with radio buttons)
    • after a scenario mapping was added, another scenario mapping can be added or the user group can be saved

users_page
Figure 1: Extend users page with user groups


modal
Figure 2: Modal window to add user group

modal2
Figure 3: Filled out values for new user group

@iripiri
Copy link
Contributor Author

iripiri commented Aug 30, 2024

Hi @Anyandsi, @SystemsPurge and @al3xa23,
this is how I imagine the user groups to be added to the frontend, let me know if you have any questions or remarks

@SystemsPurge
Copy link

Have not closed this eventually because, im not certain whether it would make things easier to have a json tag on the usergroups field of the user model in the backend. Getting all usergroups, then having to look for each user in all their users and then adding the corresponding usergroups to the usergroup field of the user table seems a bit unwieldy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants