Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
publich5
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
xuyanwei
publich5
Commits
dda86f81
提交
dda86f81
authored
6月 19, 2020
作者:
zhengyadong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
【fix】优化试卷答题流程
上级
a0bb19b8
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
51 行增加
和
66 行删除
+51
-66
pMultiple.vue
src/components/practice/pMultiple.vue
+2
-2
index.vue
src/views/moonMatch/index.vue
+0
-2
match.vue
src/views/moonMatch/match.vue
+12
-21
viewMatch.vue
src/views/moonMatch/viewMatch.vue
+0
-5
viewMatchReport.vue
src/views/moonMatch/viewMatchReport.vue
+20
-11
practice.vue
src/views/weekPractice/practice.vue
+0
-16
viewPracticeReport.vue
src/views/weekPractice/viewPracticeReport.vue
+17
-9
没有找到文件。
src/components/practice/pMultiple.vue
浏览文件 @
dda86f81
...
@@ -212,13 +212,13 @@ export default {
...
@@ -212,13 +212,13 @@ export default {
}
}
.default-e{
.default-e{
.option-num{
.option-num{
//
background: url('~@/assets/img/practice/p-E.png');
background: url('~@/assets/img/practice/p-E.png');
background-size:cover;
background-size:cover;
}
}
}
}
.default-f{
.default-f{
.option-num{
.option-num{
//
background: url('~@/assets/img/practice/p-F.png');
background: url('~@/assets/img/practice/p-F.png');
background-size:cover;
background-size:cover;
}
}
}
}
...
...
src/views/moonMatch/index.vue
浏览文件 @
dda86f81
...
@@ -73,8 +73,6 @@ export default {
...
@@ -73,8 +73,6 @@ export default {
methods
:
{
methods
:
{
getList
(){
getList
(){
getMoonListAPI
(
this
.
listQuery
).
then
(
res
=>
{
getMoonListAPI
(
this
.
listQuery
).
then
(
res
=>
{
console
.
log
(
res
.
data
.
data
,
22
);
if
(
res
.
data
.
code
==
0
){
if
(
res
.
data
.
code
==
0
){
this
.
list
=
res
.
data
.
data
.
list
this
.
list
=
res
.
data
.
data
.
list
}
}
...
...
src/views/moonMatch/match.vue
浏览文件 @
dda86f81
...
@@ -239,12 +239,10 @@ export default {
...
@@ -239,12 +239,10 @@ export default {
this
.
createRecord
.
coverId
=
this
.
id
this
.
createRecord
.
coverId
=
this
.
id
try
{
try
{
let
result
=
await
this
.
getPaperStatus
()
let
result
=
await
this
.
getPaperStatus
()
console
.
log
(
result
,
'result'
);
this
.
createPaperId
=
result
.
testPaperId
this
.
createPaperId
=
result
.
testPaperId
this
.
getDetail
(
result
.
status
,
result
.
endTime
)
this
.
getDetail
(
result
.
status
,
result
.
endTime
)
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
,
'error'
);
console
.
log
(
error
,
'error'
);
}
}
}
}
},
},
...
@@ -267,8 +265,6 @@ export default {
...
@@ -267,8 +265,6 @@ export default {
return
status
return
status
},
},
leftTimer
(
time
){
leftTimer
(
time
){
console
.
log
(
time
,
'time'
);
let
year
=
time
.
slice
(
0
,
4
)
let
year
=
time
.
slice
(
0
,
4
)
let
month
=
time
.
slice
(
5
,
7
)
let
month
=
time
.
slice
(
5
,
7
)
let
day
=
time
.
slice
(
8
,
10
)
let
day
=
time
.
slice
(
8
,
10
)
...
@@ -286,11 +282,11 @@ export default {
...
@@ -286,11 +282,11 @@ export default {
this
.
isShow
=
false
this
.
isShow
=
false
this
.
$router
.
push
({
name
:
'moonMatch'
})
this
.
$router
.
push
({
name
:
'moonMatch'
})
},
},
// 试卷答题状态
getPaperStatus
(){
getPaperStatus
(){
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
getPaperStatusAPI
(
this
.
conQuery
).
then
(
res
=>
{
getPaperStatusAPI
(
this
.
conQuery
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
0
){
if
(
res
.
data
.
code
==
0
){
console
.
log
(
res
.
data
.
data
);
resolve
(
res
.
data
.
data
)
resolve
(
res
.
data
.
data
)
}
else
{
}
else
{
reject
(
res
.
data
.
msg
)
reject
(
res
.
data
.
msg
)
...
@@ -317,7 +313,7 @@ export default {
...
@@ -317,7 +313,7 @@ export default {
this
.
setInter
=
setInterval
(()
=>
{
this
.
setInter
=
setInterval
(()
=>
{
this
.
lastTime
=
this
.
leftTimer
(
time
)
this
.
lastTime
=
this
.
leftTimer
(
time
)
if
(
this
.
lastTime
==
'00:00'
){
if
(
this
.
lastTime
==
'00:00'
){
console
.
log
(
'交卷'
);
this
.
hasDown
()
}
}
},
1000
)
},
1000
)
}
else
{
}
else
{
...
@@ -349,7 +345,6 @@ export default {
...
@@ -349,7 +345,6 @@ export default {
}
}
})
})
return
startIndex
return
startIndex
console
.
log
(
this
.
answerRecordList
,
'this.answerRecordList'
);
},
},
_filterNum
(
list
){
_filterNum
(
list
){
...
@@ -368,8 +363,6 @@ export default {
...
@@ -368,8 +363,6 @@ export default {
// 根据题目类型来确定渲染内容
// 根据题目类型来确定渲染内容
_showDetail
(
startIndex
){
// startIndex 0 代表大题,1代表小题
_showDetail
(
startIndex
){
// startIndex 0 代表大题,1代表小题
let
currentObj
=
this
.
currentObj
let
currentObj
=
this
.
currentObj
console
.
log
(
this
,
'thisthisthis'
);
if
(
currentObj
.
questionType
===
5
||
currentObj
.
questionType
===
6
){
if
(
currentObj
.
questionType
===
5
||
currentObj
.
questionType
===
6
){
let
list
=
this
.
childrenList
=
this
.
currentObj
.
children
let
list
=
this
.
childrenList
=
this
.
currentObj
.
children
let
index
=
startIndex
===
0
?
0
:
list
.
length
-
1
let
index
=
startIndex
===
0
?
0
:
list
.
length
-
1
...
@@ -445,7 +438,6 @@ export default {
...
@@ -445,7 +438,6 @@ export default {
}
}
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
createPaperAPI
(
this
.
createPaper
).
then
(
res
=>
{
createPaperAPI
(
this
.
createPaper
).
then
(
res
=>
{
console
.
log
(
res
.
data
,
'创建试卷'
);
let
data
=
res
.
data
.
data
let
data
=
res
.
data
.
data
if
(
res
.
data
.
code
==
0
){
if
(
res
.
data
.
code
==
0
){
this
.
paperObj
=
data
this
.
paperObj
=
data
...
@@ -454,11 +446,12 @@ export default {
...
@@ -454,11 +446,12 @@ export default {
// this.$router.push({name:'viewMatchReport',query:{id:this.id,paperId:this.createPaperId}})
// this.$router.push({name:'viewMatchReport',query:{id:this.id,paperId:this.createPaperId}})
}
else
{
}
else
{
this
.
createPaperId
=
data
.
id
this
.
createPaperId
=
data
.
id
this
.
createPaper
.
id
=
this
.
createPaperId
let
time
=
data
.
endtime
let
time
=
data
.
endtime
this
.
setInter
=
setInterval
(()
=>
{
this
.
setInter
=
setInterval
(()
=>
{
this
.
lastTime
=
this
.
leftTimer
(
time
)
this
.
lastTime
=
this
.
leftTimer
(
time
)
if
(
this
.
lastTime
==
'00:00'
){
if
(
this
.
lastTime
==
'00:00'
){
console
.
log
(
'交卷'
);
this
.
hasDown
()
}
}
},
1000
)
},
1000
)
}
}
...
@@ -474,7 +467,6 @@ export default {
...
@@ -474,7 +467,6 @@ export default {
async
_createRecord
(){
async
_createRecord
(){
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
createRecordAPI
(
this
.
createRecord
).
then
(
res
=>
{
createRecordAPI
(
this
.
createRecord
).
then
(
res
=>
{
console
.
log
(
res
.
data
,
'创建答题记录'
);
if
(
res
.
data
.
code
==
0
){
if
(
res
.
data
.
code
==
0
){
resolve
(
res
.
data
.
data
)
resolve
(
res
.
data
.
data
)
}
else
{
}
else
{
...
@@ -485,8 +477,6 @@ export default {
...
@@ -485,8 +477,6 @@ export default {
},
},
// 保存答题记录
// 保存答题记录
async
_saveRecord
(
obj
,
parentObj
){
async
_saveRecord
(
obj
,
parentObj
){
// return new Promise((resolve,reject)=>{
this
.
createPaper
.
id
=
this
.
createPaperId
this
.
createRecord
.
parentQuestionsId
=
parentObj
?
parentObj
.
questionid
:
''
this
.
createRecord
.
parentQuestionsId
=
parentObj
?
parentObj
.
questionid
:
''
this
.
createRecord
.
testPaperId
=
this
.
createPaperId
// 试卷id
this
.
createRecord
.
testPaperId
=
this
.
createPaperId
// 试卷id
this
.
createRecord
.
questionType
=
obj
.
questionType
// 试题类型
this
.
createRecord
.
questionType
=
obj
.
questionType
// 试题类型
...
@@ -494,12 +484,9 @@ export default {
...
@@ -494,12 +484,9 @@ export default {
this
.
createRecord
.
stuanswer
=
this
.
userAns
// 考生答案
this
.
createRecord
.
stuanswer
=
this
.
userAns
// 考生答案
try
{
try
{
let
res
=
await
this
.
_createRecord
()
let
res
=
await
this
.
_createRecord
()
// resolve(res)
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
'保存答题记录接口错误'
,
error
);
console
.
log
(
'保存答题记录接口错误'
,
error
);
// reject(error)
}
}
// })
},
},
// 添加下一题信息
// 添加下一题信息
nextQues
(){
nextQues
(){
...
@@ -510,13 +497,14 @@ export default {
...
@@ -510,13 +497,14 @@ export default {
// 下一题
// 下一题
async
nextQuestion
(){
async
nextQuestion
(){
try
{
try
{
if
(
this
.
userAns
){
await
this
.
_saveRecord
(
this
.
currentObj
)
await
this
.
_saveRecord
(
this
.
currentObj
)
this
.
_saveAnswer
(
'answer'
,
this
.
userAns
,
this
.
currentIndex
,
this
.
answerRecordList
)
// 本地保存记录
this
.
_saveAnswer
(
'answer'
,
this
.
userAns
,
this
.
currentIndex
,
this
.
answerRecordList
)
// 本地保存记录
}
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
error
,
'错误'
);
console
.
log
(
error
,
'错误'
);
}
}
this
.
nextQues
()
this
.
nextQues
()
console
.
log
(
this
.
answerRecordList
,
'保存所有得答案'
);
},
},
childrenPrevQuestion
(){
childrenPrevQuestion
(){
...
@@ -535,23 +523,25 @@ export default {
...
@@ -535,23 +523,25 @@ export default {
async
childrenNextQuestion
(){
async
childrenNextQuestion
(){
let
key
let
key
try
{
try
{
if
(
this
.
userAns
){
await
this
.
_saveRecord
(
this
.
currentChildrenObj
,
this
.
currentObj
)
// 调用保存接口
await
this
.
_saveRecord
(
this
.
currentChildrenObj
,
this
.
currentObj
)
// 调用保存接口
this
.
_saveAnswer
(
'answer'
,
this
.
userAns
,
this
.
currentIndex
,
this
.
answerRecordList
,
this
.
currentChildrenIndex
)
// 本地保存记录
this
.
_saveAnswer
(
'answer'
,
this
.
userAns
,
this
.
currentIndex
,
this
.
answerRecordList
,
this
.
currentChildrenIndex
)
// 本地保存记录
}
}
catch
(
error
){
console
.
log
(
error
,
'错误'
);}
if
(
this
.
currentChildrenIndex
+
1
<
this
.
childrenList
.
length
){
if
(
this
.
currentChildrenIndex
+
1
<
this
.
childrenList
.
length
){
this
.
currentChildrenIndex
+=
1
this
.
currentChildrenIndex
+=
1
this
.
currentChildrenObj
=
this
.
childrenList
[
this
.
currentChildrenIndex
]
// 当前题目
this
.
currentChildrenObj
=
this
.
childrenList
[
this
.
currentChildrenIndex
]
// 当前题目
this
.
_showCom
(
this
.
currentChildrenObj
)
this
.
_showCom
(
this
.
currentChildrenObj
)
this
.
changeAns
(
'refChildrenObj'
,
this
.
currentChildrenObj
,
'_getUserChildAnswer'
)
this
.
changeAns
(
'refChildrenObj'
,
this
.
currentChildrenObj
,
'_getUserChildAnswer'
)
console
.
log
(
this
.
answerRecordList
,
'保存所有得答案'
);
}
else
{
}
else
{
this
.
nextQues
()
this
.
nextQues
()
}
}
}
catch
(
error
){
console
.
log
(
error
,
'错误'
);}
},
},
// 打开交卷
// 打开交卷
async
openPost
(){
async
openPost
(){
try
{
try
{
if
(
this
.
userAns
){
if
(
this
.
currentObj
.
questionType
===
5
||
this
.
currentObj
.
questionType
===
6
){
if
(
this
.
currentObj
.
questionType
===
5
||
this
.
currentObj
.
questionType
===
6
){
await
this
.
_saveRecord
(
this
.
currentChildrenObj
,
this
.
currentObj
)
// 调用保存接口
await
this
.
_saveRecord
(
this
.
currentChildrenObj
,
this
.
currentObj
)
// 调用保存接口
this
.
_saveAnswer
(
'answer'
,
this
.
userAns
,
this
.
currentIndex
,
this
.
answerRecordList
,
this
.
currentChildrenIndex
)
// 本地保存记录
this
.
_saveAnswer
(
'answer'
,
this
.
userAns
,
this
.
currentIndex
,
this
.
answerRecordList
,
this
.
currentChildrenIndex
)
// 本地保存记录
...
@@ -559,6 +549,7 @@ export default {
...
@@ -559,6 +549,7 @@ export default {
await
this
.
_saveRecord
(
this
.
currentObj
)
await
this
.
_saveRecord
(
this
.
currentObj
)
this
.
_saveAnswer
(
'answer'
,
this
.
userAns
,
this
.
currentIndex
,
this
.
answerRecordList
)
// 本地保存记录
this
.
_saveAnswer
(
'answer'
,
this
.
userAns
,
this
.
currentIndex
,
this
.
answerRecordList
)
// 本地保存记录
}
}
}
this
.
backStatus
=
true
this
.
backStatus
=
true
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
error
,
'错误'
);
console
.
log
(
error
,
'错误'
);
...
@@ -583,7 +574,7 @@ export default {
...
@@ -583,7 +574,7 @@ export default {
// 完成
// 完成
async
hasDown
(){
async
hasDown
(){
let
result
=
await
this
.
_createPaper
(
'1'
)
let
result
=
await
this
.
_createPaper
(
'1'
)
this
.
createPaper
.
updateTime
=
getTimer
()
//
this.createPaper.updateTime = getTimer()
this
.
$router
.
push
({
name
:
'viewMatchReport'
,
query
:{
id
:
this
.
id
,
paperId
:
this
.
createPaperId
}})
this
.
$router
.
push
({
name
:
'viewMatchReport'
,
query
:{
id
:
this
.
id
,
paperId
:
this
.
createPaperId
}})
}
}
}
}
...
...
src/views/moonMatch/viewMatch.vue
浏览文件 @
dda86f81
...
@@ -175,8 +175,6 @@ export default {
...
@@ -175,8 +175,6 @@ export default {
};
};
},
},
created
()
{
created
()
{
console
.
log
(
111111
);
let
query
=
this
.
$route
.
query
let
query
=
this
.
$route
.
query
if
(
query
&&
query
.
id
){
if
(
query
&&
query
.
id
){
this
.
id
=
query
.
id
this
.
id
=
query
.
id
...
@@ -191,8 +189,6 @@ export default {
...
@@ -191,8 +189,6 @@ export default {
watch
:
{},
watch
:
{},
methods
:
{
methods
:
{
backTo
(){
backTo
(){
console
.
log
(
111
);
this
.
$router
.
go
(
-
1
)
this
.
$router
.
go
(
-
1
)
// this.$router.push({name:this.viewType[this.type].routerName})
// this.$router.push({name:this.viewType[this.type].routerName})
},
},
...
@@ -284,7 +280,6 @@ export default {
...
@@ -284,7 +280,6 @@ export default {
this
.
rightAns
.
indexOf
(
type
)
!=
-
1
&&
(
num
+=
1
)
this
.
rightAns
.
indexOf
(
type
)
!=
-
1
&&
(
num
+=
1
)
this
.
userAns
.
indexOf
(
type
)
!=
-
1
&&
(
num
+=
2
)
this
.
userAns
.
indexOf
(
type
)
!=
-
1
&&
(
num
+=
2
)
this
.
currentStatus
[
answer
]
=
num
this
.
currentStatus
[
answer
]
=
num
console
.
log
(
this
.
userAns
,
this
.
rightAns
,
'this.userAns == this.rightAns'
)
},
},
_filterAnswer
(
userAns
,
rightAns
){
_filterAnswer
(
userAns
,
rightAns
){
...
...
src/views/moonMatch/viewMatchReport.vue
浏览文件 @
dda86f81
...
@@ -8,24 +8,24 @@
...
@@ -8,24 +8,24 @@
</div>
</div>
<div
class=
"report-bg"
>
<div
class=
"report-bg"
>
<div
class=
"report-detail"
>
<div
class=
"report-detail"
>
<div
class=
"detail-num"
>
{{
detail
.
rightCount
}}
</div>
<div
class=
"detail-num"
>
{{
detail
.
rightCount
|
defaultCount
}}
</div>
<div
class=
"detail-tip"
>
本次答对题目数
</div>
<div
class=
"detail-tip"
>
本次答对题目数
</div>
</div>
</div>
</div>
</div>
<div
class=
"report-statistics"
>
<div
class=
"report-statistics"
>
<div
class=
"statistics-detail"
>
<div
class=
"statistics-detail"
>
<div
class=
"time-wrap-top"
>
<div
class=
"time-wrap-top"
>
<span
class=
"item-top"
>
{{
detail
.
begintime
&&
detail
.
begintime
.
substring
(
2
,
10
).
replace
(
/-/g
,
'.'
)
}}
</span>
<span
class=
"item-top"
>
{{
detail
.
begintime
|
filterYear
}}
</span>
<span
class=
"item-top"
>
{{
detail
.
updateTime
&&
detail
.
updateTime
.
substring
(
2
,
10
).
replace
(
/-/g
,
'.'
)
}}
</span>
<span
class=
"item-top"
>
{{
detail
.
updateTime
|
filterYear
}}
</span>
<span
class=
"item-top"
></span>
<span
class=
"item-top"
></span>
</div>
</div>
<div
class=
"time-wrap"
>
<div
class=
"time-wrap"
>
<div
class=
"time-item"
>
<div
class=
"time-item"
>
<span
class=
"item-cnt"
>
{{
detail
.
begintime
&&
detail
.
begintime
.
substring
(
10
)
}}
</span>
<span
class=
"item-cnt"
>
{{
detail
.
begintime
|
filterTime
}}
</span>
<span
class=
"item-bot"
>
开始时间
</span>
<span
class=
"item-bot"
>
开始时间
</span>
</div>
</div>
<div
class=
"time-item"
>
<div
class=
"time-item"
>
<span
class=
"item-cnt"
>
{{
detail
.
updateTime
&&
detail
.
updateTime
.
substring
(
10
)
}}
</span>
<span
class=
"item-cnt"
>
{{
detail
.
updateTime
|
filterTime
}}
</span>
<span
class=
"item-bot"
>
结束时间
</span>
<span
class=
"item-bot"
>
结束时间
</span>
</div>
</div>
<div
class=
"time-item"
>
<div
class=
"time-item"
>
...
@@ -36,12 +36,12 @@
...
@@ -36,12 +36,12 @@
<div
class=
"info-item"
>
<div
class=
"info-item"
>
<img
src=
"@/assets/img/practice/info-tip.png"
alt=
""
>
<img
src=
"@/assets/img/practice/info-tip.png"
alt=
""
>
<span
class=
"item-right"
>
正确率:
<span
class=
"item-per"
>
{{
detail
.
correct
}}
</span></span>
<span
class=
"item-right"
>
正确率:
<span
class=
"item-per"
>
{{
detail
.
correct
}}
</span></span>
<span
class=
"item-false item-point"
>
答对:
<span
class=
"item-num"
>
{{
detail
.
rightCount
}}
</span><span
class=
"item-false"
>
题
</span></span>
<span
class=
"item-false item-point"
>
答对:
<span
class=
"item-num"
>
{{
detail
.
rightCount
|
defaultCount
}}
</span><span
class=
"item-false"
>
题
</span></span>
</div>
</div>
<div
class=
"info-item info-long"
>
<div
class=
"info-item info-long"
>
<img
src=
""
alt=
""
>
<img
src=
""
alt=
""
>
<span
class=
"item-right"
>
答错:
<span
class=
"item-per item-per-color"
>
{{
detail
.
errorCount
}}
</span></span>
<span
class=
"item-right"
>
答错:
<span
class=
"item-per item-per-color"
>
{{
detail
.
errorCount
|
defaultCount
}}
</span><span
class=
"item-false"
>
题
</span></span>
<span
class=
"item-false item-point"
>
未答:
<span
class=
"item-num item-num-color"
>
{{
detail
.
unFinishCount
}}
</span><span
class=
"item-false"
>
题
</span></span>
<span
class=
"item-false item-point"
>
未答:
<span
class=
"item-num item-num-color"
>
{{
detail
.
unFinishCount
|
defaultCount
}}
</span><span
class=
"item-false"
>
题
</span></span>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -70,8 +70,18 @@ export default {
...
@@ -70,8 +70,18 @@ export default {
}
}
};
};
},
},
filters
:{
defaultCount
:
function
(
value
){
return
value
||
0
},
filterYear
:
function
(
value
){
return
value
&&
value
.
substring
(
2
,
10
).
replace
(
/-/g
,
'.'
)
},
filterTime
:
function
(
value
){
return
value
&&
value
.
substring
(
10
)
}
},
created
()
{
created
()
{
console
.
log
(
this
.
$route
.
query
);
let
query
=
this
.
$route
.
query
let
query
=
this
.
$route
.
query
this
.
paperId
=
query
.
paperId
this
.
paperId
=
query
.
paperId
...
@@ -86,7 +96,6 @@ export default {
...
@@ -86,7 +96,6 @@ export default {
paperId
:
id
paperId
:
id
}
}
getDetailPaperAPI
(
data
).
then
(
res
=>
{
getDetailPaperAPI
(
data
).
then
(
res
=>
{
console
.
log
(
res
.
data
.
data
);
if
(
res
.
data
.
code
==
0
){
if
(
res
.
data
.
code
==
0
){
this
.
detail
=
res
.
data
.
data
this
.
detail
=
res
.
data
.
data
}
else
{
}
else
{
...
@@ -250,7 +259,7 @@ export default {
...
@@ -250,7 +259,7 @@ export default {
color: #999999;
color: #999999;
}
}
.item-per {
.item-per {
margin
-left:
.07rem;
margin
: 0
.07rem;
color: #04afaf;
color: #04afaf;
font-weight: Bold;
font-weight: Bold;
}
}
...
...
src/views/weekPractice/practice.vue
浏览文件 @
dda86f81
...
@@ -106,8 +106,6 @@ import { Toast } from 'vant';
...
@@ -106,8 +106,6 @@ import { Toast } from 'vant';
import
{
getWeekDetailAPI
,
saveWeekAPI
,
getColStatusAPI
,
addCollectionAPI
,
delCollectionAPI
}
from
'@/api/week'
import
{
getWeekDetailAPI
,
saveWeekAPI
,
getColStatusAPI
,
addCollectionAPI
,
delCollectionAPI
}
from
'@/api/week'
export
default
{
export
default
{
beforeRouteLeave
(
to
,
from
,
next
)
{
beforeRouteLeave
(
to
,
from
,
next
)
{
// const answer = window.confirm('Do you really want to leave? you have unsaved changes!')
console
.
log
(
this
.
backStatus
,
22222
);
if
(
this
.
backStatus
)
{
if
(
this
.
backStatus
)
{
next
()
next
()
}
else
{
}
else
{
...
@@ -255,13 +253,11 @@ export default {
...
@@ -255,13 +253,11 @@ export default {
this
.
colQuery
.
goodsId
=
this
.
currentObj
.
questionid
this
.
colQuery
.
goodsId
=
this
.
currentObj
.
questionid
this
.
getColStatus
()
this
.
getColStatus
()
if
(
this
.
currentObj
.
questionType
===
5
||
this
.
currentObj
.
questionType
===
6
){
if
(
this
.
currentObj
.
questionType
===
5
||
this
.
currentObj
.
questionType
===
6
){
console
.
log
(
this
.
currentObj
,
111
);
this
.
childrenList
=
this
.
currentObj
.
children
this
.
childrenList
=
this
.
currentObj
.
children
if
(
this
.
childrenList
.
length
===
0
)
return
if
(
this
.
childrenList
.
length
===
0
)
return
this
.
currentChildrenIndex
=
1
this
.
currentChildrenIndex
=
1
this
.
currentChildrenObj
=
this
.
childrenList
[
0
]
this
.
currentChildrenObj
=
this
.
childrenList
[
0
]
this
.
rightAns
=
this
.
currentChildrenObj
.
rightanswer
this
.
rightAns
=
this
.
currentChildrenObj
.
rightanswer
console
.
log
(
this
.
currentChildrenObj
,
2222
);
}
}
}
}
...
@@ -280,15 +276,12 @@ export default {
...
@@ -280,15 +276,12 @@ export default {
this
.
scoreObj
.
forEach
(
item
=>
{
this
.
scoreObj
.
forEach
(
item
=>
{
obj
[
item
.
name
]
&&
this
.
_changeScore
(
item
.
name
,
item
.
value
)
obj
[
item
.
name
]
&&
this
.
_changeScore
(
item
.
name
,
item
.
value
)
})
})
console
.
log
(
this
.
userAns
,
'用户答案'
);
console
.
log
(
this
.
rightAns
,
'正确1答案'
);
},
},
_changeScore
(
answer
,
type
){
_changeScore
(
answer
,
type
){
let
num
=
0
let
num
=
0
this
.
rightAns
.
indexOf
(
type
)
!=
-
1
&&
(
num
+=
1
)
this
.
rightAns
.
indexOf
(
type
)
!=
-
1
&&
(
num
+=
1
)
this
.
userAns
.
indexOf
(
type
)
!=
-
1
&&
(
num
+=
2
)
this
.
userAns
.
indexOf
(
type
)
!=
-
1
&&
(
num
+=
2
)
this
.
currentStatus
[
answer
]
=
num
this
.
currentStatus
[
answer
]
=
num
console
.
log
(
this
.
userAns
,
this
.
rightAns
,
'this.userAns == this.rightAns'
)
},
},
// 单选选中 多选 填空
// 单选选中 多选 填空
...
@@ -381,8 +374,6 @@ export default {
...
@@ -381,8 +374,6 @@ export default {
this
.
changeScore
(
obj
)
this
.
changeScore
(
obj
)
this
.
showButton
=
'next'
this
.
showButton
=
'next'
this
.
showAnswer
=
true
this
.
showAnswer
=
true
console
.
log
(
this
.
currentStatus
,
2222
);
this
.
$refs
[
this
.
refChildrenObj
[
obj
.
questionType
]].
currentStatus
=
this
.
currentStatus
this
.
$refs
[
this
.
refChildrenObj
[
obj
.
questionType
]].
currentStatus
=
this
.
currentStatus
}
else
if
(
type
==
'4'
){
// 填空
}
else
if
(
type
==
'4'
){
// 填空
let
curentRef
=
this
.
$refs
[
this
.
refChildrenObj
[
obj
.
questionType
]]
let
curentRef
=
this
.
$refs
[
this
.
refChildrenObj
[
obj
.
questionType
]]
...
@@ -443,7 +434,6 @@ export default {
...
@@ -443,7 +434,6 @@ export default {
// 完成
// 完成
hasDown
(){
hasDown
(){
this
.
backStatus
=
true
this
.
backStatus
=
true
console
.
log
(
this
.
saveFrom
,
1
);
saveWeekAPI
(
this
.
saveFrom
).
then
(
res
=>
{
saveWeekAPI
(
this
.
saveFrom
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
0
){
if
(
res
.
data
.
code
==
0
){
this
.
$router
.
push
({
name
:
'viewPracticeReport'
,
query
:{
id
:
this
.
id
,
title
:
this
.
topTitle
,
paperId
:
res
.
data
.
data
.
id
}})
this
.
$router
.
push
({
name
:
'viewPracticeReport'
,
query
:{
id
:
this
.
id
,
title
:
this
.
topTitle
,
paperId
:
res
.
data
.
data
.
id
}})
...
@@ -454,7 +444,6 @@ export default {
...
@@ -454,7 +444,6 @@ export default {
// 获取收藏状态
// 获取收藏状态
getColStatus
(){
getColStatus
(){
getColStatusAPI
(
this
.
colQuery
).
then
(
res
=>
{
getColStatusAPI
(
this
.
colQuery
).
then
(
res
=>
{
console
.
log
(
res
.
data
,
222
);
if
(
res
.
data
.
code
==
0
){
if
(
res
.
data
.
code
==
0
){
this
.
collectionStatus
=
res
.
data
.
data
this
.
collectionStatus
=
res
.
data
.
data
}
}
...
@@ -471,7 +460,6 @@ export default {
...
@@ -471,7 +460,6 @@ export default {
}
}
let
API
=
status
?
addCollectionAPI
(
addData
)
:
delCollectionAPI
(
delData
)
let
API
=
status
?
addCollectionAPI
(
addData
)
:
delCollectionAPI
(
delData
)
API
.
then
(
res
=>
{
API
.
then
(
res
=>
{
console
.
log
(
res
.
data
,
222
);
if
(
res
.
data
.
code
==
0
){
if
(
res
.
data
.
code
==
0
){
Toast
.
success
(
`
${
!
status
?
'取消收藏'
:
'收藏成功'
}
`
);
Toast
.
success
(
`
${
!
status
?
'取消收藏'
:
'收藏成功'
}
`
);
this
.
getColStatus
()
this
.
getColStatus
()
...
@@ -480,15 +468,11 @@ export default {
...
@@ -480,15 +468,11 @@ export default {
},
},
getColStatus
(){
getColStatus
(){
getColStatusAPI
(
this
.
colQuery
).
then
(
res
=>
{
getColStatusAPI
(
this
.
colQuery
).
then
(
res
=>
{
console
.
log
(
res
.
data
,
222
);
if
(
res
.
data
.
code
==
0
){
if
(
res
.
data
.
code
==
0
){
this
.
collectionStatus
=
res
.
data
.
data
this
.
collectionStatus
=
res
.
data
.
data
}
}
})
})
},
},
// getColStatusAPI,addCollectionAPI,delCollectionAPI
}
}
}
}
</
script
>
</
script
>
...
...
src/views/weekPractice/viewPracticeReport.vue
浏览文件 @
dda86f81
...
@@ -8,24 +8,24 @@
...
@@ -8,24 +8,24 @@
</div>
</div>
<div
class=
"report-bg"
>
<div
class=
"report-bg"
>
<div
class=
"report-detail"
>
<div
class=
"report-detail"
>
<div
class=
"detail-num"
>
{{
detail
.
rightCount
}}
</div>
<div
class=
"detail-num"
>
{{
detail
.
rightCount
|
defaultCount
}}
</div>
<div
class=
"detail-tip"
>
本次答对题目数
</div>
<div
class=
"detail-tip"
>
本次答对题目数
</div>
</div>
</div>
</div>
</div>
<div
class=
"report-statistics"
>
<div
class=
"report-statistics"
>
<div
class=
"statistics-detail"
>
<div
class=
"statistics-detail"
>
<div
class=
"time-wrap-top"
>
<div
class=
"time-wrap-top"
>
<span
class=
"item-top"
>
{{
detail
.
begintime
.
substring
(
2
,
10
).
replace
(
/-/g
,
'.'
)
}}
</span>
<span
class=
"item-top"
>
{{
detail
.
begintime
|
filterYear
}}
</span>
<span
class=
"item-top"
>
{{
detail
.
updateTime
.
substring
(
2
,
10
).
replace
(
/-/g
,
'.'
)
}}
</span>
<span
class=
"item-top"
>
{{
detail
.
updateTime
|
filterYear
}}
</span>
<span
class=
"item-top"
></span>
<span
class=
"item-top"
></span>
</div>
</div>
<div
class=
"time-wrap"
>
<div
class=
"time-wrap"
>
<div
class=
"time-item"
>
<div
class=
"time-item"
>
<span
class=
"item-cnt"
>
{{
detail
.
begintime
.
substring
(
10
)
}}
</span>
<span
class=
"item-cnt"
>
{{
detail
.
begintime
|
filterTime
}}
</span>
<span
class=
"item-bot"
>
开始时间
</span>
<span
class=
"item-bot"
>
开始时间
</span>
</div>
</div>
<div
class=
"time-item"
>
<div
class=
"time-item"
>
<span
class=
"item-cnt"
>
{{
detail
.
updateTime
.
substring
(
10
)
}}
</span>
<span
class=
"item-cnt"
>
{{
detail
.
updateTime
|
filterTime
}}
</span>
<span
class=
"item-bot"
>
交卷时间
</span>
<span
class=
"item-bot"
>
交卷时间
</span>
</div>
</div>
<div
class=
"time-item"
>
<div
class=
"time-item"
>
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
<span
class=
"item-right"
>
正确率:
</span>
<span
class=
"item-right"
>
正确率:
</span>
<span
class=
"item-per"
>
{{
detail
.
correct
}}
</span>
<span
class=
"item-per"
>
{{
detail
.
correct
}}
</span>
<span
class=
"item-false item-point"
>
答错
</span>
<span
class=
"item-false item-point"
>
答错
</span>
<span
class=
"item-num"
>
{{
detail
.
errorCount
}}
</span>
<span
class=
"item-num"
>
{{
detail
.
errorCount
|
defaultCount
}}
</span>
<span
class=
"item-false"
>
题
</span>
<span
class=
"item-false"
>
题
</span>
</div>
</div>
</div>
</div>
...
@@ -68,10 +68,19 @@ export default {
...
@@ -68,10 +68,19 @@ export default {
}
}
};
};
},
},
filters
:{
defaultCount
:
function
(
value
){
return
value
||
0
},
filterYear
:
function
(
value
){
return
value
&&
value
.
substring
(
2
,
10
).
replace
(
/-/g
,
'.'
)
},
filterTime
:
function
(
value
){
return
value
&&
value
.
substring
(
10
)
}
},
created
()
{
created
()
{
console
.
log
(
this
.
$route
.
query
);
let
query
=
this
.
$route
.
query
let
query
=
this
.
$route
.
query
this
.
paperId
=
query
.
paperId
this
.
paperId
=
query
.
paperId
this
.
title
=
query
.
title
this
.
title
=
query
.
title
this
.
id
=
query
.
id
this
.
id
=
query
.
id
...
@@ -84,7 +93,6 @@ export default {
...
@@ -84,7 +93,6 @@ export default {
paperId
:
id
paperId
:
id
}
}
getDetailPaperAPI
(
data
).
then
(
res
=>
{
getDetailPaperAPI
(
data
).
then
(
res
=>
{
console
.
log
(
res
.
data
.
data
);
if
(
res
.
data
.
code
==
0
){
if
(
res
.
data
.
code
==
0
){
this
.
detail
=
res
.
data
.
data
this
.
detail
=
res
.
data
.
data
}
else
{
}
else
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论