No description
  • TypeScript 87.3%
  • Nix 7.4%
  • Shell 3%
  • JavaScript 2.1%
  • Pyret 0.2%
Find a file
IRONM00N 9b00b37ddc
Squashed commit of the following:
commit da36ee284555359f6aaa793127f819bab84a9e4e
Author: Jonathan Bell <jon@jonbell.net>
Date:   Tue Aug 26 22:00:40 2025 -0400

    retry

commit 0afbf9923816408d5a824b88436a1c090dd3f79e
Author: Jonathan Bell <jon@jonbell.net>
Date:   Tue Aug 26 21:33:23 2025 -0400

    retry

commit 4bd96597d9fc4709184bbdacc4d4e3f9a50887fa
Author: Jonathan Bell <jon@jonbell.net>
Date:   Tue Aug 26 20:28:03 2025 -0400

    tidy

commit c9ace8a5ecc04c9aaf2589eb9bf773d165fe9120
Author: Jonathan Bell <jon@jonbell.net>
Date:   Tue Aug 26 19:56:17 2025 -0400

    Debug flag

commit c3fe5ab8447898d394af8043424dc887df2193f0
Author: Jonathan Bell <jon@jonbell.net>
Date:   Sun Aug 10 19:55:18 2025 -0400

    fix... feat: deprecate handout_repo input and add automatic handout detection

commit 9f20bf2e59688790ffe0ef8e49f0b20845f85b42
Author: Jonathan Bell <jon@jonbell.net>
Date:   Sun Aug 10 19:46:41 2025 -0400

    feat: deprecate handout_repo input and add automatic handout detection

