print question solutions if set

master
Bel LaPointe 2023-04-07 11:34:32 -06:00
parent e81de97e8b
commit e1ca7dd70b
1 changed files with 7 additions and 0 deletions

View File

@ -130,6 +130,13 @@ func ReviewQ(db DB, user IDU, q IDQ) (string, string, error) {
if len(question.Clues) == 0 || response == "/clue" {
response = readline()
}
if len(question.Solution) > 0 {
fmt.Printf("> Solution:")
for i := range question.Solution {
fmt.Printf("\n\t%s", question.Solution[i].ToString(db.UserResolution(user)))
}
fmt.Println()
}
if id, _ := db.LastAnswer(user, q); id == "" {
} else if lastAnswer := db.Answer(id); lastAnswer.A != "" {
fmt.Printf("> Last time, you responded:\n\t%s\n", lastAnswer.A)