Code Monkey home page Code Monkey logo

autograder-full-stack's Introduction

This repository contains Docker and other configuration files needed to run and deploy the autograder system.

Dev Setup

See this tutorial.

Swarm Production Setup

See this tutorial.

Single-server Production Setup

See this tutorial.

Other Recipes and Things to Know

Useful scripts

A variety of scripts that use the web API can be found at https://github.com/eecs-autograder/autograder-contrib and https://gitlab.eecs.umich.edu/akamil/autograder-tools.

  • IMPORTANT: Make sure to use the correct URL for your deployment. In the former set of scripts, this is configurable with command-line arguments. In the latter, you may need to modify the source code.

Giving a user permission to create courses

Run the following in a django shell (docker exec -it ag-django python3 manage.py shell):

from django.contrib.auth.models import User, Permission
# UPDATE the email address
user = User.objects.get(username='@umich.edu')
user.user_permissions.add(Permission.objects.get(codename='create_course'))

Submissions not being processed for one project

This issue is difficult to reproduce, so we're uncertain as to whether it has been fixed. Occasionally a new project won't be correctly registered with the grading workers, and so submissions won't get past "queued" status. To manually register the project, run the following in a django shell:

from autograder.grading_tasks.tasks import register_project_queues
# UPDATE the project_pks list. The project primary key can be found in the url when viewing the project on the website.
register_project_queues(project_pks=[339])

Submission(s) stuck at "being graded" status

Sometimes a power bump can prevent grading tasks from finishing. Run the following in a django shell to restart the grading process for a student's submission:

from autograder.core.models import *
from django.contrib.auth.models import User

# UPDATE the email address
student = User.objects.get(username='<email address>')
# UPDATE the project pk
stuck = student.groups_is_member_of.get(project=<project_pk>).submissions.filter(status=Submission.GradingStatus.being_graded)

print(len(stuck))  # Should be no more than 1

for submission in stuck:
  submission.status = Submission.GradingStatus.received
  submission.save()

Creating a Custom API Token

To create a custom api token, run the following in a django shell:

from django.contrib.auth.models import User
from rest_framework.authtoken.models import Token

# Replace <username> with whatever you want.
user = User.objects.create(username='<username>@autograder.io')
token, created = Token.objects.get_or_create(user=user)
# If that username is taken, try another one.
assert created

# Securely share this token with whomever needs it.
print(token)

Add the username (<username>@autograder.io) to the appropriate roster for your course to give the token user the permissions it needs.

autograder-full-stack's People

Contributors

james-perretta avatar lukefahr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.