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

Multicourse: student fails to list assignments if not in jupyterhub config #1396

Open
peeterm007 opened this issue Nov 30, 2020 · 5 comments

Comments

@peeterm007
Copy link

Operating system

Ubuntu 20.04 LTS

DragonFly BSD 5.9

nbgrader --version

nbgrader version 0.6.1

jupyterhub --version (if used with JupyterHub)

JupyterHub 1.2.2

jupyter notebook --version

jupyter notebook 6.1.5

Expected behavior

Add a student to the course using the formgrader extension in Jupyterhub. Student can then list the assignments in the course.

Actual behavior

Add a student to the course using the formgrader extension in Jupyterhub. But student cannot see any assignments. Instead, the student sees "No courses found" in the assignment tab box.

Steps to reproduce the behavior

Set up multicourse configuration as described in Example Use Case: Multiple Classes. As instructor1, add student1 to course101. Create an assignment for course101 and release it. Log in as student1 and check assignments. Instead of the created assignment, the student sees "No courses found" in the assignment tab box.

I've tested this on two different operating systems, Ubuntu 20.04 and DragonFly 5.9 and see the same behavior.

To debug, I added print(response) in nbgrader/auth/jupyterhub.py: get_student_courses(). Turns out, the student isn't in the course, the groups list is empty.

It does work when I manually add the student into the nbgrader-course101 list in the jupyterhub_config.py. Then the groups list contains nbgrader-course101 and the student can see assignments fine.

I can also check at the command line that the student is indeed in the course101 database: nbgrader db student list returns the correct list.

Summary: it seems that JupyterHubAuthPlugin.get_student_courses() fails to get the correct student list when the student is not added to the group in the JupyterHub config file. As a result, the student cannot see the assignment list.

It might be something with my setup, but then everything with the instructor part works exactly as advertised. Also, when I manually add the student in the jupyterhub_config.py, then the rest works as well. So something ain't working with regard to the JupyterHubAuthPlugin.

Can you possibly give further hints about where to debug next?

Thanks

@rushfly
Copy link

rushfly commented Dec 1, 2020

I think I've seen a similar issue.

@peeterm007 peeterm007 changed the title Multicourse: student assignment list fails to list assignments Multicourse: student fails to list assignments if not in jupyterhub config Dec 5, 2020
@atnjqt
Copy link

atnjqt commented Sep 1, 2021

I am experiencing the same on Ubuntu 20.04LTS for nbgrader multiclass setup w/ the following versions...:

$ /usr/local/anaconda3/bin/nbgrader --version
Python version 3.8.8 (default, Apr 13 2021, 19:58:26)
[GCC 7.3.0]

$ /usr/local/anaconda3/bin/jupyterhub --version
1.4.2

$ /usr/local/anaconda3/bin/jupyter-notebook --version
6.4.3

In the past, we ran into this on a CentOS 7 deployment and had to manually add users to the jupyterhub_config.py...

The students see the Assignments tab but they do not have a drop down for the course!

@atnjqt
Copy link

atnjqt commented Sep 2, 2021

@peeterm007 I think we did find a solution for this...

Basically you should use the nbgrader cli tool to manually add your student IDs... This is of course in addition to adding the student ID through JHub Admin panel and adding through NBGrader FormGrader tab for managing students.

For example on running for student ID student_abc, they are then able to login, navigate to Assignments tab, & see the course dropdown & fetch assignments...

!nbgrader db student add student_abc

Hope that is helpful! Intuitively one might think the NBGrader Formgrader student manage should facilitate this... But in a multiclass setup using nbgrader cli to add to db is really the solution

@atnjqt
Copy link

atnjqt commented Aug 1, 2022

Still experiencing this issue, this time on JHubv2...

$ /usr/local/anaconda3/bin/nbgrader --version
Python version 3.8.8 (default, Apr 13 2021, 19:58:26)
[GCC 7.3.0]
nbgrader version 0.7.1

$ /usr/local/anaconda3/bin/jupyterhub --version
2.3.1

$/usr/local/anaconda3/bin/jupyter-notebook --version
6.4.12
Traceback (most recent call last): 
File "/usr/local/anaconda3/lib/python3.8/site-packages/nbgrader/server_extensions/assignment_list/handlers.py",
line 77, in list_released_assignments assignments = lister.start() 
File "/usr/local/anaconda3/lib/python3.8/site-packages/nbgrader/exchange/abc/list.py", 
line 28, in start return self.list_files() 
File "/usr/local/anaconda3/lib/python3.8/site-packages/nbgrader/exchange/default/list.py", 
line 208, in list_files assignments = self.parse_assignments() 
File "/usr/local/anaconda3/lib/python3.8/site-packages/nbgrader/exchange/default/list.py", 
line 72, in parse_assignments courses = self.authenticator.get_student_courses(self.coursedir.student_id) 
File "/usr/local/anaconda3/lib/python3.8/site-packages/nbgrader/auth/base.py", 
line 102, in get_student_courses return self.plugin.get_student_courses(student_id) 
File "/usr/local/anaconda3/lib/python3.8/site-packages/nbgrader/auth/jupyterhub.py", 
line 89, in get_student_courses for group in response['groups']: KeyError: 'groups'

@atnjqt
Copy link

atnjqt commented Aug 5, 2022

Okay so this time around, the issue was related to Jupyterhub v2 introduction of scopes & roles (see here.

It wasn't clear initially what RBAC permissions were necessary for NBGrader groups, but details on how to configure should be included in the upcoming 0.8.x (see pre-release here, which includes the following PR)

This doesn't get around the fact that you still need to manually add students via nbgrader cli... but thought it helpful to share!

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

3 participants