Skip to content
Snippets Groups Projects
Commit 5414d6be authored by lenke182's avatar lenke182 Committed by Jan Lenke
Browse files

Fixed wrong sum calculation if no feedback is available

sumScore may be undefined if there are submissions but with no feedback. Therefore sumScore will be displayed nothing instead of 0.
parent d9369416
No related branches found
No related tags found
1 merge request!265[frontend] [student] Fixed wrong sum calculation if no feedback is available
Pipeline #168236 failed
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
color="info" color="info"
value="true" value="true"
> >
You reached <b>{{ sumScore }}</b> of <b>{{ sumFullScore }}</b> possible points ( {{ pointRatio }}% ). You reached <b>{{ sumScore }}</b> of <b>{{ sumFullScore }}</b> possible points ({{ pointRatio }}%).
</v-alert> </v-alert>
</div> </div>
</template> </template>
...@@ -74,7 +74,7 @@ export default { ...@@ -74,7 +74,7 @@ export default {
}, },
computed: { computed: {
sumScore () { sumScore () {
return this.submissions.map(a => a.feedback && a.feedback.score).reduce((a, b) => a + b) return this.submissions.map(a => a.feedback && a.feedback.score).reduce((a, b) => a + b) || 0
}, },
sumFullScore () { sumFullScore () {
return this.submissions.map(a => a.type.fullScore).reduce((a, b) => a + b) return this.submissions.map(a => a.type.fullScore).reduce((a, b) => a + b)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment