Commit 61126524 authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/xiangwei/educationstu into master

# Conflicts:
#	src/pages/word/test.vue
parents 8b0a53f0 6c4dc420
<template>
<view class="wordTest">
<button class="">
交卷
</button>
<swiper class="swiper" @change="changeSwiper" :current="curTest">
<swiper-item v-for="(item,index) in reviewGroupList" :key="index" class="swiper-item">
<Choice v-if="item.QuestionTypeId==1" :item="item" @next="next($event,item)"></Choice>
<FillIn v-if="item.QuestionTypeId==3" :item="item" @next="next($event,item)"></FillIn>
</swiper-item>
<swiper-item v-for="(item,index) in prepGroupList" :key="index" class="swiper-item">
<Choice v-if="item.QuestionTypeId==1" :item="item" @next="next($event,item)"></Choice>
<FillIn v-if="item.QuestionTypeId==3" :item="item" @next="next($event,item)"></FillIn>
</swiper-item>
<swiper-item></swiper-item>
</swiper>
</view>
<view class="wordTest">
<button class="" @click="submitWordsTest">
交卷
</button>
<swiper class="swiper" @change="changeSwiper" :current="curTest">
<swiper-item
v-for="(item, index) in reviewGroupList"
:key="index"
class="swiper-item"
>
<Choice
v-if="item.QuestionTypeId == 1"
:item="item"
@next="next($event, item)"
></Choice>
<FillIn
v-if="item.QuestionTypeId == 3"
:item="item"
@next="next($event, item)"
></FillIn>
</swiper-item>
<swiper-item
v-for="(item, index) in prepGroupList"
:key="index"
class="swiper-item"
>
<Choice
v-if="item.QuestionTypeId == 1"
:item="item"
@next="next($event, item)"
></Choice>
<FillIn
v-if="item.QuestionTypeId == 3"
:item="item"
@next="next($event, item)"
></FillIn>
</swiper-item>
<swiper-item></swiper-item>
</swiper>
</view>
</template>
<script>
import {
ref,
reactive,
toRefs,
getCurrentInstance,
onMounted,
} from "vue";
import Choice from '../../components/word/choiceQuestion.vue'
import FillIn from '../../components/word/fillInTheBlanks.vue'
export default {
components: {
Choice,
FillIn
},
setup(props) {
let {
proxy
} = getCurrentInstance();
let data = reactive({
msg: {
CourseId: 0,
ChapterId: 0,
NextChapterId: 0
},
curTest:0,
reviewGroupList: [],
prepGroupList: [],
})
let methods = {
getList() {
proxy.$request('/AppletWords/CreateCourseExam', data.msg).then(res => {
data.reviewGroupList=res.Data.reviewGroupList
data.prepGroupList=res.Data.prepGroupList
})
},
changeSwiper(val){
data.curTest=val.detail.current
},
next(val,item){
if(val){
item.IsTrue=val
}
data.curTest+=1
}
}
onMounted(() => {
})
let that = methods;
return {
...toRefs(data),
...methods,
};
},
onLoad(options) {
uni.setNavigationBarTitle({
title: '单词测试'
});
const userInfo = uni.getStorageSync('userinfo');
this.msg.CourseId=options.CourseId
this.msg.ChapterId=options.ChapterId
this.msg.NextChapterId=options.NextChapterId
this.getList()
},
}
import { ref, reactive, toRefs, getCurrentInstance, onMounted } from "vue";
import Choice from "../../components/word/choiceQuestion.vue";
import FillIn from "../../components/word/fillInTheBlanks.vue";
export default {
components: {
Choice,
FillIn,
},
setup(props) {
let { proxy } = getCurrentInstance();
let data = reactive({
msg: {
CourseId: 0,
ChapterId: 0,
NextChapterId: 0,
},
curTest: 0,
reviewGroupList: [],
prepGroupList: [],
});
let methods = {
getList() {
proxy
.$request("/AppletWords/CreateCourseExam", data.msg)
.then((res) => {
data.reviewGroupList = res.Data.reviewGroupList;
data.prepGroupList = res.Data.prepGroupList;
});
},
changeSwiper(val) {
data.curTest = val.detail.current;
},
next(val, item) {
if (val) {
item.IsTrue = val;
}
data.curTest += 1;
},
//提交单词测试
submitWordsTest() {
var postMsg = {
ClassId: 1,
CourseId: 1,
ChapterId: 1,
ExamStartTime: "2021-01-12 10:00:00",
Details: data.reviewGroupList,
};
proxy.$request("/AppletWords/SubmitWordsExam", postMsg).then((res) => {
console.log("SubmitWordsExam", res);
});
},
};
onMounted(() => {});
let that = methods;
return {
...toRefs(data),
...methods,
};
},
onLoad(options) {
uni.setNavigationBarTitle({
title: "单词测试",
});
const userInfo = uni.getStorageSync("userinfo");
this.msg.CourseId = options.CourseId;
this.msg.ChapterId = options.ChapterId;
this.msg.NextChapterId = options.NextChapterId;
this.getList();
},
};
</script>
<style scoped>
.wordTest {
min-height: 100vh;
background-color: #F5F5F5;
}
.wordTest {
min-height: 100vh;
background-color: #f5f5f5;
}
.wordTest .swiper {
min-height: 100vh;
background-color: #F5F5F5;
}
.wordTest .swiper {
min-height: 100vh;
background-color: #f5f5f5;
}
</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