if you got a clue then prompt for pass fail

master
Bel LaPointe 2023-04-07 11:44:49 -06:00
parent 45360a6751
commit 84aab7c4da
2 changed files with 4 additions and 2 deletions

View File

@ -113,6 +113,7 @@ func ReviewQ(db DB, user IDU, q IDQ) (string, string, error) {
fmt.Printf("\n") fmt.Printf("\n")
fmt.Printf("> %+v\n", question.Tags) fmt.Printf("> %+v\n", question.Tags)
var response string var response string
gotAClue := false
for i := range question.Clues { for i := range question.Clues {
if i == 0 { if i == 0 {
fmt.Printf("> /clue for a clue\n") fmt.Printf("> /clue for a clue\n")
@ -121,6 +122,7 @@ func ReviewQ(db DB, user IDU, q IDQ) (string, string, error) {
if response != "/clue" { if response != "/clue" {
break break
} }
gotAClue = true
fmt.Printf("> %s", question.Clues[i].ToString(db.UserResolution(user))) fmt.Printf("> %s", question.Clues[i].ToString(db.UserResolution(user)))
if i+1 < len(question.Clues) { if i+1 < len(question.Clues) {
fmt.Printf(" | /clue for another clue") fmt.Printf(" | /clue for another clue")
@ -130,7 +132,7 @@ func ReviewQ(db DB, user IDU, q IDQ) (string, string, error) {
if len(question.Clues) == 0 || response == "/clue" { if len(question.Clues) == 0 || response == "/clue" {
response = readline() response = readline()
} }
if len(question.Solution) > 0 && question.Solution[0].ToString(1) == response { if !gotAClue && len(question.Solution) > 0 && question.Solution[0].ToString(1) == response {
return response, CMD_PASS, nil return response, CMD_PASS, nil
} }
if len(question.Solution) > 0 { if len(question.Solution) > 0 {

View File

@ -760,4 +760,4 @@ users:
- hiragana - hiragana
- katakana - katakana
cadence: 0s cadence: 0s
resolution: 100 resolution: 50