Skip to content
Snippets Groups Projects
Commit 79856bc0 authored by robinwilliam.hundt's avatar robinwilliam.hundt
Browse files

Fix Final checkbox

parent 459a24a8
No related branches found
No related tags found
1 merge request!79Fix final checkbox this time for sure
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
:loading="loading" :loading="loading"
:fullScore="submissionObj['full_score']" :fullScore="submissionObj['full_score']"
:skippable="assignment !== undefined" :skippable="assignment !== undefined"
:feedback="feedbackObj ? feedbackObj : {}"
@submitFeedback="submitFeedback" @submitFeedback="submitFeedback"
@skip="$emit('skip')" @skip="$emit('skip')"
/> />
......
...@@ -61,8 +61,11 @@ ...@@ -61,8 +61,11 @@
data () { data () {
return { return {
scoreError: '', scoreError: '',
initialIsFinal: this.$store.state.submissionNotes.origFeedback.isFinal ||
!this.$store.getters['submissionNotes/isFeedbackCreation'] || this.$store.getters.isReviewer,
isFinal: this.$store.state.submissionNotes.origFeedback.isFinal || isFinal: this.$store.state.submissionNotes.origFeedback.isFinal ||
!this.$store.getters['submissionNotes/isFeedbackCreation'] || this.$store.getters.isReviewer !this.$store.getters['submissionNotes/isFeedbackCreation'] || this.$store.getters.isReviewer
} }
}, },
props: { props: {
...@@ -77,6 +80,10 @@ ...@@ -77,6 +80,10 @@
skippable: { skippable: {
type: Boolean, type: Boolean,
default: false default: false
},
feedback: {
type: Object,
default: () => {}
} }
}, },
computed: { computed: {
...@@ -92,6 +99,18 @@ ...@@ -92,6 +99,18 @@
return !this.$store.getters['submissionNotes/isFeedbackCreation'] || this.$store.getters.isReviewer return !this.$store.getters['submissionNotes/isFeedbackCreation'] || this.$store.getters.isReviewer
} }
}, },
watch: {
feedback: {
handler: function (val) {
if (!val.hasOwnProperty('is_final')) {
this.isFinal = this.initialValue
} else {
this.isFinal = val.is_final
}
},
deep: true
}
},
methods: { methods: {
emitScoreError (error, duration) { emitScoreError (error, duration) {
this.scoreError = error this.scoreError = error
...@@ -111,6 +130,7 @@ ...@@ -111,6 +130,7 @@
}, },
submit () { submit () {
this.$emit('submitFeedback', {isFinal: this.isFinal}) this.$emit('submitFeedback', {isFinal: this.isFinal})
this.isFinal = this.initialIsFinal
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment