Skip to content

Commit 57da84e

Browse files
committed
set up routing and page for QS_4 closes #49
1 parent 08e7d5f commit 57da84e

File tree

4 files changed

+80
-11
lines changed

4 files changed

+80
-11
lines changed

frontend/src/components/TopBar.vue

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,32 @@
155155
</v-list>
156156
</v-menu>
157157

158-
<v-btn to="/student/submissions" v-if="isStudent && currentCourse" text dark>
159-
Submissions
160-
<v-icon>fas fa-user-edit</v-icon>
161-
</v-btn>
158+
<v-menu offset-y v-if="isStudent && currentCourse" open-on-hover>
159+
<template v-slot:activator="{ on }">
160+
<v-btn v-on="on" text dark>
161+
Submissions
162+
<v-icon>question_answer</v-icon>
163+
</v-btn>
164+
</template>
165+
<v-list dense>
166+
<v-list-item to="/student/submissions">
167+
<v-list-item-action>
168+
<v-icon>fas fa-user-edit</v-icon>
169+
</v-list-item-action>
170+
<v-list-item-content>
171+
<v-list-item-title>My Submissions</v-list-item-title>
172+
</v-list-item-content>
173+
</v-list-item>
174+
<v-list-item to="/student/all-submissions">
175+
<v-list-item-action>
176+
<v-icon>fas fa-users</v-icon>
177+
</v-list-item-action>
178+
<v-list-item-content>
179+
<v-list-item-title>All Submissions</v-list-item-title>
180+
</v-list-item-content>
181+
</v-list-item>
182+
</v-list>
183+
</v-menu>
162184

163185
<v-btn to="/student/stats" v-if="isStudent && currentCourse" text dark>
164186
Stats
@@ -331,19 +353,27 @@
331353
<v-list-item-content>Solved Quizzes</v-list-item-content>
332354
</v-list-item>
333355

334-
<v-list-item to="/student/stats">
356+
<v-list-item to="/student/submissions">
335357
<v-list-item-action>
336-
<v-icon>fas fa-user</v-icon>
358+
<v-icon>fas fa-user-edit</v-icon>
337359
</v-list-item-action>
338-
<v-list-item-content>Stats</v-list-item-content>
360+
<v-list-item-content>My Submissions</v-list-item-content>
339361
</v-list-item>
340362

341-
<v-list-item to="/student/submissions">
363+
<v-list-item to="/student/all-submissions">
342364
<v-list-item-action>
343-
<v-icon>fas fa-user-edit</v-icon>
365+
<v-icon>fas fa-users</v-icon>
344366
</v-list-item-action>
345-
<v-list-item-content>Submissions</v-list-item-content>
367+
<v-list-item-content>All Submissions</v-list-item-content>
346368
</v-list-item>
369+
370+
<v-list-item to="/student/stats">
371+
<v-list-item-action>
372+
<v-icon>fas fa-user</v-icon>
373+
</v-list-item-action>
374+
<v-list-item-content>Stats</v-list-item-content>
375+
</v-list-item>
376+
347377
</v-list-group>
348378

349379
<v-list-item to="/courses" v-if="isLoggedIn && moreThanOneCourse">

frontend/src/router.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import CoursesView from '@/views/admin/Courses/CoursesView.vue';
2828

2929
import StudentSubmissionView from '@/views/student/submissions/SubmissionView.vue'
3030
import TeacherSubmissionView from '@/views/teacher/submissions/SubmissionView.vue'
31+
import AllSubmissionsView from '@/views/student/submissions/AllSubmissionsView.vue'
3132

3233
Vue.use(Router);
3334

@@ -207,6 +208,15 @@ let router = new Router({
207208
title: APP_NAME + ' - Submissions',
208209
requiredAuth: 'Student'
209210
}
211+
},
212+
{
213+
path: 'all-submissions',
214+
name: 'all-submissions',
215+
component: AllSubmissionsView,
216+
meta: {
217+
title: process.env.VUE_APP_NAME + ' - All Submissions',
218+
requiredAuth: 'Student'
219+
}
210220
}
211221

212222
]

frontend/src/services/RemoteServices.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,23 @@ export default class RemoteServices {
656656
throw Error(await this.errorMessage(error));
657657
});
658658
}
659-
659+
660+
static async getAllStudentSubmissions(): Promise<Submission[]> {
661+
return httpClient
662+
.get(
663+
`/student/submission/all?executionId=${Store.getters.getCurrentCourse.courseExecutionId}`
664+
)
665+
.then(response => {
666+
return response.data.map((submission: any) => {
667+
return new Submission(submission);
668+
});
669+
})
670+
.catch(async error => {
671+
throw Error(await this.errorMessage(error));
672+
});
673+
}
674+
675+
660676
static async exportAll() {
661677
return httpClient
662678
.get('/admin/export', {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<template>
2+
<h2>Testing!</h2>
3+
</template>
4+
5+
<script>
6+
export default {
7+
name: 'AllSubmissionsView'
8+
};
9+
</script>
10+
11+
<style scoped>
12+
13+
</style>

0 commit comments

Comments
 (0)