This repository has been archived on 2025-02-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
iu-quiz-app/pages/courses/_course/index.vue
2022-11-03 15:32:22 +01:00

43 lines
1.0 KiB
Vue

<template>
<v-container fluid class="pa-0">
<v-sheet class="rounded-lg pa-2">
<span class="text-h4 text--secondary">{{ courseID.toUpperCase() }}</span>
<span class="text-h4">{{ $store.getters.getCourseByID(courseID).name }}</span>
</v-sheet>
<v-container>
<v-row>
<v-col v-if="isAuthorized" cols="12">
<TutorPanel :course-id="courseID" />
</v-col>
<v-col cols="12">
<Challenge :course-id="courseID" />
</v-col>
<v-col cols="12">
<Coop :course-id="courseID" />
</v-col>
</v-row>
</v-container>
</v-container>
</template>
<script>
export default {
name: 'CourseIndexPage',
data() {
return {
courseID: undefined
}
},
computed: {
isAuthorized () {
const isTutor = this.$auth.currentUser.email.endsWith('@iu.org')
const isAdmin = this.$store.getters.isAdmin
return isTutor || isAdmin
}
},
created () {
this.courseID = this.$route.params.course
}
}
</script>