Skip to content

Commit

Permalink
Add SRE-ES and Letter-ES to routes and add props
Browse files Browse the repository at this point in the history
  • Loading branch information
kellyel committed Mar 12, 2024
1 parent 80d34b9 commit 7675923
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ const navbarBlacklist = ref([
'SWR',
'SWR-ES',
'SRE',
'SRE-ES',
'PA',
'Letter',
'Letter-ES',
'Vocab',
'Multichoice',
'Morphology',
Expand Down
8 changes: 7 additions & 1 deletion src/components/tasks/TaskLetter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ import { useGameStore } from '@/store/game';
import _get from 'lodash/get';
import { fetchDocById } from '@/helpers/query/utils';
const taskId = 'letter';
const props = defineProps({
taskId: { type: String, required: true, default: 'letter' },
language: { type: String, required: true, default: 'en' },
});
const taskId = props.taskId;
const router = useRouter();
const gameStarted = ref(false);
const authStore = useAuthStore();
Expand Down Expand Up @@ -75,6 +80,7 @@ async function startTask() {
grade: _get(userData.value, 'studentData.grade'),
birthMonth: userDateObj.getMonth() + 1,
birthYear: userDateObj.getFullYear(),
language: props.language,
};
const gameParams = { ...appKit._taskInfo.variantParams };
Expand Down
8 changes: 7 additions & 1 deletion src/components/tasks/TaskSRE.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ import { useGameStore } from '@/store/game';
import _get from 'lodash/get';
import { fetchDocById } from '@/helpers/query/utils';
const taskId = 'sre';
const props = defineProps({
taskId: { type: String, required: true, default: 'sre' },
language: { type: String, required: true, default: 'en' },
});
const taskId = props.taskId;
const router = useRouter();
const gameStarted = ref(false);
const authStore = useAuthStore();
Expand Down Expand Up @@ -75,6 +80,7 @@ async function startTask() {
grade: _get(userData.value, 'studentData.grade'),
birthMonth: userDateObj.getMonth() + 1,
birthYear: userDateObj.getFullYear(),
language: props.language,
};
const gameParams = { ...appKit._taskInfo.variantParams };
Expand Down
16 changes: 16 additions & 0 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,30 @@ const routes = [
path: '/game/sre',
name: 'SRE',
component: () => import('../components/tasks/TaskSRE.vue'),
props: { taskId: 'sre', language: 'en' },
meta: { pageTitle: 'SRE' },
},
{
path: '/game/sre-es',
name: 'SRE-ES',
component: () => import('../components/tasks/TaskSRE.vue'),
props: { taskId: 'sre-es', language: 'es' },
meta: { pageTitle: 'SRE-ES' },
},
{
path: '/game/letter',
name: 'Letter',
component: () => import('../components/tasks/TaskLetter.vue'),
props: { taskId: 'letter', language: 'en' },
meta: { pageTitle: 'Letter' },
},
{
path: '/game/letter-es',
name: 'Letter-ES',
component: () => import('../components/tasks/TaskLetter.vue'),
props: { taskId: 'letter-es', language: 'es' },
meta: { pageTitle: 'Letter-ES' },
},
{
path: '/game/multichoice',
name: 'Multichoice',
Expand Down

0 comments on commit 7675923

Please sign in to comment.