Skip to contents

Reads attempts from the tracking database, with optional filters by student, tutorial, and question. Results are ordered by timestamp and then attempt id.

Usage

get_attempts(con, student_id = NULL, tutorial_id = NULL, question_id = NULL)

Arguments

con

A DBI connection.

student_id

Optional student identifier.

tutorial_id

Optional tutorial identifier.

question_id

Optional question identifier.

Value

A tibble of recorded attempts.

Examples

db_path <- tempfile(fileext = ".sqlite")
con <- init_tracking_db(db_path, overwrite = TRUE)
track_attempt(con, "student_001", "module_01", "q1", "mean(x)")
get_attempts(con)
#> # A tibble: 1 × 12
#>   attempt_id session_id        student_id tutorial_id question_id attempt_number
#>        <int> <chr>             <chr>      <chr>       <chr>                <int>
#> 1          1 session_student_… student_0… module_01   q1                       1
#> # ℹ 6 more variables: submitted_answer <chr>, grade_status <chr>, score <dbl>,
#> #   max_score <dbl>, feedback <chr>, timestamp <chr>
DBI::dbDisconnect(con)