diff --git a/src/Handler/Utils/Rating.hs b/src/Handler/Utils/Rating.hs index 5f35365e1..2ec19d999 100644 --- a/src/Handler/Utils/Rating.hs +++ b/src/Handler/Utils/Rating.hs @@ -131,7 +131,7 @@ formatRating cID Rating{ ratingValues = Rating'{..}, ..} = let [ Just $ "Veranstaltung:" <+> pretty ratingCourseName , Just $ "Blatt:" <+> pretty ratingSheetName , ("Korrektor:" <+>) . pretty <$> ratingCorrectorName - , Just $ "Blatt-Bewertung:" <+> pretty (display ratingSheetType) + , Just $ "Bewertung:" <+> pretty (display ratingSheetType) ] , "Abgabe-Id:" <+> pretty (ciphertext cID) , "=============================================" @@ -153,9 +153,11 @@ parseRating :: MonadThrow m => File -> m Rating' parseRating File{ fileContent = Just input, .. } = do inputText <- either (throw . RatingNotUnicode) return $ Text.decodeUtf8' input let - (headerLines, commentLines) = break (sep `Text.isInfixOf`) $ Text.lines inputText - ratingLines = filter (rating `Text.isInfixOf`) headerLines + (headerLines', commentLines) = break (sep `Text.isInfixOf`) $ Text.lines inputText + (reverse -> ratingLines, reverse -> headerLines) = break (sep' `Text.isInfixOf`) $ reverse headerLines' + ratingLines' = filter (rating `Text.isInfixOf`) ratingLines sep = "Beginn der Kommentare" + sep' = Text.pack $ replicate 40 '=' rating = "Bewertung:" comment' <- case commentLines of (_:commentLines') -> return . Text.strip $ Text.unlines commentLines'