diff --git a/modules/quiz.go b/modules/quiz.go index a49d6cc..79cfdc2 100644 --- a/modules/quiz.go +++ b/modules/quiz.go @@ -122,6 +122,13 @@ func quizWaitForAnswer(q quizQuestion) (bool, bool, string, int) { i := 0 haveAnswer := false timer := time.Now().Unix() + timeHintCh := make(chan bool) + go func(chan bool) { + for i := 0; i < 4; i++ { + time.Sleep(15 * time.Second) + timeHintCh <- true + } + }(timeHintCh) for { select { case m := <-quizAnswerCh: @@ -150,7 +157,7 @@ func quizWaitForAnswer(q quizQuestion) (bool, bool, string, int) { return false, false, "", 0 } break - case <-time.After(15 * time.Second): + case <-timeHintCh: i++ if i > 3 { if haveAnswer { diff --git a/modules/sc.go b/modules/sc.go index 4952943..cf506af 100644 --- a/modules/sc.go +++ b/modules/sc.go @@ -38,7 +38,7 @@ const ( RE_ORG_COMM = `