From b42549cedeee6f637eadc37a85cb5ca7859db686 Mon Sep 17 00:00:00 2001 From: Filip Gralinski Date: Sun, 12 Jul 2020 17:20:46 +0200 Subject: [PATCH] Add user id in dumped data --- Handler/Annotations.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Handler/Annotations.hs b/Handler/Annotations.hs index 6dd20ba..f7c0628 100644 --- a/Handler/Annotations.hs +++ b/Handler/Annotations.hs @@ -84,6 +84,7 @@ getAnnotationTaskResultsR annotationTaskId = do E.asc (annotationDecision E.^. AnnotationDecisionUser)] return (annotationItem E.^. AnnotationItemContent, annotationItem E.^. AnnotationItemOrder, + annotationDecision E.^. AnnotationDecisionUser, annotationDecision E.^. AnnotationDecisionValue) labels <- runDB $ selectList [AnnotationLabelAnnotationTask ==. annotationTaskId] [Asc AnnotationLabelOrder] @@ -101,11 +102,12 @@ annotationListTable = mempty ++ timestampCell "Date added" (annotationTaskAdded . entityVal) -annotationResultsTable :: Table.Table App (E.Value Text, E.Value Int, E.Value Text) +annotationResultsTable :: Table.Table App (E.Value Text, E.Value Int, E.Value (Key User), E.Value Text) annotationResultsTable = mempty - ++ Table.int "ID" (\(_, order, _) -> E.unValue order) - ++ Table.text "Answer value" (\(_, _, answer) -> E.unValue answer) - ++ Table.text "Text" (\(content, _, _) -> E.unValue content) + ++ Table.int "ID" (\(_, order, _, _) -> E.unValue order) + ++ Table.int "UserID" (\(_, _, userId, _) -> fromIntegral $ E.fromSqlKey $ E.unValue userId) + ++ Table.text "Answer value" (\(_, _, _, answer) -> E.unValue answer) + ++ Table.text "Text" (\(content, _, _, _) -> E.unValue content) annotationLabelsTable :: Table.Table App (Entity AnnotationLabel)