Skip to content
Snippets Groups Projects

Resolve "Make exam a many to many field on StudentInfo model"

Compare and Show latest version
1 file
+ 26
1
Compare changes
  • Side-by-side
  • Inline
@@ -87,7 +87,10 @@
<router-link to="/home">
<v-app-bar-title>Grady</v-app-bar-title>
</router-link>
<v-tooltip bottom>
<v-tooltip
v-if="multipleExams"
bottom
>
<template #activator="{ on }">
<v-btn
color="cyan"
@@ -116,13 +119,23 @@ import UserOptions from '@/components/UserOptions'
import InstanceActions from '@/components/InstanceActions'
import { Authentication } from '@/store/modules/authentication'
import { ConfigModule } from '../store/modules/config'
import ax, { fetchExamTypes } from '@/api'
export default {
name: 'BaseLayout',
components: { InstanceActions, UserOptions },
data () {
return {
examTypes: [],
}
},
computed: {
gradySpeak () { return Authentication.gradySpeak },
currentExam () { return ConfigModule.state.config.currentExam },
multipleExams () {
return this.examTypes.length > 1
},
isStudent () { return Authentication.isStudent },
...mapStateToComputedGetterSetter({
pathPrefix: 'UI',
@@ -139,12 +152,24 @@ export default {
]
})
},
created () {
this.loadExamTypes()
},
methods: {
logFeedbackClick () {
this.darkModeUnlocked = true
},
changeExamSelection () {
this.$router.push({ name: 'exam-selection' })
},
async loadExamTypes () {
try {
const response = (await ax.get('/api/examtype/')).data
this.examTypes = response
console.log('loaded examtypes')
} catch (ex) {
console.log(ex)
}
}
}
}
Loading