Generate a random praise or encouragement phrase. These functions are
designed for use within pass()
or fail()
messages, or anywhere else that
gradethis provides feedback to the student.
random_praise() random_encouragement() give_praise(expr, ..., location = "before", before = NULL, after = NULL) give_encouragement(expr, ..., location = "after", before = NULL, after = NULL)
expr | A |
---|---|
... | Ignored. |
location | Should the praise or encouragement be added before or after the grade message? |
before, after | Text to be added before or after the praise or encouragement phrase. |
random_praise()
and random_encouragement()
each return a length-one
string with a praising or encouraging phrase.
give_praise()
and give_encouragment()
add praise or encouragement
phrases to passing and failing grades, respectively.
random_praise
: Random praising phrase
random_encouragement
: Random encouraging phrase
give_praise
: Add praising message to a passing grade.
give_encouragement
: Add encouraging message to a failing grade.
#> [1] "Random praise: Wonderful!" "Random praise: Absolutely fabulous!" #> [3] "Random praise: Swell job!" "Random praise: You should be proud." #> [5] "Random praise: Excellent!"#> [1] "Random encouragement: Please try again." #> [2] "Random encouragement: Let's try it again." #> [3] "Random encouragement: That's okay: you learn more from mistakes than successes. Let's do it one more time." #> [4] "Random encouragement: Let's try it again." #> [5] "Random encouragement: Give it another try."# give_praise() adds praise to passing grade messages give_praise(pass("That's absolutely correct."))#> <gradethis_graded: [Correct] Super job! That's absolutely correct.># give_encouragement() encouragement to failing grade messages give_encouragement(fail("Sorry, but no."))#> <gradethis_graded: [Incorrect] #> Sorry, but no. That's okay: you learn more from mistakes than #> successes. Let's do it one more time. #> >