Builds one row per student with gradebook metrics, attempt counts, last activity, registered metadata, and a simple status.
Usage
summarise_students(
con,
tutorial_id,
rule = c("last", "best", "first"),
include_unregistered = TRUE,
group_id = NULL
)Arguments
- con
A DBI connection.
- tutorial_id
Tutorial identifier. Required.
- rule
Scoring rule used to select one attempt per student and question.
- include_unregistered
If
TRUE, include attempted questions not registered withregister_questions().- group_id
Optional registered student group identifier. If supplied, only attempts from students in that group are included.
Examples
db_path <- tempfile(fileext = ".sqlite")
con <- init_tracking_db(db_path, overwrite = TRUE)
register_students(con, "student_001")
#> # A tibble: 1 × 5
#> student_id student_label email group_id created_at
#> <chr> <chr> <chr> <chr> <chr>
#> 1 student_001 student_001 NA NA 2026-06-24T12:25:20Z
register_questions(con, "module_01", c("q1", "q2"))
#> # A tibble: 2 × 6
#> question_id tutorial_id question_label question_type max_score created_at
#> <chr> <chr> <chr> <chr> <dbl> <chr>
#> 1 q1 module_01 q1 NA 1 2026-06-24T12:…
#> 2 q2 module_01 q2 NA 1 2026-06-24T12:…
track_attempt(con, "student_001", "module_01", "q1", "mean(x)", score = 1, max_score = 1)
summarise_students(con, "module_01")
#> # A tibble: 1 × 15
#> student_id student_label email group_id tutorial_id score max_score percent
#> <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl>
#> 1 student_001 student_001 NA NA module_01 1 2 50
#> # ℹ 7 more variables: n_questions <int>, n_answered <int>, n_unanswered <int>,
#> # completed <lgl>, n_attempts <int>, last_activity <chr>, status <chr>
DBI::dbDisconnect(con)