|
@@ -110,7 +110,7 @@
|
|
|
{{(wrong+1)+'、'+test_YLRZ.list[wrong].q}}
|
|
{{(wrong+1)+'、'+test_YLRZ.list[wrong].q}}
|
|
|
</view>
|
|
</view>
|
|
|
<!-- 答案 -->
|
|
<!-- 答案 -->
|
|
|
- <view class="ylrz-test-a-box">
|
|
|
|
|
|
|
+ <!-- <view class="ylrz-test-a-box">
|
|
|
<view class="ylrz-test-a-box2">
|
|
<view class="ylrz-test-a-box2">
|
|
|
<view class="df aic fdr ylrz-test-a" v-for="(answer2,answerI2) in test_YLRZ.list[wrong].a_list" :key="answerI2">
|
|
<view class="df aic fdr ylrz-test-a" v-for="(answer2,answerI2) in test_YLRZ.list[wrong].a_list" :key="answerI2">
|
|
|
<img class="ylrz-test-a-img" :src="test_YLRZ.list[wrong].a[answerI2]==1?test_answer_icon_checked:allCheckedAnswer[wrong][answerI2]==1?test_answer_icon_wrong:test_answer_icon_unchecked"></img>
|
|
<img class="ylrz-test-a-img" :src="test_YLRZ.list[wrong].a[answerI2]==1?test_answer_icon_checked:allCheckedAnswer[wrong][answerI2]==1?test_answer_icon_wrong:test_answer_icon_unchecked"></img>
|
|
@@ -119,7 +119,19 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ </view> -->
|
|
|
|
|
+ <view class="ylrz-test-a-box">
|
|
|
|
|
+ <view class="ylrz-test-a-box2">
|
|
|
|
|
+ <view class="df aic fdr ylrz-test-a" v-for="(answer2,answerI2) in test_YLRZ.list[wrong].a_list" :key="answerI2">
|
|
|
|
|
+ <!-- <img class="ylrz-test-a-img" :src="test_YLRZ.list[wrong].a[answerI2]==1?test_answer_icon_checked:allCheckedAnswer[wrong][answerI2]==1?test_answer_icon_wrong:test_answer_icon_unchecked"></img> -->
|
|
|
|
|
+ <view class="ylrz-test-a-text">
|
|
|
|
|
+ {{test_answer_pre[answerI2]+':'+answer2}}
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <view>{{allWrong_checked_letter[wrongIndex]}}</view>
|
|
|
|
|
+ <view>{{allWrong_right_letter[wrongIndex]}}</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="ylrz-test-btn-exit ylrz-test-btn-red df aic jcc" @click="onClick_test_exit">退出</view>
|
|
<view class="ylrz-test-btn-exit ylrz-test-btn-red df aic jcc" @click="onClick_test_exit">退出</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -143,6 +155,10 @@
|
|
|
curCheckedAnswer: [],
|
|
curCheckedAnswer: [],
|
|
|
//玩家选择的答案
|
|
//玩家选择的答案
|
|
|
allCheckedAnswer: [],
|
|
allCheckedAnswer: [],
|
|
|
|
|
+ //用户错题答案的字母
|
|
|
|
|
+ allWrong_checked_letter: [],
|
|
|
|
|
+ //正确答案的字母
|
|
|
|
|
+ allWrong_right_letter: [],
|
|
|
//玩家错误的题目序列号
|
|
//玩家错误的题目序列号
|
|
|
allWrongTest: [],
|
|
allWrongTest: [],
|
|
|
scrollTop: 0,
|
|
scrollTop: 0,
|
|
@@ -258,35 +274,35 @@
|
|
|
this.resetCurCheckedAnswer();
|
|
this.resetCurCheckedAnswer();
|
|
|
},
|
|
},
|
|
|
onClick_test_next() {
|
|
onClick_test_next() {
|
|
|
- console.log("这道题选了什么", this.curCheckedAnswer);
|
|
|
|
|
|
|
+ // console.log("这道题选了什么", this.curCheckedAnswer);
|
|
|
if (this.checkedAnswer() == true) {
|
|
if (this.checkedAnswer() == true) {
|
|
|
this.curQIndex++;
|
|
this.curQIndex++;
|
|
|
this.resetCurCheckedAnswer();
|
|
this.resetCurCheckedAnswer();
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
alert("必须选择一个答案");
|
|
alert("必须选择一个答案");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
- checkedAnswer(){
|
|
|
|
|
|
|
+ checkedAnswer() {
|
|
|
let count = 0
|
|
let count = 0
|
|
|
let countMax = this.curCheckedAnswer.length
|
|
let countMax = this.curCheckedAnswer.length
|
|
|
- for (let i = 0; i <this.curCheckedAnswer.length ; i++) {
|
|
|
|
|
|
|
+ for (let i = 0; i < this.curCheckedAnswer.length; i++) {
|
|
|
|
|
|
|
|
if (this.curCheckedAnswer[i] == 0) {
|
|
if (this.curCheckedAnswer[i] == 0) {
|
|
|
count++
|
|
count++
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (count == countMax ) {
|
|
|
|
|
|
|
+ if (count == countMax) {
|
|
|
return false
|
|
return false
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
return true
|
|
return true
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
onClick_test_finish() {
|
|
onClick_test_finish() {
|
|
|
- console.log("所有答案", this.allCheckedAnswer);
|
|
|
|
|
|
|
+ // console.log("所有答案", this.allCheckedAnswer);
|
|
|
//检验一下答案
|
|
//检验一下答案
|
|
|
for (let i = 0; i < this.test_YLRZ.list.length; i++) {
|
|
for (let i = 0; i < this.test_YLRZ.list.length; i++) {
|
|
|
let isTrue = true;
|
|
let isTrue = true;
|
|
@@ -298,14 +314,55 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- console.log("检测结果为", this.allWrongTest);
|
|
|
|
|
|
|
+ // console.log("检测结果为", this.allWrongTest);
|
|
|
|
|
+ this.updateCheckedAnswerLetter();
|
|
|
this.checkedIndex1 = 2;
|
|
this.checkedIndex1 = 2;
|
|
|
- let score = 10-this.allWrongTest.length;
|
|
|
|
|
- userController.setupScore_ylrz(score,function(res){
|
|
|
|
|
- alert("提交成功");
|
|
|
|
|
- },function(res){
|
|
|
|
|
- alert("提交失败");
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ let score = 10 - this.allWrongTest.length;
|
|
|
|
|
+ // userController.setupScore_ylrz(score,function(res){
|
|
|
|
|
+ // alert("提交成功");
|
|
|
|
|
+ // },function(res){
|
|
|
|
|
+ // alert("提交失败");
|
|
|
|
|
+ // });
|
|
|
|
|
+ },
|
|
|
|
|
+ //更新用户选择答案字母
|
|
|
|
|
+ updateCheckedAnswerLetter() {
|
|
|
|
|
+ this.allWrong_checked_letter = [];
|
|
|
|
|
+ // console.log("更新用户选择答案字母", this.allCheckedAnswer, this.allWrongTest);
|
|
|
|
|
+ for (let i = 0; i < this.allWrongTest.length; i++) {
|
|
|
|
|
+ //把用户选择的答案放进去
|
|
|
|
|
+ let curCheckedLetter = '我的答案:【';
|
|
|
|
|
+ for (let j = 0; j < this.allCheckedAnswer[i].length; j++) {
|
|
|
|
|
+ if (this.allCheckedAnswer[i][j] == 1) {
|
|
|
|
|
+ curCheckedLetter += this.test_answer_pre[j];
|
|
|
|
|
+ curCheckedLetter += ','
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (curCheckedLetter[curCheckedLetter.length - 1] == ',') {
|
|
|
|
|
+ curCheckedLetter = curCheckedLetter.substring(0, curCheckedLetter.length - 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ curCheckedLetter += '】';
|
|
|
|
|
+ this.allWrong_checked_letter.push(curCheckedLetter);
|
|
|
|
|
+ }
|
|
|
|
|
+ // console.log("用户选择的答案", this.allWrong_checked_letter);
|
|
|
|
|
+
|
|
|
|
|
+ this.allWrong_right_letter = [];
|
|
|
|
|
+ for (let i = 0; i < this.allWrongTest.length; i++) {
|
|
|
|
|
+ //把正确的答案放进去
|
|
|
|
|
+ let curRightLetter = '正确答案:【';
|
|
|
|
|
+ let testIndex = this.allWrongTest[i];
|
|
|
|
|
+ for (let j = 0; j < this.test_YLRZ.list[testIndex].a.length; j++) {
|
|
|
|
|
+ if (this.test_YLRZ.list[testIndex].a[j] == 1) {
|
|
|
|
|
+ curRightLetter += this.test_answer_pre[j];
|
|
|
|
|
+ curRightLetter += ','
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (curRightLetter[curRightLetter.length - 1] == ',') {
|
|
|
|
|
+ curRightLetter = curRightLetter.substring(0, curRightLetter.length - 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ curRightLetter += '】'
|
|
|
|
|
+ this.allWrong_right_letter.push(curRightLetter);
|
|
|
|
|
+ }
|
|
|
|
|
+ // console.log("正确答案", this.allWrong_right_letter);
|
|
|
},
|
|
},
|
|
|
onClick_test_exit() {
|
|
onClick_test_exit() {
|
|
|
this.checkedIndex1 = 1;
|
|
this.checkedIndex1 = 1;
|