Overview Corrections working now

This commit is contained in:
Steffen Jost 2019-06-17 16:30:04 +02:00
parent 55cd175f06
commit fedcc9a2ad
4 changed files with 37 additions and 17 deletions

View File

@ -409,6 +409,7 @@ NrSubmissionsNewlyAssigned: Neu zugeteilt
NrSubmissionsNotAssigned: Nicht zugeteilt NrSubmissionsNotAssigned: Nicht zugeteilt
NrSubmissionsNotCorrected: Unkorrigiert NrSubmissionsNotCorrected: Unkorrigiert
CorrectionTime: Korrekturdauer (Min/Avg/Max) CorrectionTime: Korrekturdauer (Min/Avg/Max)
AssignSubmissionsRandomWarning: Die Zuteilungsvorschau kann geringfügig von der tatsächlichen Zuteilung abweichen, da die Zuteilung ein randomisierter Prozess ist. Mehrfaches neues Laden dieser Seite vor Betätigung des Zuteilungsknopfes kann dies sichtbar machen.
CorrectionsUploaded num@Int64: #{display num} Korrekturen wurden gespeichert: CorrectionsUploaded num@Int64: #{display num} Korrekturen wurden gespeichert:
NoCorrectionsUploaded: In der hochgeladenen Datei wurden keine Korrekturen gefunden. NoCorrectionsUploaded: In der hochgeladenen Datei wurden keine Korrekturen gefunden.
@ -836,7 +837,8 @@ MenuCorrectionsUpload: Korrekturen hochladen
MenuCorrectionsDownload: Offene Abgaben herunterladen MenuCorrectionsDownload: Offene Abgaben herunterladen
MenuCorrectionsCreate: Abgaben registrieren MenuCorrectionsCreate: Abgaben registrieren
MenuCorrectionsGrade: Abgaben online korrigieren MenuCorrectionsGrade: Abgaben online korrigieren
MenuCorrectionsAssign: Abgaben automatisch zuteilen MenuCorrectionsAssign: Zuteilung Korrekturen
MenuCorrectionsAssignSheet name@Text: Zuteilung Korrekturen von #{name}
MenuAuthPreds: Authorisierungseinstellungen MenuAuthPreds: Authorisierungseinstellungen
MenuTutorialDelete: Tutorium löschen MenuTutorialDelete: Tutorium löschen
MenuTutorialEdit: Tutorium editieren MenuTutorialEdit: Tutorium editieren

View File

@ -1427,7 +1427,7 @@ instance YesodBreadcrumbs UniWorX where
breadcrumb (CourseR tid ssh csh CInviteR) = return ("Einladung", Just $ CourseR tid ssh csh CShowR) breadcrumb (CourseR tid ssh csh CInviteR) = return ("Einladung", Just $ CourseR tid ssh csh CShowR)
breadcrumb (CourseR tid ssh csh (CUserR _)) = return ("Teilnehmer" , Just $ CourseR tid ssh csh CUsersR) breadcrumb (CourseR tid ssh csh (CUserR _)) = return ("Teilnehmer" , Just $ CourseR tid ssh csh CUsersR)
breadcrumb (CourseR tid ssh csh CCorrectionsR) = return ("Abgaben" , Just $ CourseR tid ssh csh CShowR) breadcrumb (CourseR tid ssh csh CCorrectionsR) = return ("Abgaben" , Just $ CourseR tid ssh csh CShowR)
breadcrumb (CourseR tid ssh csh CAssignR) = return ("Zuteilen" , Just $ CourseR tid ssh csh CCorrectionsR) breadcrumb (CourseR tid ssh csh CAssignR) = return ("Korrektur" , Just $ CourseR tid ssh csh CCorrectionsR)
breadcrumb (CourseR tid ssh csh SheetListR) = return ("Übungen" , Just $ CourseR tid ssh csh CShowR) breadcrumb (CourseR tid ssh csh SheetListR) = return ("Übungen" , Just $ CourseR tid ssh csh CShowR)
breadcrumb (CourseR tid ssh csh SheetNewR ) = return ("Neu", Just $ CourseR tid ssh csh SheetListR) breadcrumb (CourseR tid ssh csh SheetNewR ) = return ("Neu", Just $ CourseR tid ssh csh SheetListR)
breadcrumb (CourseR tid ssh csh SheetCurrentR) = return ("Aktuelles Blatt", Just $ CourseR tid ssh csh SheetListR) breadcrumb (CourseR tid ssh csh SheetCurrentR) = return ("Aktuelles Blatt", Just $ CourseR tid ssh csh SheetListR)

View File

