feat(sheets): pass-always
This commit is contained in:
parent
8bb3bc50a2
commit
b2ebce4836
@ -990,12 +990,14 @@ SheetGradingPoints maxPoints@Points: #{maxPoints} #{pluralDE maxPoints "Punkt" "
|
|||||||
SheetGradingPassPoints maxPoints@Points passingPoints@Points: Bestanden ab #{passingPoints} von #{maxPoints} #{pluralDE maxPoints "Punkt" "Punkten"}
|
SheetGradingPassPoints maxPoints@Points passingPoints@Points: Bestanden ab #{passingPoints} von #{maxPoints} #{pluralDE maxPoints "Punkt" "Punkten"}
|
||||||
SheetGradingPassBinary: Bestanden/Nicht Bestanden
|
SheetGradingPassBinary: Bestanden/Nicht Bestanden
|
||||||
SheetGradingInfo: "Bestanden nach Punkten" zählt sowohl zur maximal erreichbaren Gesamtpunktzahl also auch zur Anzahl der zu bestehenden Blätter.
|
SheetGradingInfo: "Bestanden nach Punkten" zählt sowohl zur maximal erreichbaren Gesamtpunktzahl also auch zur Anzahl der zu bestehenden Blätter.
|
||||||
|
SheetGradingPassAlways: Automatisch bestanden, sobald korrigiert
|
||||||
|
|
||||||
SheetGradingCount': Anzahl
|
SheetGradingCount': Anzahl
|
||||||
SheetGradingPoints': Punkte
|
SheetGradingPoints': Punkte
|
||||||
SheetGradingPassing': Bestehen
|
SheetGradingPassing': Bestehen
|
||||||
SheetGradingPassPoints': Bestehen nach Punkten
|
SheetGradingPassPoints': Bestehen nach Punkten
|
||||||
SheetGradingPassBinary': Bestanden/Nicht bestanden
|
SheetGradingPassBinary': Bestanden/Nicht bestanden
|
||||||
|
SheetGradingPassAlways': Automatisch bestanden, sobald korrigiert
|
||||||
|
|
||||||
SheetTypeBonus grading@SheetGrading: Bonus
|
SheetTypeBonus grading@SheetGrading: Bonus
|
||||||
SheetTypeNormal grading@SheetGrading: Normal
|
SheetTypeNormal grading@SheetGrading: Normal
|
||||||
|
|||||||
@ -798,10 +798,16 @@ postCorrectionR tid ssh csh shn cid = do
|
|||||||
[(Entity _ Course{..}, Entity _ Sheet{..}, Entity _ subm@Submission{..}, corrector)] -> do
|
[(Entity _ Course{..}, Entity _ Sheet{..}, Entity _ subm@Submission{..}, corrector)] -> do
|
||||||
let ratingComment = fmap Text.strip submissionRatingComment >>= (\c -> c <$ guard (not $ null c))
|
let ratingComment = fmap Text.strip submissionRatingComment >>= (\c -> c <$ guard (not $ null c))
|
||||||
pointsForm = case sheetType of
|
pointsForm = case sheetType of
|
||||||
NotGraded -> pure Nothing
|
NotGraded
|
||||||
_otherwise -> aopt (pointsFieldMax $ preview (_grading . _maxPoints) sheetType)
|
-> pure Nothing
|
||||||
(fslpI MsgRatingPoints (mr MsgPointsPlaceholder) & setTooltip sheetType)
|
(preview _grading -> Just PassBinary)
|
||||||
(Just submissionRatingPoints)
|
-> Just <$> apopt (convertField (bool 0 1) (/= 0) checkBoxField) (fslI MsgPassed) submissionRatingPoints
|
||||||
|
(preview _grading -> Just PassAlways)
|
||||||
|
-> Just <$> aforced (convertField (bool 0 1) (/= 0) checkBoxField) (fslI MsgPassed) 1
|
||||||
|
_otherwise
|
||||||
|
-> aopt (pointsFieldMax $ preview (_grading . _maxPoints) sheetType)
|
||||||
|
(fslpI MsgRatingPoints (mr MsgPointsPlaceholder) & setTooltip sheetType)
|
||||||
|
(Just submissionRatingPoints)
|
||||||
|
|
||||||
((corrResult, corrForm'), corrEncoding) <- runFormPost . identifyForm FIDcorrection . renderAForm FormStandard $ (,,)
|
((corrResult, corrForm'), corrEncoding) <- runFormPost . identifyForm FIDcorrection . renderAForm FormStandard $ (,,)
|
||||||
<$> areq checkBoxField (fslI MsgRatingDone) (Just $ submissionRatingDone Submission{..})
|
<$> areq checkBoxField (fslI MsgRatingDone) (Just $ submissionRatingDone Submission{..})
|
||||||
|
|||||||
@ -1121,7 +1121,7 @@ multiFileField mkPermitted = genericFileField $ mkField <$> mkPermitted
|
|||||||
, fieldAdditionalFiles = Map.fromSet (const $ FileFieldUserOption False True) permitted
|
, fieldAdditionalFiles = Map.fromSet (const $ FileFieldUserOption False True) permitted
|
||||||
}
|
}
|
||||||
|
|
||||||
data SheetGrading' = Points' | PassPoints' | PassBinary'
|
data SheetGrading' = Points' | PassPoints' | PassBinary' | PassAlways'
|
||||||
deriving (Eq, Ord, Read, Show, Enum, Bounded)
|
deriving (Eq, Ord, Read, Show, Enum, Bounded)
|
||||||
|
|
||||||
instance Universe SheetGrading'
|
instance Universe SheetGrading'
|
||||||
@ -1157,12 +1157,14 @@ sheetGradingAFormReq fs template = multiActionA selOptions fs (classify' <$> tem
|
|||||||
[ ( Points', Points <$> maxPointsReq )
|
[ ( Points', Points <$> maxPointsReq )
|
||||||
, ( PassPoints', PassPoints <$> maxPointsReq <*> passPointsReq )
|
, ( PassPoints', PassPoints <$> maxPointsReq <*> passPointsReq )
|
||||||
, ( PassBinary', pure PassBinary)
|
, ( PassBinary', pure PassBinary)
|
||||||
|
, ( PassAlways', pure PassAlways)
|
||||||
]
|
]
|
||||||
classify' :: SheetGrading -> SheetGrading'
|
classify' :: SheetGrading -> SheetGrading'
|
||||||
classify' = \case
|
classify' = \case
|
||||||
Points {} -> Points'
|
Points {} -> Points'
|
||||||
PassPoints {} -> PassPoints'
|
PassPoints {} -> PassPoints'
|
||||||
PassBinary {} -> PassBinary'
|
PassBinary {} -> PassBinary'
|
||||||
|
PassAlways {} -> PassAlways'
|
||||||
|
|
||||||
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)
|
||||||
|
|||||||
@ -48,6 +48,7 @@ instance Pretty SheetGrading where
|
|||||||
pretty Points{..} = pretty ( "Maximal " <> show maxPoints <> " Punkt(e)" :: String)
|
pretty Points{..} = pretty ( "Maximal " <> show maxPoints <> " Punkt(e)" :: String)
|
||||||
pretty PassPoints{..} = pretty ( "Maximal " <> show maxPoints <> " Punkt(e), bestanden ab " <> show passingPoints <> " Punkt(en)" :: String )
|
pretty PassPoints{..} = pretty ( "Maximal " <> show maxPoints <> " Punkt(e), bestanden ab " <> show passingPoints <> " Punkt(en)" :: String )
|
||||||
pretty PassBinary = pretty ( "Bestanden (1) / Nicht bestanden (0)" :: String )
|
pretty PassBinary = pretty ( "Bestanden (1) / Nicht bestanden (0)" :: String )
|
||||||
|
pretty PassAlways = pretty ( "Automatisch bestanden, sobald korrigiert" :: String )
|
||||||
|
|
||||||
|
|
||||||
validateRating :: SheetType -> Rating' -> [RatingException]
|
validateRating :: SheetType -> Rating' -> [RatingException]
|
||||||
@ -66,6 +67,7 @@ validateRating ratingSheetType Rating'{ .. }
|
|||||||
| has _grading ratingSheetType
|
| has _grading ratingSheetType
|
||||||
, is _Nothing ratingPoints
|
, is _Nothing ratingPoints
|
||||||
, isn't _Nothing ratingTime
|
, isn't _Nothing ratingTime
|
||||||
|
, hasn't (_grading . _PassAlways) ratingSheetType
|
||||||
= [RatingPointsRequired]
|
= [RatingPointsRequired]
|
||||||
validateRating _ _ = []
|
validateRating _ _ = []
|
||||||
|
|
||||||
@ -101,23 +103,23 @@ getRating submissionId = runMaybeT $ do
|
|||||||
|
|
||||||
formatRating :: CryptoFileNameSubmission -> Rating -> Lazy.ByteString
|
formatRating :: CryptoFileNameSubmission -> Rating -> Lazy.ByteString
|
||||||
formatRating cID Rating{ ratingValues = Rating'{..}, ..} = let
|
formatRating cID Rating{ ratingValues = Rating'{..}, ..} = let
|
||||||
doc = renderPretty 1 45 $ foldr (<$$>) mempty
|
doc = renderPretty 1 45 . foldr (<$$>) mempty $ catMaybes
|
||||||
[ "= Bitte nur Bewertung und Kommentare ändern ="
|
[ pure "= Bitte nur Bewertung und Kommentare ändern ="
|
||||||
, "============================================="
|
, pure "============================================="
|
||||||
, "========== Uni2work Bewertungsdatei ========="
|
, pure "========== Uni2work Bewertungsdatei ========="
|
||||||
, "======= diese Datei ist UTF8 encodiert ======"
|
, pure "======= diese Datei ist UTF8 encodiert ======"
|
||||||
, "Informationen zum Übungsblatt:"
|
, pure "Informationen zum Übungsblatt:"
|
||||||
, indent 2 . foldr (<$$>) mempty . catMaybes $
|
, pure . indent 2 . foldr (<$$>) mempty . catMaybes $
|
||||||
[ Just $ "Veranstaltung:" <+> pretty ratingCourseName
|
[ Just $ "Veranstaltung:" <+> pretty ratingCourseName
|
||||||
, Just $ "Blatt:" <+> pretty ratingSheetName
|
, Just $ "Blatt:" <+> pretty ratingSheetName
|
||||||
, ("Korrektor:" <+>) . pretty <$> ratingCorrectorName
|
, ("Korrektor:" <+>) . pretty <$> ratingCorrectorName
|
||||||
, ("Bewertungsschema:" <+>) . pretty <$> (ratingSheetType ^? _grading)
|
, ("Bewertungsschema:" <+>) . pretty <$> (ratingSheetType ^? _grading)
|
||||||
]
|
]
|
||||||
, "Abgabe-Id:" <+> pretty (Text.unpack $ toPathPiece cID)
|
, pure $ "Abgabe-Id:" <+> pretty (Text.unpack $ toPathPiece cID)
|
||||||
, "============================================="
|
, guardOn (hasn't (_grading . _PassAlways) ratingSheetType) "============================================="
|
||||||
, "Bewertung:" <+> pretty ratingPoints
|
, guardOn (hasn't (_grading . _PassAlways) ratingSheetType) $ "Bewertung:" <+> pretty ratingPoints
|
||||||
, "=========== Beginn der Kommentare ==========="
|
, pure $ "=========== Beginn der Kommentare ==========="
|
||||||
, pretty ratingComment
|
, pure $ pretty ratingComment
|
||||||
]
|
]
|
||||||
in Lazy.Text.encodeUtf8 . (<> "\n") $ displayT doc
|
in Lazy.Text.encodeUtf8 . (<> "\n") $ displayT doc
|
||||||
|
|
||||||
@ -149,6 +151,7 @@ parseRating File{ fileContent = Just input, .. } = do
|
|||||||
| Text.null comment' = Nothing
|
| Text.null comment' = Nothing
|
||||||
| otherwise = Just comment'
|
| otherwise = Just comment'
|
||||||
ratingLine' <- case ratingLines' of
|
ratingLine' <- case ratingLines' of
|
||||||
|
[] -> return Text.empty
|
||||||
[l] -> return l
|
[l] -> return l
|
||||||
_ -> throwM RatingMultiple
|
_ -> throwM RatingMultiple
|
||||||
let
|
let
|
||||||
|
|||||||
@ -25,6 +25,7 @@ data SheetGrading
|
|||||||
= Points { maxPoints :: Points }
|
= Points { maxPoints :: Points }
|
||||||
| PassPoints { maxPoints, passingPoints :: Points }
|
| PassPoints { maxPoints, passingPoints :: Points }
|
||||||
| PassBinary -- non-zero means passed
|
| PassBinary -- non-zero means passed
|
||||||
|
| PassAlways
|
||||||
deriving (Eq, Read, Show, Generic)
|
deriving (Eq, Read, Show, Generic)
|
||||||
|
|
||||||
deriveJSON defaultOptions
|
deriveJSON defaultOptions
|
||||||
@ -44,8 +45,10 @@ _passingBound = folding passPts
|
|||||||
passPts Points{} = Nothing
|
passPts Points{} = Nothing
|
||||||
passPts PassPoints{passingPoints} = Just $ Right passingPoints
|
passPts PassPoints{passingPoints} = Just $ Right passingPoints
|
||||||
passPts PassBinary = Just $ Left ()
|
passPts PassBinary = Just $ Left ()
|
||||||
|
passPts PassAlways = Just $ Left ()
|
||||||
|
|
||||||
gradingPassed :: SheetGrading -> Points -> Maybe Bool
|
gradingPassed :: SheetGrading -> Points -> Maybe Bool
|
||||||
|
gradingPassed PassAlways _ = Just True
|
||||||
gradingPassed gr pts = either pBinary pPoints <$> gr ^? _passingBound
|
gradingPassed gr pts = either pBinary pPoints <$> gr ^? _passingBound
|
||||||
where pBinary _ = pts /= 0
|
where pBinary _ = pts /= 0
|
||||||
pPoints b = pts >= b
|
pPoints b = pts >= b
|
||||||
|
|||||||
@ -38,6 +38,7 @@
|
|||||||
_{MsgPassed}
|
_{MsgPassed}
|
||||||
$else
|
$else
|
||||||
_{MsgNotPassed}
|
_{MsgNotPassed}
|
||||||
|
$of PassAlways
|
||||||
|
|
||||||
$maybe comment <- ratingComment
|
$maybe comment <- ratingComment
|
||||||
<tr .table__row>
|
<tr .table__row>
|
||||||
|
|||||||
@ -56,6 +56,8 @@ $newline never
|
|||||||
_{MsgPassed}
|
_{MsgPassed}
|
||||||
$else
|
$else
|
||||||
_{MsgNotPassed}
|
_{MsgNotPassed}
|
||||||
|
$of PassAlways
|
||||||
|
<dd>
|
||||||
|
|
||||||
$maybe comment <- submissionRatingComment
|
$maybe comment <- submissionRatingComment
|
||||||
<dt>
|
<dt>
|
||||||
|
|||||||
@ -8,16 +8,20 @@ $if submissionRatingDone sub
|
|||||||
$case grading
|
$case grading
|
||||||
$of Points{..}
|
$of Points{..}
|
||||||
_{MsgAchievedOf points maxPoints}
|
_{MsgAchievedOf points maxPoints}
|
||||||
|
, #
|
||||||
$of PassPoints{maxPoints}
|
$of PassPoints{maxPoints}
|
||||||
$if fromMaybe False (gradingPassed grading points)
|
$if fromMaybe False (gradingPassed grading points)
|
||||||
_{MsgPassed}, _{MsgAchievedOf points maxPoints}
|
_{MsgPassed}, _{MsgAchievedOf points maxPoints}
|
||||||
$else
|
$else
|
||||||
_{MsgNotPassed}, _{MsgAchievedOf points maxPoints}
|
_{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}
|
, #
|
||||||
|
$of PassAlways
|
||||||
|
_{SheetTypeHeader sheetType}
|
||||||
$nothing
|
$nothing
|
||||||
#{hasTickmark True}
|
#{hasTickmark True}
|
||||||
|
|||||||
@ -3,9 +3,12 @@ module Database.Fill
|
|||||||
) where
|
) where
|
||||||
|
|
||||||
import "uniworx" Import hiding (Option(..), currentYear)
|
import "uniworx" Import hiding (Option(..), currentYear)
|
||||||
|
import Handler.Utils.Form (SheetGrading'(..), SheetType'(..), SheetGroup'(..))
|
||||||
|
|
||||||
import qualified Data.ByteString as BS
|
import qualified Data.ByteString as BS
|
||||||
import qualified Data.ByteString.Lazy as LBS
|
import qualified Data.ByteString.Lazy as LBS
|
||||||
|
import qualified Data.Text as Text
|
||||||
|
-- import Data.Text.IO (hPutStrLn)
|
||||||
|
|
||||||
import qualified Data.Set as Set
|
import qualified Data.Set as Set
|
||||||
import qualified Data.Map as Map
|
import qualified Data.Map as Map
|
||||||
@ -25,6 +28,7 @@ import qualified Data.CaseInsensitive as CI
|
|||||||
import qualified Data.Csv as Csv
|
import qualified Data.Csv as Csv
|
||||||
|
|
||||||
import Crypto.Random (getRandomBytes)
|
import Crypto.Random (getRandomBytes)
|
||||||
|
import Data.List (genericLength)
|
||||||
|
|
||||||
|
|
||||||
testdataDir :: FilePath
|
testdataDir :: FilePath
|
||||||
@ -68,7 +72,7 @@ fillDb = do
|
|||||||
|
|
||||||
termTime :: Bool -- ^ Next term?
|
termTime :: Bool -- ^ Next term?
|
||||||
-> Season
|
-> Season
|
||||||
-> Integer
|
-> Rational
|
||||||
-> Bool -- ^ Relative to end of semester?
|
-> Bool -- ^ Relative to end of semester?
|
||||||
-> WeekDay
|
-> WeekDay
|
||||||
-> (Day -> UTCTime)
|
-> (Day -> UTCTime)
|
||||||
@ -76,7 +80,7 @@ fillDb = do
|
|||||||
termTime next gSeason weekOffset fromEnd day = ($ utctDay)
|
termTime next gSeason weekOffset fromEnd day = ($ utctDay)
|
||||||
where
|
where
|
||||||
utctDay = fromWeekDate wYear wWeek $ fromEnum day
|
utctDay = fromWeekDate wYear wWeek $ fromEnum day
|
||||||
(wYear, wWeek, _) = toWeekDate . addDays (7 * weekOffset) $ fromGregorian gYear rMonth rDay
|
(wYear, wWeek, _) = toWeekDate . addDays (round $ 7 * weekOffset) $ fromGregorian gYear rMonth rDay
|
||||||
gYear = year $ seasonTerm next gSeason
|
gYear = year $ seasonTerm next gSeason
|
||||||
(rMonth, rDay)
|
(rMonth, rDay)
|
||||||
| Winter <- gSeason
|
| Winter <- gSeason
|
||||||
@ -743,108 +747,111 @@ fillDb = do
|
|||||||
,(maxMuster , Just sfMMp)
|
,(maxMuster , Just sfMMp)
|
||||||
,(tinaTester, Just sfTTb)
|
,(tinaTester, Just sfTTb)
|
||||||
]
|
]
|
||||||
sh1 <- insert Sheet
|
|
||||||
{ sheetCourse = pmo
|
let shTypes = NotGraded : [ shType g | g <- shGradings, shType <- [ Normal, Bonus, Informational ] ]
|
||||||
, sheetName = "Papierabgabe"
|
where shGradings = [ Points 6, PassPoints 3 6, PassBinary, PassAlways ]
|
||||||
, sheetDescription = Nothing
|
shGroupings = [ Arbitrary 3, RegisteredGroups, NoGroups ]
|
||||||
, sheetType = Normal $ Points 6
|
shSubModes = do
|
||||||
, sheetGrouping = Arbitrary 3
|
corrector <- universeF
|
||||||
, sheetMarkingText = Nothing
|
[ SubmissionMode corrector Nothing
|
||||||
, sheetVisibleFrom = Just $ termTime True Summer 0 False Monday toMidnight
|
, SubmissionMode corrector $ Just NoUpload
|
||||||
, sheetActiveFrom = Just $ termTime True Summer 1 False Monday toMidnight
|
, SubmissionMode corrector $ Just UploadSpecific
|
||||||
, sheetActiveTo = Just $ termTime True Summer 2 False Sunday beforeMidnight
|
{ specificFiles = impureNonNull $ Set.fromList
|
||||||
, sheetSubmissionMode = SubmissionMode True Nothing
|
[ UploadSpecificFile "Aufgabe 1" "exercise_2.1.hs" False
|
||||||
, sheetHintFrom = Nothing
|
, UploadSpecificFile "Aufgabe 2" "exercise_2.2.hs" False
|
||||||
, sheetSolutionFrom = Nothing
|
, UploadSpecificFile "Erklärung der Eigenständigkeit" "erklärung.txt" True
|
||||||
, sheetAutoDistribute = True
|
]
|
||||||
, sheetAnonymousCorrection = False
|
}
|
||||||
}
|
] ++ [ SubmissionMode corrector $ Just UploadAny{..}
|
||||||
void . insert $ SheetEdit jost now sh1
|
| unpackZips <- universeF
|
||||||
forM_ [fhamann, maxMuster, tinaTester] $ \u -> do
|
, extensionRestriction <- [ Nothing, Just . impureNonNull $ Set.fromList ["pdf", "txt", "jpeg", "hs"] ]
|
||||||
p <- liftIO getRandom
|
]
|
||||||
$logDebug (review _PseudonymText p)
|
|
||||||
void . insert $ SheetPseudonym sh1 p u
|
sheetCombinations = ((,,) <$> shTypes <*> shGroupings <*> shSubModes)
|
||||||
void . insert $ SheetCorrector jost sh1 (Load (Just True) 0) CorrectorNormal
|
|
||||||
void . insert $ SheetCorrector gkleen sh1 (Load (Just True) 1) CorrectorNormal
|
forM_ (zip [0..] sheetCombinations) $ \(shNr, (sheetType, sheetGrouping, sheetSubmissionMode)) -> do
|
||||||
h102 <- insertFile "H10-2.hs"
|
MsgRenderer mr <- getMsgRenderer
|
||||||
h103 <- insertFile "H10-3.hs"
|
|
||||||
pdf10 <- insertFile "ProMo_Uebung10.pdf"
|
let sheetSubmissionModeDescr
|
||||||
void . insert $ SheetFile sh1 h102 SheetHint
|
| Just userMode <- sheetSubmissionMode ^? _submissionModeUser . _Just
|
||||||
void . insert $ SheetFile sh1 h103 SheetSolution
|
= let
|
||||||
void . insert $ SheetFile sh1 pdf10 SheetExercise
|
extra = catMaybes
|
||||||
--
|
[ guardOn (fromMaybe False $ userMode ^? _unpackZips) $ mr MsgAutoUnzip
|
||||||
sub1 <- insert $ Submission
|
, guardOn (maybe False (is _Just) $ userMode ^? _extensionRestriction) $ mr MsgUploadModeExtensionRestriction
|
||||||
{ submissionSheet = sh1
|
]
|
||||||
, submissionRatingPoints = Nothing
|
in mr (classifySubmissionMode sheetSubmissionMode) <> " (" <> Text.intercalate ", " (mr (classifyUploadMode userMode) : extra) <> ")"
|
||||||
, submissionRatingComment = Nothing
|
| Just userMode <- sheetSubmissionMode ^? _submissionModeUser . _Just
|
||||||
, submissionRatingBy = Just gkleen
|
= mr (classifySubmissionMode sheetSubmissionMode) <> " (" <> mr (classifyUploadMode userMode) <> ")"
|
||||||
, submissionRatingAssigned = Just now
|
| otherwise
|
||||||
, submissionRatingTime = Nothing
|
= mr (classifySubmissionMode sheetSubmissionMode)
|
||||||
}
|
sheetGroupingDescr = case sheetGrouping of
|
||||||
void . insert $ SubmissionEdit (Just maxMuster) now sub1
|
Arbitrary{} -> mr Arbitrary'
|
||||||
void . insert $ SubmissionUser maxMuster sub1
|
RegisteredGroups -> mr RegisteredGroups'
|
||||||
sub1fid1 <- insertFile "AbgabeH10-1.hs"
|
NoGroups -> mr NoGroups'
|
||||||
void . insert $ SubmissionFile sub1 sub1fid1 False False
|
sheetTypeDescr
|
||||||
sub2 <- insert $ Submission sh1 Nothing Nothing Nothing Nothing Nothing
|
| Just g <- sheetType ^? _grading
|
||||||
void . insert $ SubmissionEdit (Just fhamann) now sub2
|
= let sheetGrading' = case g of
|
||||||
void . insert $ SubmissionUser fhamann sub2
|
Points{} -> Points'
|
||||||
sh2 <- insert Sheet
|
PassPoints{} -> PassPoints'
|
||||||
{ sheetCourse = pmo
|
PassBinary{} -> PassBinary'
|
||||||
, sheetName = "Spezifische Abgabe"
|
PassAlways{} -> PassAlways'
|
||||||
, sheetDescription = Nothing
|
in mr sheetType' <> " (" <> mr sheetGrading' <> ")"
|
||||||
, sheetType = Normal $ Points 6
|
| otherwise
|
||||||
, sheetGrouping = Arbitrary 3
|
= mr sheetType'
|
||||||
, sheetMarkingText = Nothing
|
where
|
||||||
, sheetVisibleFrom = Just $ termTime True Summer 1 False Monday toMidnight
|
sheetType' = case sheetType of
|
||||||
, sheetActiveFrom = Just $ termTime True Summer 2 False Monday toMidnight
|
NotGraded -> NotGraded'
|
||||||
, sheetActiveTo = Just $ termTime True Summer 3 False Sunday beforeMidnight
|
Normal{} -> Normal'
|
||||||
, sheetSubmissionMode = SubmissionMode False $ Just UploadSpecific
|
Bonus{} -> Bonus'
|
||||||
{ specificFiles = impureNonNull $ Set.fromList
|
Informational{} -> Informational'
|
||||||
[ UploadSpecificFile "Aufgabe 1" "exercise_2.1.hs" False
|
|
||||||
, UploadSpecificFile "Aufgabe 2" "exercise_2.2.hs" False
|
prog = 14 * (shNr % genericLength sheetCombinations)
|
||||||
, UploadSpecificFile "Erklärung der Eigenständigkeit" "erklärung.txt" True
|
|
||||||
]
|
-- liftIO . hPutStrLn stderr $ Text.intercalate ", " [sheetTypeDescr, sheetGroupingDescr, sheetSubmissionModeDescr]
|
||||||
|
-- liftIO . hPutStrLn stderr $ tshow (sheetType, sheetGrouping, sheetSubmissionMode)
|
||||||
|
|
||||||
|
shId <- insert Sheet
|
||||||
|
{ sheetCourse = pmo
|
||||||
|
, sheetName = CI.mk $ tshow shNr <> ": " <> Text.intercalate ", " [sheetTypeDescr, sheetGroupingDescr, sheetSubmissionModeDescr]
|
||||||
|
, sheetDescription = Nothing
|
||||||
|
, sheetType, sheetGrouping, sheetSubmissionMode
|
||||||
|
, sheetMarkingText = Nothing
|
||||||
|
, sheetVisibleFrom = Just $ termTime True Summer prog False Monday toMidnight
|
||||||
|
, sheetActiveFrom = Just $ termTime True Summer (prog + 1) False Monday toMidnight
|
||||||
|
, sheetActiveTo = Just $ termTime True Summer (prog + 2) False Sunday beforeMidnight
|
||||||
|
, sheetHintFrom = Nothing
|
||||||
|
, sheetSolutionFrom = Nothing
|
||||||
|
, sheetAutoDistribute = True
|
||||||
|
, sheetAnonymousCorrection = True
|
||||||
}
|
}
|
||||||
, sheetHintFrom = Nothing
|
void . insert $ SheetEdit jost now shId
|
||||||
, sheetSolutionFrom = Nothing
|
when (submissionModeCorrector sheetSubmissionMode) $
|
||||||
, sheetAutoDistribute = True
|
forM_ [fhamann, maxMuster, tinaTester] $ \uid -> do
|
||||||
, sheetAnonymousCorrection = False
|
p <- liftIO getRandom
|
||||||
}
|
void . insert $ SheetPseudonym shId p uid
|
||||||
void . insert $ SheetEdit jost now sh2
|
void . insert $ SheetCorrector jost shId (Load (Just True) 0) CorrectorNormal
|
||||||
sh3 <- insert Sheet
|
void . insert $ SheetCorrector gkleen shId (Load (Just True) 1) CorrectorNormal
|
||||||
{ sheetCourse = pmo
|
void . insert $ SheetCorrector svaupel shId (Load (Just True) 1) CorrectorNormal
|
||||||
, sheetName = "Dateiendung-eingeschränkte Abgabe"
|
h102 <- insertFile "H10-2.hs"
|
||||||
, sheetDescription = Nothing
|
h103 <- insertFile "H10-3.hs"
|
||||||
, sheetType = Normal $ Points 6
|
pdf10 <- insertFile "ProMo_Uebung10.pdf"
|
||||||
, sheetGrouping = Arbitrary 3
|
void . insert $ SheetFile shId h102 SheetHint
|
||||||
, sheetMarkingText = Nothing
|
void . insert $ SheetFile shId h103 SheetSolution
|
||||||
, sheetVisibleFrom = Just $ termTime True Summer 2 False Monday toMidnight
|
void . insert $ SheetFile shId pdf10 SheetExercise
|
||||||
, sheetActiveFrom = Just $ termTime True Summer 3 False Monday toMidnight
|
|
||||||
, sheetActiveTo = Just $ termTime True Summer 4 False Sunday beforeMidnight
|
forM_ [fhamann, maxMuster, tinaTester] $ \uid -> do
|
||||||
, sheetSubmissionMode = SubmissionMode False . Just $ UploadAny True defaultExtensionRestriction
|
subId <- insert $ Submission
|
||||||
, sheetHintFrom = Nothing
|
{ submissionSheet = shId
|
||||||
, sheetSolutionFrom = Nothing
|
, submissionRatingPoints = Nothing
|
||||||
, sheetAutoDistribute = True
|
, submissionRatingComment = Nothing
|
||||||
, sheetAnonymousCorrection = True
|
, submissionRatingBy = Nothing
|
||||||
}
|
, submissionRatingAssigned = Nothing
|
||||||
void . insert $ SheetEdit jost now sh3
|
, submissionRatingTime = Nothing
|
||||||
sh4 <- insert Sheet
|
}
|
||||||
{ sheetCourse = pmo
|
void . insert $ SubmissionEdit (Just uid) now subId
|
||||||
, sheetName = "Uneingeschränkte Abgabe, einzelne Datei"
|
void . insert $ SubmissionUser uid subId
|
||||||
, sheetDescription = Nothing
|
fId <- insertFile "AbgabeH10-1.hs"
|
||||||
, sheetType = Normal $ Points 6
|
void . insert $ SubmissionFile subId fId False False
|
||||||
, sheetGrouping = Arbitrary 3
|
|
||||||
, sheetMarkingText = Nothing
|
|
||||||
, sheetVisibleFrom = Just $ termTime True Summer 3 False Monday toMidnight
|
|
||||||
, sheetActiveFrom = Just $ termTime True Summer 4 False Monday toMidnight
|
|
||||||
, sheetActiveTo = Just $ termTime True Summer 5 False Sunday beforeMidnight
|
|
||||||
, sheetSubmissionMode = SubmissionMode False . Just $ UploadAny False Nothing
|
|
||||||
, sheetHintFrom = Nothing
|
|
||||||
, sheetSolutionFrom = Nothing
|
|
||||||
, sheetAutoDistribute = True
|
|
||||||
, sheetAnonymousCorrection = True
|
|
||||||
}
|
|
||||||
void . insert $ SheetEdit jost now sh4
|
|
||||||
tut1 <- insert Tutorial
|
tut1 <- insert Tutorial
|
||||||
{ tutorialName = "Di08"
|
{ tutorialName = "Di08"
|
||||||
, tutorialCourse = pmo
|
, tutorialCourse = pmo
|
||||||
@ -1103,7 +1110,7 @@ fillDb = do
|
|||||||
participants <- getRandomR (0, 50)
|
participants <- getRandomR (0, 50)
|
||||||
manyUsers' <- shuffleM $ take 1024 manyUsers
|
manyUsers' <- shuffleM $ take 1024 manyUsers
|
||||||
forM_ (take participants manyUsers') $ \uid ->
|
forM_ (take participants manyUsers') $ \uid ->
|
||||||
void . insert $ CourseParticipant cid uid now Nothing Nothing CourseParticipantActive
|
void . insertUnique $ CourseParticipant cid uid now Nothing Nothing CourseParticipantActive
|
||||||
|
|
||||||
aSeedBig <- liftIO $ getRandomBytes 40
|
aSeedBig <- liftIO $ getRandomBytes 40
|
||||||
bigAlloc <- insert' Allocation
|
bigAlloc <- insert' Allocation
|
||||||
|
|||||||
Reference in New Issue
Block a user