提交 63f7149d authored 作者: zhengyadong's avatar zhengyadong

查看解析

上级 e91dcbbb
......@@ -8,3 +8,11 @@ export function getWeekDetailAPI(params){
params
})
}
// 收藏详情
export function getCollDetailAPI(params){
return request({
url:`${requestPath.resource}/collection/page`,
method:'get',
params
})
}
......@@ -19,6 +19,15 @@ export function getMatchDetailAPI(params){
})
}
// 继续答题
export function getMatchConDetailAPI(params){
return request({
url:`${requestPath.resource}/record/test-paper`,
method:'get',
params
})
}
// // 保存周周练
// export function saveWeekAPI(data){
// return request({
......@@ -47,4 +56,15 @@ export function createRecordAPI(data){
}
// 查看解析
export function getMatchViewAPI(params){
return request({
url:`${requestPath.resource}/record/get/question-statistics`,
method:'get',
params
})
}
<template>
<div class="type-answer">
<div class="right-answer">正确答案:{{answer.replace(',','')}}</div>
<div class="right-answer">
<div class="answer-result false" v-if="showAns&&!ansStatus">
<img src="@/assets/img/practice/false-result.png" alt="">回答错误
</div>
<div class="answer-result right" v-if="showAns&&ansStatus">
<img src="@/assets/img/practice/right-result.png" alt="">回答正确
</div>
正确答案:{{answer.replace(/,/g,'')}}
</div>
<div class="answer-analysis">
<span class="analysis-t">解析:</span>
<span v-html="analysis"></span>
......@@ -20,6 +28,14 @@ export default {
type: String,
default: ""
},
showAns:{
type:Boolean,
default:false
},
ansStatus:{
type:Boolean,
default:false
}
},
data() {
return {};
......@@ -43,9 +59,33 @@ export default {
padding: .15rem .12rem;
border-radius: .02rem;
.right-answer{
display: flex;
color: #333333;
font-weight: Bold;
font-size: .15rem;
.answer-result{
margin-right: .2rem;
font-weight: Bold;
display: flex;
align-items: center;
img{
margin-right: .07rem;
}
}
.right{
color: #24C17D;
img{
height: .13rem;
width: .13rem;
}
}
.false{
color: #FA6E51;
img{
height: .12rem;
width: .12rem;
}
}
}
.answer-analysis{
margin-top: .1rem;
......
......@@ -96,14 +96,17 @@ export default {
choiseSelect(name){
console.log(this.activeName,222);
if(!Array.isArray(this.activeName)) this.activeName =[]
if(!Array.isArray(this.activeName)){
this.activeName = this.activeName.replace(/,/g,'').split('')
}
if(this.showButton !== 'curent') return
if(this.activeName.indexOf(name) != -1){
this.activeName.splice(this.activeName.indexOf(name),1)
}else{
this.activeName.push(name)
}
this.$emit('changeSelect',this.activeName)
let result = this.activeName.join('').replace(/,/g,'')
this.$emit('changeSelect',result)
}
},
}
......
......@@ -102,7 +102,7 @@ let router = new Router({
title: "错题详情",
isLogin: true
},
component: () => import('@/views/wrongBook/detail.vue'),
component: () => import('@/views/moonMatch/viewMatch.vue'),
},
{
path: '/myCollection',
......@@ -114,6 +114,15 @@ let router = new Router({
component: () => import('@/views/collection/index.vue'),
},
{
path: '/myCollectionDetail',
name: 'myCollectionDetail',
meta: {
title: "试题详情",
isLogin: true
},
component: () => import('@/views/moonMatch/viewMatch.vue'),
},
{
path: '/myCourseware',
name: 'myCourseware',
meta: {
......@@ -133,7 +142,6 @@ let router = new Router({
{
path: '/weekPractice',
name: 'weekPractice',
/*meta:'周周练',*/
meta: {
title: "周周练",
isLogin: true
......@@ -143,7 +151,6 @@ let router = new Router({
{
path: '/practice',
name: 'practice',
/*meta:'周周练试卷',*/
meta: {
title: "周周练试卷",
isLogin: true
......@@ -153,7 +160,6 @@ let router = new Router({
{
path: '/viewPracticeReport',
name: 'viewPracticeReport',
/*meta:'答题报告',*/
meta: {
title: "答题报告",
isLogin: true
......@@ -163,7 +169,6 @@ let router = new Router({
{
path: '/moonMatch',
name: 'moonMatch',
/*meta:'月月赛',*/
meta: {
title: "月月赛",
isLogin: true
......@@ -173,7 +178,6 @@ let router = new Router({
{
path: '/match',
name: 'match',
/*meta:'月月赛试卷',*/
meta: {
title: "月月赛试卷",
isLogin: true
......@@ -181,9 +185,17 @@ let router = new Router({
component: () => import('@/views/moonMatch/match.vue'),
},
{
path: '/viewMatch',
name: 'viewMatch',
meta: {
title: "查看解析",
isLogin: true
},
component: () => import('@/views/moonMatch/viewMatch.vue'),
},
{
path: '/viewMatchReport',
name: 'viewMatchReport',
/*meta:'答题报告',*/
meta: {
title: "答题报告",
isLogin: true
......@@ -194,7 +206,6 @@ let router = new Router({
{
path: '/answerRecord',
name: 'answerRecord',
/*meta:'答题记录',*/
meta: {
title: "答题记录",
isLogin: true
......
......@@ -67,8 +67,8 @@
},
toView(item){
console.log(item,1);
Toast.fail('功能开发中')
// this.$router.push({name:'myWrongDetail',query:{code:item.code}})
// Toast.fail('功能开发中')
this.$router.push({name:'myCollectionDetail',query:{id:item.code, type:'coll'}})
}
},
......
......@@ -10,7 +10,7 @@
<span v-if="item.beginTime">{{item.beginTime}}-{{item.endTime}}</span>
</div>
<div class="item-btn">
<span v-if="item.examStatus === '3'||item.examStatus === '-2'">查看解析</span>
<span v-if="item.examStatus === '3'||item.examStatus === '-2'" @click="view(item)">查看解析</span>
<span :class="statusObj[item.examStatus]&&statusObj[item.examStatus].class" @click="linkTo(item)">{{statusObj[item.examStatus].label}}</span>
</div>
</div>
......@@ -80,13 +80,16 @@ export default {
}
})
},
view(item){
this.$router.push({name:'viewMatch',query:{id:item.id, type:'match'}})
},
linkTo(item){
//答题状态 0未开始 1开始答题 2继续答题 3重新答题 -1已过期(无答题记录) -2(有答题记录)
let begin = ()=>{
this.$router.push({name:'match',query:{id:item.id, title:item.name}})
}
let conti = ()=>{
this.$router.push({name:'match',query:{id:item.id, title:item.name}})
this.$router.push({name:'match',query:{id:item.id, title:item.name,type:'continue'}})
}
let again = ()=>{
this.$router.push({name:'match',query:{id:item.id, title:item.name}})
......
......@@ -131,7 +131,7 @@ import pMultiple from "@/components/practice/pMultiple.vue"; // 多选
import completion from "@/components/practice/completion.vue"; // 填空
import textCase from "@/components/practice/textCase.vue"; // 填空
import { getTimer } from "@/utils/function.js"
import { getMatchDetailAPI, createPaperAPI,createRecordAPI } from '@/api/moon'
import { getMatchDetailAPI, createPaperAPI,createRecordAPI,getMatchConDetailAPI } from '@/api/moon'
export default {
beforeRouteLeave (to, from, next) {
......@@ -178,6 +178,9 @@ export default {
id:1,
type:0, //1 周周练 2 月月赛
},
conQuery:{
coverId:null
},
id:0,
currentObj:{},
currentIndex:0,
......@@ -246,13 +249,17 @@ export default {
};
},
created() {
this.id = this.$route.query.id
this.topTitle = this.$route.query.title
this.listQuery.id = this.id
this.createPaper.coverId = this.id
this.createPaper.begintime = getTimer()
this.createRecord.coverId = this.id
this.getDetail()
let query = this.$route.query
if(query.id){
this.id = query.id
this.topTitle = query.title
this.listQuery.id = this.id
this.conQuery.coverId = this.id
this.createPaper.coverId = this.id
this.createPaper.begintime = getTimer()
this.createRecord.coverId = this.id
this.getDetail(query.type||'')
}
},
mounted(){
......@@ -274,8 +281,14 @@ export default {
this.isShow = false
this.$router.push({name:'moonMatch'})
},
getDetail(){
getMatchDetailAPI(this.listQuery).then(res=>{
getDetail(type){
let API
if(type == 'continue'){
API = getMatchConDetailAPI(this.conQuery)
}else{
API = getMatchDetailAPI(this.listQuery)
}
API.then(res=>{
if(res.data.code == 0){
if(res.data.data.length === 0) return
this.list = res.data.data
......@@ -287,14 +300,35 @@ export default {
this.currentChildrenIndex = 0
this.currentChildrenObj = this.childrenList[0]
}
this._createPaper('0')
if(type == 'continue'){
this.resetList(this.list)
this.currentIndex = -1
this.nextQues()
}else{
this._createPaper('0')
}
this.totalNum = this._filterNum(this.list)
}else{
}
})
},
// 继续答题初始化用户答案数据
resetList(list){
// this.answerRecordList
list.forEach((item,index)=>{
if(item.questionType == '5'||item.questionType == '6'){
item.children.forEach((el,ind)=>{
this._saveAnswer('answer',el.stuanswer||'',index,this.answerRecordList,ind)
})
}else{
this._saveAnswer('answer',item.stuanswer||'',index,this.answerRecordList)
}
})
console.log(this.answerRecordList,'this.answerRecordList');
//
},
_filterNum(list){
let num = 0
......@@ -363,7 +397,6 @@ export default {
// children:[]
}
}
},
// 创建试卷
async _createPaper(status){
......
差异被折叠。
......@@ -15,7 +15,7 @@
<div class="report-statistics">
<div class="statistics-detail">
<div class="time-wrap-top">
<span class="item-top">{{detail.begintim&&detail.begintime.substring(2,10).replace(/-/g,'.')}}</span>
<span class="item-top">{{detail.begintime&&detail.begintime.substring(2,10).replace(/-/g,'.')}}</span>
<span class="item-top">{{detail.updateTime&&detail.updateTime.substring(2,10).replace(/-/g,'.')}}</span>
<span class="item-top"></span>
</div>
......@@ -46,7 +46,7 @@
</div>
</div>
<div class="footer-but">
<span class="footer-back" @click="backTo">返回</span>
<span class="footer-back" @click="view">查看解析</span>
<span class="footer-again" @click="doAgain">再练一次</span>
</div>
</div>
......@@ -96,10 +96,16 @@ export default {
})
},
backTo() {
this.$router.push({name:'weekPractice'})
this.$router.push({name:'moonMatch'})
},
view(){
this.$router.push({name:'viewMatch',query:{
title:this.title,
id:this.id
}})
},
doAgain() {
this.$router.push({name:'practice',query:{
this.$router.push({name:'match',query:{
title:this.title,
id:this.id
}})
......
......@@ -221,8 +221,8 @@ export default {
if(res.data.code == 0){
this.list = res.data.data
if(this.list.length === 0) return
this.currentIndex = 4 // 当前选中索引值
this.currentObj = this.list[3] // 当前选中题目
this.currentIndex = 1 // 当前选中索引值
this.currentObj = this.list[0] // 当前选中题目
this.rightAns = this.currentObj.rightanswer // 当前正确答案
this.colQuery.goodsId = this.currentObj.questionid
this.getColStatus()
......
......@@ -69,8 +69,8 @@
},
toView(item){
console.log(item,1);
Toast.fail('功能开发中')
// this.$router.push({name:'myWrongDetail',query:{code:item.code}})
// Toast.fail('功能开发中')
this.$router.push({name:'myWrongDetail',query:{id:item.code, type:'wrong'}})
}
},
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论