Merge branch 'master' of gitlab.cip.ifi.lmu.de:jost/UniWorX
This commit is contained in:
commit
222401de6b
@ -1140,17 +1140,22 @@ assignHandler tid ssh csh cid assignSids = do
|
|||||||
E.on $ corrector E.^. SheetCorrectorUser E.==. user E.^. UserId
|
E.on $ corrector E.^. SheetCorrectorUser E.==. user E.^. UserId
|
||||||
E.where_ $ corrector E.^. SheetCorrectorSheet `E.in_` E.valList sheetIds
|
E.where_ $ corrector E.^. SheetCorrectorSheet `E.in_` E.valList sheetIds
|
||||||
return (corrector, user)
|
return (corrector, user)
|
||||||
let correctorMap :: Map UserId (User, Map SheetName SheetCorrector)
|
let regular_correctors = nub $ fmap (\(_,Entity uid _) -> uid) correctors
|
||||||
correctorMap = (\f -> foldl f Map.empty correctors) (\acc (Entity _ sheetcorr@SheetCorrector{sheetCorrectorSheet}, Entity uid user) ->
|
act_correctors <- E.select . E.distinct . E.from $ \(submission `E.InnerJoin` user) -> do
|
||||||
let shn = sheetName $ sheets ! sheetCorrectorSheet
|
E.on $ submission E.^. SubmissionRatingBy E.==. (E.just $ user E.^. UserId)
|
||||||
in Map.insertWith (\(usr, ma) (_, mb) -> (usr, Map.union ma mb)) uid (user, Map.singleton shn sheetcorr) acc
|
E.where_ $ submission E.^. SubmissionSheet `E.in_` E.valList sheetIds
|
||||||
)
|
E.where_ $ user E.^. UserId `E.notIn` E.valList regular_correctors
|
||||||
|
return (submission E.^. SubmissionSheet, user)
|
||||||
|
|
||||||
-- -- lecturerNames :: Map UserId User
|
let fakeSheetCorrector :: (E.Value SheetId, Entity User) -> (Entity SheetCorrector, Entity User)
|
||||||
-- lecturerNames <- fmap entities2map $ E.select $ E.from $ \(user `E.InnerJoin` lecturer) -> do
|
fakeSheetCorrector (E.Value shid, usr@(Entity uid _)) = (Entity (error "Fake SheetId") (SheetCorrector uid shid mempty CorrectorExcused), usr)
|
||||||
-- E.on $ user E.^. UserId E.==. lecturer E.^. LecturerUser
|
|
||||||
-- E.where_ $ lecturer E.^. LecturerCourse E.==. E.val cid
|
let correctorMap :: Map UserId (User, Map SheetName SheetCorrector)
|
||||||
-- return user
|
correctorMap = (\f -> foldl f Map.empty (correctors ++ (fakeSheetCorrector <$> act_correctors)) )
|
||||||
|
(\acc (Entity _ sheetcorr@SheetCorrector{sheetCorrectorSheet}, Entity uid user) ->
|
||||||
|
let shn = sheetName $ sheets ! sheetCorrectorSheet
|
||||||
|
in Map.insertWith (\(usr, ma) (_, mb) -> (usr, Map.union ma mb)) uid (user, Map.singleton shn sheetcorr) acc
|
||||||
|
)
|
||||||
|
|
||||||
submissions <- E.select . E.from $ \submission -> do
|
submissions <- E.select . E.from $ \submission -> do
|
||||||
E.where_ $ submission E.^. SubmissionSheet `E.in_` E.valList sheetIds
|
E.where_ $ submission E.^. SubmissionSheet `E.in_` E.valList sheetIds
|
||||||
|
|||||||
@ -130,6 +130,16 @@
|
|||||||
<td .table__th>#{getLoadSum shn}
|
<td .table__th>#{getLoadSum shn}
|
||||||
<td .table__th>#{ciSubmissions}
|
<td .table__th>#{ciSubmissions}
|
||||||
<td .table__td colspan=3>^{simpleLinkI (SomeMessage MsgMenuCorrectorsChange) (CSheetR tid ssh csh shn SCorrR)}
|
<td .table__td colspan=3>^{simpleLinkI (SomeMessage MsgMenuCorrectorsChange) (CSheetR tid ssh csh shn SCorrR)}
|
||||||
|
|
||||||
|
<tr .table__row .table__row--head>
|
||||||
|
<th>
|
||||||
|
<th colspan=2>
|
||||||
|
<th>
|
||||||
|
<th colspan=3>
|
||||||
|
$# Always iterate over orderedSheetNames for consistent sorting! Newest first, except in this table
|
||||||
|
$forall shn <- orderedSheetNames
|
||||||
|
<th .table__th colspan=5>#{shn}
|
||||||
|
|
||||||
^{btnWdgt}
|
^{btnWdgt}
|
||||||
<div>
|
<div>
|
||||||
<p>_{MsgAssignSubmissionsRandomWarning}
|
<p>_{MsgAssignSubmissionsRandomWarning}
|
||||||
Reference in New Issue
Block a user