Skip to contents

Builds one row per question with attempt counts, answer counts, mean score, mean percent, and full-credit rate. Registered questions with no attempts are included.

Usage

summarise_questions(
  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 with register_questions().

group_id

Optional registered student group identifier. If supplied, only attempts from students in that group are included.

Value

A tibble with question-level pedagogical summary metrics.

Examples

db_path <- tempfile(fileext = ".sqlite")
con <- init_tracking_db(db_path, overwrite = TRUE)
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_questions(con, "module_01")
#> # A tibble: 2 × 14
#>   tutorial_id question_id question_label question_type max_score
#>   <chr>       <chr>       <chr>          <chr>             <dbl>
#> 1 module_01   q1          q1             NA                    1
#> 2 module_01   q2          q2             NA                    1
#> # ℹ 9 more variables: n_possible_students <int>, n_students <int>,
#> #   n_attempts <int>, n_answered <int>, n_full_credit <int>, mean_score <dbl>,
#> #   mean_percent <dbl>, full_credit_rate <dbl>, mean_attempts_per_student <dbl>
DBI::dbDisconnect(con)