diff --git a/client/src/components/content-blocks/assignment/FeedbackForm.vue b/client/src/components/content-blocks/assignment/FeedbackForm.vue
index 450694dc..7cb77a91 100644
--- a/client/src/components/content-blocks/assignment/FeedbackForm.vue
+++ b/client/src/components/content-blocks/assignment/FeedbackForm.vue
@@ -7,7 +7,7 @@
:saved="saved"
:final="final"
:placeholder="placeholder"
- :reopen="$emit('reopen')"
+ :reopen="reopenSubmission"
>
@@ -22,6 +22,7 @@
@@ -36,7 +37,7 @@
FinalSubmission
},
- props: ['userInput', 'saved', 'placeholder', 'action', 'reopen', 'document'],
+ props: ['userInput', 'saved', 'placeholder', 'action', 'reopen', 'document', 'sharedMsg'],
computed: {
final() {
@@ -45,6 +46,9 @@
},
methods: {
+ reopenSubmission() {
+ this.$emit('reopen');
+ },
saveInput(input) {
this.$emit('saveInput', input);
}
diff --git a/client/src/components/content-blocks/assignment/FinalSubmission.vue b/client/src/components/content-blocks/assignment/FinalSubmission.vue
index f75741f8..3f255f9b 100644
--- a/client/src/components/content-blocks/assignment/FinalSubmission.vue
+++ b/client/src/components/content-blocks/assignment/FinalSubmission.vue
@@ -7,7 +7,7 @@
>
-
Das Ergebnis wurde mit der Lehrperson geteilt
+
{{sharedMsg}}
Bearbeiten
@@ -19,7 +19,7 @@
import {newLineToParagraph} from '@/helpers/text';
export default {
- props: ['userInput'],
+ props: ['userInput', 'sharedMsg'],
components: {
InfoIcon,
diff --git a/client/src/graphql/gql/mutations/updateFeedback.gql b/client/src/graphql/gql/mutations/updateFeedback.gql
index dfa696b2..6d495e14 100644
--- a/client/src/graphql/gql/mutations/updateFeedback.gql
+++ b/client/src/graphql/gql/mutations/updateFeedback.gql
@@ -4,6 +4,7 @@ mutation UpdateSubmissionFeedback($input: UpdateSubmissionFeedbackInput!) {
updatedSubmissionFeedback {
id
text
+ final
}
}
}
diff --git a/client/src/pages/studentSubmission.vue b/client/src/pages/studentSubmission.vue
index 9a4197a6..f68126bd 100644
--- a/client/src/pages/studentSubmission.vue
+++ b/client/src/pages/studentSubmission.vue
@@ -16,12 +16,14 @@
@@ -30,7 +32,7 @@
🤩
😎
🤔
- 👍🏻
+ 👍🏻
👎🏻
@@ -84,8 +86,6 @@
this.updateFeedbackText(feedbackText);
},
_save: debounce(function () {
- const that = this;
-
this.saving++;
this.$apollo.mutate({
mutation: UPDATE_FEEDBACK_MUTATION,
@@ -97,23 +97,7 @@
}
}
},
- update(store, {data: {updateSubmissionFeedback: {successful, updatedSubmissionFeedback}}}) {
- try {
- if (successful) {
- const query = STUDENT_SUBMISSIONS_QUERY;
- const variables = {
- id: that.studentSubmission.id
- };
- const data = store.readQuery({query, variables});
-
- data.studentSubmission = Object.assign({}, that.studentSubmission);
- store.writeQuery({query, variables, data});
- }
- } catch (e) {
- console.error(e);
- // Query did not exist in the cache, and apollo throws a generic Error. Do nothing
- }
- }
+ update: this.updateCache
}).then(() => {
this.saving--;
if (this.saving === 0) {
@@ -141,7 +125,8 @@
final: true
}
}
- }
+ },
+ update: this.updateCache
});
},
reopen() {
@@ -159,9 +144,27 @@
final: false
}
}
- }
+ },
+ update: this.updateCache
});
},
+ updateCache(store, {data: {updateSubmissionFeedback: {successful, updatedSubmissionFeedback}}}) {
+ try {
+ if (successful) {
+ const query = STUDENT_SUBMISSIONS_QUERY;
+ const variables = {
+ id: this.studentSubmission.id
+ };
+ const data = store.readQuery({query, variables});
+
+ data.studentSubmission.submissionfeedback = Object.assign({}, updatedSubmissionFeedback);
+ store.writeQuery({query, variables, data});
+ }
+ } catch (e) {
+ console.error(e);
+ // Query did not exist in the cache, and apollo throws a generic Error. Do nothing
+ }
+ },
updateFeedbackText(text) {
this.studentSubmission = Object.assign({}, this.studentSubmission, {
submissionfeedback: Object.assign({}, this.studentSubmission.submissionfeedback, {text: text})
@@ -206,6 +209,6 @@
}
.emojis {
- font-size: toRem(24px);
+ font-size: toRem(32px);
}
diff --git a/server/assignments/schema/mutations.py b/server/assignments/schema/mutations.py
index 27a5aee1..c8c29332 100644
--- a/server/assignments/schema/mutations.py
+++ b/server/assignments/schema/mutations.py
@@ -52,7 +52,11 @@ class UpdateSubmissionFeedback(relay.ClientIDMutation):
(submission_feedback, created) = SubmissionFeedback.objects.get_or_create(teacher=user,
student_submission_id=student_submission_id)
- submission_feedback.final = submission_feedback_data.get('final') or submission_feedback.final
+ final = submission_feedback.final
+ if 'final' in submission_feedback_data:
+ final = submission_feedback_data.get('final')
+
+ submission_feedback.final = final
submission_feedback.text = submission_feedback_data.get('text')
submission_feedback.save()