Fix broken line by line mode when viewing an output

This commit is contained in:
Filip Gralinski 2021-02-27 12:11:17 +01:00
parent 4c5967c0a1
commit f600882dea
2 changed files with 6 additions and 4 deletions

View File

@ -553,6 +553,8 @@ viewOutputWithNonDefaultTestSelected entry tests mainTest (outputHash, testSet)
let variantId = entityKey <$> tableEntryVariant <$> entry
let theStamp = submissionStamp $ entityVal $ tableEntrySubmission $ current entry
let theVersion = submissionVersion $ entityVal $ tableEntrySubmission $ current entry
challenge <- handlerToWidget $ runDB $ get404 $ submissionChallenge $ entityVal $ tableEntrySubmission $ current entry
let isNonSensitive = challengeSensitive challenge == Just False
@ -623,8 +625,8 @@ viewOutputWithNonDefaultTestSelected entry tests mainTest (outputHash, testSet)
return Nothing
$(widgetFile "view-output")
lineByLineTable :: Entity Test -> UTCTime -> Table.Table App (Int, DiffLineRecord)
lineByLineTable (Entity testId test) theStamp = mempty
lineByLineTable :: Entity Test -> SHA1 -> UTCTime -> Table.Table App (Int, DiffLineRecord)
lineByLineTable (Entity testId test) theVersion theStamp = mempty
++ Table.int "#" fst
++ theLimitedTextCell "input" (((\(DiffLineRecord inp _ _ _) -> inp) . snd))
++ theLimitedTextCell "expected output" ((\(DiffLineRecord _ expected _ _) -> expected) . snd)
@ -637,7 +639,7 @@ lineByLineTable (Entity testId test) theStamp = mempty
evaluationErrorBound = Nothing,
evaluationErrorMessage = Nothing,
evaluationStamp = theStamp,
evaluationVersion = undefined }
evaluationVersion = theVersion }
resultTable :: Entity Submission -> WidgetFor App ()
resultTable (Entity submissionId submission) = do

View File

@ -10,5 +10,5 @@
$maybe result <- mResult
<a name="worst-items-#{testSet}">
<h4>worst items
^{Table.buildBootstrap (lineByLineTable mainTest theStamp) result}
^{Table.buildBootstrap (lineByLineTable mainTest theVersion theStamp) result}
$nothing