chore: matriculation numbers limited same length again
- this time as suffixes - also start range description with full used length otherwise suffix-description is confusing
This commit is contained in:
parent
f0a79dff65
commit
b974942f07
@ -333,7 +333,8 @@ examAutoOccurrence (hash -> seed) rule config@ExamAutoOccurrenceConfig{..} occur
|
|||||||
| (uid, (User{..}, Nothing)) <- Map.toList users
|
| (uid, (User{..}, Nothing)) <- Map.toList users
|
||||||
, matriculation' <- userMatrikelnummer ^.. _Just . filtered (not . null)
|
, matriculation' <- userMatrikelnummer ^.. _Just . filtered (not . null)
|
||||||
]
|
]
|
||||||
in matrUsers
|
takeEnd n chars = drop (length chars - n) chars
|
||||||
|
in Map.mapKeysWith Set.union (takeEnd . F.minimum . Set.map length $ Map.keysSet matrUsers) matrUsers
|
||||||
_ -> Map.singleton [] $ Map.keysSet users
|
_ -> Map.singleton [] $ Map.keysSet users
|
||||||
|
|
||||||
occurrences' :: Map ExamOccurrenceId Natural
|
occurrences' :: Map ExamOccurrenceId Natural
|
||||||
@ -599,10 +600,18 @@ examAutoOccurrence (hash -> seed) rule config@ExamAutoOccurrenceConfig{..} occur
|
|||||||
&& (null t || Just (toNullable nextStart) > maybeEnd)
|
&& (null t || Just (toNullable nextStart) > maybeEnd)
|
||||||
= go nextStart borderLength ((occurrenceId, mappingDescription) : acc) t
|
= go nextStart borderLength ((occurrenceId, mappingDescription) : acc) t
|
||||||
| borderLength < maxTagLength
|
| borderLength < maxTagLength
|
||||||
= go (singleton $ head alphabet) (succ borderLength) [] result
|
= go restartStart restartBorderLength [] result
|
||||||
| otherwise
|
| otherwise
|
||||||
= []
|
= []
|
||||||
where
|
where
|
||||||
|
restartBorderLength :: Int
|
||||||
|
restartBorderLength = succ borderLength
|
||||||
|
|
||||||
|
restartStart :: NonNull [CI Char]
|
||||||
|
restartStart = case rule of
|
||||||
|
ExamRoomMatriculation -> impureNonNull $ replicate restartBorderLength $ head alphabet
|
||||||
|
_rule -> singleton $ head alphabet
|
||||||
|
|
||||||
mappingDescription :: Set ExamOccurrenceMappingDescription
|
mappingDescription :: Set ExamOccurrenceMappingDescription
|
||||||
mappingDescription = Set.fromList $ case maybeEnd of
|
mappingDescription = Set.fromList $ case maybeEnd of
|
||||||
(Just end) -> ExamOccurrenceMappingRange (toNullable start) end : specialMapping
|
(Just end) -> ExamOccurrenceMappingRange (toNullable start) end : specialMapping
|
||||||
|
|||||||
Reference in New Issue
Block a user