diff --git a/client/src/components/icons/ChevronDoubleRight.vue b/client/src/components/icons/ChevronDoubleRight.vue new file mode 100644 index 0000000..797fcad --- /dev/null +++ b/client/src/components/icons/ChevronDoubleRight.vue @@ -0,0 +1,23 @@ + + + + \ No newline at end of file diff --git a/client/src/components/navbar/Index.vue b/client/src/components/navbar/Index.vue index 674a72b..ec31dcf 100644 --- a/client/src/components/navbar/Index.vue +++ b/client/src/components/navbar/Index.vue @@ -50,7 +50,7 @@
- +
diff --git a/client/src/router/index.js b/client/src/router/index.js index 408b124..bc1544f 100644 --- a/client/src/router/index.js +++ b/client/src/router/index.js @@ -1,5 +1,5 @@ import { createRouter, createWebHistory } from 'vue-router' -import { mdiAccountBoxMultiple, mdiAccountGroupOutline, mdiAccountQuestion, mdiChartBox, mdiCodeTags, mdiCounter, mdiEarth, mdiHandCoin, mdiHome, mdiInformation, mdiWeb } from '@mdi/js' +import { mdiAccountBoxMultiple, mdiAccountGroupOutline, mdiAccountQuestion, mdiChartBox, mdiCodeTags, mdiCompare, mdiCounter, mdiEarth, mdiHandCoin, mdiHome, mdiInformation, mdiWeb } from '@mdi/js' import About from '@/views/about/Index.vue' import AboutPage from '@/views/about/About.vue' import Acknowledgements from '@/views/about/Acknowledgements.vue' @@ -13,8 +13,9 @@ import Refused from '@/views/errors/Refused.vue' import Results from '@/views/results/Index.vue' import ResultsPage from '@/views/results/Results.vue' import Scores from '@/views/results/Scores.vue' -import Answers from '@/views/results/Answers.vue' +import CompareAnswers from '@/views/results/CompareAnswers.vue' import Statistics from '@/views/results/Statistics.vue' +import CompareResults from '@/views/results/CompareResults.vue' const routes = [ { @@ -144,17 +145,28 @@ const routes = [ component: Scores, meta: { index: 1, - title: 'All Scores', + title: 'Your Scores', svgPath: mdiCounter, parentIndex: -1 } }, + { + path: 'compare', + name: 'CompareResults', + component: CompareResults, + meta: { + index: 2, + title: 'Compare Results', + svgPath: mdiCompare, + parentIndex: -1 + } + }, { path: 'statistics', name: 'Statistics', component: Statistics, meta: { - index: 2, + index: 3, title: 'Statistics', svgPath: mdiChartBox, parentIndex: -1 @@ -163,10 +175,10 @@ const routes = [ { path: 'answers', name: 'Answers', - component: Answers, + component: CompareAnswers, meta: { - index: 3, - title: 'Global Answers', + index: 4, + title: 'Compare Answers', svgPath: mdiEarth, parentIndex: -1 } diff --git a/client/src/stores/app.js b/client/src/stores/app.js index ba31109..79759c2 100644 --- a/client/src/stores/app.js +++ b/client/src/stores/app.js @@ -4,15 +4,19 @@ export const useAppStore = defineStore({ id: 'app', state: () => ({ hasData: false, - results: {} + answers: [], + playbooks: {}, + results: {}, + scores: {}, + count: null }), actions: { toggleData() { this.hasData = !this.hasData console.log('Toggled Has Data. New value', this.hasData) }, - storeResults(results) { - this.results = JSON.parse(JSON.stringify(results)) + store(key, data) { + this[key] = JSON.parse(JSON.stringify(data)) } } }) \ No newline at end of file diff --git a/client/src/views/quiz/Question.vue b/client/src/views/quiz/Question.vue index d60b1e7..9d7cfd3 100644 --- a/client/src/views/quiz/Question.vue +++ b/client/src/views/quiz/Question.vue @@ -93,7 +93,7 @@ } } ).then( (response) => { - this.appStore.storeResults(response.data) + this.appStore.store('results', response.data) console.log('Results fetched from the server.') this.$router.push('/results') }).catch( (error) => { @@ -125,7 +125,7 @@
diff --git a/client/src/views/results/Answers.vue b/client/src/views/results/CompareAnswers.vue similarity index 94% rename from client/src/views/results/Answers.vue rename to client/src/views/results/CompareAnswers.vue index 8a2dac0..c892d32 100644 --- a/client/src/views/results/Answers.vue +++ b/client/src/views/results/CompareAnswers.vue @@ -14,7 +14,7 @@