$newline never $# SPDX-FileCopyrightText: 2022 Gregor Kleen ,Steffen Jost ,Winnie Ros $# $# SPDX-License-Identifier: AGPL-3.0-or-later

_{MsgCorrectionSheets}

_{MsgCourseParticipants nrParticipants}

_{MsgTableSheet} $if groupsPossible _{MsgNrSubmittorsTotal} _{MsgNrSubmissionsTotal} _{MsgNrSubmissionsNotAssigned} _{MsgNrSubmissionsNotCorrected} _{MsgCorrectionTime}
_{MsgGenericNumChange} _{MsgGenericMin} _{MsgGenericAvg} _{MsgGenericMax} $# Always iterate over orderedSheetNames for consistent sorting! Newest first, except in this table $forall sheetName <- reverse orderedSheetNames $maybe CorrectionInfo{ciSubmittors, ciSubmissions, ciAssigned, ciCorrected, ciMin, ciTot, ciMax} <- Map.lookup sheetName sheetMap
^{simpleLink (toWidget sheetName) (CSheetR tid ssh csh sheetName SSubsR)} $if groupsPossible #{ciSubmittors} #{ciSubmissions} $maybe ((splus,sfailed),_,_) <- Map.lookup sheetName assignment $if 0 < Set.size sfailed #{ciSubmissions - ciAssigned} (-#{show (Set.size splus)}, failed: #{show (Set.size sfailed)}) $elseif 0 < Set.size splus #{ciSubmissions - ciAssigned} (-#{show (Set.size splus)}) $else #{ciSubmissions - ciAssigned} $nothing #{ciSubmissions - ciAssigned} #{ciSubmissions - ciCorrected} #{showDiffDays ciMin} #{showAvgsDays ciTot ciCorrected} #{showDiffDays ciMax}

_{MsgCorrectionCorrectors}
_{MsgTableCorrector} _{MsgGenericAll} _{MsgCorDeficitProportion} _{MsgCorrectionTime} $# Always iterate over orderedSheetNames for consistent sorting! Newest first, except in this table $forall shn <- orderedSheetNames ^{simpleLink (toWidget shn) (CSheetR tid ssh csh shn SShowR)}
_{MsgNrSubmissionsTotal} _{MsgNrSubmissionsNotCorrected} _{MsgGenericMin} _{MsgGenericAvg} _{MsgGenericMax} $# Always iterate over orderedSheetNames for consistent sorting! Newest first, except in this table $forall _shn <- orderedSheetNames _{MsgTableCorProportion} _{MsgNrSubmissionsTotalShort} _{MsgGenericNumChange} _{MsgNrSubmissionsNotCorrectedShort} _{MsgGenericAvg} $forall (CorrectionInfo{ciCorrector, ciSubmissions=ciSubmissionsNr, ciCorrected, ciMin, ciTot, ciMax}) <- corrInfos $with (nameW,loadM, name) <- getCorrector ciCorrector $# TODO: User proper Tooltips instead of title attribute here, once Tooltips work with tables
^{nameW} #{ciSubmissionsNr} $with total <- ciSubmissions corrMapSum $if total > 0 \ (#{textPercent' True 0 ciSubmissionsNr total}) #{ciSubmissionsNr - ciCorrected} $maybe deficit <- getCorrDeficit ciCorrector #{rationalToFixed3 deficit} #{showDiffDays ciMin} #{showAvgsDays ciTot ciCorrected} #{showDiffDays ciMax} $# Always iterate over orderedSheetNames for consistent sorting! Newest first, except in this table $forall shn <- orderedSheetNames $maybe CorrectionInfo{ciSubmissions=sheetSubmissionsNr} <- Map.lookup shn sheetMap $maybe SheetCorrector{sheetCorrectorLoad, sheetCorrectorState} <- Map.lookup shn loadM #{showCompactCorrectorLoad sheetCorrectorLoad sheetCorrectorState} $if sheetCorrectorState == CorrectorNormal $maybe Load{byProportion=total} <- Map.lookup shn sheetLoad $if total > 0 \ (#{textPercent' True 0 (byProportion sheetCorrectorLoad) total}) $maybe CorrectionInfo{ciSubmissions,ciCorrected,ciTot} <- getCorrSheetStatus ciCorrector shn #{ciSubmissions} $if sheetSubmissionsNr > 0 \ (#{textPercent' True 0 ciSubmissions sheetSubmissionsNr}) $maybe nrNew <- getCorrNewAssignment ciCorrector shn $# #{ciAssigned} `ciSubmissions` is here always identical to `ciAssigned` and also works for `ciCorrector == Nothing`. ciAssigned only useful in aggregate maps like `sheetMap` (+#{nrNew}) $nothing #{ciSubmissions - ciCorrected} #{showAvgsDays ciTot ciCorrected} $nothing $if not (null orderedSheetNames)
Σ $with ciSubmissionsNr <- ciSubmissions corrMapSum $with ciCorrectedNr <- ciCorrected corrMapSum #{ciSubmissionsNr} #{ciSubmissionsNr - ciCorrectedNr} #{ciCorrected corrMapSum} #{showDiffDays (ciMin corrMapSum)} #{showAvgsDays (ciTot corrMapSum) (ciCorrected corrMapSum)} #{showDiffDays (ciMax corrMapSum)} $# Always iterate over orderedSheetNames for consistent sorting! Newest first, except in this table $forall shn <- orderedSheetNames $maybe CorrectionInfo{ciSubmissions} <- Map.lookup shn sheetMap #{getLoadSum shn} #{ciSubmissions} ^{simpleLinkI (SomeMessage MsgCorrectorsChange) (CSheetR tid ssh csh shn SEditR)} $if not (null assignment)
$# Always iterate over orderedSheetNames for consistent sorting! Newest first, except in this table $forall shn <- orderedSheetNames $maybe btnView <- sheetBtnViews !? shn $if has (ix shn) assignment ^{fvWidget btnView}
$# Always iterate over orderedSheetNames for consistent sorting! Newest first, except in this table $forall shn <- orderedSheetNames ^{simpleLink (toWidget shn) (CSheetR tid ssh csh shn SShowR)}

_{MsgAssignSubmissionsRandomWarning} $if not (null assignment) $maybe btnView <- btnViews !? Nothing

_{MsgAssignSubmissionsAssignableSheets}