GithubHelp home page GithubHelp logo

typesarespaces / haskelltester Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sweirich/haskelltester

0.0 1.0 0.0 32 KB

Simple autograder for Haskell programming assignments

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

Shell 14.47% Haskell 59.05% Makefile 26.48%

haskelltester's Introduction

This repository contains simple scripts and utilities for creating and automatically grading Haskell assignments.

It is tailored for use with the gradescope tool: https://www.gradescope.com/ but could be adapted for other platforms.

Creating an assignment for autograding

  1. Create an assignment as normally, marking student answers with {-# SOLN #-} yyy {-# STUBWITH xxx #-}. The hstub utitlity will create a version of the file that replaces yyy with xxx.

1a. Add the following to your stack.yaml file:

  1. Create a test/Main.hs module that imports Tester from the gradescope library. Use this library to define the Problems for the assignment.
problem0 :: Problem
problem0 = 
  Problem { name = "higher-order operation on lists",
          tests = [(t0a, 3), (t0b, 3), (t0c, 3),
                   (t0d, 3), (t0e, 3)],
          style = 5,
          design = 0,
          requirements = 0,
          testcases = 0
        }

The main method of this module should look something like this:

main :: IO ()
main = testerMain [problem0, problem1, problem2, problem3, problem4]
  1. Give the stubbed versions of the source files to students, but keep your tests private. When they submit, compile their versions using your test/Main.

Setting up assignments in gradescope

  1. "Create programming assignment" in gradescope. If you are lucky you can just duplicate an existing assignment from the previous year.

  2. Set up the outline with the point values for each problem. (TODO: figure out how to automatically do this via TestMain)

  3. Zip up the assignment's TestMain.hs, gradescope library, and any other files needed for testing (see $(TESTSRC)) using a make recipe like this one.

# Recipe to construct a zipfile appropriate for testing this assignment via gradescope
# 
HW_DIR         ?= ../hw/$(HWNAME)
TESTER_DIR     ?= ../../haskelltester
GRADESCOPE_SRC ?= gradescope/src/*.hs gradescope/*.cabal gradescope/LICENSE gradescope/CHANGELOG.md
TESTER_SRC     ?= setup.sh run_autograder $(GRADESCOPE_SRC) 
GRADESCOPE_ZIP ?= $(HWNAME)_grader.zip

# Create the zipfile, replacing testerMain (works locally) with gradeScopeMain in the (works on GS) in TestMain module
#
zipfile: $(addprefix $(TESTER_DIR),$(TESTER_SRC)) $(TESTSRC) 
	if [ -a src/TestMain.hs ] ; then sed s/testerMain/gradeScopeMain/ src/TestMain.hs | sed s/TestMain/GradeScopeMain/ > src/GradeScopeMain.hs ; fi
	rm -rf $(GRADESCOPE_ZIP)
	zip $(GRADESCOPE_ZIP) $(TESTSRC) src/GradeScopeMain.hs
	(cd $(TESTER_DIR); zip $(HW_DIR)/$(GRADESCOPE_ZIP) $(TESTER_SRC))
	rm -rf src/GradeScopeMain.hs
  1. Under "configure autograder" upload the $(HWNAME)_grader.zip file (Or "Update autograder")

It takes a long time to set up the autograder as it needs to install GHC. (TODO: figure out a better way to set up gradescope so that we don't have to reinstall GHC with every tester update.)

haskelltester's People

Contributors

sweirich avatar typesarespaces avatar

Watchers

James Cloos 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.