Skip to content

Score report functionality#51

Merged
tbrown122387 merged 10 commits intotbrown122387:masterfrom
pebenbow:master
Jan 19, 2026
Merged

Score report functionality#51
tbrown122387 merged 10 commits intotbrown122387:masterfrom
pebenbow:master

Conversation

@pebenbow
Copy link
Copy Markdown
Contributor

@pebenbow pebenbow commented Jan 19, 2026

In response to issue #14 , I have added a new function, getTestScriptReport, which accepts a given test script as an argument. It parses the test cases, counts them up and sums their point values, and generates a formatted report (seen below) that summarizes the test script.

This should be useful for auditing test scripts and quickly counting tests/points when configuring an autograder.

SIDE NOTE: Apologies for the convoluted commit history. I accidentally forgot to pull changes from tbrown122387:master before I began my work on this, so I had to go back, revert my commits, rebase from master, and reapply everything.

> report <- getTestScriptReport("scratch/lab0_tests.r")
==============================================================
TEST SCRIPT ANALYSIS REPORT
==============================================================

Script: scratch/lab0_tests.r

SUMMARY:
  Total test_that calls: 3
  Total criteria: 5
  Total points: 7

EXPECT_ FUNCTION USAGE:
  expect_equal: 3
  expect_true: 2

TEST DETAILS:
  Test 1: Create a vector with integers 1,2,3 (visible)
    Criteria: 1
    Points: 1
  Test 2: Create a character variable that says hey to Laurie (visible)
    Criteria: 2
    Points: 2
  Test 3: Dataframe has 32 rows and 11 columns (visible)
    Criteria: 2
    Points: 4

==============================================================

pebenbow and others added 10 commits January 16, 2026 16:31
…criteria, and point values for a given test script"

This reverts commit 7eace0d.
…ow supports other file types besides R scripts"

This reverts commit 00da302.
…of giving gradeR users a quick and easy way to determine how many test cases and criteria their test scripts contain, and what the overall point values are.
… test file and produces a score report that instructors can use to determine max possible points when configuring their autograder assignments
… as the new feature for generating score reports from test scripts
@tbrown122387
Copy link
Copy Markdown
Owner

Awesome, this looks great!

@tbrown122387 tbrown122387 merged commit 25a3696 into tbrown122387:master Jan 19, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants