-
Notifications
You must be signed in to change notification settings - Fork 327
Description
I have an Ubuntu Server hosting The Littlest Jupyter Hub (tljh) and am trying to set up nbgrader for multiple instructors with different classes.
I have gotten the formgrader working and have been able to do a manual exchange of assignments between students and instructors. I am having issues with getting the internal exchange working between students and instructors, however. When I use the command line as student1:
nbgrader fetch_assignment ps1 --course c1
I am told "You do not have access to this course"
I have tried following the documentation here and have tried referencing the demo github here
When releasing assignments they do go into the exchange and have the proper setup.
I really have no idea what to do further or what I may have messed up along the way.
I have 2 nbgrader_config.py files and 1 jupyterhub_config.py file.
The following are my config files
~/jupyter/jupyter_config.py
c = get_config()
#formgrader
c.JupyterHub.NotebookApp.tornado_settings = {
'headers': {
'Content-Security-Policy': "frame-ancestors 'self'"
}
}
# Our user list
c.Authenticator.allowed_users = [
'jupyter-bradp',
'jupyter-dakoop',
'jupyter-professor1',
'jupyter-student1',
'jupyter-student2',
'jupyter-student3',
]
c.Authenticator.admin_users = {
'jupyter-bradp',
'jupyter-dakoop',
'jupyter-professor1',
}
# instructor1 and instructor2 have access to different shared servers:
c.JupyterHub.load_groups = {
'instructors' = [
'jupyter-bradp',
'jupyter-professor1',
],
'formgrade-c1': [
'jupyter-bradp',
],
'formgrade-course123':[
'jupyter-professor1',
],
'nbgrader-c1': [
'jupyter-bradp',
'jupyter-student1',
],
'nbgrader-course123': [],
}
for course in ['c1']:
roles.append(
'name':f'formgrade-{course}',
'groups':[f'formgrade-{course}'],
'scopes':[
f'access:services!service={course}',
]
)
#course material access
roles.append(
{
'name':f'nbgrader-{course}',
'groups':[f'nbgrader-{course}'],
'scopes':[
'list:services',
f'read:services!service={course}',
],
}
)
# Start the notebook server as a service. The port can be whatever you want
# and the group has to match the name of the group defined above.
c.JupyterHub.services = [
{
'name': 'c1',
'url': 'http://127.0.0.1:9999',
'command': [
'jupyterhub-singleuser',
'--group=formgrade-c1',
'--debug',
],
'user': 'jupyter-bradp',
'cwd': '/home/jupyter-bradp/c1',
'api_token': token, # include api token from admin user
},
{
'name': 'course123',
'url': 'http://127.0.0.1:9998',
'command': [
'jupyterhub-singleuser',
'--group=formgrade-course123',
'--debug',
],
'user': 'grader-course123',
'cwd': '/home/grader-course123',
'api_token': token # include api token from admin user
},
]
~/jupyter/nbgrader_config.py (This is the global nbgrader config file)
from nbgrader.auth import JupyterHubAuthPlugin
c = get_config()
c.Exchange.path_includes_course = True
c.Authenticator.plugin_class = JupyterHubAuthPlugin
~/home/jupyter-bradp/c1/nbgrader_config.py
c = get_config()
c.CourseDirectory.course_id = "c1"
c.IncludeHeaderFooter.header = "source/header.ipynb"
c.Exchange.root = '/tmp/exchange'
c.NbGrader.logfile = "/home/jupyter-bradp/nbgrader.log"