From 7c83fc22a0faf37c9dd085b1fec758624d3a653e Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期三, 27 十一月 2024 15:38:55 +0800 Subject: [PATCH] 答题器新增公式类填空题类型 --- src/components/examinations/index.vue | 41 +++++++++++++++++++++++++++++++---------- 1 files changed, 31 insertions(+), 10 deletions(-) diff --git a/src/components/examinations/index.vue b/src/components/examinations/index.vue index 653a3a7..fe083ff 100644 --- a/src/components/examinations/index.vue +++ b/src/components/examinations/index.vue @@ -41,7 +41,11 @@ <span class="questionNum" :style="{ - marginTop: value.questionType == 'completion' ? '12px' : '0', + marginTop: + value.questionType == 'completion' || + value.questionType == 'mathField' + ? '12px' + : '0', }" >{{ index + 1 }}. </span> @@ -53,7 +57,8 @@ v-if=" value.stemStyle == 'Txt' && value.questionType != 'completion' && - value.questionType != 'dropdown' + value.questionType != 'dropdown' && + value.questionType != 'mathField' " :id="value.id" v-html="value.stem.stemTxt" @@ -78,7 +83,13 @@ ></el-image> </p> <!-- 濉┖棰橀骞� --> - <p class="titleText" v-if="value.questionType == 'completion'"> + <p + class="titleText" + v-if=" + value.questionType == 'completion' || + value.questionType == 'mathField' + " + > <span v-for="(itemText, indexText) in value.stem" :key="indexText + 'questionType'" @@ -88,16 +99,22 @@ v-html="itemText" class="input-txt" ></span> - <!-- <input - v-else + <input + v-if=" + typeof itemText != 'string' && + value.questionType == 'completion' + " type="text" class="input" v-model.trim="value.userAnswer[itemText.num]" :disabled="value.isComplete" :style="{ backgroundColor: inputBc }" - /> --> + /> <math-field - v-else + v-if=" + typeof itemText != 'string' && + value.questionType == 'mathField' + " class="mathField" :menuItems="[]" @input="onChangeInput($event, nindex, index, itemText.num)" @@ -284,7 +301,8 @@ type != 'mock' && (value.questionType == 'shortAnswer' || value.questionType == 'multipleChoice' || - value.questionType == 'completion') + value.questionType == 'completion' || + value.questionType == 'mathField') " > <el-button @click="checkPares(value)" style="margin-top: 10px" @@ -676,7 +694,7 @@ } else { // 濉┖棰� for (let dindex = 0; dindex < citem.userAnswer.length; dindex++) { - citem.userAnswer[dindex] = ''; + citem.userAnswer[dindex] = ""; } } } @@ -730,7 +748,10 @@ } else if (citem.questionType == "shortAnswer") { // 绠�绛� 缈昏瘧 citem.isRight = null; - } else if (citem.questionType == "completion") { + } else if ( + citem.questionType == "completion" || + citem.questionType == "mathField" + ) { // 濉┖ if (typeof citem.answer == "string") { citem.isRight = citem.answer == citem.userAnswer[0]; -- Gitblit v1.9.1