From fc35fd26c1eb699d6eb8aa1b9febb48641c26d05 Mon Sep 17 00:00:00 2001 From: Wolfgang Witt Date: Fri, 19 Feb 2021 12:13:12 +0100 Subject: [PATCH] fix: mappingDescription doesn't overlap for the first n rooms/with small names/matrikelnummer --- src/Handler/Utils/Exam.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Handler/Utils/Exam.hs b/src/Handler/Utils/Exam.hs index aeb86d024..b3632453a 100644 --- a/src/Handler/Utils/Exam.hs +++ b/src/Handler/Utils/Exam.hs @@ -593,8 +593,8 @@ examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences nextStart | Nothing <- maybeEnd = start - | length start < borderLength - = start <> impureNonNull [head alphabet] + | (Just end) <- maybeEnd, length end < borderLength + = impureNonNull $ end <> [head alphabet] | (Just end) <- maybeEnd = impureNonNull $ reverse $ increase $ reverse end alphabetCycle :: [CI Char] @@ -611,8 +611,8 @@ examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences nextChar | c `elem` alphabet = dropWhile (/= c) alphabetCycle List.!! 1 - | otherwise -- shouldn't happen, simply use head alphabet - = error $ "uncaught non-alphabet char: " ++ show c --TODO head alphabet + | otherwise -- shouldn't happen, simply use head alphabet as a fallback + = head alphabet transformTag :: Int -> [CI Char] -> [CI Char] transformTag l tag = case rule of