format_quiz: Formatting and printing quizzes, questions, and answers

Description Usage Arguments See Also Examples

Description

Notes:

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## S3 method for class 'tutorial_question_answer'
format(x, ..., spacing = "")

## S3 method for class 'tutorial_question'
format(x, ..., spacing = "")

## S3 method for class 'tutorial_quiz'
format(x, ...)

## S3 method for class 'tutorial_question'
print(x, ...)

## S3 method for class 'tutorial_question_answer'
print(x, ...)

## S3 method for class 'tutorial_quiz'
print(x, ...)

Arguments

x

object of interest

...

ignored

spacing

Text to be placed at the beginning of each new line

See Also

quiz, question, answer

Examples

1
2
3
4
5
6
7
8
9
ex_question <- question("What number is the letter A in the alphabet?",
  answer("8"),
  answer("14"),
  answer("1", correct = TRUE),
  answer("23"),
  incorrect = "See [here](https://en.wikipedia.org/wiki/English_alphabet) and try again.",
  allow_retry = TRUE
)
cat(format(ex_question), "\n")

Example output

What number is the letter A in the alphabet?                                        , 8                                                                                   , FALSE                                                                               , 14                                                                                  , FALSE                                                                               , 1                                                                                   , TRUE                                                                                , 23                                                                                  , FALSE                                                                               , TRUE                                                                                , TRUE                                                                                , TRUE                                                                                , TRUE                                                                                , FALSE                                                                               , FALSE                                                                               , TRUE                                                                                ,                                                                                     , Submit Answer                                                                       , TRUE                                                                                , FALSE                                                                               ,                                                                                     ,                                                                                     , What number is the letter A in the alphabet?                                        , 8                                                                                   , FALSE                                                                               , 14                                                                                  , FALSE                                                                               , 1                                                                                   , TRUE                                                                                , 23                                                                                  , FALSE                                                                               , Correct!                                                                            , See <a href="https://en.wikipedia.org/wiki/English_alphabet">here</a> and try again. 100% auto 100% , auto , TRUE , FALSE, FALSE, FALSE, 100% , auto , FALSE jquery                                                        , 1.11.3                                                        , /usr/lib/R/site-library/rmarkdown/rmd/h/jquery                , jquery.min.js                                                 , TRUE                                                          , bootstrap                                                     , 3.3.5                                                         , /usr/lib/R/site-library/rmarkdown/rmd/h/bootstrap             , width=device-width, initial-scale=1                           , js/bootstrap.min.js                                           , shim/html5shiv.min.js                                         , shim/respond.min.js                                           , css/bootstrap.min.css                                         , TRUE                                                          , bootbox                                                       , 4.4.0                                                         , /usr/local/lib/R/site-library/learnr/lib/bootbox              , bootbox.min.js                                                , TRUE                                                          , localforage                                                   , 1.5                                                           , /usr/local/lib/R/site-library/learnr/lib/localforage          , localforage.min.js                                            , TRUE                                                          , tutorial                                                      , 0.9.2.1                                                       , /usr/local/lib/R/site-library/learnr/lib/tutorial             , tutorial.js                                                   , tutorial.css                                                  , TRUE                                                          , tutorial-autocompletion                                       , 0.9.2.1                                                       , /usr/local/lib/R/site-library/learnr/lib/tutorial             , tutorial-autocompletion.js                                    , TRUE                                                          , tutorial-diagnostics                                          , 0.9.2.1                                                       , /usr/local/lib/R/site-library/learnr/lib/tutorial             , tutorial-diagnostics.js                                       , TRUE                                                          , slickquiz                                                     , 1.5.20                                                        , /usr/local/lib/R/site-library/learnr/htmlwidgets/lib/slickquiz, js/slickQuiz.js                                               , css/slickQuiz.css                                             , css/slickQuizTutorial.css                                     , TRUE                                                           NULL NULL NULL 

learnr documentation built on March 26, 2020, 7:45 p.m.