From 204d2a822b78caac40fa7bb394910a21aa0b96c2 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期三, 24 七月 2024 15:43:30 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/store/modules/grade.js | 265 +++--------------------------------------------------
1 files changed, 15 insertions(+), 250 deletions(-)
diff --git a/src/store/modules/grade.js b/src/store/modules/grade.js
index 3042188..737f735 100644
--- a/src/store/modules/grade.js
+++ b/src/store/modules/grade.js
@@ -1,262 +1,22 @@
import { ref, computed } from 'vue';
import { defineStore } from 'pinia';
-export const useGradeStore = defineStore('exam', () => {
- const examInfo = ref({
- examId: 1,
- examName: '鑰冭瘯鍚嶇О',
- examType: '鑰冭瘯绫诲瀷',
- examStatus: '鑰冭瘯鐘舵��',
- examStartTime: '2021-01-01',
- examEndTime: '2021-01-01',
- examTime: 5,
- });
+export const useGradeStore = defineStore('grade', () => {
+ const examInfo = ref(null);
+ const examDetail = ref([]);
const examType = ref({
1: '鍗曢�夐',
2: '澶氶�夐',
- 3: '闊抽棰�'
+ 3: '鍒ゆ柇棰�',
+ 4: '濉┖棰�',
+ 5: '绠�绛旈',
+ 6: '璇煶棰�',
+ 7: '璁$畻棰�',
+ 8: '鍒嗘瀽棰�',
});
const currentType = ref(1);
const currentIndex = ref(0);
-
-
- const examDetail = ref([
- {
- questionType: 1,
- questionList: [
- {
- "id": null,
- "questionType": 1,
- "gradeLevel": null,
- "subjectId": 2,
- "title": "1+1=锛�",
- "items": [
- {
- "prefix": "A",
- "content": "1"
- },
- {
- "prefix": "B",
- "content": "2"
- },
- {
- "prefix": "C",
- "content": "3"
- },
- {
- "prefix": "D",
- "content": "4"
- }
- ],
- "analyze": "闂皬鏈嬪弸",
- "correct": "A",
- "right": "A",
- "score": "3",
- "difficult": 5,
- "isRight": true
- },
- {
- "id": null,
- "questionType": 1,
- "gradeLevel": null,
- "subjectId": 2,
- "title": "1+1=锛�",
- "items": [
- {
- "prefix": "A",
- "content": "1"
- },
- {
- "prefix": "B",
- "content": "2"
- },
- {
- "prefix": "C",
- "content": "3"
- },
- {
- "prefix": "D",
- "content": "4"
- }
- ],
- "analyze": "闂皬鏈嬪弸",
- "correct": "A",
- "right": "B",
- "score": "3",
- "difficult": 5,
- "isRight": false
- }
- ]
- },
- {
- questionType: 2,
- questionList: [
- {
- "id": null,
- "questionType": 1,
- "gradeLevel": null,
- "subjectId": 2,
- "title": "1+1=锛�",
- "items": [
- {
- "prefix": "A",
- "content": "1"
- },
- {
- "prefix": "B",
- "content": "2"
- },
- {
- "prefix": "C",
- "content": "3"
- },
- {
- "prefix": "D",
- "content": "4"
- }
- ],
- "analyze": "闂皬鏈嬪弸",
- "correct": "A,B",
- "right": "A,B,C",
- "score": "5",
- "difficult": 5,
- "isRight": false
- },
- {
- "id": null,
- "questionType": 1,
- "gradeLevel": null,
- "subjectId": 2,
- "title": "1+1=锛�",
- "items": [
- {
- "prefix": "A",
- "content": "1"
- },
- {
- "prefix": "B",
- "content": "2"
- },
- {
- "prefix": "C",
- "content": "3"
- },
- {
- "prefix": "D",
- "content": "4"
- }
- ],
- "analyze": "闂皬鏈嬪弸",
- "correct": "A,D",
- "right": "B,C",
- "score": "5",
- "difficult": 5,
- "isRight": false
- },
- {
- "id": null,
- "questionType": 1,
- "gradeLevel": null,
- "subjectId": 2,
- "title": "1+1=锛�",
- "items": [
- {
- "prefix": "A",
- "content": "1"
- },
- {
- "prefix": "B",
- "content": "2"
- },
- {
- "prefix": "C",
- "content": "3"
- },
- {
- "prefix": "D",
- "content": "4"
- }
- ],
- "analyze": "闂皬鏈嬪弸",
- "correct": "B,C",
- "right": "B,C",
- "score": "5",
- "difficult": 5,
- "isRight": true
- }
- ]
- },
- {
- questionType: 3,
- questionList: [
- {
- "id": null,
- "questionType": 1,
- "gradeLevel": null,
- "subjectId": 2,
- "title": "娴嬭瘯闊抽1",
- "audioFile": '/test.mp3',
- "items": [
- {
- "prefix": "A",
- "content": "1"
- },
- {
- "prefix": "B",
- "content": "2"
- },
- {
- "prefix": "C",
- "content": "3"
- },
- {
- "prefix": "D",
- "content": "4"
- }
- ],
- "analyze": "闂皬鏈嬪弸",
- "correct": "",
- "right": "B",
- "score": "3",
- "difficult": 5,
- "isRight": false
- },
- {
- "id": null,
- "questionType": 1,
- "gradeLevel": null,
- "subjectId": 2,
- "title": "娴嬭瘯闊抽2",
- "audioFile": '/test.mp3',
- "items": [
- {
- "prefix": "A",
- "content": "1"
- },
- {
- "prefix": "B",
- "content": "2"
- },
- {
- "prefix": "C",
- "content": "3"
- },
- {
- "prefix": "D",
- "content": "4"
- }
- ],
- "analyze": "闂皬鏈嬪弸",
- "correct": "D",
- "right": "A",
- "score": "3",
- "difficult": 5,
- "isRight": false
- }
- ]
- },
- ]);
const getActiveQuestion = computed(() => {
const temp = examDetail.value.find(item => item.questionType === currentType.value);
@@ -272,7 +32,10 @@
const setExamDetail = (detail) => {
examDetail.value = detail;
};
-
+ const initExam = () => {
+ currentIndex.value = 0;
+ currentType.value = 1;
+ }
return {
examInfo,
examDetail,
@@ -281,6 +44,8 @@
currentType,
currentIndex,
+ initExam,
+
getActiveQuestion,
setExamInfo,
--
Gitblit v1.8.0