提交 e0dac24d 编写于 作者: guangjun.yang's avatar guangjun.yang

解析相关问题

上级 7375f299
......@@ -51,19 +51,6 @@
:class="{'select': item.isCorrect, 'error': item.isSelected && !item.isCorrect}"
>{{currentQuestion.unionType == 2 ? getOrderVac(index) : item.text}}</span>
</div>
<!-- <div class="item">
<img src="../../images/question/error.png" alt="">
<span class="content">积极采取救治措施</span>
</div>
<div class="item">
<img src="../../images/question/correct.png" alt="">
<span class="content select">向上级医师报告</span>
</div>
<div class="item">
<span class="option">D</span>
<span class="content">查看病理,了解病史</span>
</div>-->
</article>
<article
class="c-btn-wrapper"
......@@ -77,7 +64,11 @@
</article>
<article class="analysis-wrapper" v-show="currentQuestion.isAnalyzed">
<span class="title">解析</span>
<div class="content" v-html="currentQuestion.intro"></div>
<div v-if="currentQuestion.intro" class="content" v-html="currentQuestion.intro"></div>
<div class="no-intro" v-else>
<img src="../../images/question/no-analysis.png" alt />
<span class="text">暂无相关解析</span>
</div>
</article>
</section>
</template>
......@@ -105,6 +96,12 @@ export default {
"userInfo"
])
},
// watch: {
// "currentQuestion.isAnalyzed"(newVal) {
// console.log('watch isAnalyzed', newVal);
// window.scrollTo(0, 2000);
// }
// },
data() {
return {};
},
......@@ -327,6 +324,22 @@ export default {
width: 100% !important;
}
}
.no-intro {
display: flex;
flex-direction: column;
align-items: center;
padding: 60px 0 120px;
img {
width: 100px;
height: 100px;
}
.text {
height: 12px;
line-height: 12px;
font-size: 12px;
color: #999999;
}
}
}
}
</style>
\ No newline at end of file
......@@ -91,6 +91,10 @@ export default {
this.currentQuestion.isAnalyzed = true;
if(!this.currentQuestion.commitFlag) {
this.commitAnswer();
} else {
setTimeout(() => {
this.$emit("scrollTop");
}, 200);
}
// this.$store.commit('SET_CURRENT_QUESTION', this.currentQuestion);
},
......@@ -98,7 +102,6 @@ export default {
// 收藏/不收藏
toggleCollect() {
this.favor(this.currentQuestion);
this.$emit("scrollTop");
// this.$store.commit('SET_CURRENT_QUESTION', this.currentQuestion);
},
......@@ -146,8 +149,6 @@ export default {
setEntry: true,
token: this.userInfo.userToken,
};
// 计算是否答对了题目(只有多选题,才做相应处理)
// if (this.currentQuestion.typeId == 2) {
let isRight = this.currentQuestion.myAnswer == this.currentQuestion.answer;
if (isRight) {
this.currentQuestion.commitFlag = 1;
......@@ -155,7 +156,10 @@ export default {
this.currentQuestion.commitFlag = 2;
}
this.currentQuestion.isAnalyzed = true;
// }
// this.$forceUpdate();
setTimeout(() => {
this.$emit("scrollTop");
}, 200);
this.POST(`onlineexam/practise/commit`, params).then(({ data }) => {
console.log('in commitAnswer res', data);
// if(data.resultType == 1) {
......
// import fetch from '@/utils/fetch';
// import { getBaseUrl } from '@/utils/index'
// import { setCookie, getCookie, delCookie } from '@/utils/index';
// import { envConfig } from '@/utils/env-config';
import { findQuestionIndexNo } from "@/utils";
const question = {
state: {
currentTitle: "题库",
questionList: [],
currentQuestion: {
isAnalyzed: false,
options: [ // 从options加工出来
{
isCorrect: false,
isSelected: true,
text: "进行分析评估",
},
{
isCorrect: false,
isSelected: false,
text: "进行分析评估",
},
{
isCorrect: true,
isSelected: true,
text: "进行分析评估",
},
{
isCorrect: false,
isSelected: false,
text: "进行分析评估",
},
],
titleId: 1,
titleNo: 1, // 题序,从1开始
typeId: 1, // 题目类型ID 1-单选,2-多选,3-判断
unionId: "", // 联合类型题目,分组唯一标识
unionType: 1, // 0普通题型 1-共用题干; 2-共用选项
unionQuestion: "", // 共用题干
question: '题干内容<img src="https://files.yunqueyi.com/image/png/protal/project/20200702161856970.png" />', // 题干内容
config: "", // 选项
answer: "", // 正确答案
intro: "", // 题目解析
score: 0, // 题目分值
myAnswer: "", // 我的答案
commitFlag: 0, // 0还未做 1做对了 2做错了
favorFlag: 0, // 0未收藏 1已收藏
pictureFlag: "", // 0没有图 1有图
questionStreamType: "", // 题干内流媒体类型:0-文本,1-图片,2-视频,3-音频
directoryId: 0, // 题库ID
paperId: "", // 试卷ID
paperIndex: "", // 试卷索引
},
commonConfig: {
// 0: 免费; 1: 收费; 没有绑卡且是收费题库(bindStatus == 0 && freeFlag == 1)可以走免费体验流程
freeFlag: 0,
directoryId: "",
secondSubjectId: 0,
cardType: 3,
goodsType: 3,
commitKind: 1, // 答题来源 1:错题集 2:收藏 3:题库
},
titleConfig: {
bindStatus: 0, // 绑卡状态:0未绑卡 1已绑卡
commitKind: 1, // 答题来源 1:错题集 2:收藏 3:题库
currentTitleNo: 0, // 定位答题题目id
resultId: 0, // 刷题库轮次ID
totalCount: 0, // 题目总数
}
},
mutations: {
SET_COMMON_CONIFG: (state, payload) => {
state.commonConfig = payload;
},
SET_TITLE_CONIFG: (state, payload) => {
state.titleConfig = payload;
},
SET_COMMIT_KIND: (state, payload) => {
state.titleConfig.commitKind = payload;
},
SET_FREE_FLAG: (state, payload) => {
state.titleConfig.freeFlag = payload;
},
SET_TOTAL_COUNT: (state, payload) => {
state.titleConfig.totalCount = payload;
},
SET_QUESTION_LIST: (state, payload) => {
state.questionList = payload;
},
SET_CURRENT_QUESTION: (state, payload) => {
state.currentQuestion = payload;
},
},
actions: {
// 处理返回的数据
handlerQuestionList({ commit, state }, rezultData) {
// debugger
let questionList = rezultData.practiseTitleModelList;
let handlerList = [], question, option, optionList = [], myAnswer = "", answer = "";
questionList.forEach( (item, index) => {
question = JSON.parse(JSON.stringify(item));
question.isAnalyzed = false;
option = {};
optionList = [];
question.options.forEach( (text, i) => {
option.isCorrect = false;
option.isSelected = false;
option.text = text;
optionList.push(JSON.parse(JSON.stringify(option)));
});
question.options = optionList;
console.log('handlerList', index);
handlerList.push(question);
});
console.log('in handlerList', handlerList);
let cIndex = findQuestionIndexNo(handlerList, 'titleNo', rezultData.currentTitleNo || 1);
commit("SET_CURRENT_QUESTION", handlerList[cIndex]);
commit("SET_QUESTION_LIST", handlerList);
let titleConfig = {
bindStatus: rezultData.bindStatus, // 绑卡状态:0未绑卡 1已绑卡
commitKind: rezultData.commitKind, // 答题来源 1:错题集 2:收藏 3:题库
currentTitleNo: rezultData.currentTitleNo, // 定位答题题目id
resultId: rezultData.resultId, // 刷题库轮次ID
totalCount: rezultData.totalCount, // 题目总数
}
commit("SET_TITLE_CONIFG", titleConfig);
},
},
}
export default question;
此差异已折叠。
......@@ -474,7 +474,8 @@ export default {
// 滚动到最上面
scrollTop() {
console.log("in scrollTop");
window.scrollTo(0, 2000);
}
}
};
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册