Browse Source

Merge branch 'master' of github.com:nisstyre56/Questioner

master
wes 12 years ago
parent
commit
241bb59986
  1. 4
      Ask.hs
  2. 2
      tell.hs

4
Ask.hs

@ -7,8 +7,8 @@ import Data.List.Split
import Text.JSON
data Question = Question {text :: String ,
possibleAnswers :: [String],
correctAnswer :: String}
possibleAnswers :: [String],
correctAnswer :: String}
letters = join $ zipWith (\l n -> (replicate n) <$> l) (repeat ['a'..'z']) ([1, 2..])

2
tell.hs

@ -11,7 +11,7 @@ questionPath = "./questions.json"
check = (readline "> ") >>= output where
output (Nothing) = return Nothing
output (Just a) | a == "END" = return Nothing
| otherwise = return (Just a)
| otherwise = return (Just a)
getQuestions = whileJust check return
getQuestionFile = So.readFile questionPath