write_answers {tutorial.helpers} | R Documentation |
Write tutorial answers to file
Description
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 |
is_test |
|
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)
}