Open jeflem opened 1 year ago
The nbgrader/nbextensions
directory is gone on the main
branch, so this will need to be updated for the 0.9.x version
Thanks @jeflem, and sorry for the late answer to this PR.
I tested it only in single course environment (not with jupyterhub), it worked well for course list, but not for assignment list.
And if you have time, can you rebase it on main, please ?
Thanks for considering this PR! I rebased on main. I'm not a git pro. So if something went wrong please let me know.
I tested it only in single course environment (not with jupyterhub), it worked well for course list, but not for assignment list.
For non-local formgraders (JHub) course titles are shown in the assignement list's drop-down where you select a course. For local formgraders this does not work (course ID is shown). I'll try to explain why, as far as I understand the design of course list and assignment list extensions:
c.CourseDirectory.course_title
.c.NbGrader.course_titles
dict.Current solution (not showing title in assignment list for local formgraders) is not optimal, but good enough for my use case (no local formgraders). If we want to see titles of local formgraders in the assignment list, too, one solution would be to always use the c.NbGrader.course_titles
config option. Even for local formgraders (and course specific config files) we would have to provide the mapping of IDs to titles in this dict. So instead of c.CourseDirectory.course_title = 'Course 101'
one could write
c.NbGrader.course_titles.update({'course101': 'Course 101'})
It's important to use update
here to not overwrite items defined in other config files. Don't know whether this is a better solution. Now we lost the symmetry between c.CourseDirectory.course_id
and c.CourseDirectory.course_title
.
All other solutions I thought about require lots of code changes (listing all formgraders and compare their course IDs to course IDs extracted from assignments, for example). Ideas welcome!
Course list and assignment list extensions show nbgrader's
course_id
(and/or the formgrader service's name) in the GUI. A course'scourse_id
property has to be (at least) URL save if nbgrader is running in a multi-class JupyterHub setting. Thus, no white space, no specical characters (German umlauts, Chinese,...) allowed.This PR adds a
course_title
property to nbgrader courses and modifies course list and assignment list extensions (server/lab/nb) to showcourse_title
where appropriate. Usingcourse_title
for GUI (and for nothing else) allows for arbitrary course titles.If the new
course_title
property is not set, then behavior is as before (showcourse_id
). In single-class environments setc.CourseDirectory.course_title
to some string. In multi-class JupyterHub environments setThis PR closes #1795.
Tests pass.
Would be great if someone could carefully review this PR. It's my first contribution to nbgrader, maybe I missed something important.