|
@@ -19,7 +19,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
<view v-else>
|
|
<view v-else>
|
|
|
- <uv-icon v-if="isOptionCorrect(option)" name="checkmark-circle-fill" color="#2CC6A0" size="22" />
|
|
|
|
|
|
|
+ <uv-icon v-if="isOptionCorrect(question, option)" name="checkmark-circle-fill" color="#2CC6A0" size="22" />
|
|
|
<uv-icon v-else-if="isOptionIncorrect(option)" name="close-circle-fill" color="#FF5B5C" size="22" />
|
|
<uv-icon v-else-if="isOptionIncorrect(option)" name="close-circle-fill" color="#FF5B5C" size="22" />
|
|
|
<view v-else class="question-option-index">{{ option.no }}</view>
|
|
<view v-else class="question-option-index">{{ option.no }}</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -52,17 +52,20 @@
|
|
|
class="absolute top-0 left-1/2 -translate-x-1/2 w-222 h-64" />
|
|
class="absolute top-0 left-1/2 -translate-x-1/2 w-222 h-64" />
|
|
|
<ie-image v-else src="/pagesStudy/static/image/icon-answer-incorrect.png"
|
|
<ie-image v-else src="/pagesStudy/static/image/icon-answer-incorrect.png"
|
|
|
class="absolute top-0 left-1/2 -translate-x-1/2 w-240 h-64" />
|
|
class="absolute top-0 left-1/2 -translate-x-1/2 w-240 h-64" />
|
|
|
- <view class="flex-1">
|
|
|
|
|
|
|
+ <view v-if="!isOnlySubjective" class="flex-1">
|
|
|
<view class="text-34 text-[#2CC6A0] font-bold">{{ question.answer1 }}</view>
|
|
<view class="text-34 text-[#2CC6A0] font-bold">{{ question.answer1 }}</view>
|
|
|
<view class="mt-4 text-26">正确答案</view>
|
|
<view class="mt-4 text-26">正确答案</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="h-40 w-1 bg-back"></view>
|
|
<view class="h-40 w-1 bg-back"></view>
|
|
|
- <view class="flex-1">
|
|
|
|
|
|
|
+ <view v-if="!isOnlySubjective" class="flex-1">
|
|
|
<view class="text-34 font-bold" :class="[question.isCorrect ? 'text-[#2CC6A0]' : 'text-[#FF5B5C]']">
|
|
<view class="text-34 font-bold" :class="[question.isCorrect ? 'text-[#2CC6A0]' : 'text-[#FF5B5C]']">
|
|
|
{{ question.answers.join('') || (question.isNotKnow ? '不会' : '未答') }}
|
|
{{ question.answers.join('') || (question.isNotKnow ? '不会' : '未答') }}
|
|
|
</view>
|
|
</view>
|
|
|
<view class="mt-4 text-26">我的答案</view>
|
|
<view class="mt-4 text-26">我的答案</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <view v-if="isOnlySubjective" class="text-left mt-10 px-20">
|
|
|
|
|
+ <uv-parse :content="'正确答案:' + question.answer2"></uv-parse>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
<view v-if="(readonly && question.parse) || (!readonly && question.showParse)" class="mt-40">
|
|
<view v-if="(readonly && question.parse) || (!readonly && question.showParse)" class="mt-40">
|
|
@@ -95,7 +98,7 @@ import { Study } from '@/types';
|
|
|
import { useExam } from '@/composables/useExam';
|
|
import { useExam } from '@/composables/useExam';
|
|
|
import { EnumQuestionType } from '@/common/enum';
|
|
import { EnumQuestionType } from '@/common/enum';
|
|
|
import { NEXT_QUESTION, PREV_QUESTION, NEXT_QUESTION_QUICKLY, PREV_QUESTION_QUICKLY, SHOW_SUBMIT_CONFIRM, IS_ALL_DONE } from '@/types/injectionSymbols';
|
|
import { NEXT_QUESTION, PREV_QUESTION, NEXT_QUESTION_QUICKLY, PREV_QUESTION_QUICKLY, SHOW_SUBMIT_CONFIRM, IS_ALL_DONE } from '@/types/injectionSymbols';
|
|
|
-const { questionTypeDesc } = useExam();
|
|
|
|
|
|
|
+const { questionTypeDesc, isOptionCorrect } = useExam();
|
|
|
const props = defineProps<{
|
|
const props = defineProps<{
|
|
|
question: Study.Question;
|
|
question: Study.Question;
|
|
|
readonly?: boolean;
|
|
readonly?: boolean;
|
|
@@ -154,15 +157,17 @@ const getStyleClass = (option: Study.QuestionOption) => {
|
|
|
// console.log(props.question, option)
|
|
// console.log(props.question, option)
|
|
|
return customClass;
|
|
return customClass;
|
|
|
};
|
|
};
|
|
|
-const isOptionCorrect = (option: Study.QuestionOption) => {
|
|
|
|
|
- const { answers, answer1, answer2 } = props.question;
|
|
|
|
|
- if ([EnumQuestionType.SINGLE_CHOICE, EnumQuestionType.JUDGMENT].includes(props.question.typeId)) {
|
|
|
|
|
- return answer1.includes(option.no);
|
|
|
|
|
- } else if ([EnumQuestionType.MULTIPLE_CHOICE].includes(props.question.typeId)) {
|
|
|
|
|
- return answer1.includes(option.no);
|
|
|
|
|
- }
|
|
|
|
|
- return false;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+// const isOptionCorrect = (option: Study.QuestionOption) => {
|
|
|
|
|
+// const { answers, answer1, answer2 } = props.question;
|
|
|
|
|
+// if ([EnumQuestionType.SINGLE_CHOICE, EnumQuestionType.JUDGMENT].includes(props.question.typeId)) {
|
|
|
|
|
+// return answer1.includes(option.no);
|
|
|
|
|
+// } else if ([EnumQuestionType.MULTIPLE_CHOICE].includes(props.question.typeId)) {
|
|
|
|
|
+// return answer1.includes(option.no);
|
|
|
|
|
+// } else if (props.question.typeId === EnumQuestionType.SUBJECTIVE) {
|
|
|
|
|
+// return answers.includes(option.no);
|
|
|
|
|
+// }
|
|
|
|
|
+// return false;
|
|
|
|
|
+// }
|
|
|
const isOptionIncorrect = (option: Study.QuestionOption) => {
|
|
const isOptionIncorrect = (option: Study.QuestionOption) => {
|
|
|
const { answers, answer1 } = props.question;
|
|
const { answers, answer1 } = props.question;
|
|
|
return answers.includes(option.no) && !answer1.includes(option.no);
|
|
return answers.includes(option.no) && !answer1.includes(option.no);
|