TU-Wien-dataLAB / Grader-Service

Grader Service offers lecturers and students a well integrated teaching environment for data science, machine learning and programming classes.

Home Page:https://grader-service.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

banner

General

Documentation Status

BSD-3-Clause

GitHub commit activity

Grader Service

PyPI

PyPI - Python Version

Grader Labextension

PyPI

PyPI - Python Version

npm

Disclaimer: Grader Service is still in the early development stages. You may encounter issues while using the service.

Grader Service offers lecturers and students a well integrated teaching environment for data science, machine learning and programming classes.

Try out GraderService:

binder

Read the official documentation.

image

Requirements =========== ..

JupyterHub, JupyterLab, Python >= 3.8, pip, Node.js>=12, npm

Installation

This repository contains the packages for the jupyter extensions and the grader service itself.

The grader service has only been tested on Unix/macOS operating systems.

This repository contains all the necessary packages for a full installation of the grader service.

  • grader-service: Manages students and instructors, files, grading and multiple lectures. It can be run as a standalone containerized service and can utilize a kubernetes cluster for grading assignments. This package also contains grader-convert, a tool for converting notebooks to different formats (e.g. removing solution code, executing, etc.). It can be used as a command line tool but will mainly be called by the service. The conversion logic is based on nbgrader.
pip install grader-service
  • grader-labextension: The JupyterLab plugin for interacting with the service. Provides the UI for instructors and students and manages the local git repositories for the assignments and so on. The package is located in its own repo.
pip install grader-labextension

Installation from Source

To install this package from source, clone into the repository or download the zip file.

Local installation

In the grader directory run:

Then, navigate to the grader_labextension-directory and follow the instructions in the README file.

Development Environment

Alternatively you can run the installation scripts in examples/dev_environment. Follow the documentation there. The directory also contains the config files for a local installation.

Getting Started

Running grader service

To run the grader service you first have to register the service in JupyterHub as an unmanaged service in the config:

The api token can be generated in the jupyterhub control panel. You can verify the config by running jupyterhub -f <config_file.py> and you should see the following error message: :

Cannot connect to external service grader at http://127.0.0.1:4010. Is it running?

Specifying user roles

Since the JupyterHub is the only source of authentication for the service, it has to rely on the JupyterHub to provide all the necessary information for user groups.

Users have to be added to specific groups which maps the users to lectures and roles. They have to be separated by colons.

The config could look like this:

Here, user1 is an instructor of the lecture with the code lect1 and so on.

Starting the service

In order to start the grader service we have to provide a configuration file for it as well:

The <token> has to be the same value as the JupyterHub service token specified earlier. The grader_service_dir directory has to be an existing directory with appropriate permissions to let the grader service read and write from it.

Alternatively, you can run grader-service --generate-config -f /path/to/grader_service_config.py to generate the skeleton for the config file that show all possible configuration options.

Furthermore the database must be initialized before we can start the service. To do this navigate to the grader_service_dir that was specified and execute the following command: :

grader-service-migrate

Then the grader service can be started by specifying the config file as such: :

grader-service -f <grader_service_config.py>

When restarting the JupyterHub you should now see the following log message: :

Adding external service grader at http://127.0.0.1:4010

Do not forget to set the log level to INFO in the JupyterHub config if you want to see this message.

The last thing we have to configure is the server-side of the JupyterLab plugin which also needs information where to access the endpoints of the service. This can be done in the jupyter_server_config.py file. When using the defaults from above we do not need to explicitly configure this but it would look like this:

Using LTI3 Authenticator

In order to use the grader service with an LMS like Moodle, the groups first have to be added to the JupyterHub so the grader service gets the necessary information from the hub.

For this purpose, the LTI 1.3 Authenticator can be used so that users from the LMS can be added to the JupyterHub.

To automatically add the groups for the grader service from the LTI authenticator, the following post auth hook can be used.

Make sure that the course_id does not contain any spaces or special characters!

Optional Configuration of JupyterLab >=3.4

The grader labextension also uses the embedded cell toolbar of JupyterLab for further cell manipulation. These optional features include:

  • Run Cell: This command simply run the current cell without advancing.
  • Revert Cell: In the conversion process new metadata is set to allow students to revert every answer cell to their original state.
  • Show Hint: Students can access a hint to a task if one is specified.

To access these commands buttons have to be added to the JupyterLab cell toolbar by editing the overrides.json file. We also recommend that all other built in cell toolbar buttons should be disabled in the config because they might enable unwanted cell manipulation by students.

A sample overrides.json file could look like this:

About

Grader Service offers lecturers and students a well integrated teaching environment for data science, machine learning and programming classes.

https://grader-service.readthedocs.io/en/latest/

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 50.7%Language:Jupyter Notebook 48.6%Language:Jinja 0.4%Language:Shell 0.2%Language:Smarty 0.1%Language:Dockerfile 0.1%Language:Mako 0.0%