commit d958e04e91
Author: Smaran Teja <84965962+Smaran-Teja@users.noreply.github.com>
Date:   Fri Aug 8 19:30:22 2025 -0400

    Alternative mutation testing specification (#17)

    * linear grading, line numbers not required

    * bundle

    * add prompt and shortname to MutantResult

    * bundle

    * tweaks

    * bundle

    * remove log, mutation breakpoint output text, bundle

    * move **

    * remove mutantAdvice in yml, combine points and total_faults into linearScoring in MutationTestUnit yml specification

    * bundle, remove mutantAdvice usages

commit a16c89329f
Merge: 2262bd3 b12646a
Author: Jonathan Bell <jon@jonbell.net>
Date:   Thu Aug 7 21:58:43 2025 -0400

    Merge branch 'version3'

commit b12646a19e
Author: Jonathan Bell <jon@jonbell.net>
Date:   Tue Jul 29 09:26:47 2025 -0400

    Use nodejs native zip instead of relying on presence of 'zip' command

commit 3f4c9cd54b
Author: Jonathan Bell <jon@jonbell.net>
Date:   Tue Jul 29 09:16:16 2025 -0400

    Improve artifact handling for mutation reports

commit eb774cd031
Author: Jonathan Bell <jon@jonbell.net>
Date:   Tue Jul 29 07:52:54 2025 -0400

    Option to run mutation on student implementation

commit ca8660d031
Author: Jonathan Bell <jon@jonbell.net>
Date:   Mon Jul 28 13:03:09 2025 -0400

    debugging :(

commit 244dc924bf
Author: Jonathan Bell <jon@jonbell.net>
Date:   Mon Jul 28 12:47:33 2025 -0400

    ignore non-zero return from lint

commit 3a539de1ac
Author: Jonathan Bell <jon@jonbell.net>
Date:   Mon Jul 28 12:42:58 2025 -0400

    ignore non-zero return from lint

commit 77cb0e6dc7
Author: Jonathan Bell <jon@jonbell.net>
Date:   Mon Jul 28 12:33:57 2025 -0400

    ignore non-zero return from lint

commit c97ed933e3
Author: Jonathan Bell <jon@jonbell.net>
Date:   Mon Jul 28 12:31:23 2025 -0400

    ignore non-zero return from lint

commit f682ed9775
Author: Jonathan Bell <jon@jonbell.net>
Date:   Mon Jul 28 12:27:40 2025 -0400

    ignore gradle lint return code

commit f4d5fc9a98
Author: Jonathan Bell <jon@jonbell.net>
Date:   Mon Jul 28 12:08:49 2025 -0400

    Don't show fault coverage report if there are no mutantadvice provided

commit 8c369b0e08
Author: Jonathan Bell <jon@jonbell.net>
Date:   Mon Jul 28 09:54:31 2025 -0400

    Add script to generate pawtograder schema, include the generated schema in repo
2025-09-07 07:26:41 -04:00
.devcontainer Initial commit 2025-01-26 21:25:20 -05:00
.github rm dist 2025-09-05 05:09:26 -04:00
.vscode migrate error handling 2025-04-05 17:00:50 -04:00
__fixtures__ Initial commit 2025-01-26 21:25:20 -05:00
__tests__ . 2025-01-28 20:25:26 -05:00
badges Initial commit 2025-01-26 21:25:20 -05:00
dist/grading/builders Squashed commit of the following: 2025-09-07 07:26:41 -04:00
nix patch dcic2024 to use new graphs library so it can run headlessly 2025-09-05 05:11:13 -04:00
pyret communicate over fd3; temporary std{out, err} logging 2025-09-05 05:13:10 -04:00
script Initial commit 2025-01-26 21:25:20 -05:00
src Squashed commit of the following: 2025-09-07 07:26:41 -04:00
.env.example Initial commit 2025-01-26 21:25:20 -05:00
.envrc core functionality for pyret autograder 2025-09-05 05:09:26 -04:00
.gitattributes Initial commit 2025-01-26 21:25:20 -05:00
.gitignore completely switch to nix 👀 2025-09-05 05:09:26 -04:00
.markdown-lint.yml Initial commit 2025-01-26 21:25:20 -05:00
.node-version use pyret-autograder's tools 2025-09-05 05:09:26 -04:00
.npmignore Migrate API calls to use supabase edge functions 2025-04-03 11:10:38 -04:00
.prettierignore core functionality for pyret autograder 2025-09-05 05:09:26 -04:00
.prettierrc.yml Initial commit 2025-01-26 21:25:20 -05:00
.yaml-lint.yml Initial commit 2025-01-26 21:25:20 -05:00
action.yml Squashed commit of the following: 2025-09-07 07:26:41 -04:00
CODEOWNERS Initial commit 2025-01-26 21:25:20 -05:00
eslint.config.mjs core functionality for pyret autograder 2025-09-05 05:09:26 -04:00
flake.lock bump; improve flake 2025-09-05 05:13:10 -04:00
flake.nix Squashed commit of the following: 2025-09-07 07:26:41 -04:00
jest.config.js Initial commit 2025-01-26 21:25:20 -05:00
LICENSE Add README, update license 2025-04-23 20:16:31 -04:00
openapi-codegen.config.ts . 2025-01-28 20:25:26 -05:00
package-lock.json Squashed commit of the following: 2025-09-07 07:26:41 -04:00
package.json Squashed commit of the following: 2025-09-07 07:26:41 -04:00
pawtograder.schema.json Squashed commit of the following: 2025-09-07 07:26:41 -04:00
README.md Python builder (#11) 2025-06-30 20:10:50 -04:00
rollup.config.ts hopefully fix path issue 2025-09-05 05:11:13 -04:00
tsconfig.base.json Initial commit 2025-01-26 21:25:20 -05:00
tsconfig.eslint.json Initial commit 2025-01-26 21:25:20 -05:00
tsconfig.json Initial commit 2025-01-26 21:25:20 -05:00

Pawtograder Assignment Action

Grading Overview

This action works closely with the Pawtograder project. It invokes two key Pawtograder Edge Functions, as shown below:

sequenceDiagram
    participant A as Action
    participant CS as autograder-create-submission
    participant SF as autograder-submit-feedback
    A->>CS: Register Submission
    CS->>A: Submission ID and private grader URL
    A->>SF: Submit grader results, tests and output
    SF->>A: Confirmation

GitHub provides the action with an OIDC token, which the autograder-create-submission function uses to authenticate that the commit is coming from a known repository. It performs other security checks, registers a submission, and returns a one-time URL to download the private grader (the grader repository that is configured for the assignment).

Within the action, the Grader class is responsible for executing the grading process, utilizing the pawtograder.yml configuration file in the grader repository. This configuration file implements the PawtograderConfig interface (see src/grader/types.ts).

Upon completion of the grading process, the autograder-submit-feedback function is called with grading results, again relying on the GitHub OIDC token to authenticate.

Development tips

Run the grader locally

To test changes to the grader, you can run it locally without invoking GitHub Actions or interfacing with Pawtograder at all:

npx tsimp src/grading/main.ts -s /full/path/to/solution/repo -u /full/path/to/submission/repo

Note: Be sure to use full paths from the root of your computer for the solution and submission repos (avoid relative pathing)

A significant amount of output will be printed to the console, including a pretty-printed JSON object with the results of the grading that would be passed along to Pawtograder.

Every time you run the action, solution/student files get copied into a temporary pawtograder-grading/ directory. This directory persists after runs for debugging purposes. Be sure to delete this directory after each run or else you may face a EACCES copyfile error or get weird results with nested folders.

Transpile before pushing

GitHub Actions will only run JS, so we need to transpile before pushing:

npm run bundle

The CI workflow will fail if the dist/ directory does not match what is expected from the build.

About the configuration file

The pawtograder.yml file is used to configure the autograder, and defines the way to build the project and run the tests. This file is parsed by the pawtograder/assignment-action to grade student code. That action abstracts the details of building a project, linting it, grading unit tests, and even running a mutation analysis on the student's tests. It also handles parsing output from those tests and analyses.

The action takes the files that match the names and/or glob patterns in submissionFiles.files and copies them into the corresponding location in the solution repository. Then, it runs the tests defined in the solution repository. If you collect students' tests, you must define them in the submissionFiles.testFiles section - this way you don't need to worry about whether or not a student's test can overwrite one of yours (and we can do mutation and other analyses on the test files).

About the grading specification

The gradedParts section defines the parts of the assignment that are graded. Each part has a name, and a list of units that are graded. Parts can be used to seggregate functionality by multiple checkpoints of an assignment (e.g. show "Part 1" tests all in one visual group with a part-level score, then show "Part 2" tests and so on). A Part can also be set to hide_until_released to prevent students from seeing the output or score of tests in this part until their submission is graded and released.

gradedUnits defines the units that are graded for a part, this is the lowest level of granularity that can be graded. There are two kinds of gradedUnit:

  • Regular test units are used for traditional test cases with point values. They have a name (displayed to students), a point value, and an array of test names. For JUnit, names are matched as prefixes of the test name using the Fully.Qualified.ClassName.testMethod pattern. Note that because it's both extremely convenient to specify many tests using a prefix and easy to mess up the points, you need to speciy the number of tests you expect to run. By default, points are only awarded if all tests are run and pass, or use allow_partial_credit: true to award points*(Passed/Total) points.
  • Mutation test units are used for grading mutation analysis of student tests. Each Mutation test unit has a name, a list of locations (in the solution code) to expect mutants to be detected by students' tests (format: "file.name:lineStart-lineEnd"), and a list of scoring breakpoints. Breakpoints define the number of points to award based on the number of mutants detected within the specified locations, and are objects with keys minimumMutantsDetected and pointsToAward.