+ Czas na zapoznanie się z pytaniem
+ Czas na udzielenie odpowiedzi
+
+
+
START
+
@@ -81,6 +86,26 @@ defineProps<{
-
{{ questionaries }}
+
{{ questionaries }}
+
+
diff --git a/components/TopBar.vue b/components/TopBar.vue
index 33bf668..3360a95 100644
--- a/components/TopBar.vue
+++ b/components/TopBar.vue
@@ -7,19 +7,19 @@ defineProps<{
-
+
- Wartość punktowa
+
Wartość punktowa
{{ points }}
- Aktualna kategoria (implement)
+
Aktualna kategoria (implement)
{{ category }}
- Czas do końca egzaminu (implement)
+
Czas do końca egzaminu (implement)
{{ timeRemaining }}
diff --git a/package.json b/package.json
index 8277082..022a8cd 100644
--- a/package.json
+++ b/package.json
@@ -14,6 +14,7 @@
"@nuxt/fonts": "0.10.3",
"@nuxtjs/tailwindcss": "6.13.1",
"array-shuffle": "^3.0.0",
+ "date-fns": "^4.1.0",
"dotenv": "^16.4.7",
"drizzle-orm": "^0.40.0",
"nuxt": "^3.15.4",
diff --git a/pages/exam.vue b/pages/exam.vue
index 185e5f4..ea3c66d 100644
--- a/pages/exam.vue
+++ b/pages/exam.vue
@@ -20,14 +20,16 @@ const {
const countBasic = ref(0);
const countAdvanced = ref(-1);
+const now = ref("basic");
+
const tak_nie_model = ref();
+const abc_model = ref();
async function next() {
if (countBasic.value + 1 < dataBasic.value?.length!) {
questionaries.value.push({
- nr_pytania: question.value?.nr_pytania,
+ question: question.value,
chosen_answer: tak_nie_model.value ?? "",
- correct_answer: question.value?.poprawna_odp?.toLowerCase(),
chosen_is_correct:
tak_nie_model.value == question.value?.poprawna_odp?.toLowerCase(),
liczba_pkt: question.value?.liczba_pkt,
@@ -37,17 +39,50 @@ async function next() {
useHead({
title: `Pytanie ${countBasic.value + 1}/${dataBasic.value?.length}`,
});
- } else {
- // await navigateTo("/advanced");
+ } else if (countAdvanced.value + 1 < dataAdvanced.value?.length!) {
+ if (countAdvanced.value != -1) {
+ questionaries.value.push({
+ question: question.value,
+ chosen_answer: abc_model.value ?? "",
+ chosen_is_correct:
+ abc_model.value == question.value?.poprawna_odp?.toLowerCase(),
+ liczba_pkt: question.value?.liczba_pkt,
+ });
+ } else {
+ now.value = "advanced";
+ }
+ countAdvanced.value++;
+ abc_model.value = "";
}
}
-const question = computed(() => dataBasic.value?.at(countBasic.value));
+async function endExam() {
+ return;
+}
+
+const questionBasic = computed
(() =>
+ dataBasic.value?.at(countBasic.value)
+);
+const questionAdvanced = computed(() =>
+ dataAdvanced.value?.at(countAdvanced.value)
+);
+
+const question = computed(() => {
+ if (now.value == "basic") {
+ return questionBasic.value;
+ } else if (now.value == "advanced") {
+ return questionAdvanced.value;
+ } else {
+ return;
+ }
+});
+
const media = computed(() => {
const mediaSplit = question.value?.media?.split(".");
return {
fileType: mediaSplit?.pop()?.toLowerCase(),
fileName: mediaSplit?.join("."),
+ ogName: question.value?.media,
};
});
@@ -74,7 +109,16 @@ const questionaries: Ref> = ref([]);
:time-remaining="`25:00`"
/>
-
+
+
> = ref([]);
:count-basic="countBasic"
:count-advanced="countAdvanced"
@next-question="next()"
+ :now="now"
/>