|
|
|
@ -128,7 +128,7 @@ const xnOptionsList = computed(() => { |
|
|
|
|
const selectedOption = ref<{ oid: any; qid: string }[]>(Array(questions.value.length).fill(null)); |
|
|
|
|
|
|
|
|
|
//选中逻辑 |
|
|
|
|
const selectOption = (option: any) => { |
|
|
|
|
const selectOption = async (option: any) => { |
|
|
|
|
if (complete.value == false) { |
|
|
|
|
if (questions.value.length > 0) { |
|
|
|
|
const currentQuestion = questions.value[currentQuestionIndex.value]; |
|
|
|
@ -138,6 +138,11 @@ const selectOption = (option: any) => { |
|
|
|
|
}; |
|
|
|
|
console.log(selectedOption.value[currentQuestionIndex.value].oid, option); |
|
|
|
|
} |
|
|
|
|
//选择答案错误时给出提示 |
|
|
|
|
const res: any = await checkapi(selectedOption.value[currentQuestionIndex.value]); |
|
|
|
|
if (res.result !== "success") { |
|
|
|
|
ElMessage.error('回答错误') |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
const score = ref(0); // 初始化分数为0 |
|
|
|
|