Commit b328904e authored by zhengke's avatar zhengke

1

parent daf9ff75
...@@ -109,6 +109,30 @@ export function GetQuestionWords(data) { ...@@ -109,6 +109,30 @@ export function GetQuestionWords(data) {
}) })
} }
/**
* 获取语法
* @param {JSON参数} data
*/
export function GetQuestionGrammar(data) {
return request({
url: '/Exam/GetQuestionGrammar',
method: 'post',
data
})
}
/**
* 获取听力
* @param {JSON参数} data
*/
export function GetQuestionListening(data) {
return request({
url: '/Exam/GetQuestionListening',
method: 'post',
data
})
}
/** /**
* 点击答案提交答题 * 点击答案提交答题
* @param {JSON参数} data * @param {JSON参数} data
......
This diff is collapsed.
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</view> </view>
<view v-for="(item2, index2) in item1.QuestionContentObj" :key="index2" <view v-for="(item2, index2) in item1.QuestionContentObj" :key="index2"
class="flex item2 flex_start_center"> class="flex item2 flex_start_center">
<template v-if="item1.StundetAnswer==''"> <template v-if="item1.StundetAnswer.length==0">
<view class="chooseNum" @click="change(item1, item2)">{{ item2.ShowName }} <view class="chooseNum" @click="change(item1, item2)">{{ item2.ShowName }}
</view> </view>
<view class="chooseName" @click="change(item1, item2)" v-html="item2.Content"></view> <view class="chooseName" @click="change(item1, item2)" v-html="item2.Content"></view>
...@@ -35,17 +35,17 @@ ...@@ -35,17 +35,17 @@
</view> </view>
</template> </template>
</view> </view>
<view class="AnswerContent" v-if="item1.StundetAnswer!=''"> <view class="AnswerContent" v-if="item1.StundetAnswer.length>0">
<view> <view>
<text style="color: #8c8a94">正确答案:</text> <text style="color: #8c8a94">正确答案:</text>
<text class="isTrueAnswer">{{ item1.QuestionAnswerList[0] }}</text> <text class="isTrueAnswer">{{ item1.QuestionAnswerList[0] }}</text>
<text>您的答案是: <text>您的答案是:
<template v-if="item1.StundetAnswer != ''"> <template v-if="item1.StundetAnswer.length>0">
<text v-if="item1.StundetAnswer == item1.QuestionAnswerList[0]" <text v-if="item1.StundetAnswer[0] == item1.QuestionAnswerList[0]"
class="isTrueAnswer"> class="isTrueAnswer">
{{ item1.StundetAnswer }},回答正确 {{ item1.StundetAnswer }},回答正确
</text> </text>
<text v-else class="isNotAnswer">{{ item1.StundetAnswer }},回答错误</text> <text v-else class="isNotAnswer">{{ item1.StundetAnswer[0] }},回答错误</text>
</template> </template>
<template v-else> <template v-else>
<text>未作答</text> <text>未作答</text>
...@@ -98,9 +98,6 @@ ...@@ -98,9 +98,6 @@
let UserInfo = uni.getStorageSync('userInfo'); let UserInfo = uni.getStorageSync('userInfo');
watch(() => [...props.paperData], (val) => { watch(() => [...props.paperData], (val) => {
val.forEach(x => {
x.StundetAnswer = '';
})
data.dataList = [...data.dataList, ...val]; data.dataList = [...data.dataList, ...val];
}) })
let methods = { let methods = {
...@@ -116,9 +113,9 @@ ...@@ -116,9 +113,9 @@
}, },
//点击选择答案 //点击选择答案
change(item1, item2) { change(item1, item2) {
item1.StundetAnswer = item2.Name; item1.StundetAnswer[0] = item2.Name;
if (item1.QuestionAnswerList && item1.QuestionAnswerList.length > 0) { if (item1.QuestionAnswerList && item1.QuestionAnswerList.length > 0) {
if (item1.StundetAnswer == item1.QuestionAnswerList[0]) { if (item1.StundetAnswer[0] == item1.QuestionAnswerList[0]) {
data.current += 1; data.current += 1;
} }
} }
...@@ -131,18 +128,19 @@ ...@@ -131,18 +128,19 @@
QuestionContent: item1.QuestionContentObj, QuestionContent: item1.QuestionContentObj,
QuestionTypeId: item1.QuestionTypeId, QuestionTypeId: item1.QuestionTypeId,
QuestionTypeKey: item1.QuestionTypeKey, QuestionTypeKey: item1.QuestionTypeKey,
Answer: item1.StundetAnswer, StudentAnswer: item1.StundetAnswer,
Answer: item1.Answer,
AnswerParse: item1.AnswerParse, AnswerParse: item1.AnswerParse,
LevelType:item1.LevelType, LevelType:item1.LevelType,
IsAnswer: 0, IsAnswer: 0,
IsWrong: 0 IsWrong: 0
} }
if(item1.StundetAnswer){ if(item1.StundetAnswer.length>0){
msg.IsAnswer=1; msg.IsAnswer=1;
}else{ }else{
msg.IsAnswer=0; msg.IsAnswer=0;
} }
if(item1.StundetAnswer==item1.QuestionAnswerList[0]){ if(item1.StundetAnswer[0]==item1.QuestionAnswerList[0]){
msg.IsWrong=0; msg.IsWrong=0;
}else{ }else{
msg.IsWrong=1; msg.IsWrong=1;
...@@ -157,8 +155,8 @@ ...@@ -157,8 +155,8 @@
}, },
//判断是否为正确答案 //判断是否为正确答案
getErrorAnswer(item1, Number) { getErrorAnswer(item1, Number) {
if (item1.StundetAnswer != item1.QuestionAnswerList[0]) { if (item1.StundetAnswer[0] != item1.QuestionAnswerList[0]) {
if (item1.StundetAnswer == Number) { if (item1.StundetAnswer[0] == Number) {
return true return true
} }
} }
......
...@@ -206,12 +206,12 @@ ...@@ -206,12 +206,12 @@
<view class="Ques_Num" v-if="TypeObj">{{TypeObj.wordsFinishCount}}/{{TypeObj.wordsTotalCount}}</view> <view class="Ques_Num" v-if="TypeObj">{{TypeObj.wordsFinishCount}}/{{TypeObj.wordsTotalCount}}</view>
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/word1.png" alt="" /> <img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/word1.png" alt="" />
</view> </view>
<view class="Ques_Circle"> <view class="Ques_Circle" @click="goExam(2)">
<view class="Ques_Top">语法</view> <view class="Ques_Top">语法</view>
<view class="Ques_Num" v-if="TypeObj">{{TypeObj.grammarFinishCount}}/{{TypeObj.grammarTotalCount}}</view> <view class="Ques_Num" v-if="TypeObj">{{TypeObj.grammarFinishCount}}/{{TypeObj.grammarTotalCount}}</view>
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/word2.png" alt="" /> <img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/word2.png" alt="" />
</view> </view>
<view class="Ques_Circle"> <view class="Ques_Circle" @click="goExam(3)">
<view class="Ques_Top">听力</view> <view class="Ques_Top">听力</view>
<view class="Ques_Num" v-if="TypeObj">{{TypeObj.listeningFinishCount}}/{{TypeObj.listeningTotalCount}}</view> <view class="Ques_Num" v-if="TypeObj">{{TypeObj.listeningFinishCount}}/{{TypeObj.listeningTotalCount}}</view>
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/word3.png" alt="" /> <img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/word3.png" alt="" />
...@@ -369,6 +369,8 @@ ...@@ -369,6 +369,8 @@
}, },
async onLoad(options) { async onLoad(options) {
await this.getLevels(); await this.getLevels();
},
async onShow(){
let UserInfo = uni.getStorageSync('userInfo'); let UserInfo = uni.getStorageSync('userInfo');
this.TypeMsg.StudentId = UserInfo.AccountId; this.TypeMsg.StudentId = UserInfo.AccountId;
await this.getLevelTotal(); await this.getLevelTotal();
......
...@@ -9,17 +9,18 @@ ...@@ -9,17 +9,18 @@
</template> </template>
</van-nav-bar> </van-nav-bar>
<view class="exam-con"> <view class="exam-con">
<!-- 单词 --> <!-- 单词 语法-->
<word :paperData="dataList" v-if="Type==1" :Count="Count" @getAfter="getAfter()" /> <word :paperData="dataList" v-if="Type==1||Type==2" :Count="Count" @getAfter="getAfter()" />
<!-- 听力 -->
<listen :paperData="dataList" v-if="Type==3" :Count="Count" @getAfter="getAfter()" />
<!-- 阅读理解 --> <!-- 阅读理解 -->
<readingCompre :paperData="dataList" v-if="Type==4" :Count="Count" @getAfter="getAfter()" /> <readingCompre :paperData="dataList" v-if="Type==4" :Count="Count" @getAfter="getAfter()" />
</view> </view>
<van-toast id="van-toast" />
</view> </view>
</template> </template>
<script> <script>
import { import {
ref, ref,
reactive, reactive,
toRefs, toRefs,
...@@ -28,20 +29,27 @@ import { ...@@ -28,20 +29,27 @@ import {
watch, watch,
computed, computed,
onMounted, onMounted,
} from "vue"; } from "vue";
import { GetQuestionReading } from "../../api/exam"; import {
import { changeNumToHan } from "../../utils/index"; submitPaper,
import { submitPaper,GetQuestionWords } from "../../api/exam"; GetQuestionWords,
GetQuestionGrammar,
import readingCompre from "../../components/question/readingCompre"; GetQuestionListening,
import word from "../../components/question/word.vue"; GetQuestionReading,
export default { } from "../../api/exam";
import readingCompre from "../../components/question/readingCompre";
import word from "../../components/question/word.vue";
import listen from "../../components/question/listen.vue";
export default {
components: { components: {
word, word,
listen,
readingCompre readingCompre
}, },
setup(props, context) { setup(props, context) {
let { refs } = getCurrentInstance(); let {
refs
} = getCurrentInstance();
console.log(refs); console.log(refs);
let data = reactive({ let data = reactive({
statusBarHeight: 0, statusBarHeight: 0,
...@@ -49,19 +57,18 @@ export default { ...@@ -49,19 +57,18 @@ export default {
changeIndex: 0, //大题序号 changeIndex: 0, //大题序号
isOperate: true, //考试状态 判断是考试还是查看答案 isOperate: true, //考试状态 判断是考试还是查看答案
isAutoTime: false, isAutoTime: false,
examMsg:{ examMsg: {
PageIndex: 1, PageIndex: 1,
PageSize:20, PageSize: 20,
BankType: 1, BankType: 1,
StartId:0 StartId: 0
}, },
Count:0, //题目总数 Count: 0, //题目总数
Type: 1, //1单词 2语法 3听力 4阅读 Type: 1, //1单词 2语法 3听力 4阅读
}); });
let methods = { let methods = {
changeNumToHan,
//返回 //返回
goBack(){ goBack() {
uni.navigateBack(); uni.navigateBack();
}, },
jumpPage() { jumpPage() {
...@@ -69,45 +76,59 @@ export default { ...@@ -69,45 +76,59 @@ export default {
url: "/pages/exam/examPaper", url: "/pages/exam/examPaper",
}); });
}, },
GetWords(){ //单词
let res = GetQuestionWords(data.examMsg).then(res=>{ GetWords() {
if (res) { let res = GetQuestionWords(data.examMsg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.dataList = res.Data.PageData; this.dataList = res.Data.PageData;
this.Count = res.Data.Count; this.Count = res.Data.Count;
} }
});
},
//语法
getGrammar() {
let res = GetQuestionGrammar(data.examMsg).then(res => {
if (res.Code == 1) {
this.dataList = res.Data.PageData;
this.Count = res.Data.Count;
} }
}); });
}, },
GetMyQuestionReading() { //听力
let res = GetQuestionReading(data.examMsg).then(res=>{ getListen() {
if (res) { let res = GetQuestionListening(data.examMsg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
console.log(res,'数据');
this.dataList = res.Data.PageData; this.dataList = res.Data.PageData;
this.Count = res.Data.Count; this.Count = res.Data.Count;
} }
});
},
//阅读
GetMyQuestionReading() {
let res = GetQuestionReading(data.examMsg).then(res => {
if (res.Code == 1) {
console.log(res, '数据');
this.dataList = res.Data.PageData;
this.Count = res.Data.Count;
} }
}); });
}, },
//往后追加题 //往后追加题
getAfter(){ getAfter() {
data.examMsg.PageIndex++; data.examMsg.PageIndex++;
if(data.Type==1){ if (data.Type == 1) {
this.GetWords(); this.GetWords();
} }
if(data.Type==4){ if (data.Type == 2) {
this.getGrammar();
}
if (data.Type == 3){
this.getListen();
}
if (data.Type == 4) {
this.GetMyQuestionReading(); this.GetMyQuestionReading();
} }
}, },
//获取答案改变后的数据
getAnswerChange(val, index) {
// data.peaperDetail.Paper.GroupList[index] = val;
},
//交卷
async savePaper() {
},
}; };
onMounted(() => { onMounted(() => {
data.statusBarHeight = uni.getSystemInfoSync().statusBarHeight; data.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
...@@ -118,35 +139,43 @@ export default { ...@@ -118,35 +139,43 @@ export default {
}; };
}, },
async onLoad(options) { async onLoad(options) {
console.log(options,'options'); console.log(options, 'options');
if(options&&options.Type){ if (options && options.Type) {
this.Type = options.Type; this.Type = options.Type;
} }
if(options&&options.BankType){ if (options && options.BankType) {
this.examMsg.BankType = options.BankType; this.examMsg.BankType = options.BankType;
} }
if(options&&options.StartId){ if (options && options.StartId) {
this.examMsg.StartId = options.StartId; this.examMsg.StartId = options.StartId;
} }
//获取单词 //获取单词
if(this.Type==1){ if (this.Type == 1) {
this.GetWords(); this.GetWords();
} }
if(this.Type==4){ //获取语法
if (this.Type == 2) {
this.getGrammar();
}
//获取听力
if (this.Type == 3) {
this.getListen();
}
if (this.Type == 4) {
this.GetMyQuestionReading(); this.GetMyQuestionReading();
} }
}, },
}; };
</script> </script>
<style scoped> <style scoped>
.exam-con { .exam-con {
box-sizing: border-box; box-sizing: border-box;
} }
.answerSheet { .answerSheet {
font-size: 40rpx; font-size: 40rpx;
margin-left: 30rpx; margin-left: 30rpx;
color: #000; color: #000;
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment