From 72ed98c66d1585c94ee5383c19a1dec8e10bb050 Mon Sep 17 00:00:00 2001 From: Arnaud Bailly Date: Wed, 5 Nov 2025 07:55:45 +0100 Subject: record last success/failure in score --- lambda-calcul/haskell/src/Minilang/API.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lambda-calcul/haskell/src/Minilang/API.hs') diff --git a/lambda-calcul/haskell/src/Minilang/API.hs b/lambda-calcul/haskell/src/Minilang/API.hs index fffee7f..8082ac8 100644 --- a/lambda-calcul/haskell/src/Minilang/API.hs +++ b/lambda-calcul/haskell/src/Minilang/API.hs @@ -22,6 +22,7 @@ import System.Random (StdGen, uniformList) type LambdaAPI = "api" :> "register" :> ReqBody '[JSON] User :> Verb 'POST 201 '[JSON] Token :<|> "api" :> "leaderboard" :> Get '[JSON] [Score] + :<|> "api" :> "score" :> QueryParam "token" Token :> Get '[JSON] Score :<|> "api" :> "challenge" :> QueryParam "token" Token :> Get '[JSON] Challenge :<|> "api" :> "challenge" :> QueryParam "token" Token :> ReqBody '[JSON] Text :> Post '[JSON] () :<|> Raw @@ -29,7 +30,8 @@ type LambdaAPI = data Score = Score { user :: User, grade :: Int, - lastTest :: Maybe UTCTime + lastTest :: Maybe UTCTime, + lastResult :: Maybe Bool } deriving (Eq, Show, Generic, ToJSON, FromJSON) -- cgit v1.3.1