gradeR

The goal of gradeR is to help grade bunches of R script assignment submissions. This package has one function called calcGrades(), and much of the testing functionality is taken from the testthat package.

Installation

You can install the released version of gradeR from CRAN with:

install.packages("gradeR")

You can install the development version of gradeR from with:

# install.packages("devtools")
devtools::install_github("tbrown122387/gradeR")

Example

This is a basic overview which shows you how to grade a bunch of assignment submissions. Make sure to change the paths to ones that actually exist on your machine. For more details on this example, see the vignette.

# load in the package
library(gradeR)

# this is the directory with all of the student submissions
submissionDir <- "../submissions/"

# get the grades
grades <- calcGrades(submission_dir = submissionDir, 
                     your_test_file = "~/your/path/assignment1_test_file.r")

The directory of the first argument will be walked recursively, and any file ending in a .R or .r will be sourced and tested using the tests in the assignment1_grading_file.r.

The file with the tests is specified in the second argument. This is a file you must create on your own. For more information on how to write testthat tests, see this.

It might be beneficial to recommend that your students: