forked from filipg/gonito
Limit number of parameters shown
This commit is contained in:
parent
45cdff5e3d
commit
424dc329f5
@ -138,6 +138,12 @@ descriptionCell mauthId = Table.widget "description" (
|
|||||||
(getInfoLink s mauthId)
|
(getInfoLink s mauthId)
|
||||||
tagEnts)
|
tagEnts)
|
||||||
|
|
||||||
|
formatListWithLimit :: Int -> (a -> Text) -> [a] -> Text
|
||||||
|
formatListWithLimit limit fun l = (Data.Text.unwords $ map fun $ Import.take limit l) <>
|
||||||
|
(if length l <= limit
|
||||||
|
then ""
|
||||||
|
else " [...]")
|
||||||
|
|
||||||
|
|
||||||
descriptionToBeShown :: Submission -> Variant -> [Parameter] -> Text
|
descriptionToBeShown :: Submission -> Variant -> [Parameter] -> Text
|
||||||
descriptionToBeShown s v params = (submissionDescription s) ++ (Data.Text.pack vdescription) ++ " " ++ paramsShown
|
descriptionToBeShown s v params = (submissionDescription s) ++ (Data.Text.pack vdescription) ++ " " ++ paramsShown
|
||||||
@ -147,7 +153,8 @@ descriptionToBeShown s v params = (submissionDescription s) ++ (Data.Text.pack v
|
|||||||
""
|
""
|
||||||
else
|
else
|
||||||
" " ++ r
|
" " ++ r
|
||||||
paramsShown = Data.Text.unwords $ map formatParameter params
|
maximumNumberOfParamsShown = 8
|
||||||
|
paramsShown = formatListWithLimit maximumNumberOfParamsShown formatParameter params
|
||||||
|
|
||||||
extractScore :: TestReference -> TableEntry -> Maybe Evaluation
|
extractScore :: TestReference -> TableEntry -> Maybe Evaluation
|
||||||
extractScore k tableEntry = lookup k $ tableEntryMapping tableEntry
|
extractScore k tableEntry = lookup k $ tableEntryMapping tableEntry
|
||||||
|
Loading…
Reference in New Issue
Block a user