@ -1054,7 +1054,7 @@ postSAssignR tid ssh csh shn = do
(shid,cid) <- runDB $ fetchSheetIdCourseId tid ssh csh shn (shid,cid) <- runDB $ fetchSheetIdCourseId tid ssh csh shn
assignHandler tid ssh csh cid [shid] assignHandler tid ssh csh cid [shid]
-- DEPRECATED assignHandler' -- DEPRECATED assignHandler', delete me soonish
assignHandler' :: TermId -> SchoolId -> CourseShorthand -> CourseId -> [SheetId] -> Handler Html assignHandler' :: TermId -> SchoolId -> CourseShorthand -> CourseId -> [SheetId] -> Handler Html
assignHandler' tid ssh csh _cid rawSids = do assignHandler' tid ssh csh _cid rawSids = do
-- gather data -- gather data
@ -1175,7 +1175,10 @@ assignHandler tid ssh csh cid assignSids = do
infoMap = List.foldl (flip buildS) emptySheets submissions infoMap = List.foldl (flip buildS) emptySheets submissions
-- ensure that all sheets are shown, including those without any submissions -- ensure that all sheets are shown, including those without any submissions
emptySheets = foldl (\m sid -> Map.insert (sheetName $ sheets ! sid) Map.empty m) Map.empty sheetIds emptySheets = foldl (\m sid -> Map.insert (sheetName $ sheets ! sid) emptyCorrs m) Map.empty sheetIds
emptyCorrs = foldl (\m uid -> let cic = Just uid in
Map.insert cic mempty{ciCorrector=cic} m) Map.empty $ Map.keys correctorMap
buildS :: (Entity Submission, E.Value Int64) -> Map SheetName (Map (Maybe UserId) CorrectionInfo) -> Map SheetName (Map (Maybe UserId) CorrectionInfo) buildS :: (Entity Submission, E.Value Int64) -> Map SheetName (Map (Maybe UserId) CorrectionInfo) -> Map SheetName (Map (Maybe UserId) CorrectionInfo)
buildS (Entity _sheetId Submission{..}, E.Value nrSbmtrs) m = buildS (Entity _sheetId Submission{..}, E.Value nrSbmtrs) m =
@ -1184,7 +1187,7 @@ assignHandler tid ssh csh cid assignSids = do
cinf = Map.singleton submissionRatingBy $ CorrectionInfo cinf = Map.singleton submissionRatingBy $ CorrectionInfo
{ ciSubmittors = fromIntegral nrSbmtrs { ciSubmittors = fromIntegral nrSbmtrs
, ciSubmissions = 1 , ciSubmissions = 1
, ciAssigned = maybe 0 (const 1) submissionRatingBy , ciAssigned = maybe 0 (const 1) submissionRatingBy -- only used in sheetMap
, ciCorrected = maybe 0 (const 1) submissionRatingTime , ciCorrected = maybe 0 (const 1) submissionRatingTime
, ciCorrector = submissionRatingBy , ciCorrector = submissionRatingBy
, ciMin = corTime , ciMin = corTime
@ -1229,7 +1232,9 @@ assignHandler tid ssh csh cid assignSids = do
showAvgsDays (Just dt) n = formatDiffDays $ dt / fromIntegral n showAvgsDays (Just dt) n = formatDiffDays $ dt / fromIntegral n
heat :: Integer -> Integer -> Double heat :: Integer -> Integer -> Double
heat full achieved = roundToDigits 3 $ cutOffPercent 0.4 (fromIntegral full) (fromIntegral achieved) heat full achieved = roundToDigits 3 $ cutOffPercent 0.4 (fromIntegral full) (fromIntegral achieved)
let headingShort = MsgMenuCorrectionsAssign let headingShort
| 0 < Map.size assignment = MsgMenuCorrectionsAssignSheet $ Text.intercalate ", " $ fmap CI.original $ Map.keys assignment
| otherwise = MsgMenuCorrectionsAssign
headingLong = prependCourseTitle tid ssh csh MsgMenuCorrectionsAssign headingLong = prependCourseTitle tid ssh csh MsgMenuCorrectionsAssign
siteLayoutMsg headingShort $ do siteLayoutMsg headingShort $ do
setTitleI headingLong setTitleI headingLong

View File

@ -6,7 +6,7 @@
<th .table__th>_{MsgSheet} <th .table__th>_{MsgSheet}
$if groupsPossible $if groupsPossible
<th .table__th>_{MsgNrSubmittorsTotal} <th .table__th>_{MsgNrSubmittorsTotal}
<th .table__th colspan=2>_{MsgNrSubmissionsTotal} <th .table__th >_{MsgNrSubmissionsTotal}
<th .table__th colspan=2>_{MsgNrSubmissionsNotAssigned} <th .table__th colspan=2>_{MsgNrSubmissionsNotAssigned}
<th .table__th>_{MsgNrSubmissionsNotCorrected} <th .table__th>_{MsgNrSubmissionsNotCorrected}
<th .table__th colspan=3>_{MsgCorrectionTime} <th .table__th colspan=3>_{MsgCorrectionTime}
@ -15,13 +15,17 @@
<td .table__td>^{simpleLink (toWidget sheetName) (CSheetR tid ssh csh sheetName SSubsR)} <td .table__td>^{simpleLink (toWidget sheetName) (CSheetR tid ssh csh sheetName SSubsR)}
$if groupsPossible $if groupsPossible
<td .table__td>#{ciSubmittors} <td .table__td>#{ciSubmittors}
<td .table__td>#{ciSubmissions}
$maybe ((splus,sfailed),_) <- Map.lookup sheetName assignment $maybe ((splus,sfailed),_) <- Map.lookup sheetName assignment
<td .table__td>#{ciSubmissions} $if 0 < Set.size sfailed
<td .table__td .alert-success>(+#{show (Set.size splus)}) <td .table__td>#{ciSubmissions - ciAssigned}
<td .table__td>#{ciSubmissions - ciAssigned} <td .table__td .alert-danger>(-#{show (Set.size splus)}, failed: #{show (Set.size sfailed)})
<td .table__td .alert-danger>(#{show (Set.size sfailed)}) $elseif 0 < Set.size splus
<td .table__td>#{ciSubmissions - ciAssigned}
<td .table__td .alert-success>(-#{show (Set.size splus)})
$else
<td .table__td colspan=2>#{ciSubmissions - ciAssigned}
$nothing $nothing
<td .table__td colspan=2>#{ciSubmissions}
<td .table__td colspan=2>#{ciSubmissions - ciAssigned} <td .table__td colspan=2>#{ciSubmissions - ciAssigned}
<td .table__td>#{ciSubmissions - ciCorrected} <td .table__td>#{ciSubmissions - ciCorrected}
<td .table__td>#{showDiffDays ciMin} <td .table__td>#{showDiffDays ciMin}
@ -37,6 +41,7 @@
<th .table__th colspan=3>_{MsgCorrectionTime} <th .table__th colspan=3>_{MsgCorrectionTime}
$forall shn <- sheetNames $forall shn <- sheetNames
<th .table__th colspan=5>#{shn} <th .table__th colspan=5>#{shn}
$# ^{simpleLinkI (SomeMessage MsgMenuCorrectors) (CSheetR tid ssh csh shn SCorrR)}
$forall (CorrectionInfo{ciCorrector, ciSubmissions, ciCorrected, ciMin, ciTot, ciMax}) <- Map.elems corrMap $forall (CorrectionInfo{ciCorrector, ciSubmissions, ciCorrected, ciMin, ciTot, ciMax}) <- Map.elems corrMap
$with (nameW,loadM) <- getCorrector ciCorrector $with (nameW,loadM) <- getCorrector ciCorrector
<tr .table__row> <tr .table__row>
@ -51,14 +56,22 @@
<td .table__td>#{showCompactCorrectorLoad sheetCorrectorLoad sheetCorrectorState} <td .table__td>#{showCompactCorrectorLoad sheetCorrectorLoad sheetCorrectorState}
$nothing $nothing
<td .table__td> <td .table__td>
$maybe CorrectionInfo{ciAssigned,ciCorrected,ciTot} <- getCorrSheetStatus ciCorrector shn $maybe CorrectionInfo{ciSubmissions,ciCorrected,ciTot} <- getCorrSheetStatus ciCorrector shn
$maybe nrNew <- getCorrNewAssignment ciCorrector shn $maybe nrNew <- getCorrNewAssignment ciCorrector shn
<td .table__td>#{ciAssigned} <td .table__td>#{ciSubmissions}
$# <td .table__td>#{ciAssigned} `ciSubmissions` is here always identical to `ciAssigned` and also works for `ciCorrector == Nothing`. ciAssigned only useful in aggregate maps like `sheetMap`
<td .table__td .alert-success>(+#{nrNew}) <td .table__td .alert-success>(+#{nrNew})
$nothing $nothing
<td .table__td colspan=2>#{ciAssigned} <td .table__td colspan=2>#{ciSubmissions}
<td .table__td .heated style="--hotness: #{heat ciSubmissions ciCorrected}">#{ciAssigned - ciCorrected} <td .table__td .heated style="--hotness: #{heat ciSubmissions ciCorrected}">#{ciSubmissions - ciCorrected}
<td .table__td>#{showAvgsDays ciTot ciCorrected} <td .table__td>#{showAvgsDays ciTot ciCorrected}
$nothing $nothing
<td .table__td colspan=4> <td .table__td colspan=4>
^{btnWdgt} $if 0 < length sheetNames
<tr .table__row>
<td colspan=6>
$forall shn <- sheetNames
<td .table__td colspan=5>^{simpleLinkI (SomeMessage MsgMenuCorrectors) (CSheetR tid ssh csh shn SCorrR)}
^{btnWdgt}
<div>
<p>_{MsgAssignSubmissionsRandomWarning}