Skip to content

Commit 1678514

Browse files
committed
done
1 parent f1dc368 commit 1678514

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/quiz_handler.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,19 +100,23 @@ pub async fn handle_math_quiz(
100100
let db = locked_state.db.get().ok()?;
101101
let (bonus_xp, new_level) = award_quiz_xp(&db, &mut locked_state.rng, msg.author.id.get(), &msg.author.name).ok()?;
102102

103+
let duration_secs = elapsed.as_secs_f64();
104+
103105
return Some(
104106
Command::text(if let Some(level) = new_level {
105107
format!(
106-
"<@{}> Correct! Well done. You earned {} XP and leveled up to level {}!",
108+
"<@{}> Correct! Well done. You earned {} XP and leveled up to level {}! (Solved in {:.3}s)",
107109
msg.author.id.get(),
108110
bonus_xp,
109-
level
111+
level,
112+
duration_secs
110113
)
111114
} else {
112115
format!(
113-
"<@{}> Correct! Well done. You earned {} XP!",
116+
"<@{}> Correct! Well done. You earned {} XP! (Solved in {:.3}s)",
114117
msg.author.id.get(),
115-
bonus_xp
118+
bonus_xp,
119+
duration_secs
116120
)
117121
})
118122
.reply(),
@@ -200,7 +204,8 @@ pub async fn trigger_math_quiz(
200204
locked_state.pending_math_tests.insert(msg.channel_id.get(), pending);
201205

202206
Some(Command::text(format!(
203-
"**MATH TEST TIME!** Solve this in 30 seconds:\n`{}`\n(Answer to 1 decimal place)",
207+
"<@{}> **MATH TEST TIME!** Solve this in 30 seconds:\n`{}`\n(Answer to 1 decimal place)",
208+
msg.author.id.get(),
204209
test.question
205210
)))
206211
}

0 commit comments

Comments
 (0)