refactor: 对接标准答案
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
52f7cac53a
commit
91aa7411d9
|
|
@ -2,19 +2,10 @@
|
|||
<script lang="ts" setup>
|
||||
import { computed, ref } from 'vue'
|
||||
|
||||
interface AnswerKey {
|
||||
id: string
|
||||
content: string
|
||||
score: number
|
||||
type: 'text' | 'image' | 'formula'
|
||||
}
|
||||
|
||||
interface Props {
|
||||
questionTitle?: string
|
||||
standardAnswer?: string
|
||||
fullScore?: number
|
||||
answerKeys?: AnswerKey[]
|
||||
sampleAnswers?: string[]
|
||||
scoringStandard?: string
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
|
|
@ -24,47 +15,6 @@ const props = withDefaults(defineProps<Props>(), {
|
|||
})
|
||||
|
||||
const modelValue = defineModel<boolean>()
|
||||
|
||||
// 当前查看的标签页
|
||||
const activeTab = ref<'answer' | 'standard' | 'sample'>('answer')
|
||||
|
||||
// 模拟标准答案数据(实际项目中从API获取)
|
||||
const mockAnswerKeys = computed(() => {
|
||||
if (props.answerKeys.length > 0) {
|
||||
return props.answerKeys
|
||||
}
|
||||
return [
|
||||
{
|
||||
id: '1',
|
||||
content: '根据题意,工业革命对西欧社会的影响主要体现在以下几个方面:',
|
||||
score: 2,
|
||||
type: 'text' as const,
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
content: '1. 促进了资本主义经济的发展,推动了产业结构的转型;',
|
||||
score: 3,
|
||||
type: 'text' as const,
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
content: '2. 改变了社会阶级结构,形成了工业资产阶级和无产阶级;',
|
||||
score: 3,
|
||||
type: 'text' as const,
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
content: '3. 推动了城市化进程,改变了人们的生活方式。',
|
||||
score: 4,
|
||||
type: 'text' as const,
|
||||
},
|
||||
]
|
||||
})
|
||||
|
||||
// 切换标签页
|
||||
function switchTab(tab: 'answer' | 'standard' | 'sample') {
|
||||
activeTab.value = tab
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -90,7 +40,7 @@ function switchTab(tab: 'answer' | 'standard' | 'sample') {
|
|||
<text
|
||||
class="whitespace-pre-line text-14px text-gray-800 leading-relaxed"
|
||||
>
|
||||
答案
|
||||
{{ standardAnswer || '暂无标准答案' }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -286,6 +286,7 @@ function handleQuickScoreSelect(score: number) {
|
|||
v-model="showAnswer"
|
||||
:question-title="`${currentQuestion?.question_major}.${currentQuestion?.question_minor}`"
|
||||
:full-score="currentQuestion?.full_score"
|
||||
:standard-answer="currentQuestion?.standard_answer"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Reference in New Issue