From c99d96ecb8a43400eb10dfe192bf751cb00a9d25 Mon Sep 17 00:00:00 2001 From: Wolfgang Witt Date: Thu, 25 Feb 2021 23:29:07 +0100 Subject: [PATCH] fix: handle rare cases where a mappingDescription with start>end would be produced --- src/Handler/Utils/Exam.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Handler/Utils/Exam.hs b/src/Handler/Utils/Exam.hs index 3d0068735..74188ef0f 100644 --- a/src/Handler/Utils/Exam.hs +++ b/src/Handler/Utils/Exam.hs @@ -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