summaryrefslogtreecommitdiff
path: root/assignment-6/multiplechoice.icl
diff options
context:
space:
mode:
Diffstat (limited to 'assignment-6/multiplechoice.icl')
-rw-r--r--assignment-6/multiplechoice.icl8
1 files changed, 7 insertions, 1 deletions
diff --git a/assignment-6/multiplechoice.icl b/assignment-6/multiplechoice.icl
index 327ef21..da6690d 100644
--- a/assignment-6/multiplechoice.icl
+++ b/assignment-6/multiplechoice.icl
@@ -8,11 +8,17 @@ import Data.Tuple
import iTasks
-Start w = startEngine (allTasks createUsers >>| doAuthenticated (get currentUser >>- main)) w
+Start w = startEngine (allTasks createUsers >>| authedMain) w
where
createUsers :: [Task UserAccount]
createUsers = [catchAll (createUser u) (\_ -> return u) \\ u <- myUsers]
+ authedMain :: Task ()
+ authedMain = doAuthenticated (get currentUser >>- main) >>*
+ [OnAllExceptions (\_ ->
+ viewInformation (Title "Login failed") [] "Your username or password is incorrect"
+ >>| authedMain)]
+
:: Question =
{ question :: String
, answers :: [String]