Add user id in dumped data

This commit is contained in:
Filip Gralinski 2020-07-12 17:20:46 +02:00
parent 8bcb8b6992
commit b42549cede

View File

@ -84,6 +84,7 @@ getAnnotationTaskResultsR annotationTaskId = do
E.asc (annotationDecision E.^. AnnotationDecisionUser)] E.asc (annotationDecision E.^. AnnotationDecisionUser)]
return (annotationItem E.^. AnnotationItemContent, return (annotationItem E.^. AnnotationItemContent,
annotationItem E.^. AnnotationItemOrder, annotationItem E.^. AnnotationItemOrder,
annotationDecision E.^. AnnotationDecisionUser,
annotationDecision E.^. AnnotationDecisionValue) annotationDecision E.^. AnnotationDecisionValue)
labels <- runDB $ selectList [AnnotationLabelAnnotationTask ==. annotationTaskId] [Asc AnnotationLabelOrder] labels <- runDB $ selectList [AnnotationLabelAnnotationTask ==. annotationTaskId] [Asc AnnotationLabelOrder]
@ -101,11 +102,12 @@ annotationListTable = mempty
++ timestampCell "Date added" (annotationTaskAdded . entityVal) ++ 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 annotationResultsTable = mempty
++ Table.int "ID" (\(_, order, _) -> E.unValue order) ++ Table.int "ID" (\(_, order, _, _) -> E.unValue order)
++ Table.text "Answer value" (\(_, _, answer) -> E.unValue answer) ++ Table.int "UserID" (\(_, _, userId, _) -> fromIntegral $ E.fromSqlKey $ E.unValue userId)
++ Table.text "Text" (\(content, _, _) -> E.unValue content) ++ Table.text "Answer value" (\(_, _, _, answer) -> E.unValue answer)
++ Table.text "Text" (\(content, _, _, _) -> E.unValue content)
annotationLabelsTable :: Table.Table App (Entity AnnotationLabel) annotationLabelsTable :: Table.Table App (Entity AnnotationLabel)