diff --git a/core/views/subscription.py b/core/views/subscription.py index 88dc1d3e3ef1b7557a98ec4df83cdffc695b4cbf..266bd64715e4fbb6d98abfbc0cdbb128869f31fe 100644 --- a/core/views/subscription.py +++ b/core/views/subscription.py @@ -97,7 +97,7 @@ class AssignmentApiViewSet( @permission_classes((IsReviewer,)) def list(self, *args, **kwargs): - super().list(*args, **kwargs) + return super().list(*args, **kwargs) @action(detail=False, permission_classes=(IsReviewer,), methods=['get', 'delete']) def active(self, request): diff --git a/frontend/src/store/modules/submission-notes.ts b/frontend/src/store/modules/submission-notes.ts index 3c1f13762c7a7fee8b69b5fd0621b8e182b9de79..b34a6d71024c4e4b30d592d346d27301f7c4c624 100644 --- a/frontend/src/store/modules/submission-notes.ts +++ b/frontend/src/store/modules/submission-notes.ts @@ -1,14 +1,10 @@ import Vue from 'vue' import * as hljs from 'highlight.js' import * as api from '@/api' -import { nameSpacer } from '@/util/helpers' -import { Feedback, FeedbackComment, Submission, SubmissionNoType } from '@/models' +import { Feedback, FeedbackComment, SubmissionNoType } from '@/models' import { RootState } from '@/store/store' -import { Module } from 'vuex' import { getStoreBuilder, BareActionContext } from 'vuex-typex' -export const subNotesNamespace = nameSpacer('submissionNotes/') - export interface SubmissionNotesState { submission: SubmissionNoType ui: { @@ -143,13 +139,16 @@ async function submitFeedback ({ state }: BareActionContext<SubmissionNotesState } if (state.origFeedback.score === undefined && state.updatedFeedback.score === undefined) { throw new Error('You need to give a score.') + } else if (state.updatedFeedback.score !== undefined) { + feedback.score = state.updatedFeedback.score } else { - feedback.score = state.updatedFeedback.score || state.origFeedback.score || 0 + feedback.score = state.origFeedback.score } + if (Object.keys(state.updatedFeedback.feedbackLines || {}).length > 0) { feedback.feedbackLines = state.updatedFeedback.feedbackLines } else if (feedback.score! < SubmissionNotes.submissionType.fullScore!) { - throw new Error('You need to provide a reason for a reduced score.') + throw new Error('You need to add or change a comment when setting a non full score.') } // delete those comments that have been marked for deletion await SubmissionNotes.deleteComments()