jupyter / nbgrader

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

Create formgraders on the fly #1354

Closed huwf closed 4 years ago

huwf commented 4 years ago

From what I gathered since 0.6.0 there is support for running multiple courses with multiple instructors using Jupyterhub. It also seems that the formgraders need to be created manually as new services in Jupyterhub which I believe would then require the hub to be restarted.

My use case is that we have courses which constantly overlap, so if we can avoid restarting that would be ideal. I will be using LTI based auth, so there is potential to send extra information for creation of course directories and add instructors and students to the right groups. That seems a bit hacky though. Are there any plans to have nbgrader be able to do this, or is it out of scope?

Are there any plans to update nbgrader to support this, or is it better to try doing through Jupyterhub? I'm happy to help with some code if anything happens on nbgrader, but I haven't looked at the codebase since 0.3 and I imagine it's changed quite a lot since then...

perllaghu commented 4 years ago

We use nbgrader this way: In an LTI authenticated service.

We have an external authentication point, which Jupyter refers to for authentication. We also have an external exchange, which uses the same external authentication point to verify user authentication.

Course enrolment is set in a cookie when the user spawns their notebook, and that is used as the reference.

We use the same cookie to determine if we enable formgrader [for instructors.]

We keep course enrolment details in the exchange, and a user is auto-enrolled when they arrive with an LTI connection stating they have come from that course.

It works fine for us.

PS: "multiple instructors" does not mean multiple markers: nbgrader still has the gradebook.db database in the instructors HOME.

huwf commented 4 years ago

Hi, thanks for the response. Good to know I'm on the right track with the LTI setup.

How do you handle creating/grading a new course? Is the cookie linking to the new service?

perllaghu commented 4 years ago

The exchange is where courses are important - off the top of my head, I can't remember the details. There's some docs in nbgrader about external exchanges, and our exchange is on github (edina/nbexchange)

The cookie is a JWT cookie we set ourselves - but have a look at the "plugin" code in the nbexchange - that'll hopefully help steer you on a useful direction (it won't be the exact solution for you - but it'll help clarify some options)

perllaghu commented 4 years ago

Closing, as this was more about the LTI course details being passed to the notebook rather than creating random multiple formgraders