For instructors#
Instructors are regular hub users with additional permission to manage courses in nbgrader. In the learning management system (LMS) they create courses and control access to those courses and, thus, to the JupyterHub.
Nbgitpuller#
Ananke-based JupyterHubs have nbgitpuller installed. Nbgitpuller takes content from a git repository (GitHub, GitLab and others), synchronizes the repo into each user’s home directory and opens the requested notebook when the user clicks the nbgitpuller link.
To generate nbgitpuller links use the nbgitpuller link generator.
Important
If your users log in to the hub via LTI they first have to come to their JupyterLab via the LMS. Then they can click the nbgitpuller link.
Nbgrader#
Course management#
Note
Here we use Moodle terminology. Other LMS may denote things differently.
In your LMS you may either configure an ‘external tool’ activity yourself (see LMS configuration for container admins) or your LMS admin provides preconfigured external tools. In case of self-configuration you have to provide the client ID generated by the LMS for the external tool to your container admin. Alternatively, if your LMS allows for custome client IDs, you may get a client ID from your container admin. In both cases connection between LMS and Jupyter only works if both sides know the common client ID.
Each Jupyter activity in your LMS generates a separate nbgrader course in Jupyter. The nbgrader course’s title gets autogenerated from the LMS course title and the activity title.
Important
As soon as you have created a new Jupyter activity in your LMS (and client IDs are known to both sides) log in to Jupyter via this activity. Else stundent’s log in won’t work. You have to be the first who logs in!
Note
After creating a new Jupyter activity, your first log in to Jupyter via this activity will take up tp 60 seconds due to lots of background work for creating corresponding nbgrader course and user management. Even if you see JupyterLab’s GUI wait another 10 second and ignore cumbersome messages (click ‘Dismiss’).s. Subsequent logins and your student’s login will be much faster.
If students log in to Jupyter via the LMS activity they automatically get enroled to the corresponding nbgrader course. Once enroled, they have access to all their nbgrader courses. Which activity is chosen for entering Jupyter then does not matter anymore.
Basic usage#
To create and manage nbgrader assignments in your JupyterLab session click ‘Nbgrader’, ‘Course List’. In the list, click your course. A new JupyterLab session opens. This session belongs to a separate user account created for the course. All instructors of the corresponding LMS activity have access to this account.
In the course’s Lab session click ‘Nbgrader’, ‘Formgrader’. Usage of the formgrader GUI is described in nbgrader’s documentation.
Note
When collecting submissions with the formgrader, nbgrader will complain about possible cheating attempts in the log output due to unexpected file ownerships. This warning can be savely ignored as long as no student tries cheating ;-) The warning is caused by Ananke’s management of user accounts. Developers plan to tackle this problem in a future release.
Batch autograding#
The “Manage Submissions” page of Nbgraders Formgrader GUI shows commands for batch autgrading in a terminal. Before running those commands you have to activate the Conda environment, where Nbgrader is installed in:
conda activate jhub
The environment name always is jhub
, even if you have created local or global additional environments.
Feedback configuration#
Nbgrader provides two configuration options for feedback generation. In the course’s Lab open a terminal and run nano ~/.jupyter/nbgrader_config.py
. A console based text editor will open showing a few lines of Python code. Do not change anything here except for (un)commenting following two lines:
If
'nbgrader.preprocessors.ClearHiddenTests',
is active (not commented out), then students won’t see the code of hidden tests in their feedback files. Else you will disclose your hidden tests. Note that this option does not (!) remove output of hidden tests. Default for new courses is ‘active’.If
'nbgrader.preprocessors.Execute'
is active (not commented out), then the students’ notebooks will be reexecuted. If you have removed code of hidden tests with above option, then reexecution will remove output of hidden tests, too (including tracebacks). Whether this is a good idea depends on your test and feedback design, because reexecution will remove any outputs (feedback!) from hidden tests, too. Default for new courses is ‘inactive’.
Close the editor with Ctrl-C
, then Y
, then return
. Close the terminal by typing logout
.
Note
For unknown reasons nbgrader shows a warning Config option 'display_data_priority' not recognized by 'ClearHiddenTests'
while generating feedback. This warning can be savely ignored.
Further configuration#
To use custom delimiters for your sample solution add following lines to the formgrader user’s ~/.jupyter/nbgrader_config.py
(cf. above):
c.ClearSolutions.begin_solution_delimeter = "BEGIN MY SOLUTION"
c.ClearSolutions.end_solution_delimeter = "END MY SOLUTION"
Code cells to be filled by the student contain raise NotImplementedError
by default. You may place different code there by adding
c.ClearSolutions.code_stub = {
"python": "YOUR_DEFAULT_CODE_FOR_STUDENT_CELLS"
}
to ~/.jupyter/nbgrader_config.py
.
Kore#
The Kore service shipping with the Ananke Jupyter Distribution on the one hand sends nbgrader’s grades to the LMS. On the other hand, it provides course management functionality for nbgrader. The service can be operated via the JupyterLab extension or via the ‘Services’ tab in the Hub Control Panel.
The following functionality is provided:
Grading Scope:
- If the grading_scopes parameter is set to current
, the instructor can only send grades for the current course—specifically, the course they accessed JupyterHub from.
- If it is set to all
, the instructor can send grades for all courses in which they have access rights, providing broader control for instructors managing multiple courses.
Importing Courses, Assignments, and Problems: - Instructors can import data from both running and backed-up courses. This includes importing entire courses, specific assignments, or individual problems. - Note: When copying data (sending “to”), the extension only allows importing to running/active courses, and not to backed up courses.
Course Management: - The extension allows instructors to back up, reset, or delete any running course where they have the necessary access rights.