fix: mappingDescription doesn't overlap for the first n rooms/with small names/matrikelnummer

This commit is contained in:
Wolfgang Witt 2021-02-19 12:13:12 +01:00 committed by Wolfgang Witt
parent 6ccc192426
commit fc35fd26c1

View File

@ -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