feat(exam-correct): add hasMore to no-op reponse
This commit is contained in:
parent
d4d27f8ef6
commit
e941083a44
@ -98,9 +98,10 @@ postECorrectR tid ssh csh examn = do
|
||||
if
|
||||
-- on no-op request, answer with 200 and a set of all participant matches
|
||||
| is _Nothing ciqResults, is _Nothing ciqGrade -> do
|
||||
users <- traverse userToResponse participantMatches
|
||||
users <- traverse userToResponse $ take maxCountUserMatches participantMatches
|
||||
return CorrectInterfaceResponseNoOp
|
||||
{ cirnUsers = Set.fromList users
|
||||
{ cirnUsers = Set.fromList users
|
||||
, cirnHasMore = length participantMatches > maxCountUserMatches
|
||||
}
|
||||
|
||||
-- on match with exactly one exam participant, insert results and/or grade and answer with 200
|
||||
|
||||
@ -93,9 +93,10 @@ postEECorrectR tid ssh coursen examn = do
|
||||
|
||||
if
|
||||
| is _Nothing ciqResults, is _Nothing ciqGrade -> do
|
||||
users <- traverse userToResponse matches
|
||||
users <- traverse userToResponse $ take maxCountUserMatches matches
|
||||
return CorrectInterfaceResponseNoOp
|
||||
{ cirnUsers = Set.fromList users
|
||||
{ cirnUsers = Set.fromList users
|
||||
, cirnHasMore = length matches > maxCountUserMatches
|
||||
}
|
||||
| [match@(Entity uid _)] <- matches -> do
|
||||
now <- liftIO getCurrentTime
|
||||
|
||||
@ -51,6 +51,7 @@ data CorrectInterfaceResponse
|
||||
}
|
||||
| CorrectInterfaceResponseNoOp
|
||||
{ cirnUsers :: Set CorrectInterfaceUser
|
||||
, cirnHasMore :: Bool
|
||||
}
|
||||
|
||||
deriveToJSON defaultOptions
|
||||
|
||||
Loading…
Reference in New Issue
Block a user