forked from elinw/swirl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phrases.R
56 lines (53 loc) · 2.36 KB
/
phrases.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Return random praise.
praise <- function() {
swirl_is_fun <- getOption("swirl_is_fun")
if(is.null(swirl_is_fun) || isTRUE(swirl_is_fun)) {
phrases <- c(s()%N%"You got it!",
s()%N%"Nice work!",
s()%N%"Keep up the great work!",
s()%N%"You are doing so well!",
s()%N%"All that hard work is paying off!",
s()%N%"You nailed it! Good job!",
s()%N%"You're the best!",
s()%N%"You are amazing!",
s()%N%"Keep working like that and you'll get there!",
s()%N%"Perseverance, that's the answer.",
s()%N%"Great job!",
s()%N%"You are quite good my friend!",
s()%N%"Your dedication is inspiring!",
s()%N%"You got it right!",
s()%N%"That's correct!",
s()%N%"You are really on a roll!",
s()%N%"Excellent job!",
s()%N%"All that practice is paying off!",
s()%N%"Excellent work!",
s()%N%"That's a job well done!",
s()%N%"That's the answer I was looking for.")
} else {
phrases <- s()%N%"Correct!"
}
sample(phrases, 1)
}
# Return random "try again" message.
tryAgain <- function() {
swirl_is_fun <- getOption("swirl_is_fun")
if(is.null(swirl_is_fun) || isTRUE(swirl_is_fun)) {
phrases <- c(s()%N%"Almost! Try again.",
s()%N%"You almost had it, but not quite. Try again.",
s()%N%"Give it another try.",
s()%N%"Not quite! Try again.",
s()%N%"Not exactly. Give it another go.",
s()%N%"That's not exactly what I'm looking for. Try again.",
s()%N%"Nice try, but that's not exactly what I was hoping for. Try again.",
s()%N%"Keep trying!",
s()%N%"That's not the answer I was looking for, but try again.",
s()%N%"Not quite right, but keep trying.",
s()%N%"You're close...I can feel it! Try it again.",
s()%N%"One more time. You can do it!",
s()%N%"Not quite, but you're learning! Try again.",
s()%N%"Try again. Getting it right on the first try is boring anyway!")
} else {
phrases <- s()%N%"Incorrect. Please try again."
}
sample(phrases, 1)
}