diff --git a/src/front/src/components/testing/CatalogTest.vue b/src/front/src/components/testing/CatalogTest.vue index 7f519d3b8..563605fa2 100644 --- a/src/front/src/components/testing/CatalogTest.vue +++ b/src/front/src/components/testing/CatalogTest.vue @@ -22,7 +22,9 @@
{{ cardValue.name }}
-
{{ cardValue.description }}
+
+ {{ cardValue.description }} +
@@ -33,7 +35,7 @@
- + diff --git a/src/front/src/components/testing/DetailCardTest.vue b/src/front/src/components/testing/DetailCardTest.vue index 670c0009f..737127e09 100644 --- a/src/front/src/components/testing/DetailCardTest.vue +++ b/src/front/src/components/testing/DetailCardTest.vue @@ -57,10 +57,16 @@ import BodyDetailTesting from '@/components/testing/BodyDetailTesting.vue'; import QuestionBlock from '@/components/testing/QuestionBlock.vue'; import TestResults from '@/components/testing/TestResults.vue'; import { axiosApiInstance } from '@/utils/axios-api'; +import { useRoute } from 'vue-router'; +import { useAccountStore } from '../../store/AccountStore'; +// import fernet from 'fernet'; export default { components: { BodyDetailTesting, HeaderDetailTesting, QuestionBlock, TestResults }, setup() { + const route = useRoute(); + const accountStore = useAccountStore(); + const testId = route.params.id; const testStarted = ref(false); const testFinished = ref(false); const showFinishDialog = ref(false); @@ -74,6 +80,35 @@ export default { console.log(data.value); }; + // const userLogin = accountStore.user; + // const encryptedData = + // 'gAAAAABntEv1Gi_kxhY4EJTyxFetzeiNaE5uu4w43lzljCw9_2xJzLkFM7Gj08cS5eZ0ULw_s_eLAI_Jxf2nVYh_fK4Z5EAhVA=='; + // + // async function decryptData(encryptedData, userLogin) { + // const encoder = new TextEncoder(); + // const userKeyBuffer = await crypto.subtle.digest('SHA-256', encoder.encode(userLogin)); + // + // // Конвертация ArrayBuffer в Base64 + // const userKeyArray = Array.from(new Uint8Array(userKeyBuffer)); + // const base64Key = btoa(String.fromCharCode(...userKeyArray)); + // + // // Создаём секретный ключ + // const secret = new fernet.Secret(base64Key); + // + // // Расшифровываем данные + // const token = new fernet.Token({ + // secret: secret, + // token: encryptedData, + // ttl: 0, + // }); + // + // return token.decode(); + // } + // + // decryptData(encryptedData, userLogin) + // .then((decrypted) => console.log('Расшифрованное значение:', decrypted)) + // .catch((err) => console.error('Ошибка расшифровки:', err)); + const formattedTime = computed(() => { if (!data.value?.time) return '00:00'; @@ -147,7 +182,7 @@ export default { }); onMounted(() => { - getTestById(1); + getTestById(testId); }); return { diff --git a/src/front/src/components/testing/QuestionBlock.vue b/src/front/src/components/testing/QuestionBlock.vue index bd4b41ad0..0fbef3432 100644 --- a/src/front/src/components/testing/QuestionBlock.vue +++ b/src/front/src/components/testing/QuestionBlock.vue @@ -4,7 +4,7 @@ Вопрос {{ currentQuestion + 1 }} из {{ totalQuestions }} -

{{ question.name }}

+

{{ question.name }}

diff --git a/src/front/src/views/TestHomePage.vue b/src/front/src/views/TestHomePage.vue index 3b01ea513..386eef477 100644 --- a/src/front/src/views/TestHomePage.vue +++ b/src/front/src/views/TestHomePage.vue @@ -30,12 +30,12 @@ -