fix: handle rare cases where a mappingDescription with start>end would be produced

This commit is contained in:
Wolfgang Witt 2021-02-25 23:29:07 +01:00 committed by Wolfgang Witt
parent cd07a56a9f
commit c99d96ecb8

View File

@ -613,7 +613,11 @@ examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences
_rule -> singleton $ head alphabet
mappingDescription :: Set ExamOccurrenceMappingDescription
mappingDescription = Set.fromList $ ExamOccurrenceMappingRange (toNullable start) end : specialMapping
mappingDescription
-- if start > end, the room only consists of users with a non-ascii tag directly adjacent to the last room
-- therefore, leave out a potentially confusing range description
| toNullable start > end = Set.fromList specialMapping
| otherwise = Set.fromList $ ExamOccurrenceMappingRange (toNullable start) end : specialMapping
specialMapping :: [ExamOccurrenceMappingDescription]
specialMapping