ExcerciseBuddies for DefinedGroups are forced
This commit is contained in:
parent
780201703c
commit
11c17e3dc8
@ -55,15 +55,18 @@ makeSubmissionForm :: Bool -> SheetGroup -> [Text] -> Form (Source Handler File,
|
|||||||
makeSubmissionForm unpackZips grouping buddies = identForm FIDsubmission $ \html -> do
|
makeSubmissionForm unpackZips grouping buddies = identForm FIDsubmission $ \html -> do
|
||||||
flip (renderAForm FormStandard) html $ (,)
|
flip (renderAForm FormStandard) html $ (,)
|
||||||
<$> areq (zipFileField unpackZips) (fsm $ bool MsgSubmissionFile MsgSubmissionArchive unpackZips) Nothing
|
<$> areq (zipFileField unpackZips) (fsm $ bool MsgSubmissionFile MsgSubmissionArchive unpackZips) Nothing
|
||||||
<*> (catMaybes <$> sequenceA [aopt textField (fsm $ MsgSubmissionMember g) buddy
|
<*> (catMaybes <$> sequenceA [bool aforced' aopt editableBuddies textField (fsm $ MsgSubmissionMember g) buddy
|
||||||
| g <- [1..(max groupNr $ length buddies)] -- groupNr might have decreased meanwhile
|
| g <- [1..(max groupNr $ length buddies)] -- groupNr might have decreased meanwhile
|
||||||
| buddy <- map (Just . Just) buddies ++ repeat Nothing -- show current buddies
|
| buddy <- map (Just . Just) buddies ++ repeat Nothing -- show current buddies
|
||||||
])
|
])
|
||||||
<* submitButton
|
<* submitButton
|
||||||
where
|
where
|
||||||
groupNr
|
(groupNr, editableBuddies)
|
||||||
| Arbitrary{..} <- grouping = pred maxParticipants -- pred to account for the person submitting
|
| Arbitrary{..} <- grouping = (pred maxParticipants, True) -- pred to account for the person submitting
|
||||||
| otherwise = 0
|
| otherwise = (0, False)
|
||||||
|
|
||||||
|
aforced' f fs (Just (Just v)) = Just <$> aforced f fs v
|
||||||
|
aforced' _ _ _ = error "Cannot happen since groupNr==0 if grouping/=Arbitrary"
|
||||||
|
|
||||||
|
|
||||||
getSubmissionR, postSubmissionR :: TermId -> Text -> Text -> SubmissionMode -> Handler Html
|
getSubmissionR, postSubmissionR :: TermId -> Text -> Text -> SubmissionMode -> Handler Html
|
||||||
|
|||||||
Reference in New Issue
Block a user