diff --git a/client/src/stores/app.js b/client/src/stores/results.js similarity index 83% rename from client/src/stores/app.js rename to client/src/stores/results.js index 58423e7..157795a 100644 --- a/client/src/stores/app.js +++ b/client/src/stores/results.js @@ -1,7 +1,7 @@ import { defineStore } from 'pinia' -export const useAppStore = defineStore({ - id: 'app', +export const useResultsStore = defineStore({ + id: 'results', state: () => ({ answers: [], playbooks: {}, diff --git a/client/src/views/Home.vue b/client/src/views/Home.vue index d34c073..0e699bb 100644 --- a/client/src/views/Home.vue +++ b/client/src/views/Home.vue @@ -1,5 +1,6 @@ diff --git a/client/src/views/about/Index.vue b/client/src/views/about/Index.vue index 4343ccd..2f5169c 100644 --- a/client/src/views/about/Index.vue +++ b/client/src/views/about/Index.vue @@ -1,9 +1,28 @@ diff --git a/client/src/views/quiz/Index.vue b/client/src/views/quiz/Index.vue index b03922a..a1c6583 100644 --- a/client/src/views/quiz/Index.vue +++ b/client/src/views/quiz/Index.vue @@ -3,18 +3,18 @@ import Config from '@/config.js' import { useQuestionStore } from '@/stores/questions.js' import { useAnswersStore } from '@/stores/answers.js' - import { useAppStore } from '@/stores/app.js' + import { useResultsStore } from '@/stores/results.js' export default { setup() { const questionStore = useQuestionStore() const answersStore = useAnswersStore() - const appStore = useAppStore() + const resultsStore = useResultsStore() return { questionStore, answersStore, - appStore + resultsStore } }, name: 'QuestionIndex', @@ -28,8 +28,8 @@ this.$router.push(`/quiz/question/${this.answersStore.quizCurrent}`) } else { this.answersStore.$reset() - this.appStore.$reset() } + this.resultsStore.$reset() }, methods: { getQuestions() { diff --git a/client/src/views/quiz/Question.vue b/client/src/views/quiz/Question.vue index 34a6570..732be38 100644 --- a/client/src/views/quiz/Question.vue +++ b/client/src/views/quiz/Question.vue @@ -3,7 +3,7 @@ import Config from '@/config.js' import { useQuestionStore } from '@/stores/questions.js' import { useAnswersStore } from '@/stores/answers.js' - import { useAppStore } from '@/stores/app.js' + import { useResultsStore } from '@/stores/results.js' import Content from '@/components/Content.vue' import Header from '@/components/Header.vue' import TextFrame from '@/components/TextFrame.vue' @@ -15,12 +15,12 @@ setup() { const questionStore = useQuestionStore() const answersStore = useAnswersStore() - const appStore = useAppStore() + const resultsStore = useResultsStore() return { questionStore, answersStore, - appStore + resultsStore } }, components: { @@ -69,8 +69,8 @@ } } ).then( (response) => { - console.log('Submitted results.') - this.appStore.store('results', response.data) + console.log('Submitted answers.') + this.resultsStore.store('results', response.data) console.log('Results fetched from the server.') this.answersStore.quizCurrent = null this.$router.push('/results') diff --git a/client/src/views/results/CompareResults.vue b/client/src/views/results/CompareResults.vue index 1415843..d57519e 100644 --- a/client/src/views/results/CompareResults.vue +++ b/client/src/views/results/CompareResults.vue @@ -4,15 +4,15 @@ import Content from '@/components/Content.vue' import Header from '@/components/Header.vue' import TextFrame from '@/components/TextFrame.vue' - import { useAppStore } from '@/stores/app.js' + import { useResultsStore } from '@/stores/results.js' import ChevronDoubleRight from '@/components/icons/ChevronDoubleRight.vue' export default { setup() { - const appStore = useAppStore() + const resultsStore = useResultsStore() return { - appStore + resultsStore } }, mounted() { @@ -30,7 +30,7 @@ axios.get(`${Config.SERVER}api/playbooks/`) .then((response) => { console.log('Fetched playbook stats from the server.') - this.appStore.store('playbooks', response.data) + this.resultsStore.store('playbooks', response.data) }) .catch( error => { console.log(error) @@ -39,7 +39,7 @@ axios.get(`${Config.SERVER}api/count/`) .then((response) => { console.log('Fetched user count from the server.') - this.appStore.store('count', response.data) + this.resultsStore.store('count', response.data) }) .catch( error => { console.log(error) @@ -76,8 +76,8 @@
-