Skip to content

Commit

Permalink
Fixes bug with grade_learnr(): grade_learnr() cannot find .praise and…
Browse files Browse the repository at this point in the history
… .encourage at runtime if these are saved outside of the function. Why?
  • Loading branch information
garrettgman committed Aug 9, 2018
1 parent 9b23772 commit 3659d66
Showing 1 changed file with 53 additions and 51 deletions.
104 changes: 53 additions & 51 deletions R/grade_learnr.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,59 @@ grade_learnr <- function(label = NULL,
envir_result = NULL,
evaluate_result = NULL,
...) {

# Praise messages
.praise <- c("Absolutely fabulous!",
"Amazing!",
"Awesome!",
"Beautiful!",
"Bravo!",
"Cool job!",
"Delightful!",
"Excellent!",
"Fantastic!",
"Great work!",
"I couldn't have done it better myself.",
"Impressive work!",
"Lovely job!",
"Magnificent!",
"Nice job!",
"Out of this world!",
"Resplendent!",
"Smashing!",
"Someone knows what they're doing :)",
"Spectacular job!",
"Splendid!",
"Success!",
"Super job!",
"Superb work!",
"Swell job!",
"Terrific!",
"That's a first-class answer!",
"That's glorious!",
"That's marvelous!",
"Very good!",
"Well done!",
"What first-rate work!",
"Wicked smaht!",
"Wonderful!",
"You aced it!",
"You rock!",
"You should be proud.",
":)")

# Encouragement messages
.encourage <- c("Please try again.",
"Give it another try.",
"Let's try it again.",
"Try it again; next time's the charm!",
"Don't give up now, try it one more time.",
"But no need to fret, try it again.",
"Try it again. I have a good feeling about this.",
"Try it again. You get better each time.",
"Try it again. Perseverence is the key to success.",
"That's okay: you learn more from mistakes than successes. Let's do it one more time.")


# Sometimes no user code is provided, but
# that means there is nothing to check. Also,
Expand Down Expand Up @@ -109,54 +162,3 @@ grade_learnr <- function(label = NULL,
result
}

# Praise messages
.praise <- c("Absolutely fabulous!",
"Amazing!",
"Awesome!",
"Beautiful!",
"Bravo!",
"Cool job!",
"Delightful!",
"Excellent!",
"Fantastic!",
"Great work!",
"I couldn't have done it better myself.",
"Impressive work!",
"Lovely job!",
"Magnificent!",
"Nice job!",
"Out of this world!",
"Resplendent!",
"Smashing!",
"Someone knows what they're doing :)",
"Spectacular job!",
"Splendid!",
"Success!",
"Super job!",
"Superb work!",
"Swell job!",
"Terrific!",
"That's a first-class answer!",
"That's glorious!",
"That's marvelous!",
"Very good!",
"Well done!",
"What first-rate work!",
"Wicked smaht!",
"Wonderful!",
"You aced it!",
"You rock!",
"You should be proud.",
":)")

# Encouragement messages
.encourage <- c("Please try again.",
"Give it another try.",
"Let's try it again.",
"Try it again; next time's the charm!",
"Don't give up now, try it one more time.",
"But no need to fret, try it again.",
"Try it again. I have a good feeling about this.",
"Try it again. You get better each time.",
"Try it again. Perseverence is the key to success.",
"That's okay: you learn more from mistakes than successes. Let's do it one more time.")

0 comments on commit 3659d66

Please sign in to comment.