modules/quiz: Changed hint timing

This commit is contained in:
Andreas Neue 2017-01-21 17:04:24 +01:00
parent 4388bc22b8
commit 44f64960b7
2 changed files with 9 additions and 2 deletions

View File

@ -122,6 +122,13 @@ func quizWaitForAnswer(q quizQuestion) (bool, bool, string, int) {
i := 0 i := 0
haveAnswer := false haveAnswer := false
timer := time.Now().Unix() 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 { for {
select { select {
case m := <-quizAnswerCh: case m := <-quizAnswerCh:
@ -150,7 +157,7 @@ func quizWaitForAnswer(q quizQuestion) (bool, bool, string, int) {
return false, false, "", 0 return false, false, "", 0
} }
break break
case <-time.After(15 * time.Second): case <-timeHintCh:
i++ i++
if i > 3 { if i > 3 {
if haveAnswer { if haveAnswer {

View File

@ -38,7 +38,7 @@ const (
RE_ORG_COMM = `<li class="commitment">(.*)</li>` RE_ORG_COMM = `<li class="commitment">(.*)</li>`
FANS_INT = 1000 FANS_INT = 1000
FLEET_INT = 1000 FLEET_INT = 1000
FUNDS_INT = 10000 FUNDS_INT = 50000
) )
var ( var (