Writes raw attempts, observed-attempt scores, or gradebook rows to a CSV file using
readr::write_csv().
Usage
export_results(
con,
path,
type = c("attempts", "scores", "gradebook"),
tutorial_id = NULL,
rule = "last",
include_unregistered = TRUE
)Arguments
- con
A DBI connection.
- path
Output CSV path.
- type
Export type. Use
"attempts"for raw attempts,"scores"for observed-attempt scores, or"gradebook"for scores based on registered expected questions.- tutorial_id
Optional tutorial identifier.
- rule
Scoring rule used when
type = "scores".- include_unregistered
If
TRUE, gradebook exports include attempted questions that were not registered withregister_questions().
Examples
db_path <- tempfile(fileext = ".sqlite")
csv_path <- tempfile(fileext = ".csv")
con <- init_tracking_db(db_path, overwrite = TRUE)
track_attempt(con, "student_001", "module_01", "q1", "mean(x)", score = 1, max_score = 1)
export_results(con, csv_path, type = "attempts")
DBI::dbDisconnect(con)