Learn R Programming

ghclass (version 0.4.0)

org_grade_assignment: Setup grading for an assignment

Description

This is a higher level function that automates the common steps for setting up grading of an assignment:

  • Find repos matching a filter pattern in an organization

  • Clone all matched repos locally

  • Download GitHub Actions artifacts (e.g. rendered html, md files)

  • Report any missing artifacts

  • Create comment template files for each repo

Usage

org_grade_assignment(
  path,
  org,
  repo_filter,
  artifacts = character(),
  comment_template = "",
  key_repo = NULL
)

Value

An invisible list containing:

  • repos — character vector of matched repo addresses

  • cloned — result from local_repo_clone()

  • artifacts — named list of results from each action_artifact_download() call

  • comments — character vector of comment file paths created

  • key — result from cloning the key repo (if provided)

Arguments

path

Character. Root directory for the grading folder (created if it doesn't exist).

org

Character. Name of the GitHub organization.

repo_filter

Character. Regex pattern passed to org_repos()'s filter argument to select repos (e.g. "hw01_").

artifacts

Named character vector. Names are subfolder names, values are regex patterns passed as filter to action_artifact_download() (matched against artifact names). E.g. c("html" = "html-output", "report" = "pdf-report").

comment_template

Character. Template text used to populate each comment markdown file. Defaults to "".

key_repo

Character. Optional repository address in owner/name format to clone into the root of the grading folder as an answer key.