Skip to content

Commit

Permalink
fix: Fixed task type and unessesary whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkoelle committed Jan 21, 2021
1 parent 34d5301 commit 1c404cb
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions app/utils/Formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 1c404cb

Please sign in to comment.