Skip to contents

Take a tutorial session, extract out all the submitted answers, and write out a file --- either as html, rds or pdf --- with all of those answers.

Usage

write_answers(file, session, is_test = FALSE)

Arguments

file

Location to render answers to. Output file type determined by file suffix. Acceptable values are "html", "rds" and "pdf".

session

Session object from Shiny with learnr.

is_test

TRUE/FALSE depending on whether or not we are just testing the function. Default is TRUE.

Details

We only keep track of the questions/exercises that the student has completed. So, if she only answers three questions, the resulting output will only have 6 rows (the three answers plus the header row plus the first row with tutorial info plus the last row with the time taken). The other obvious approach is to keep all the questions/exercises and leave unanswered ones as NA. Not sure if that approach is better, or even possible.

Examples

if(interactive()){
  write_answers("outfile.pdf", sess)
}