jupyter / nbgrader

A system for assigning and grading notebooks
https://nbgrader.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.3k stars 317 forks source link

filter course list dropdown menu #1857

Open bpfrd opened 10 months ago

bpfrd commented 10 months ago

Hello,

I am using nbgrader together with z2jh for multiple courses where each course has its own configuration (GPU, CPU, RAM, docker image, etc.). each user (students & instructors) may be registered in multiple courses, therefore in order to spawn the correct course & its configuration, before spawning their pod I ask them within options_form to choose their course. then in the pre_spawn_hook I use user_options to spawn the correct course. But within the nbgrader assignment list (as shown in the attached picture) they have still the possibility to change the course (while spawner is spun for another course!).

I was wondering how I can avoid this. how can I override the function in nbgrader that generates this dropdown courselist menu? how can I pass the correct courses to this menu?

best img-nbgrader

lahwaacz commented 9 months ago

If I understand nbgrader correctly, this dropdown menu is based on user groups and roles configured in JupyterHub database. As this is global to JupyterHub, I don't see a way how you could modify this according your spawner options...