From 1c404cbaa450fb9fc13d0ca63d2aa9f0a7a3d43a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20K=C3=B6lle?= Date: Thu, 21 Jan 2021 06:25:18 +0100 Subject: [PATCH] fix: Fixed task type and unessesary whitespace --- app/utils/Formatter.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/app/utils/Formatter.ts b/app/utils/Formatter.ts index 1af9522..feb0f66 100644 --- a/app/utils/Formatter.ts +++ b/app/utils/Formatter.ts @@ -126,21 +126,19 @@ export function serializeCorrection( : []; const serializedTasks = tasks && ratings - ? serializeTasks(tasks, ratings, correction.submission.sheet.type) + ? serializeTasks(tasks, ratings, correction.submission.sheet.valueType) : ''; const serializedAnnotation = correction.annotation && correction.annotation.text.trim().length > 0 ? `\n${wordWrap(correction.annotation.text, 60)}\n` : ''; - const serializedConditionalComment = correction.submission.sheet.tasks - ? `\n${ - getConditionalCommentForValue( - getRatingValueForTasks(tasks, ratings) / - correction.submission.sheet.maxValue, - conditionalComments - ).text - }\n` - : ''; + const conditionalComment = getConditionalCommentForValue( + getRatingValueForTasks(tasks, ratings) / + correction.submission.sheet.maxValue, + conditionalComments + ).text; + const serializedConditionalComment = + conditionalComment.length > 0 ? `\n${conditionalComment}\n` : ''; return serializedTasks + serializedAnnotation + serializedConditionalComment; }