Commit cc63fa89 authored by zhengke's avatar zhengke

修改

parent a401df8e
......@@ -203,4 +203,40 @@ export function GetAppBankStatic(data) {
method: 'post',
data
})
}
/**
* 获取错题数据
* @param {JSON参数} data
*/
export function GetPracticeWrongStatic(data) {
return request({
url: '/Exam/GetPracticeWrongStatic',
method: 'post',
data
})
}
/**
* 获取单词错题
* @param {JSON参数} data
*/
export function GetPracticeWrongPage(data) {
return request({
url: '/Exam/GetPracticeWrongPage',
method: 'post',
data
})
}
/**
* 设置错题已复习
* @param {JSON参数} data
*/
export function SetPracticeReview(data) {
return request({
url: '/Exam/SetPracticeReview',
method: 'post',
data
})
}
\ No newline at end of file
......@@ -2,13 +2,17 @@
<!-- 听力题 -->
<view class="listen">
<view class="item">
<audio style="text-align: left" poster="http://pic.pimg.tw/pam86591/1408719752-3322564110_n.jpg"
:src="dataObj.Src" name="日语听力" :action="audioAction" controls></audio>
<view>
<view class="My_listen" @click="play(dataObj.Title)">
<i class="icon_audio_default" v-if="!isPlay"></i>
<i class="icon_audio_playing" v-else></i>
</view>
<!-- <audio style="text-align: left" ref="audio" poster="http://pic.pimg.tw/pam86591/1408719752-3322564110_n.jpg"
:src="getAudioSrc(dataObj.Title)" name="日语听力" :action="audioAction" controls></audio> -->
<view style="float: right;margin:20rpx 0;">
<text class="Exam_Score">{{dataObj.Score}}分)</text>
</view>
<view class="item1" :style="{ height: `calc(100vh - 414rpx)` }">
<view class="questionView">
<view class="questionView" v-if="!isShowJx">
<view v-for="(item, index) in dataObj.QuestionContentObj" :key="index" class="item2">
<view class="flex questionTitle">
<view>{{ index + 1 }}、({{item.QuestionName.slice(0, 2)}})</view>
......@@ -40,11 +44,11 @@
<!-- 单选 、判断-->
<view class="flex flex_start_center item3" v-if="item.QuestionKey === 'single'">
<view class="chooseNum"
:class="{ 'isTrueAnswer': item2.IsAnswer,'isNotAnswer':getErrorAnswer(dataObj,index,item2.Name)}">
:class="{ 'isRightAnswer': item2.Name==dataObj.QuestionAnswerList[index],'isNotRightAnswer':getErrorAnswer(dataObj,index,item2.Name)}">
{{ item2.Name }}
</view>
<view class="chooseName"
:class="{ 'isTrueAnswer': item2.IsAnswer,'isNotAnswer':getErrorAnswer(dataObj,index,item2.Name)}"
:class="{ 'isRightText': item2.Name==dataObj.QuestionAnswerList[index],'isNotAnswer':getErrorAnswer(dataObj,index,item2.Name)}"
v-html="item2.Content"></view>
</view>
</view>
......@@ -93,7 +97,9 @@
computed,
onMounted,
onUnmounted,
} from "vue";
} from "vue";
const innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.autoplay = false;
export default {
props: {
paperData: Object,
......@@ -101,7 +107,8 @@
},
setup(props, context) {
let {
refs
refs,
proxy
} = getCurrentInstance();
let data = reactive({
dataObj: props.paperData,
......@@ -109,8 +116,8 @@
audioAction: {
method: "pause"
},
isPlay:false
});
let methods = {
// 单选
singerChange(item1, index, item3) {
......@@ -126,21 +133,55 @@
},
//获取音频链接
getAudioSrc(Src){
let arr = Src.split(" "); //按空格分段
var MySrc='';
arr.map((e) => {
if (e.indexOf("src") != -1) {
let Before = e.split("url=")[1]
if (Before) {
MySrc = decodeURIComponent(Before.slice(0, -1));
}
}
});
return MySrc
},
onchange(e) {
data.current = e.detail.current;
play(Src) {
let arr = Src.split(" "); //按空格分段
var MySrc='';
arr.map((e) => {
if (e.indexOf("src") != -1) {
let Before = e.split("url=")[1]
if (Before) {
MySrc = decodeURIComponent(Before.slice(0, -1));
}
}
});
if(data.isPlay){
innerAudioContext.pause();
data.isPlay=false;
}else{
innerAudioContext.src = MySrc;
innerAudioContext.play()
data.isPlay = true;
innerAudioContext.onEnded((e)=>{
data.isPlay = false;
})
}
},
//父组件切换调用
clickParent(){
innerAudioContext.stop();
}
};
onMounted(() => {
data.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
data.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
});
let that = methods;
return {
...toRefs(data),
...methods,
};
},
}
};
</script>
<style scoped>
......@@ -184,7 +225,17 @@
align-items: center;
justify-content: space-between;
}
.isRightAnswer{
background-color: green;
color:#fff!important;
}
.isRightText{
color:green!important;
}
.isNotRightAnswer{
background-color: red!important;
color:#fff!important;
}
.isNotAnswer {
color: red !important;
}
......@@ -312,4 +363,58 @@
.isCanNext {
background-color: gray !important;
}
.icon_audio_default {
background: transparent url('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/iconloop.png') no-repeat 0 0;
width: 18px;
height: 25px;
vertical-align: middle;
display: inline-block;
-webkit-background-size: 54px 25px;
background-size: 54px 25px;
background-position: -36px center;
}
.icon_audio_playing {
background: transparent url('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/iconloop.png') no-repeat 0 0;
width: 18px;
height: 25px;
vertical-align: middle;
display: inline-block;
-webkit-background-size: 54px 25px;
background-size: 54px 25px;
-webkit-animation: audio_playing 1s infinite;
background-position: 0px center;
}
@-webkit-keyframes audio_playing {
30% {
background-position: 0px center;
}
31% {
background-position: -18px center;
}
61% {
background-position: -18px center;
}
61.5% {
background-position: -36px center;
}
100% {
background-position: -36px center;
}
}
.My_listen {
width: 170rpx;
height: 170rpx;
background-color: #E4E5FB;
border-radius: 50%;
margin: 0 auto 30rpx;
display: flex;
justify-content: center;
align-items: center;
}
</style>
......@@ -11,7 +11,7 @@
<view style="margin:30rpx;" class="Exam_Score">
本阅读理解共{{dataObj.QuestionContentObj.length}}小题({{dataObj.Score}}分)</text>
</view>
<view class="questionView">
<view class="questionView" v-if="!isShowJx">
<view v-for="(item, index) in dataObj.QuestionContentObj" :key="index"
class="item2">
<view class="flex questionTitle">
......@@ -45,10 +45,10 @@
<!-- 单选-->
<view class="flex item3"
v-if="item2.QuestionKey === 'single' || item2.QuestionKey === 'single-number'">
<view class="chooseNum" :class="{ 'isTrueAnswer': item3.IsAnswer,'isNotAnswer':getErrorAnswer(dataObj,index2,item3.Name)}">
<view class="chooseNum" :class="{ 'isRightAnswer': item3.Name==dataObj.QuestionAnswerList[index2],'isNotRightAnswer':getErrorAnswer(dataObj,index2,item3.Name)}">
{{ item3.Name }}
</view>
<view class="chooseName" :class="{ isTrueAnswer: item3.IsAnswer }"
<view class="chooseName" :class="{ 'isRightText': item3.Name==dataObj.QuestionAnswerList[index2],'isNotAnswer':getErrorAnswer(dataObj,index2,item3.Name) }"
v-html="item3.Content"></view>
</view>
</view>
......@@ -192,11 +192,20 @@
.isTrueAnswer {
color: green !important;
}
.isRightAnswer{
background-color: green;
color:#fff!important;
}
.isRightText{
color:green!important;
}
.isNotRightAnswer{
background-color: red!important;
color:#fff!important;
}
.isNotAnswer {
color: red !important;
}
.ExamIndex_Box {
margin-right: 48rpx;
}
......
......@@ -19,7 +19,7 @@
</view>
<view v-for="(item2, index2) in item1.QuestionContentObj" :key="index2"
class="flex item2 flex_start_center">
<template v-if="item1.StundetAnswer.length==0">
<template v-if="item1.StudentAnswer.length==0">
<view class="chooseNum" @click="change(item1, item2)">{{ item2.ShowName }}
</view>
<view class="chooseName" @click="change(item1, item2)" v-html="item2.Content"></view>
......@@ -35,17 +35,17 @@
</view>
</template>
</view>
<view class="AnswerContent" v-if="item1.StundetAnswer.length>0">
<view class="AnswerContent" v-if="item1.StudentAnswer.length>0">
<view>
<text style="color: #8c8a94">正确答案:</text>
<text class="isTrueAnswer">{{ item1.QuestionAnswerList[0] }}</text>
<text>您的答案是:
<template v-if="item1.StundetAnswer.length>0">
<text v-if="item1.StundetAnswer[0] == item1.QuestionAnswerList[0]"
<template v-if="item1.StudentAnswer.length>0">
<text v-if="item1.StudentAnswer[0] == item1.QuestionAnswerList[0]"
class="isTrueAnswer">
{{ item1.StundetAnswer }},回答正确
{{ item1.StudentAnswer }},回答正确
</text>
<text v-else class="isNotAnswer">{{ item1.StundetAnswer[0] }},回答错误</text>
<text v-else class="isNotAnswer">{{ item1.StudentAnswer[0] }},回答错误</text>
</template>
<template v-else>
<text>未作答</text>
......@@ -113,9 +113,9 @@
},
//点击选择答案
change(item1, item2) {
item1.StundetAnswer[0] = item2.Name;
item1.StudentAnswer[0] = item2.Name;
if (item1.QuestionAnswerList && item1.QuestionAnswerList.length > 0) {
if (item1.StundetAnswer[0] == item1.QuestionAnswerList[0]) {
if (item1.StudentAnswer[0] == item1.QuestionAnswerList[0]) {
data.current += 1;
}
}
......@@ -128,19 +128,19 @@
QuestionContent: item1.QuestionContentObj,
QuestionTypeId: item1.QuestionTypeId,
QuestionTypeKey: item1.QuestionTypeKey,
StudentAnswer: item1.StundetAnswer,
StudentAnswer: item1.StudentAnswer,
Answer: item1.Answer,
AnswerParse: item1.AnswerParse,
LevelType:item1.LevelType,
IsAnswer: 0,
IsWrong: 0
}
if(item1.StundetAnswer.length>0){
if(item1.StudentAnswer.length>0){
msg.IsAnswer=1;
}else{
msg.IsAnswer=0;
}
if(item1.StundetAnswer[0]==item1.QuestionAnswerList[0]){
if(item1.StudentAnswer[0]==item1.QuestionAnswerList[0]){
msg.IsWrong=0;
}else{
msg.IsWrong=1;
......@@ -155,8 +155,8 @@
},
//判断是否为正确答案
getErrorAnswer(item1, Number) {
if (item1.StundetAnswer[0] != item1.QuestionAnswerList[0]) {
if (item1.StundetAnswer[0] == Number) {
if (item1.StudentAnswer[0] != item1.QuestionAnswerList[0]) {
if (item1.StudentAnswer[0] == Number) {
return true
}
}
......
......@@ -106,6 +106,8 @@
"style": {
"navigationStyle": "custom"
}
},{
"path":"wrong"
}]
},
{
......
......@@ -21,7 +21,7 @@
@answerChange="getAnswerChange($event, index)" :paperData="item" :isShowJx="isShowJx" />
<readingCompre v-if="item.QuestionTypeKey=='reading-comprehensio'"
@answerChange="getAnswerChange($event, index)" :paperData="item" :isShowJx="isShowJx" />
<listen v-if="item.QuestionTypeKey=='listening'" @answerChange="getAnswerChange($event, index)"
<listen v-if="item.QuestionTypeKey=='listening'" ref="myRef" @answerChange="getAnswerChange($event, index)"
:paperData="item" :isShowJx="isShowJx" />
</swiper-item>
</swiper>
......@@ -48,7 +48,9 @@
import answer from "../../components/question/subject/answer.vue"; //答题卡
import {
GetAppBankDetails,
GetPracticeWrongPage,
SetStudentStartExam,
SetPracticeReview
} from "../../api/exam";
export default {
components: {
......@@ -60,7 +62,8 @@
props: {},
setup(props, context) {
let {
ctx
ctx,
refs
} = getCurrentInstance();
let data = reactive({
dataList: [],
......@@ -80,9 +83,20 @@
isShowJx: false,
Count: 0,
isShowAnswer: false,
statusBarHeight: 0
statusBarHeight: 0,
wrongMsg:{
pageIndex:1,
pageSize:10000,
StudentId:1,
QCategoryIds:"",
StartId:0
},
setMsg:{
Id:0
}
});
let UserInfo = uni.getStorageSync('userInfo');
let methods = {
goBack() {
uni.navigateBack();
......@@ -90,8 +104,17 @@
onchange(e) {
if(e&&e.detail){
data.current = e.detail.current;
ctx.$refs.myRef[0].clickParent();
this.setPractise();
}
},
//设置已答题
setPractise(){
data.setMsg.Id = data.dataList[data.current-1].Id;
SetPracticeReview(data.setMsg).then(res=>{
})
},
getList() {
if(data.isShowJx){
data.msg.StudentId = UserInfo.AccountId;
......@@ -136,6 +159,15 @@
getAnswerChange(val, index) {
data.dataList[index] = val;
},
//获取单词错题
getWrongWord(){
GetPracticeWrongPage(data.wrongMsg).then(res=>{
if(res.Code==1){
data.dataList = res.Data.PageData;
data.Count = res.Data.Count;
}
})
},
//开始考试调用接口
getStart(){
data.startMsg.StudentId = UserInfo.AccountId;
......@@ -160,18 +192,49 @@
this.msg.BankId = options.BankId;
this.startMsg.BankId = options.BankId;
}
let UserInfo = uni.getStorageSync('userInfo');
if (options && options.Type){
// 1开始考试 2产看解析
if(options.Type==1){
this.getStart();
this.msg.StudentId='';
this.isShowJx=false;
this.getList();
}
if(options.Type==2){
this.isShowJx=true;
this.getList();
}
//3 4 5 6从错题跳过来
if(options.Type==3){
this.wrongMsg.StudentId = UserInfo.AccountId;
this.wrongMsg.QCategoryIds = '3,4,5';
this.wrongMsg.StartId = options.StartId;
this.getWrongWord();
this.isShowJx=true;
}
if(options.Type==4){
this.wrongMsg.StudentId = UserInfo.AccountId;
this.wrongMsg.QCategoryIds = '6';
this.wrongMsg.StartId = options.StartId;
this.getWrongWord();
this.isShowJx=true;
}
if(options.Type==5){
this.wrongMsg.StudentId = UserInfo.AccountId;
this.wrongMsg.QCategoryIds = '8';
this.wrongMsg.StartId = options.StartId;
this.getWrongWord();
this.isShowJx=true;
}
if(options.Type==6){
this.wrongMsg.StudentId = UserInfo.AccountId;
this.wrongMsg.QCategoryIds = '9';
this.wrongMsg.StartId = options.StartId;
this.getWrongWord();
this.isShowJx=true;
}
}
this.getList();
}
};
</script>
......
<style scoped>
.WrongContent {
padding: 40rpx;
background-color: #F5F5F5;
height: 93vh;
}
.Wrong_Top {
display: flex;
margin-bottom:37rpx;
}
.Wrong_Top>view {
flex: 1;
height: 270rpx;
background-color: #fff;
padding: 40rpx 32rpx;
margin-right: 32rpx;
border-radius: 24rpx;
}
.Wr_Name {
color: #111111;
font-size: 28rpx;
margin-bottom: 40rpx;
}
.img_Box img {
width: 87rpx;
height: 87rpx;
}
.Wr_Total {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 40rpx;
}
.Wr_Fuxi {
color: #4C50E7;
font-size: 24rpx;
}
.Wr_Current {
font-size: 40rpx;
color: #FA9717;
}
.Wr_CurTotal {
color: #888888;
font-size: 25rpx;
}
</style>
<template>
<view class="WrongContent">
<view class="Wrong_Top">
<view @click="goWrongTopic(3)">
<view class="Wr_Name">单词</view>
<view class="img_Box">
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/word.png"
alt="" />
</view>
<view class="Wr_Total" v-if="Object.keys(dataObj).length>0">
<view>
<text class="Wr_Current">{{dataObj.wordsWrongFinishCount}}</text><text class="Wr_CurTotal">/{{dataObj.wordsWrongTotalCount}}</text>
</view>
<view class="Wr_Fuxi">
<text v-if="dataObj.wordsWrongFinishCount==0">未复习</text>
<text v-if="dataObj.wordsWrongFinishCount>0&&dataObj.wordsWrongFinishCount<dataObj.wordsWrongTotalCount">复习中</text>
<text v-if="dataObj.wordsWrongFinishCount==dataObj.wordsWrongTotalCount">复习完毕</text>
</view>
</view>
</view>
<view style="margin-right:0;" @click="goWrongTopic(4)">
<view class="Wr_Name">语法</view>
<view class="img_Box">
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/gramer.png"
alt="" />
</view>
<view class="Wr_Total" v-if="Object.keys(dataObj).length>0">
<view>
<text class="Wr_Current">{{dataObj.grammarWrongFinishCount}}</text><text class="Wr_CurTotal">/{{dataObj.grammarWrongTotalCount}}</text>
</view>
<view class="Wr_Fuxi">
<text v-if="dataObj.grammarWrongFinishCount==0">未复习</text>
<text v-if="dataObj.grammarWrongFinishCount>0&&dataObj.grammarWrongFinishCount<dataObj.grammarWrongTotalCount">复习中</text>
<text v-if="dataObj.grammarWrongFinishCount==dataObj.grammarWrongTotalCount">复习完毕</text>
</view>
</view>
</view>
</view>
<view class="Wrong_Top" @click="goWrongTopic(5)">
<view>
<view class="Wr_Name">阅读理解</view>
<view class="img_Box">
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/read.png"
alt="" />
</view>
<view class="Wr_Total" v-if="Object.keys(dataObj).length>0">
<view>
<text class="Wr_Current">{{dataObj.readingWrongFinishCount}}</text><text class="Wr_CurTotal">/{{dataObj.readingWrongTotalCount}}</text>
</view>
<view class="Wr_Fuxi">
<text v-if="dataObj.readingWrongFinishCount==0">未复习</text>
<text v-if="dataObj.readingWrongFinishCount>0&&dataObj.readingWrongFinishCount<dataObj.readingWrongTotalCount">复习中</text>
<text v-if="dataObj.readingWrongFinishCount==dataObj.readingWrongTotalCount">复习完毕</text>
</view>
</view>
</view>
<view style="margin-right:0;" @click="goWrongTopic(6)">
<view class="Wr_Name">听力</view>
<view class="img_Box">
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/listen.png"
alt="" />
</view>
<view class="Wr_Total" v-if="Object.keys(dataObj).length>0">
<view>
<text class="Wr_Current">{{dataObj.listeningWrongFinishCount}}</text><text class="Wr_CurTotal">/{{dataObj.listeningWrongTotalCount}}</text>
</view>
<view class="Wr_Fuxi">
<text v-if="dataObj.listeningWrongFinishCount==0">未复习</text>
<text v-if="dataObj.listeningWrongFinishCount>0&&dataObj.listeningWrongFinishCount<dataObj.listeningWrongTotalCount">复习中</text>
<text v-if="dataObj.listeningWrongFinishCount==dataObj.listeningWrongTotalCount">复习完毕</text>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
} from "vue";
import {GetPracticeWrongStatic} from "../../api/exam";
export default {
components: {
},
setup(props, ctx) {
let data = reactive({
pageState: "more",
msg: {
StudentId:0
},
dataObj: {},
});
let methods = {
getWrongTotal(){
GetPracticeWrongStatic(data.msg).then(res=>{
console.log(res,'数据');
if(res.Code==1){
data.dataObj = res.Data;
}
})
},
//跳转
goWrongTopic(Type){
let StartId=0;
//3单词 4语法 5阅读理解 6听力
if(Type==3){
StartId = data.dataObj.wordsWrongStartId;
}
if(Type==4){
StartId = data.dataObj.grammarWrongStartId;
}
if(Type==5){
StartId = data.dataObj.readingWrongStartId;
}
if(Type==6){
StartId = data.dataObj.listeningWrongStartId;
}
uni.navigateTo({
url: "/pages/exam/examGongu?StartId="+StartId+'&&Type='+Type
});
}
};
let that = methods;
return {
...toRefs(data),
...methods,
};
},
onLoad(options) {
uni.setNavigationBarTitle({
title: "错题库"
});
},
onShow() {
let UserInfo = uni.getStorageSync('userInfo');
this.msg.StudentId = UserInfo.AccountId;
this.getWrongTotal();
}
};
</script>
<style>
</style>
......@@ -46,6 +46,7 @@
单词练习
</view>
<view @click="goWord()">跳转。。。</view>
<view @click="goWord2()">跳转错题</view>
<view class="flex_around_center ">
<view class="wordItem">
......@@ -192,7 +193,12 @@
},
goWord(){
uni.navigateTo({
url: '/pages/exam/MyExam'
url: '/pages/exam/MyExam',
});
},
goWord2(){
uni.navigateTo({
url: '/pages/exam/wrong'
});
},
jumpTimetable() {
......
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