forked from elinw/swirl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow user to make feedback less playful
- Loading branch information
Showing
1 changed file
with
47 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,56 @@ | ||
# Return random praise. | ||
praise <- function() { | ||
phrases <- c("You got it!", | ||
"Nice work!", | ||
"Keep up the great work!", | ||
"You are doing so well!", | ||
"All that hard work is paying off!", | ||
"You nailed it! Good job!", | ||
"You're the best!", | ||
"You are amazing!", | ||
"Keep working like that and you'll get there!", | ||
"Perseverance, that's the answer.", | ||
"Great job!", | ||
"You are quite good my friend!", | ||
"You're dedication is inspiring!", | ||
"You got it right!", | ||
"That's correct!", | ||
"You are really on a roll!", | ||
"Excellent job!", | ||
"All that practice is paying off!", | ||
"Excellent work!", | ||
"That's a job well done!", | ||
"That's the answer I was looking for.") | ||
swirl_is_fun <- getOption("swirl_is_fun") | ||
|
||
if(is.null(swirl_is_fun) || isTRUE(swirl_is_fun)) { | ||
phrases <- c("You got it!", | ||
"Nice work!", | ||
"Keep up the great work!", | ||
"You are doing so well!", | ||
"All that hard work is paying off!", | ||
"You nailed it! Good job!", | ||
"You're the best!", | ||
"You are amazing!", | ||
"Keep working like that and you'll get there!", | ||
"Perseverance, that's the answer.", | ||
"Great job!", | ||
"You are quite good my friend!", | ||
"You're dedication is inspiring!", | ||
"You got it right!", | ||
"That's correct!", | ||
"You are really on a roll!", | ||
"Excellent job!", | ||
"All that practice is paying off!", | ||
"Excellent work!", | ||
"That's a job well done!", | ||
"That's the answer I was looking for.") | ||
} else { | ||
phrases <- "Correct!" | ||
} | ||
sample(phrases, 1) | ||
} | ||
|
||
# Return random "try again" message. | ||
tryAgain <- function() { | ||
phrases <- c("Almost! Try again.", | ||
"You almost had it, but not quite. Try again.", | ||
"Give it another try.", | ||
"Not quite! Try again.", | ||
"Not exactly. Give it another go.", | ||
"That's not exactly what I'm looking for. Try again.", | ||
"Nice try, but that's not exactly what I was hoping for. Try again.", | ||
"Keep trying!", | ||
"That's not the answer I was looking for, but try again.", | ||
"Not quite right, but keep trying.", | ||
"You're close...I can feel it! Try it again.", | ||
"One more time. You can do it!", | ||
"Not quite, but you're learning! Try again.", | ||
"Try again. Getting it right on the first try is boring anyway!") | ||
swirl_is_fun <- getOption("swirl_is_fun") | ||
|
||
if(is.null(swirl_is_fun) || isTRUE(swirl_is_fun)) { | ||
phrases <- c("Almost! Try again.", | ||
"You almost had it, but not quite. Try again.", | ||
"Give it another try.", | ||
"Not quite! Try again.", | ||
"Not exactly. Give it another go.", | ||
"That's not exactly what I'm looking for. Try again.", | ||
"Nice try, but that's not exactly what I was hoping for. Try again.", | ||
"Keep trying!", | ||
"That's not the answer I was looking for, but try again.", | ||
"Not quite right, but keep trying.", | ||
"You're close...I can feel it! Try it again.", | ||
"One more time. You can do it!", | ||
"Not quite, but you're learning! Try again.", | ||
"Try again. Getting it right on the first try is boring anyway!") | ||
} else { | ||
phrases <- "Incorrect. Please try again." | ||
} | ||
sample(phrases, 1) | ||
} |