Rating type shown along rating in all corrections.
This commit is contained in:
parent
2ef4bbc014
commit
b05f1ccc75
@ -150,6 +150,7 @@ colRating = sortable (Just "rating") (i18nCell MsgRating) $ \DBRow{ dbrOutput=(
|
|||||||
tid = course ^. _3
|
tid = course ^. _3
|
||||||
ssh = course ^. _4
|
ssh = course ^. _4
|
||||||
-- shn = sheetName
|
-- shn = sheetName
|
||||||
|
|
||||||
mkRoute = do
|
mkRoute = do
|
||||||
cid <- encrypt subId
|
cid <- encrypt subId
|
||||||
return $ CSubmissionR tid ssh csh sheetName cid CorrectionR
|
return $ CSubmissionR tid ssh csh sheetName cid CorrectionR
|
||||||
@ -435,7 +436,6 @@ postCorrectionsR = do
|
|||||||
, colAssigned
|
, colAssigned
|
||||||
, colRating
|
, colRating
|
||||||
, colRated
|
, colRated
|
||||||
, colSheetType
|
|
||||||
] -- Continue here
|
] -- Continue here
|
||||||
psValidator = def
|
psValidator = def
|
||||||
& restrictFilter (\name _ -> name /= "corrector") -- We need to be careful to restrict allowed sorting/filter to not expose sensitive information
|
& restrictFilter (\name _ -> name /= "corrector") -- We need to be careful to restrict allowed sorting/filter to not expose sensitive information
|
||||||
@ -456,7 +456,6 @@ postCCorrectionsR tid ssh csh = do
|
|||||||
, colSMatrikel
|
, colSMatrikel
|
||||||
, colSubmittors
|
, colSubmittors
|
||||||
, colSubmissionLink
|
, colSubmissionLink
|
||||||
, colSheetType
|
|
||||||
, colRating
|
, colRating
|
||||||
, colRated
|
, colRated
|
||||||
, colCorrector
|
, colCorrector
|
||||||
@ -771,7 +770,6 @@ postCorrectionsGradeR = do
|
|||||||
, colSheet
|
, colSheet
|
||||||
, colPseudonyms
|
, colPseudonyms
|
||||||
, colSubmissionLink
|
, colSubmissionLink
|
||||||
, colSheetType
|
|
||||||
, colRated
|
, colRated
|
||||||
, colRatedField
|
, colRatedField
|
||||||
, colPointsField
|
, colPointsField
|
||||||
|
|||||||
@ -263,7 +263,7 @@ multiFileField permittedFiles' = Field{..}
|
|||||||
pVals <- lift permittedFiles'
|
pVals <- lift permittedFiles'
|
||||||
let
|
let
|
||||||
decrypt' :: CryptoUUIDFile -> Handler (Maybe FileId)
|
decrypt' :: CryptoUUIDFile -> Handler (Maybe FileId)
|
||||||
decrypt' = fmap (either (\(_ :: CryptoIDError) -> Nothing) Just) . try . decrypt
|
decrypt' = fmap (either (\(_ :: CryptoIDError) -> Nothing) Just) . try . decrypt
|
||||||
yieldMany vals
|
yieldMany vals
|
||||||
.| C.filter (/= unpackZips)
|
.| C.filter (/= unpackZips)
|
||||||
.| C.map fromPathPiece .| C.catMaybes
|
.| C.map fromPathPiece .| C.catMaybes
|
||||||
@ -288,7 +288,7 @@ multiFileField permittedFiles' = Field{..}
|
|||||||
let fuiChecked
|
let fuiChecked
|
||||||
| Right sentVals' <- sentVals = fuiId' `elem` sentVals'
|
| Right sentVals' <- sentVals = fuiId' `elem` sentVals'
|
||||||
| otherwise = True
|
| otherwise = True
|
||||||
return FileUploadInfo{..}
|
return FileUploadInfo{..}
|
||||||
fileInfos <- mapM toFUI <=< handlerToWidget . runDB . E.select . E.from $ \file -> do
|
fileInfos <- mapM toFUI <=< handlerToWidget . runDB . E.select . E.from $ \file -> do
|
||||||
E.where_ $ file E.^. FileId `E.in_` E.valList (setToList pVals)
|
E.where_ $ file E.^. FileId `E.in_` E.valList (setToList pVals)
|
||||||
E.orderBy [E.asc $ file E.^. FileTitle]
|
E.orderBy [E.asc $ file E.^. FileTitle]
|
||||||
@ -303,13 +303,13 @@ multiFileField permittedFiles' = Field{..}
|
|||||||
|
|
||||||
|
|
||||||
data SheetGrading' = Points' | PassPoints' | PassBinary'
|
data SheetGrading' = Points' | PassPoints' | PassBinary'
|
||||||
deriving (Eq, Ord, Read, Show, Enum, Bounded)
|
deriving (Eq, Ord, Read, Show, Enum, Bounded)
|
||||||
|
|
||||||
instance Universe SheetGrading'
|
instance Universe SheetGrading'
|
||||||
instance Finite SheetGrading'
|
instance Finite SheetGrading'
|
||||||
|
|
||||||
nullaryPathPiece ''SheetGrading' (camelToPathPiece . dropSuffix "'")
|
nullaryPathPiece ''SheetGrading' (camelToPathPiece . dropSuffix "'")
|
||||||
embedRenderMessage ''UniWorX ''SheetGrading' ("SheetGrading" <>)
|
embedRenderMessage ''UniWorX ''SheetGrading' ("SheetGrading" <>)
|
||||||
|
|
||||||
|
|
||||||
data SheetType' = Bonus' | Normal' | Informational' | NotGraded'
|
data SheetType' = Bonus' | Normal' | Informational' | NotGraded'
|
||||||
@ -319,7 +319,7 @@ instance Universe SheetType'
|
|||||||
instance Finite SheetType'
|
instance Finite SheetType'
|
||||||
|
|
||||||
nullaryPathPiece ''SheetType' (camelToPathPiece . dropSuffix "'")
|
nullaryPathPiece ''SheetType' (camelToPathPiece . dropSuffix "'")
|
||||||
embedRenderMessage ''UniWorX ''SheetType' ("SheetType" <>)
|
embedRenderMessage ''UniWorX ''SheetType' ("SheetType" <>)
|
||||||
|
|
||||||
|
|
||||||
data SheetGroup' = Arbitrary' | RegisteredGroups' | NoGroups'
|
data SheetGroup' = Arbitrary' | RegisteredGroups' | NoGroups'
|
||||||
@ -333,31 +333,31 @@ embedRenderMessage ''UniWorX ''SheetGroup' (("SheetGroup" <>) . dropSuffix "'")
|
|||||||
|
|
||||||
sheetGradingAFormReq :: FieldSettings UniWorX -> Maybe SheetGrading -> AForm Handler SheetGrading
|
sheetGradingAFormReq :: FieldSettings UniWorX -> Maybe SheetGrading -> AForm Handler SheetGrading
|
||||||
sheetGradingAFormReq fs template = multiActionA fs selOptions (classify' <$> template)
|
sheetGradingAFormReq fs template = multiActionA fs selOptions (classify' <$> template)
|
||||||
where
|
where
|
||||||
selOptions = Map.fromList
|
selOptions = Map.fromList
|
||||||
[ ( Points', Points <$> maxPointsReq )
|
[ ( Points', Points <$> maxPointsReq )
|
||||||
, ( PassPoints', PassPoints <$> maxPointsReq <*> passPointsReq )
|
, ( PassPoints', PassPoints <$> maxPointsReq <*> passPointsReq )
|
||||||
, ( PassBinary', pure PassBinary)
|
, ( PassBinary', pure PassBinary)
|
||||||
]
|
]
|
||||||
classify' :: SheetGrading -> SheetGrading'
|
classify' :: SheetGrading -> SheetGrading'
|
||||||
classify' = \case
|
classify' = \case
|
||||||
Points {} -> Points'
|
Points {} -> Points'
|
||||||
PassPoints {} -> PassPoints'
|
PassPoints {} -> PassPoints'
|
||||||
PassBinary {} -> PassBinary'
|
PassBinary {} -> PassBinary'
|
||||||
|
|
||||||
maxPointsReq = apreq pointsField (fslI MsgSheetGradingMaxPoints) (template >>= preview _maxPoints)
|
maxPointsReq = apreq pointsField (fslI MsgSheetGradingMaxPoints) (template >>= preview _maxPoints)
|
||||||
passPointsReq = apreq pointsField (fslI MsgSheetGradingPassingPoints) (template >>= preview _passingPoints)
|
passPointsReq = apreq pointsField (fslI MsgSheetGradingPassingPoints) (template >>= preview _passingPoints)
|
||||||
|
|
||||||
|
|
||||||
sheetTypeAFormReq :: FieldSettings UniWorX -> Maybe SheetType -> AForm Handler SheetType
|
sheetTypeAFormReq :: FieldSettings UniWorX -> Maybe SheetType -> AForm Handler SheetType
|
||||||
sheetTypeAFormReq fs template = multiActionA fs selOptions (classify' <$> template)
|
sheetTypeAFormReq fs template = multiActionA fs selOptions (classify' <$> template)
|
||||||
where
|
where
|
||||||
selOptions = Map.fromList
|
selOptions = Map.fromList
|
||||||
[ ( Bonus' , Bonus <$> gradingReq )
|
[ ( Bonus' , Bonus <$> gradingReq )
|
||||||
, ( Normal', Normal <$> gradingReq )
|
, ( Normal', Normal <$> gradingReq )
|
||||||
, ( Informational', Informational <$> gradingReq )
|
, ( Informational', Informational <$> gradingReq )
|
||||||
, ( NotGraded', pure NotGraded )
|
, ( NotGraded', pure NotGraded )
|
||||||
]
|
]
|
||||||
gradingReq = sheetGradingAFormReq (fslI MsgSheetGrading
|
gradingReq = sheetGradingAFormReq (fslI MsgSheetGrading
|
||||||
& setTooltip MsgSheetGradingInfo) (template >>= preview _grading)
|
& setTooltip MsgSheetGradingInfo) (template >>= preview _grading)
|
||||||
|
|
||||||
@ -440,8 +440,8 @@ utcTimeField = Field
|
|||||||
fieldTimeFormat :: String
|
fieldTimeFormat :: String
|
||||||
--fieldTimeFormat = "%e.%m.%y %k:%M"
|
--fieldTimeFormat = "%e.%m.%y %k:%M"
|
||||||
fieldTimeFormat = "%Y-%m-%dT%H:%M"
|
fieldTimeFormat = "%Y-%m-%dT%H:%M"
|
||||||
|
|
||||||
-- `defaultTimeLocale` is okay here, since `fieldTimeFormat` does not contain any
|
-- `defaultTimeLocale` is okay here, since `fieldTimeFormat` does not contain any
|
||||||
readTime :: Text -> Either UniWorXMessage UTCTime
|
readTime :: Text -> Either UniWorXMessage UTCTime
|
||||||
readTime t =
|
readTime t =
|
||||||
case localTimeToUTC <$> parseTimeM True defaultTimeLocale fieldTimeFormat (T.unpack t) of
|
case localTimeToUTC <$> parseTimeM True defaultTimeLocale fieldTimeFormat (T.unpack t) of
|
||||||
@ -595,7 +595,7 @@ formResultModal res finalDest handler = maybeT_ $ do
|
|||||||
FormMissing -> mzero
|
FormMissing -> mzero
|
||||||
FormFailure errs -> mapM_ (addMessage Error . toHtml) errs >> mzero
|
FormFailure errs -> mapM_ (addMessage Error . toHtml) errs >> mzero
|
||||||
FormSuccess val -> lift . execWriterT $ handler val
|
FormSuccess val -> lift . execWriterT $ handler val
|
||||||
|
|
||||||
isModal <- hasCustomHeader HeaderIsModal
|
isModal <- hasCustomHeader HeaderIsModal
|
||||||
if
|
if
|
||||||
| isModal -> sendResponse $ toJSON messages
|
| isModal -> sendResponse $ toJSON messages
|
||||||
|
|||||||
@ -3,18 +3,19 @@ $# submissionRatingPoints :: Maybe points
|
|||||||
|
|
||||||
$maybe points <- submissionRatingPoints
|
$maybe points <- submissionRatingPoints
|
||||||
$maybe grading <- preview _grading sheetType
|
$maybe grading <- preview _grading sheetType
|
||||||
$case grading
|
$case grading
|
||||||
$of Points{..}
|
$of Points{..}
|
||||||
_{MsgAchievedOf points maxPoints}
|
_{MsgAchievedOf points maxPoints}
|
||||||
$of PassPoints{}
|
$of PassPoints{maxPoints}
|
||||||
$if fromMaybe False (gradingPassed grading points)
|
$if fromMaybe False (gradingPassed grading points)
|
||||||
_{MsgPassed}
|
_{MsgPassed}, _{MsgAchievedOf points maxPoints}
|
||||||
$else
|
$else
|
||||||
_{MsgNotPassed}
|
_{MsgNotPassed}, _{MsgAchievedOf points maxPoints}
|
||||||
$of PassBinary
|
$of PassBinary
|
||||||
$if fromMaybe False (gradingPassed grading points)
|
$if fromMaybe False (gradingPassed grading points)
|
||||||
_{MsgPassed}
|
_{MsgPassed}
|
||||||
$else
|
$else
|
||||||
_{MsgNotPassed}
|
_{MsgNotPassed}
|
||||||
|
, _{SheetTypeHeader sheetType}
|
||||||
$nothing
|
$nothing
|
||||||
#{tickmarkS}
|
#{tickmarkS}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user