Giter Club home page Giter Club logo

mbgrader's Introduction

mbgrader

mbgrader (math batch grader) is a custom web application for batch grading assignments where students submit numbers and matrices as .csv files, or text in .txt files.

Requirements

flask=1.1.1
flask-sqlalchemy=2.4.0
numpy=1.16.4
pandas=0.25.1
python=3.7.4
sqlalchemy=1.3.7
sqlite=3.29.0

Quickstart

Setup the database:

python init_db.py

Setup the Flask environment variable and run:

export FLASK_APP=app
flask run

Open a browser and navigate to http://127.0.0.1:5000/. Create a new assignment by entering the corresponding folder name locating in the submissions folder. There is an example assignment called example1. mbgrader assumes the folder structure:

submissions/
    assignment_name/
        student_id_1/
            var1.csv
            var2.csv
            var3.txt
        student_id_2/
            var1.csv
            var2.csv
            var3.txt

Create a new question and enter a preprocessing function if necessary. Requirements for the preprocessing function are:

  • Function must be named fun.
  • Input parameters:
    • s is the student number: int
    • r is the response: str, np.float64, or np.ndarray
  • Return value must be the same type as the response.

For example, the preprocessing function for the question "What is your student number?":

import numpy as np

def fun(s,r):
    if isinstance(r,str):
        return "text"
    elif isinstance(r,np.ndarray):
        return np.array([0,0])
    else:
        if abs(r - s) > 0:
            return np.float64(1)
        else:
            return np.float64(0)

Create a new response from student responses by entering:

  • New response variable name
  • Comma-separated list of variables used to compute new response
  • lambda to compute new variable where input is a list and entries are the selected variables
  • Extension to indicate datatype

Canvas

The script canvas2mbgrader.m reads MATLAB .mat and .fig files from the canvas folder and saves the data to the submissions folder. The script requires a file canvasIdstudentID.csv with Canvas IDs in the first column and Student IDs in the second column.

Uploading feedback

The script mbgrader2canvas.py reads the grades and feedback produced by mbgrader and submits it to Canvas. To do this, it will need a token from Canvas; you can generate a token from Canvas by going to 'Account', 'Settings', and clicking 'New Access Token'. This token needs to be stored in the top of the mbgrader directory in the file 'token.txt'. When running this script, it will request the Canvas Course ID, the Canvas Assignment ID, and the Assignment Name. The Canvas IDs can be obtained from the URL of the assignment submission page, e.g. https://canvas.ubc.ca/courses/12345/assignments/9876543 has a course ID of 12345 and an assignment ID of 9876543. The Assignment Name is what you called the assignment in mbgrader.

mbgrader's People

Contributors

patrickwalls avatar mfdeakin 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.