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
|
if
|
||||||
-- on no-op request, answer with 200 and a set of all participant matches
|
-- on no-op request, answer with 200 and a set of all participant matches
|
||||||
| is _Nothing ciqResults, is _Nothing ciqGrade -> do
|
| is _Nothing ciqResults, is _Nothing ciqGrade -> do
|
||||||
users <- traverse userToResponse participantMatches
|
users <- traverse userToResponse $ take maxCountUserMatches participantMatches
|
||||||
return CorrectInterfaceResponseNoOp
|
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
|
-- 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
|
if
|
||||||
| is _Nothing ciqResults, is _Nothing ciqGrade -> do
|
| is _Nothing ciqResults, is _Nothing ciqGrade -> do
|
||||||
users <- traverse userToResponse matches
|
users <- traverse userToResponse $ take maxCountUserMatches matches
|
||||||
return CorrectInterfaceResponseNoOp
|
return CorrectInterfaceResponseNoOp
|
||||||
{ cirnUsers = Set.fromList users
|
{ cirnUsers = Set.fromList users
|
||||||
|
, cirnHasMore = length matches > maxCountUserMatches
|
||||||
}
|
}
|
||||||
| [match@(Entity uid _)] <- matches -> do
|
| [match@(Entity uid _)] <- matches -> do
|
||||||
now <- liftIO getCurrentTime
|
now <- liftIO getCurrentTime
|
||||||
|
|||||||
@ -51,6 +51,7 @@ data CorrectInterfaceResponse
|
|||||||
}
|
}
|
||||||
| CorrectInterfaceResponseNoOp
|
| CorrectInterfaceResponseNoOp
|
||||||
{ cirnUsers :: Set CorrectInterfaceUser
|
{ cirnUsers :: Set CorrectInterfaceUser
|
||||||
|
, cirnHasMore :: Bool
|
||||||
}
|
}
|
||||||
|
|
||||||
deriveToJSON defaultOptions
|
deriveToJSON defaultOptions
|
||||||
|
|||||||
Reference in New Issue
Block a user