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

Cleaned up StudentViews / Added test output

closes #91
parent 81ea7844
No related branches found
No related tags found
1 merge request!87Resolve "Student Feedback Serializer/View"
Pipeline #
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<table class="table table-info rounded"> <table class="table table-info rounded">
<tbody> <tbody>
<tr> <tr>
<th>Modul</th> <th>Module</th>
<td>{{ exam.module_reference }}</td> <td>{{ exam.module_reference }}</td>
</tr> </tr>
<tr> <tr>
......
<template>
<v-alert type="warning" :value="value" class="non-final-alert ">
This feedback is not final! Changes will likely occur!
</v-alert>
</template>
<script>
export default {
name: 'non-final-feedback-alert',
props: {
value: {
type: Boolean,
default: true
}
}
}
</script>
<style scoped>
.non-final-alert {
font-weight: bolder;
}
</style>
...@@ -10,7 +10,11 @@ ...@@ -10,7 +10,11 @@
<td>{{ props.item.type.name }}</td> <td>{{ props.item.type.name }}</td>
<td class="text-xs-right">{{ props.item.feedback.score }}</td> <td class="text-xs-right">{{ props.item.feedback.score }}</td>
<td class="text-xs-right">{{ props.item.type.full_score }}</td> <td class="text-xs-right">{{ props.item.type.full_score }}</td>
<td class="text-xs-right"><v-btn :to="`/student/submission/${props.item.type.pk}`" color="orange lighten-2"><v-icon>chevron_right</v-icon></v-btn></td> <td class="text-xs-right">
<v-btn :to="`/submission/${props.item.type.pk}`" color="orange lighten-2">
<v-icon>chevron_right</v-icon>
</v-btn>
</td>
</template> </template>
</v-data-table> </v-data-table>
<v-alert color="info" value="true"> <v-alert color="info" value="true">
...@@ -34,11 +38,18 @@ ...@@ -34,11 +38,18 @@
}, },
{ {
text: 'Score', text: 'Score',
align: 'right',
value: 'feedback.score' value: 'feedback.score'
}, },
{ {
text: 'Maximum Score', text: 'Maximum Score',
align: 'right',
value: 'type.full_score' value: 'type.full_score'
},
{
text: 'View',
align: 'center',
sortable: false
} }
] ]
} }
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
v-if="!mini" v-if="!mini"
class="elevation-1 exam-info ma-1" class="elevation-1 exam-info ma-1"
/> />
<v-list-tile exact v-for="(item, i) in submissionNavItems" :key="i" :to="item.route"> <v-list-tile exact v-for="item in submissionNavItems" :key="item.route" :to="item.route">
<v-list-tile-action> <v-list-tile-action>
<v-icon v-if="!visited[item.id]">assignment</v-icon> <v-icon v-if="!visited[item.id]">assignment</v-icon>
<v-icon v-else>check</v-icon> <v-icon v-else>check</v-icon>
...@@ -54,11 +54,6 @@ ...@@ -54,11 +54,6 @@
name: 'Overview', name: 'Overview',
icon: 'home', icon: 'home',
route: '/home' route: '/home'
},
{
name: 'Statistics',
icon: 'show_chart',
route: '/home'
} }
] ]
} }
......
<template> <template>
<v-container flex> <v-container flex>
<non-final-feedback-alert :value="!feedbackIsFinal"/>
<v-layout row wrap> <v-layout row wrap>
<v-flex lg6 md12 mt-5> <v-flex lg6 md12 mt-5>
<base-annotated-submission> <base-annotated-submission>
...@@ -19,18 +20,25 @@ ...@@ -19,18 +20,25 @@
</v-toolbar> </v-toolbar>
<template slot="table-content"> <template slot="table-content">
<tr v-for="(code, lineNo) in submission" :key="lineNo"> <tr v-for="(code, lineNo) in submission" :key="lineNo">
<submission-line :code="code" :lineNo="lineNo"/> <submission-line :code="code" :lineNo="lineNo">
<feedback-comment <feedback-comment
v-if="feedback[lineNo] && showFeedback" v-if="feedback[lineNo] && showFeedback"
v-for="(comment, index) in feedback[lineNo]" v-for="(comment, index) in feedback[lineNo]"
v-bind="comment" v-bind="comment"
:key="index" :line-no="lineNo"
/> :key="index"
/>
</submission-line>
</tr> </tr>
</template> </template>
</base-annotated-submission> </base-annotated-submission>
<submission-tests
:tests="submission.tests"
:expand="true"
class="mt-3"
></submission-tests>
</v-flex> </v-flex>
<v-flex lg6 md12> <v-flex lg6 md12 mt-5 pl-3>
<submission-type <submission-type
v-bind="submissionType"> v-bind="submissionType">
</submission-type> </submission-type>
...@@ -49,10 +57,14 @@ ...@@ -49,10 +57,14 @@
import FeedbackComment from '@/components/submission_notes/base/FeedbackComment' import FeedbackComment from '@/components/submission_notes/base/FeedbackComment'
import {studentPageMut} from '@/store/modules/student-page' import {studentPageMut} from '@/store/modules/student-page'
import {subNotesMut} from '@/store/modules/submission-notes' import {subNotesMut} from '@/store/modules/submission-notes'
import SubmissionTests from '@/components/SubmissionTests'
import NonFinalFeedbackAlert from '@/components/student/NonFinalFeedbackAlert'
export default { export default {
name: 'student-submission-page', name: 'student-submission-page',
components: { components: {
NonFinalFeedbackAlert,
SubmissionTests,
FeedbackComment, FeedbackComment,
SubmissionLine, SubmissionLine,
BaseAnnotatedSubmission, BaseAnnotatedSubmission,
...@@ -71,10 +83,13 @@ ...@@ -71,10 +83,13 @@
'submission' 'submission'
]), ]),
...mapState({ ...mapState({
score: function (state) { return state.studentPage.submissionData[this.id].feedback.score }, score (state) { return state.studentPage.submissionData[this.id].feedback.score },
submissionType: function (state) { return state.studentPage.submissionData[this.id].type }, submissionType (state) { return state.studentPage.submissionData[this.id].type },
feedback: function (state) { feedback (state) {
return state.studentPage.submissionData[this.$route.params.id].feedback.feedback_lines return state.studentPage.submissionData[this.$route.params.id].feedback.feedback_lines
},
feedbackIsFinal (state) {
return state.studentPage.submissionData[this.$route.params.id].feedback.is_final
} }
}) })
}, },
...@@ -87,9 +102,6 @@ ...@@ -87,9 +102,6 @@
}, },
mounted () { mounted () {
this.onRouteMountOrUpdate(this.id) this.onRouteMountOrUpdate(this.id)
this.$nextTick(() => {
window.PR.prettyPrint()
})
}, },
beforeRouteUpdate (to, from, next) { beforeRouteUpdate (to, from, next) {
this.onRouteMountOrUpdate(to.params.id) this.onRouteMountOrUpdate(to.params.id)
......
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