diff --git a/modules/quiz.go b/modules/quiz.go index 9d2cd44..8d58ef3 100644 --- a/modules/quiz.go +++ b/modules/quiz.go @@ -4,6 +4,7 @@ package modules import ( "bufio" + "flag" "fmt" "math/rand" "os" @@ -20,6 +21,7 @@ type quizQuestion struct { } var ( + quizQuestionsFile = flag.String("quiz_questions_file", "questions.txt", "quiz: questions file") quizCtrlCh = make(chan string, 1024) quizAnswerCh = make(chan *Message, 1024) quizQuestions []quizQuestion @@ -67,7 +69,7 @@ func quiz() { } func quizRun() { - quizQuestions = quizLoadQuestions("questions.txt") + quizQuestions = quizLoadQuestions(*quizQuestionsFile) ranklist := make(map[string]int) SayCh <- fmt.Sprintf("%s\nQuiz gestartet.", "*") for {