diff --git a/package.json b/package.json index bae3e8c..5e359f0 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,10 @@ "@commitlint/cli": "^19.3.0", "@commitlint/config-conventional": "^19.2.2", "axios": "^1.7.2", + "clsx": "^2.1.1", "pinia": "^2.1.7", "primeicons": "^7.0.0", + "tailwind-merge": "^2.3.0", "vue": "^3.4.21", "vue-awesome-paginate": "^1.1.46", "vue-router": "4", diff --git a/src/api/examsRepository.ts b/src/api/examsRepository.ts index 7375e9c..7d0d646 100644 --- a/src/api/examsRepository.ts +++ b/src/api/examsRepository.ts @@ -1,13 +1,14 @@ import AxiosClient from "./axios"; const resource = "/category"; +const resourceExam = "/exam"; export default { get(classId: string, currentPage: number) { return AxiosClient.get(`${resource}/${classId}/exams?page=${currentPage}`); }, getOne(exerciseId: string) { - return AxiosClient.get(`/exam/${exerciseId}`); + return AxiosClient.get(`${resourceExam}/${exerciseId}`); }, search(searchText: string, page: number) { return AxiosClient.post('/search', { @@ -15,5 +16,8 @@ export default { page: page || 1, }); }, + submit(formData: any) { + return AxiosClient.post(`${resourceExam}/submit`, formData); + } } diff --git a/src/components/Button/ButtonUtils.vue b/src/components/Button/ButtonUtils.vue new file mode 100644 index 0000000..d720fa4 --- /dev/null +++ b/src/components/Button/ButtonUtils.vue @@ -0,0 +1,22 @@ + + + \ No newline at end of file diff --git a/src/components/DoExercise/Question.vue b/src/components/DoExercise/Question.vue index cbf0d7c..f3fba6f 100644 --- a/src/components/DoExercise/Question.vue +++ b/src/components/DoExercise/Question.vue @@ -1,11 +1,15 @@ \ No newline at end of file diff --git a/src/components/DoExercise/Quote.vue b/src/components/DoExercise/Quote.vue new file mode 100644 index 0000000..f703d8f --- /dev/null +++ b/src/components/DoExercise/Quote.vue @@ -0,0 +1,20 @@ + + + \ No newline at end of file diff --git a/src/components/DoExercise/Results.vue b/src/components/DoExercise/Results.vue new file mode 100644 index 0000000..504a6ce --- /dev/null +++ b/src/components/DoExercise/Results.vue @@ -0,0 +1,73 @@ + + + \ No newline at end of file diff --git a/src/utils/cn.ts b/src/utils/cn.ts new file mode 100644 index 0000000..f408c26 --- /dev/null +++ b/src/utils/cn.ts @@ -0,0 +1,6 @@ +import { ClassValue, clsx } from "clsx"; +import { twMerge } from "tailwind-merge"; + +export function cn(...inputs: ClassValue[]) { + return twMerge(clsx(inputs)); +} \ No newline at end of file diff --git a/src/views/DoExercisePage.vue b/src/views/DoExercisePage.vue index 47eb38b..22f677c 100644 --- a/src/views/DoExercisePage.vue +++ b/src/views/DoExercisePage.vue @@ -1,19 +1,27 @@