From 3aeeda83bc01a0b62e54d46337fa9211945f04ae Mon Sep 17 00:00:00 2001 From: "robinwilliam.hundt" <robinwilliam.hundt@stud.uni-goettingen.de> Date: Sat, 18 Aug 2018 22:34:44 +0200 Subject: [PATCH] added .asm file ending in import / small bug fix in sub-notes store --- frontend/src/store/modules/submission-notes.ts | 6 +++--- util/importer.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/store/modules/submission-notes.ts b/frontend/src/store/modules/submission-notes.ts index 9a4fe315..ea23fe7b 100644 --- a/frontend/src/store/modules/submission-notes.ts +++ b/frontend/src/store/modules/submission-notes.ts @@ -51,7 +51,7 @@ function initialState (): SubmissionNotesState { hasOrigFeedback: false, origFeedback: { pk: 0, - score: 0, + score: undefined, isFinal: false, feedbackLines: {} }, @@ -158,9 +158,9 @@ const submissionNotes: Module<SubmissionNotesState, RootState> = { if (Object.keys(state.updatedFeedback.feedbackLines || {}).length > 0) { feedback.feedbackLines = state.updatedFeedback.feedbackLines } - if (state.origFeedback.score === null && state.updatedFeedback.score === null) { + if (state.origFeedback.score === undefined && state.updatedFeedback.score === undefined) { throw new Error('You need to give a score.') - } else if (state.updatedFeedback.score !== null) { + } else if (state.updatedFeedback.score !== undefined) { feedback.score = state.updatedFeedback.score } await dispatch('deleteComments') diff --git a/util/importer.py b/util/importer.py index bbd4c706..a1ed1e61 100644 --- a/util/importer.py +++ b/util/importer.py @@ -166,7 +166,8 @@ def call_loader(func: Callable) -> None: def file_suffix_to_lang_name(suffix: str) -> str: suffix2name = { 'hs': 'haskell', - 's': 'mipsasm' + 's': 'mipsasm', + 'asm': 'mipsasm' } if suffix not in suffix2name: return suffix -- GitLab