提交 74d520c4 authored 作者: lihuihui's avatar lihuihui

错题添加答题卡,能力自测页面拆分,答题页面样式更改

上级 f04204de
......@@ -45,7 +45,8 @@ if ($GLOBAL.isDev === 'development') {
followRedirects: true,
logLevel: 'info',
headers: {
'Referer': $GLOBAL.webConf.url
'Referer': $GLOBAL.webConf.url,
'Connection': 'keep-alive'
},
pathRewrite: {
'^/api': '/'
......
......@@ -18,6 +18,13 @@ export function getMyQuestionDetail(data) {
return httpRequest.get('/zy/v2/examination/question/detail', data)
}
/**
* 获取我的所有试题
*/
export function getAllQuestion(data) {
return httpRequest.get('/zy/v2/examination/my-question-all', data)
}
/* 删除试题 */
export function deleteQuestion(data) {
return httpRequest.post('/zy/v2/examination/delete-my-question', data, {
......@@ -32,6 +39,13 @@ export function collectQuestion(data) {
})
}
/* 缓存试题 */
export function cacheQuestion(data) {
return httpRequest.post('/zy/v2/examination/cache-question', data, {
headers: { 'Content-Type': 'multipart/form-data' }
})
}
/* 意见反馈 */
export function submitFeedback(data) {
return httpRequest.post('/zy/v2/feedback/commit', data, {
......
src/assets/images/radio2.png

692 Bytes | W: | H:

src/assets/images/radio2.png

708 Bytes | W: | H:

src/assets/images/radio2.png
src/assets/images/radio2.png
src/assets/images/radio2.png
src/assets/images/radio2.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -479,7 +479,7 @@ export default {
padding-bottom: env(safe-area-inset-bottom);
.btn{width:3rem;
height:.7rem;
background:rgba(43,124,233,1);
background:#C62245;
border-radius:.12rem;
color: #fff;
font-size: .3rem;
......
......@@ -77,7 +77,7 @@
<div class="btn-box">
<div class="padd" v-if="!topicCard.isShow">
<!-- {{ swiper.slides[swiper.activeIndex].attributes['data-dId'].nodeValue }} -->
<div :class="collect.currentPages ? 'icon1 active' : 'icon1'" @click="collectQuestion()"></div>
<div v-if="nextBtnShow" :class="collect.currentPages ? 'icon1 active' : 'icon1'" @click="collectQuestion()"></div>
<div class="analysis" @click="analyShow" v-if="$route.query.id == undefined && ($route.query.course_id || $route.query.tag_id)">查看解析</div>
<div class="btn left" @click="switchQuestions('left')" v-show="currentNum !== 1">上一题</div>
<div class="btn right" @click="switchQuestions('right')" v-show="nextBtnShow">下一题</div>
......@@ -93,7 +93,7 @@
<div class="btn-box" v-if="questionCount != 1">
<div class="padd" v-if="!topicCard.isShow">
<!-- {{ swiper.slides[swiper.activeIndex].attributes['data-dId'].nodeValue }} -->
<div :class="collect.currentPages ? 'icon1 active' : 'icon1'" @click="collectQuestion()"></div>
<div v-if="nextBtnShow" :class="collect.currentPages ? 'icon1 active' : 'icon1'" @click="collectQuestion()"></div>
<div class="analysis" @click="analyShow" v-if="$route.query.id == undefined && ($route.query.course_id || $route.query.tag_id)">查看解析</div>
<div class="btn left" @click="switchQuestions('left')" v-show="currentNum !== 1">上一题</div>
<div class="btn right" @click="switchQuestions('right')" v-show="nextBtnShow">下一题</div>
......@@ -678,6 +678,9 @@ export default {
})
},
setCurrentCollect() {
if (!this.nextBtnShow) {
return false
}
const itemDid = this.swiper.slides[this.swiper.activeIndex].attributes['data-dId'].nodeValue
const itemCid = this.swiper.slides[this.swiper.activeIndex].attributes['data-cId'].nodeValue
this.questionsData.questions.find(item => {
......@@ -791,7 +794,7 @@ export default {
padding: .1rem .2rem;
font-size: .2rem;
color: #fff;
background: #67A8FF;
background: #F47885;
border-radius: .25rem;
margin-left: .2rem;
}
......@@ -855,8 +858,8 @@ export default {
word-wrap:break-word;
}
.active{
color: #fff;
background:#67A8FF;
color: #5F95DE;
background:#DDF1FF;
}
.active2{
color: #fff;
......@@ -935,7 +938,7 @@ export default {
.btn{
width:1.97rem;
height:.7rem;
background:rgba(43,124,233,1);
background:#C62245;
border-radius:.12rem;
text-align: center;
line-height: .7rem;
......@@ -987,7 +990,7 @@ export default {
.btn{
width:2.6rem;
height:.7rem;
background:rgba(43,124,233,1);
background:#C62245;
border-radius:.12rem;
text-align: center;
line-height: .7rem;
......@@ -1039,7 +1042,7 @@ export default {
margin: .4rem auto 0 auto;
width:5.5rem;
height:.7rem;
background:rgba(255,103,103,1);
background:#C62245;
border-radius:.12rem;
text-align: center;
line-height: .7rem;
......
<template>
<div>
<div class="tab1">
<!-- <div class="title">能力自测 测试说明</div> -->
<img src="../../assets/images/tab1bg.png" alt="">
<p class="ti">自测考试时间20分钟</p>
<p class="tx">考试题目共33题,分四部分</p>
<p class="tx">单选题共15题</p>
<p class="tx">多选题共10题</p>
<p class="tx">判断题共5题</p>
<p class="tx">案例题共1题</p>
<p class="ti2">了解自己知识掌握情况</p>
<p class="ti2">成绩报告准确分析定位</p>
<div class="comp">
<div class="btn" @click="abilityExam">开始测试</div>
</div>
</div>
<div class="exam_submit" v-if="isExamPop">
<div class="pop">
<div class="tit">能力自测</div>
<div class="txt">您上次未做完试题</div>
<div class="btn_box">
<div class="btn" @click="goAbilityExam(1)">重新答题</div>
<div class="btn btn2" @click="goAbilityExam(0)">继续答题</div>
</div>
</div>
</div>
<div class="exam_submit" v-if="isExamPopTo">
<div class="pop">
<div class="tit">能力自测</div>
<div class="txt">考试还未结束确定退出考试?</div>
<div class="btn_box">
<div class="btn" @click="isExamPopTo = false">退出考试</div>
<div class="btn btn2" @click="goAbilityExam(0)">继续考试</div>
</div>
</div>
</div>
</div>
</template>
<script>
import * as api from '@/api/courseExam.js'
export default {
data() {
return {
isExamPop: false,
isExamPopTo: false
}
},
mounted() {
if (window.localStorage.isExamEnd === 'true' || window.localStorage.isExamEnd === true) {
this.init()
}
},
methods: {
async abilityExam() {
const isLogin = await this.$store.dispatch('checkLogin')
if (!isLogin) {
this.goAbilityExam(1)
return false
}
const param = {
type: 1
}
api.getExamStatus(param).then(res => {
if (parseInt(res.status) === 0 || parseInt(res.status) === 3) {
this.isExamPop = true
} else {
this.goAbilityExam(1)
}
})
},
goAbilityExam(n) {
window.localStorage.isExamEnd = true
window.localStorage.examTab = 0
this.$router.push({
path: '/exam/answer',
query: {
type: 1,
is_create: n,
papersUrl: 'zy/v2/examination/examination-papers'
}
})
},
async init() {
const param = {
type: 1
}
const isLogin = await this.$store.dispatch('checkLogin')
if (isLogin) {
api.getExamStatus(param).then(res => {
if (parseInt(res.status) === 0 || parseInt(res.status) === 3) {
this.isExamPopTo = true
}
})
}
}
}
}
</script>
<style lang="scss" scoped>
.tab1{
// padding-top: .2rem;
padding: .8rem .4rem 1rem .4rem;
.txt{
font-size: .26rem;
color: #222;
line-height: .26ren;
}
.comp{
position: fixed;
bottom: .15rem;
left: 50%;
-webkit-transform: translateX(-50%);
padding-bottom: env(safe-area-inset-bottom);
}
.btn{
width:6.7rem;
height:.7rem;
background:#C62245;
border-radius:.12rem;
text-align: center;
line-height: .7rem;
color: #fff;
font-size: .3rem;
}
.title{
font-size:.4rem;
font-weight:bold;
color:rgba(255,103,103,1);
line-height: 100%;
padding-top: .2rem;
text-align: center;
}
img{
width: 5.01rem;
height: 3.98rem;
display: block;
margin: 0.2rem auto 0 auto;
}
p{
line-height: 100%;
font-size: .26rem;
color: #222;
text-align: center;
}
.tx{
margin-top: .2rem;
}
.ti{
font-size: .3rem;
margin: .4rem 0 .2rem 0;
font-weight: bold;
}
.ti2{
font-size: .3rem;
font-weight: bold;
margin-top: .4rem;
}
}
.exam_submit{
position: fixed;
top: 0;
left: 0;
z-index: 999999;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.6);
.pop{
width: 5.9rem;
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%,-50%);
background:rgba(255,255,255,1);
border-radius:.12rem;
padding: 0.4rem 0;
.tit{
font-weight:bold;
color:rgba(34,34,34,1);
font-size:.3rem;
text-align: center;
line-height: 100%;
}
.txt{
color:rgba(34,34,34,1);
font-size:.3rem;
text-align: center;
line-height: 100%;
margin-top: .8rem;
}
.btn_box{
padding:0 0.2rem;
display: flex;
margin-top: .8rem;
.btn{
width:2.6rem;
height:.7rem;
background:#C62245;
border-radius:.12rem;
text-align: center;
line-height: .7rem;
color: #fff;
font-size: .3rem;
}
.btn2{
margin-left: auto;
}
}
}
}
</style>
......@@ -14,7 +14,7 @@
</ul>
</div>
<div class="tab-con" id="bottom-view">
<div v-show="tabNav.navIndex == 0" class="tab1">
<!-- <div v-show="tabNav.navIndex == 0" class="tab1">
<div class="title">能力自测 测试说明</div>
<img src="../../assets/images/tab1bg.png" alt="">
<p class="ti">自测考试时间20分钟</p>
......@@ -28,8 +28,8 @@
<div class="comp">
<div class="btn" @click="abilityExam">开始测试</div>
</div>
</div>
<div v-show="tabNav.navIndex == 1" class="tab2">
</div> -->
<div v-show="tabNav.navIndex == 0" class="tab2">
<ul class="ul">
<template v-for="(item, index) in CourseChapter">
<li @click="listFold(item)" :key="index">
......@@ -64,7 +64,7 @@
</template>
</ul>
</div>
<div v-show="tabNav.navIndex == 2" class="tab3">
<div v-show="tabNav.navIndex == 1" class="tab3">
<ul>
<template v-for="(item, index) in courseList">
<li :key="index" @click="courseNodeDetail(item.course_id)">
......@@ -113,7 +113,7 @@ export default {
isExamPop: false,
isExamPopTo: false,
tabNav: {
navText: ['能力自测', '随堂小测', '知识点小测'],
navText: ['随堂小测', '知识点小测'],
navIndex: 0
},
CourseChapter: [],
......@@ -139,15 +139,15 @@ export default {
}
},
mounted() {
if (window.localStorage.examTab === '1' || window.localStorage.examTab === 1) {
this.getCourseChapterList()
this.tabNav.navIndex = 1
} else {
if (window.localStorage.isExamEnd === 'true' || window.localStorage.isExamEnd === true) {
this.init()
}
this.tabNav.navIndex = 0
}
this.getCourseChapterList()
// if (window.localStorage.examTab === '1' || window.localStorage.examTab === 1) {
// this.tabNav.navIndex = 1
// } else {
// // if (window.localStorage.isExamEnd === 'true' || window.localStorage.isExamEnd === true) {
// // this.init()
// // }
// // this.tabNav.navIndex = 0
// }
// this.getCourseChapterList()
this.scrollDom()
},
......@@ -285,7 +285,7 @@ export default {
},
async tab(e) {
const isLogin = await this.$store.dispatch('checkLogin')
if (e === 1 || e === 2) {
if (e === 0 || e === 1) {
if (!isLogin) {
if (this.isWeapp) {
// 小程序
......@@ -304,7 +304,7 @@ export default {
forbidClick: true,
duration: 1000
})
if (e === 1) {
if (e === 0) {
window.localStorage.examTab = e
this.getCourseChapterList()
} else {
......@@ -353,6 +353,8 @@ export default {
line-height: 1.1rem;
font-size: .3rem;
color:#999999;
flex: 1;
text-align: center;
}
li.active{
color: #222;
......
......@@ -222,7 +222,7 @@ export default {
.btn{
width: 1.76rem;
height: .8rem;
border: 0.01rem solid #3a7be6;
border: 0.01rem solid #F47885;
display: flex;
justify-content: center;
border-radius: .1rem;
......@@ -241,7 +241,7 @@ export default {
}
}
.btn.active{
background:#3a7be6;
background:#F47885;
.txt{
color: #fff;
}
......@@ -263,7 +263,7 @@ export default {
.b{
width:6.7rem;
height:.7rem;
background:#FF6767;
background:#C62245;
border-radius:.12rem;
margin: .15rem auto;
text-align: center;
......
<template>
<div class="card_box">
<div class="head" id="top-view2">
<i class="el-icon-arrow-left"></i>
</div>
<div id="bottom-view2">
<div class="card_con">
<div class="flag">
<ul>
<li>
<div class="circle active1"></div>
<div class="txt">已答</div>
</li>
<li style="width:.5rem">
</li>
<li>
<div class="circle active3"></div>
<div class="txt">未答</div>
</li>
</ul>
</div>
<div class="question">
<div class="tips">按答题时间排序,最新错题在前面</div>
<ul>
<template v-for="(item, index) in dataList">
<li @click="goQuestionDetail(item.question_id)" :class="item.answer.length ? 'active1' : 'active3'" :key="index">
<div class="circle">{{ index + 1 }}</div>
<div class="txt">{{ questionType[item.question_type] }}</div>
</li>
</template>
</ul>
</div>
</div>
</div>
<div class="clear-btn">
<div class="btn" @click="clearQuestion">清空记录,重新答题</div>
</div>
</div>
</template>
<script>
import { Toast } from 'vant'
import * as api from '@/api/my.js'
export default {
components: {
[Toast.name]: Toast
},
mounted() {
this.initData()
},
data() {
return {
questionType: {
1: '单选题',
2: '多选题',
5: '案例题',
6: '判断题'
},
dataList: []
}
},
methods: {
clearQuestion() {
const param = {
type: this.$route.query.type,
question_type: this.$route.query.questionType,
clear: 1
}
api.cacheQuestion(param).then(res => {
Toast('清空成功')
this.initData()
})
},
goQuestionDetail(id) {
const index = this.dataList.findIndex(item => { return item.question_id === id })
window.localStorage.myQuestionDetileId = id
this.$router.push({
name: 'questionsDetails',
query: {
type: this.$route.query.type,
questionType: this.$route.query.questionType,
page: parseInt(index / 30) + 1
}
})
},
initData() {
api.getAllQuestion({ type: this.$route.query.type, question_type: this.$route.query.questionType }).then(res => {
this.dataList = res
})
// $.ajax({
// url: 'https://zy-teaching2.ezijing.com/v2/examination/my-question-all?type=1',
// type: 'GET',
// data: {},
// xhrFields: { withCredentials: true },
// success: function (data) {
// // for(let i = 0; i< data.length; ++i) {console.log(data[i]);}
// }
// })
}
}
}
</script>
<style lang="scss" scoped>
.card_box{
width: 100%;
height: 100%;
background: #fff;
.card_con{
padding: 0 .4rem;
overflow-y: scroll;
.flag{
border-bottom: 0.01rem solid #EEEEEE;
ul{
list-style: none;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
li{
margin: 0 .4rem 0.1rem .4rem;
text-align: center;
.circle{
width: .6rem;
height: .6rem;
border-radius: 50%;
font-size: .26rem;
text-align: center;
line-height: .6rem;
color: #fff;
}
.active1{
background: #67C23A;
}
.active2{
background:rgba(255,128,0,1);
}
.active3{
background:rgba(204,204,204,1);
}
.txt{
color: #222222;
font-size: .26rem;
margin-top: 0.1rem;
}
}
}
}
.question{
.tips{
margin-top: .4rem;
font-size: .26rem;
color:rgba(51,51,51,1);
}
.title{
font-size: .3rem;
color: #333333;
margin-top: .1rem;
margin-bottom: .4rem;
}
ul{
list-style: none;
margin-top: .5rem;
padding: 0 0.6rem;
border-bottom: 0.01rem solid #EEEEEE;
display: flex;
flex-wrap: wrap;
li{
position: relative;
width: .6rem;
height: .6rem;
text-align: center;
margin-right: .6rem;
margin-bottom: .4rem;
padding-bottom: .38rem;
.circle{
width: .6rem;
height: .6rem;
border-radius: 50%;
font-size: .26rem;
line-height: .6rem;
color: #fff;
}
.txt{
position: absolute;
bottom: 0;
left: 50%;
-webkit-transform: translateX(-50%);
font-size: .2rem;
color: #333;
margin-top: .1rem;
line-height: 100%;
white-space:nowrap
}
}
:nth-child(5n+5){
margin: 0;
}
.active1{
.circle{
background: #67C23A;
}
}
.active2{
.circle{
background:rgba(255,128,0,1);
}
}
.active3{
.circle{
background:rgba(204,204,204,1);
}
}
}
}
}
}
.head{
color: #222;
display: flex;
padding: .4rem 0;
align-items: center;
i{
font-size: .35rem;
margin-left: .28rem;
}
.title{
margin-left: .03rem;
font-size: .3rem;
}
}
#bottom-view2{
overflow: scroll;
}
.card_box{
padding-bottom: .9rem;
}
.clear-btn{
position: fixed;
bottom: 0;
left: 0;
width:100%;
height:1rem;
background:rgba(255,255,255,1);
box-shadow:0rem 0rem .06rem 0rem rgba(0,0,0,0.05);
.btn{
width:6.7rem;
height:.7rem;
background:rgba(198,34,69,1);
border-radius:.12rem;
font-size:.3rem;
text-align: center;
line-height: .7rem;
color: #fff;
margin: .15rem auto;
}
}
</style>
......@@ -122,10 +122,10 @@ export default {
const pageCount = (index / 50).toString()
let num = 1
pageCount.indexOf('.') === -1 ? num = pageCount : num = parseInt(pageCount) + 1
window.localStorage.myQuestionDetileId = id
this.$router.push({
path: '/my/questionsDetails',
query: {
id: id,
page: parseInt(num) === 0 ? 1 : num,
type: 2
}
......@@ -158,12 +158,6 @@ export default {
this.initData()
}
},
// scrollDom() {
// const topViewH = document.getElementById('top-view').offsetHeight
// const clientHeight = document.documentElement.clientHeight
// const bottomView = document.getElementById('bottom-view')
// bottomView.style.height = (clientHeight - topViewH) + 'px'
// },
del(ids) {
const idGroup = Array.isArray(ids) ? ids : [ids]
const param = {
......
......@@ -135,12 +135,13 @@ export default {
const pageCount = (index / 50).toString()
let num = 1
pageCount.indexOf('.') === -1 ? num = pageCount : num = parseInt(pageCount) + 1
window.localStorage.myQuestionDetileId = id
this.$router.push({
path: '/my/questionsDetails',
query: {
id: id,
page: parseInt(num) === 0 ? 1 : num,
type: this.activeClass === '0' ? 1 : 3
type: this.activeClass === '0' ? 1 : 3,
questionType: this.screen.screenVal
}
})
},
......@@ -251,8 +252,8 @@ export default {
0: 0,
1: 1,
2: 2,
3: 5,
4: 6
3: 6,
4: 5
}
this.params = {
type: this.activeClass === '0' ? 1 : 3,
......@@ -260,6 +261,7 @@ export default {
page: 1,
page_size: 50
}
this.screen.screenVal = n[index]
this.screen.checkedText = value
this.clear()
this.screen.isShow = false
......@@ -312,7 +314,7 @@ export default {
.w-btn{
width:3rem;
height:.7rem;
background:rgba(43,124,233,1);
background:#C62245;
border-radius:.12rem;
font-size:.3rem;
text-align: center;
......@@ -323,7 +325,7 @@ export default {
.z-btn{
width:2.1rem;
height:.7rem;
background:rgba(43,124,233,1);
background:#C62245;
border-radius:.12rem;
font-size: .3rem;
text-align: center;
......
......@@ -3,6 +3,12 @@ export default [
/* 测试页面 */
{ path: '/test', name: 'test', component: () => import('../pages/test.vue') },
/* 课程检测 */
{
path: '/exam/abilityAnswer',
name: 'abilityAnswer',
component: () => import('../pages/courseExam/abilityAnswer.vue')
},
/* 能力自测首页 */
{
path: '/exam/index',
name: 'examIndex',
......@@ -124,6 +130,13 @@ export default [
component: () => import('../pages/my/questionsDetails.vue'),
meta: { requiredLogin: true }
},
// 我的-试题详情-答题卡
{
path: '/my/answerCard',
name: 'answerCard',
component: () => import('../pages/my/answerCard.vue'),
meta: { requiredLogin: true }
},
// 我的-收藏试题
{
path: '/my/collectQuestions',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论