MyNixOS website logo
Description

Helps Grade Assignment Submissions that are R Scripts.

After being given the location of your students' submissions and a test file, the function runs each .R file, and evaluates the results from all the given tests. Results are neatly returned in a data frame that has a row for each student, and a column for each test.

gradeR

The goal of gradeR is to help grade bunches of R script assignment submissions. This package has two primary functions called calcGrades() and calcGradesForGradescope, 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 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:

  • clear out their workspace and source their .R submissions before submitting them. This makes sure everything runs as expected (at least on their machine).
  • to not rename files that are read in as data, or change any raw data files on their hard drives. If they forget to abide by this rule, you will have to edit their submission and rename file names in their script.
  • to not use global file paths (have them interactively use setwd(), and then read in files using only their name). If they forget to do this, then you will need to change all of the global paths to local paths on their machine.

Contributing

Please see CONTRIBUTING.md for more information on how you can contribute to this project!

Metadata

Version

1.0.10

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows