Uses diff command to compare expected output with student's submission output

Overview

AUTOGRADER for GRADESCOPE using diff with partial grading

Description:

Uses diff command to compare expected output with student's submission output

Utilizes partial grading for each test case

Steps for setup:

  1. Preffered start would be to have the solution to the project
  • Redirected input for the projects is assumed - Example: when run from command line: ./a.out < input1.txt
  • input1.txt consists of the input to the program
  1. These test cases are your input files that are stored in the /tests folder
  • Come up with as many test cases as you may want
  • These are to be saved in the format - input1.txt, input2.txt...
  1. For each of the specific test cases, generate the corresponding output files
  • These are to be saved in the format - output1.txt, output2.txt...
  • These are the expected output files to be tested against
  • Stored in the /tests folder
  1. makefile:
  • This is the script that compiles the uploaded cpp file and generates the executable file (exe)
  • The students MUST upload their submissions with the name 'project_test.cpp'
  1. test.bats:
  • You see test cases starting with @test
  • diff_files() is a function where the comparison happens
  • Various options for the diff command can be added here
  • For more info please do 'man diff'
  • variable 'numLines' is the number of lines in the expected output
  • variable 'testCasePoints' is the number of points for each test case (should match the number in weights.txt)
  • If each test cases has different number of lines or worth different points, these above two variables can be declared locally in each test case
  • compiletest: tests if program compiles
  • test1/2/3:
    • runs the exe with redirected input file and stores temperory ouput in testOutput.txt
    • run diff_files calls the diff_files() function with the two parameters (student's output and the expected output)
    • If the outputs do not match:
      • the for loop prints the comparison with the mismatched lines
      • the variable score calculates the partial credit for the test case
      • the \x1F is a unique character that gets parsed by the autograder.py file
  • testclean: makes sure the exe gets cleaned properly
  1. weights.txt: This file holds the breakdown of points for each test case
  2. run_autograder:
  • No changes here
  • This is the master shell script file that runs everything
  1. requirements.txt and setup.sh:
  • No changes here
  1. autograder.py:
  • main python file that grades and assigns points to give it to GradeScope for displaying
  1. The solution program need not be uploaded

Steps to configuring GradeScope:

  1. Go to your course's assignments page
  2. Click on 'Create Assignment' and select 'Programming Assignment'
  3. Fill out the information in the next page and create the assignment
  4. Once created, in the 'Configure AutoGrader' tab on the left:
  • Upload a zip file of all the files from the setup
  • The files need to be zipped directly and should not be one level deep inside a folder
  1. After uploading, click on 'Update Autograder'
  • This might take a couple of mins

You can test the autograder by uploading your solution. You can debug each student's submission by using the debug via ssh button in each student's submission page

Acknowlegments:

  • Aditya Narasimhan
  • Gregory Madra
  • Sanjana Mudduluru
  • Sudhindra Gopal Krishna
  • Monique Shotande

Reference:

https://bats-core.readthedocs.io/en/stable/tutorial.html

Copyright © 2022 adinaras

A comprehensive and FREE Online Python Development tutorial going step-by-step into the world of Python.

FREE Reverse Engineering Self-Study Course HERE Fundamental Python The book and code repo for the FREE Fundamental Python book by Kevin Thomas. FREE B

Kevin Thomas 7 Mar 19, 2022
Generating a report CSV and send it to an email - Python / Django Rest Framework

Generating a report in CSV format and sending it to a email How to start project. Create a folder in your machine Create a virtual environment python3

alexandre Lopes 1 Jan 17, 2022
charcade is a string manipulation library that can animate, color, and bruteforce strings

charcade charcade is a string manipulation library that can animate, color, and bruteforce strings. Features Animating text for CLI applications with

Aaron 8 May 23, 2022
Version bêta d'un système pour suivre les prix des livres chez Books to Scrape,

Version bêta d'un système pour suivre les prix des livres chez Books to Scrape, un revendeur de livres en ligne. En pratique, dans cette version bêta, le programme n'effectuera pas une véritable surv

Mouhamed Dia 1 Jan 06, 2022
Contains the assignments from the course Building a Modern Computer from First Principles: From Nand to Tetris.

Contains the assignments from the course Building a Modern Computer from First Principles: From Nand to Tetris.

Matheus Rodrigues 1 Jan 20, 2022
DataAnalysis: Some data analysis projects in charles_pikachu

DataAnalysis DataAnalysis: Some data analysis projects in charles_pikachu You can star this repository to keep track of the project if it's helpful fo

9 Nov 04, 2022
The Python Dict that's better than heroin.

addict addict is a Python module that gives you dictionaries whose values are both gettable and settable using attributes, in addition to standard ite

Mats Julian Olsen 2.3k Dec 22, 2022
Demonstration that AWS IAM policy evaluation docs are incorrect

The flowchart from the AWS IAM policy evaluation documentation page, as of 2021-09-12, and dating back to at least 2018-12-27, is the following: The f

Ben Kehoe 15 Oct 21, 2022
Gtech μLearn Sample_bot

Ser_bot Gtech μLearn Sample_bot Do Greet a newly joined member in a channel (random message) While adding a reaction to a message send a message to a

Jerin Paul 1 Jan 19, 2022
A course-planning, course-map rendering and GPA-calculation web service, designed for the SFU (Simon Fraser University) student.

SFU Course Planner What is the overall goal of the project (i.e. what does it do, or what problem is it solving)? As the title suggests, this project

Ash Peng 1 Oct 21, 2021
An ongoing curated list of OS X best applications, libraries, frameworks and tools to help developers set up their macOS Laptop.

macOS Development Setup Welcome to MacOS Local Development & Setup. An ongoing curated list of OS X best applications, libraries, frameworks and tools

Paul Veillard 3 Apr 03, 2022
The source code that powers readthedocs.org

Welcome to Read the Docs Purpose Read the Docs hosts documentation for the open source community. It supports Sphinx docs written with reStructuredTex

Read the Docs 7.4k Dec 25, 2022
Get link preview of a website.

Preview Link You may have seen a preview of a link with a title, image, domain, and description when you share a link on social media. This preview ha

SREEHARI K.V 8 Jan 08, 2023
Automatic links from code examples to reference documentation

sphinx-codeautolink Automatic links from Python code examples to reference documentation at the flick of a switch! sphinx-codeautolink analyses the co

Felix Hildén 41 Dec 17, 2022
A Json Schema Generator

JSON Schema Generator Author : Eru Michael About A Json Schema Generator. This is a generic program that: Reads a JSON file similar to what's present

1 Nov 10, 2021
Mayan EDMS is a document management system.

Mayan EDMS is a document management system. Its main purpose is to store, introspect, and categorize files, with a strong emphasis on preserving the contextual and business information of documents.

3 Oct 02, 2021
Data-Scrapping SEO - the project uses various data scrapping and Google autocompletes API tools to provide relevant points of different keywords so that search engines can be optimized

Data-Scrapping SEO - the project uses various data scrapping and Google autocompletes API tools to provide relevant points of different keywords so that search engines can be optimized; as this infor

Vibhav Kumar Dixit 2 Jul 18, 2022
Template repo to quickly make a tested and documented GitHub action in Python with Poetry

Python + Poetry GitHub Action Template Getting started from the template Rename the src/action_python_poetry package. Globally replace instances of ac

Kevin Duff 89 Dec 25, 2022
Main repository for the Sphinx documentation builder

Sphinx Sphinx is a tool that makes it easy to create intelligent and beautiful documentation for Python projects (or other documents consisting of mul

5.1k Jan 04, 2023
Python syntax highlighted Markdown doctest.

phmdoctest 1.3.0 Introduction Python syntax highlighted Markdown doctest Command line program and Python library to test Python syntax highlighted cod

Mark Taylor 16 Aug 09, 2022