Skip to content

The auto solution checking system for YSDA; server, storing grades and managing deadlines

Notifications You must be signed in to change notification settings

manytask/manytask

Repository files navigation

manytask

Test Publish codecov github docker

Small web application for managing courses: store students' grades, maintain deadlines, provide scoreboard etc.


How it works

In a nutshell, manytask is a wrapper around google sheets (as database, storing students' scores) and some bunch of functions to interact with gitlab.

The full manytask setup roughly looks as follows

  • google sheet - in readable format, store students' scores/grades
  • self-hosted gitlab instance - storing repos with assignments and students' repo
    • private repo - a repository with tasks, public and private tests, gold solutions, ect.
    • public repo - a repository available to students with tasks and solution templates
    • students' group - the group where manytask will create repositories for students
      each students' repo - fork from public repo
  • gitlab runners - place where students' solutions likely to be tested
  • checker script - some script to test students' solutions and push scores/grades to the manytask
  • manytask instance - web application managing students' grades (in google sheet) and deadlines (web page)

So the main aims of manytask:

  • Store and manage students' grades (store, provide, show, edit, ect)
  • Show web page with grades and deadlines for student
  • Manage users and repositories creation

Functions for which manytask is NOT intended:

  • Test students' solutions
  • Be language/course specific

So basically, manytask will store and display grades for you, but not test solutions' correctness in any way.


Setup

Debug and development

  1. Clone repo
git clone https://github.com/yandexdataschool/manytask
  1. Create .env file with dev environment
cp .env.example .env
  1. Generate credentials for accessing google spreadsheets API (for this test table)
    1. Follow the steps described in this article
    2. Base64 encode the created JSON key (using tools online, base64 lib in python, or btoa function in the browser)
    3. Put it in the .env file by GDOC_ACCOUNT_CREDENTIALS_BASE64 key

Production

Please refer to the system setup documentation.

Run application

Debug and development

First you need to create .env file with debug environment

Local (manytask only)

Create new venv and install requirements

python -m venv .venv
source .venv/bin/activate
python -m pip install -U -r requirements.txt

Run it

FLASK_DEBUG=1 FLASK_APP="manytask:create_app()" python -m flask run --host=0.0.0.0 --port=5050 --reload --without-threads

So, now it's available at localhost:5050

Docker (manytask only)

docker build --tag manytask .
docker rm manytask || true
docker run \
    --name manytask \
    --restart always \
    --publish "5050:5050" \
    --env-file .env \
    --env FLASK_DEBUG=1 \
    manytask:latest

So, now it's available at localhost:5050

Docker-compose (manytask only)

docker-compose -f docker-compose.development.yml up --build

So, now it's available at localhost:5050

Production

Please, refer to the production documentation.

API and Testing Script Interface

Checker script

There is already implemented python lib yandexdataschool/checker for testing students' solutions with manytask integration.
The basic idea: checker is a script running in a gitlab-ci that performs students' solutions testing and call manytask api to set scores achieved; More info in the yandexdataschool/checker repo;

Custom script

However, you can implement your own checker just following manytask api:

  • All the endpoints require Authorization: Bearer <token> or Authorization: <token> (deprecated) header contain TESTER_TOKEN, to validate it's authorized checker.
  • Or, alternatively, being admin (session with admin field)
method api endpoint description required in body optional in body return
POST /api/report set student's score (optionally save source code) task, username, user_id (deprecated), score (if None - max score) check_deadline, submit_time (%Y-%m-%d %H:%M:%S%z), commit_time (deprecated), multipart/form-data source files user_id, username, task, score, commit_time, submit_time
GET /api/score get student's score task, username, user_id (deprecated) - user_id, username, task, score
POST /api/update_config update course to sent config *config yaml file* (see examples) - -
POST /api/update_cache update cached scores for all users - - -
GET /api/solutions get all solutions for the task task - zip archive file with solutions

Please refer yandexdataschool/checker repo for instructions and tips

Additional information

Originally was developed at gitlab as shad-ts by Fedor Korotkiy for Yandex School of Data Analysis

Acknowledgment

  • Fedor Korotkiy - development of the very first version, 2017-2018
  • Ilariia_Belova - updates for python course, 2018
  • Vadim Mazaev - updates for python course, 2019-2020
  • Nikita Bondartsev - minor updates for python course, 2020-2021
  • Konstantin Chernyshev - updates for python course, massive refactor and moving to github, 2020-2024

About

The auto solution checking system for YSDA; server, storing grades and managing deadlines

Resources

Code of conduct

Stars

Watchers

Forks

Packages

No packages published