Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
transport-show-h5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
transport-show-h5
Commits
fb83ef89
提交
fb83ef89
authored
7月 08, 2020
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
updata
上级
d1ce5e52
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
62 行增加
和
27 行删除
+62
-27
ExamAction.js
src/modules/exam-module/action/ExamAction.js
+1
-1
ExamEnd.vue
src/modules/exam-module/src/ExamEnd.vue
+2
-2
ExamTopic.vue
src/modules/exam-module/src/ExamTopic.vue
+59
-24
没有找到文件。
src/modules/exam-module/action/ExamAction.js
浏览文件 @
fb83ef89
...
@@ -43,7 +43,7 @@ export default class ExamAction extends BaseACTION {
...
@@ -43,7 +43,7 @@ export default class ExamAction extends BaseACTION {
const
opa
=
[
'A'
,
'B'
,
'C'
,
'D'
,
'E'
,
'F'
,
'G'
]
const
opa
=
[
'A'
,
'B'
,
'C'
,
'D'
,
'E'
,
'F'
,
'G'
]
return
opa
[
index
]
return
opa
[
index
]
}
}
})
.
toString
().
replace
(
new
RegExp
(
','
,
'g'
),
''
)
,
}),
answer_count
:
e
.
answer_count
answer_count
:
e
.
answer_count
}
}
})
})
...
...
src/modules/exam-module/src/ExamEnd.vue
浏览文件 @
fb83ef89
...
@@ -87,7 +87,7 @@
...
@@ -87,7 +87,7 @@
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"st-btn"
v-if=
"title === '随堂测试' || title === '模拟考试'"
>
<div
class=
"st-btn"
v-if=
"title === '随堂测试' || title === '模拟考试'
|| title === '知识点测试'
"
>
<div
class=
"btn"
@
click=
"go(1)"
>
全部解析
</div>
<div
class=
"btn"
@
click=
"go(1)"
>
全部解析
</div>
<div
class=
"btn"
@
click=
"go(-1)"
>
错题解析
</div>
<div
class=
"btn"
@
click=
"go(-1)"
>
错题解析
</div>
</div>
</div>
...
@@ -120,7 +120,7 @@ export default {
...
@@ -120,7 +120,7 @@ export default {
created
()
{
created
()
{
},
},
mounted
()
{
mounted
()
{
if
(
this
.
$route
.
query
.
course_id
)
{
if
(
this
.
$route
.
query
.
course_id
||
this
.
$route
.
query
.
tag_id
)
{
this
.
$route
.
query
.
type
===
1
||
this
.
$route
.
query
.
type
===
'1'
?
this
.
title
=
'随堂测试'
:
this
.
title
=
'知识点测试'
this
.
$route
.
query
.
type
===
1
||
this
.
$route
.
query
.
type
===
'1'
?
this
.
title
=
'随堂测试'
:
this
.
title
=
'知识点测试'
}
else
{
}
else
{
this
.
$route
.
query
.
type
===
1
||
this
.
$route
.
query
.
type
===
'1'
?
this
.
title
=
'能力自测'
:
this
.
title
=
'模拟考试'
this
.
$route
.
query
.
type
===
1
||
this
.
$route
.
query
.
type
===
'1'
?
this
.
title
=
'能力自测'
:
this
.
title
=
'模拟考试'
...
...
src/modules/exam-module/src/ExamTopic.vue
浏览文件 @
fb83ef89
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<div
class=
"exam-box"
>
<div
class=
"exam-box"
>
<div
id=
"top-view"
v-show=
"!topicCard.isShow"
>
<div
id=
"top-view"
v-show=
"!topicCard.isShow"
>
<div
class=
"tool-box"
>
<div
class=
"tool-box"
>
<div
class=
"time"
>
{{
$route
.
query
.
course_id
||
$route
.
query
.
tag_id
?
''
:
'倒计时'
}}{{
remainingTime
}}
</div>
<div
class=
"time"
>
{{
$route
.
query
.
id
!==
undefined
?
''
:
$route
.
query
.
course_id
||
$route
.
query
.
tag_id
?
''
:
'倒计时'
}}{{
remainingTime
}}
</div>
<div
class=
"tag-box"
>
<div
class=
"tag-box"
>
<span
@
click=
"signQuestion"
v-if=
"isExamEnd"
:class=
"signText == '标记' ? '' : 'active'"
>
{{
signText
}}
</span>
<span
@
click=
"signQuestion"
v-if=
"isExamEnd"
:class=
"signText == '标记' ? '' : 'active'"
>
{{
signText
}}
</span>
<span
@
click=
"showCard"
v-if=
"isExamEnd"
>
答题卡
</span>
<span
@
click=
"showCard"
v-if=
"isExamEnd"
>
答题卡
</span>
...
@@ -25,29 +25,36 @@
...
@@ -25,29 +25,36 @@
<ul
class=
"option"
v-if=
"item.type === '1' || item.type === '6' || item.type === '5' && dItem.answer_count
<
=
1
"
>
<ul
class=
"option"
v-if=
"item.type === '1' || item.type === '6' || item.type === '5' && dItem.answer_count
<
=
1
"
>
<template
v-for=
"(opt, oIndex) in dItem.question_options"
>
<template
v-for=
"(opt, oIndex) in dItem.question_options"
>
<template
v-if=
"requestData2 != 0 && requestData[item.id]"
>
<template
v-if=
"requestData2 != 0 && requestData[item.id]"
>
<li
:key=
"oIndex"
v-if=
"requestData[item.id][dItem.id]"
:class=
"requestData[item.id][dItem.id].answer.find(res =>
{ return res === opt.id }) ? 'active' : ''" @click="selectRadio(dItem, opt.id, oIndex, item)" :data-id="opt.id">
{{
opaKey
[
oIndex
]
}}
.
{{
opt
.
option
}}
</li>
<li
:key=
"oIndex"
v-if=
"requestData[item.id][dItem.id]"
:class=
"
dItem.answerOpt.find(cla =>
{ return cla == opaKey[oIndex] })
&&
(isAnalysis || $route.query.id) ? 'active2' :
requestData[item.id][dItem.id].answer.find(res => { return res === opt.id }) ? 'active' : ''" @click="selectRadio(dItem, opt.id, oIndex, item)" :data-id="opt.id">
{{
opaKey
[
oIndex
]
}}
.
{{
opt
.
option
}}
</li>
<li
:key=
"oIndex"
v-else
:class=
"dItem.activeIndex == oIndex ? 'active' : ''"
@
click=
"selectRadio(dItem, opt.id, oIndex, item)"
:data-id=
"opt.id"
>
{{
opaKey
[
oIndex
]
}}
.
{{
opt
.
option
}}
</li>
<li
:key=
"oIndex"
v-else
:class=
"dItem.a
nswerOpt.find(cla =>
{ return cla == opaKey[oIndex] })
&&
(isAnalysis || $route.query.id) ? 'active2' : dItem.a
ctiveIndex == oIndex ? 'active' : ''" @click="selectRadio(dItem, opt.id, oIndex, item)" :data-id="opt.id">
{{
opaKey
[
oIndex
]
}}
.
{{
opt
.
option
}}
</li>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
<li
:key=
"oIndex"
:class=
"dItem.activeIndex == oIndex ? 'active' : ''"
@
click=
"selectRadio(dItem, opt.id, oIndex, item)"
:data-id=
"opt.id"
>
{{
opaKey
[
oIndex
]
}}{{
opt
.
option
}}
</li>
<li
:key=
"oIndex"
:class=
"dItem.a
nswerOpt.find(cla =>
{ return cla == opaKey[oIndex] })
&&
(isAnalysis || $route.query.id) ? 'active2' : dItem.a
ctiveIndex == oIndex ? 'active' : ''" @click="selectRadio(dItem, opt.id, oIndex, item)" :data-id="opt.id">
{{
opaKey
[
oIndex
]
}}{{
opt
.
option
}}
</li>
</
template
>
</
template
>
</template>
</template>
</ul>
</ul>
<ul
class=
"option"
v-if=
"item.type === '2' || item.type === '5' && dItem.answer_count > 1"
>
<ul
class=
"option"
v-if=
"item.type === '2' || item.type === '5' && dItem.answer_count > 1"
>
<
template
v-for=
"(opt, oIndex) in dItem.question_options"
>
<
template
v-for=
"(opt, oIndex) in dItem.question_options"
>
<template
v-if=
"requestData2 != 0 && requestData[item.id]"
>
<template
v-if=
"requestData2 != 0 && requestData[item.id]"
>
<li
:key=
"oIndex+'-'"
v-if=
"requestData[item.id][dItem.id]"
:class=
"opt.active ? 'active' : ''"
@
click=
"selectCheckbox(opt, opt.id, dItem, item, oIndex)"
:data-id=
"opt.id"
>
{{
opaKey
[
oIndex
]
}}
.
{{
opt
.
option
}}
</li>
<li
:key=
"oIndex+'-'"
v-if=
"requestData[item.id][dItem.id]"
:class=
"
dItem.answerOpt.find(cla =>
{ return cla == opaKey[oIndex] })
&&
(isAnalysis || $route.query.id) ? 'active2' :
opt.active ? 'active' : ''" @click="selectCheckbox(opt, opt.id, dItem, item, oIndex)" :data-id="opt.id">
{{
opaKey
[
oIndex
]
}}
.
{{
opt
.
option
}}
</li>
<li
:key=
"oIndex+'-'"
v-else
:class=
"opt.active ? 'active' : ''"
@
click=
"selectCheckbox(opt, opt.id, dItem, item, oIndex)"
:data-id=
"opt.id"
>
{{
opaKey
[
oIndex
]
}}
.
{{
opt
.
option
}}
</li>
<li
:key=
"oIndex+'-'"
v-else
:class=
"
dItem.answerOpt.find(cla =>
{ return cla == opaKey[oIndex] })
&&
(isAnalysis || $route.query.id) ? 'active2' :
opt.active ? 'active' : ''" @click="selectCheckbox(opt, opt.id, dItem, item, oIndex)" :data-id="opt.id">
{{
opaKey
[
oIndex
]
}}
.
{{
opt
.
option
}}
</li>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
<li
:key=
"oIndex+'-'"
:class=
"opt.active ? 'active' : ''"
@
click=
"selectCheckbox(opt, opt.id, dItem, item, oIndex)"
:data-id=
"opt.id"
>
{{
opaKey
[
oIndex
]
}}
.
{{
opt
.
option
}}
</li>
<li
:key=
"oIndex+'-'"
:class=
"
dItem.answerOpt.find(cla =>
{ return cla == opaKey[oIndex] })
&&
(isAnalysis || $route.query.id) ? 'active2' :
opt.active ? 'active' : ''" @click="selectCheckbox(opt, opt.id, dItem, item, oIndex)" :data-id="opt.id">
{{
opaKey
[
oIndex
]
}}
.
{{
opt
.
option
}}
</li>
</
template
>
</
template
>
</template>
</template>
</ul>
</ul>
<div
class=
"analy"
v-if=
"isAnalysis || $route.query.id"
>
<div
class=
"analy"
v-if=
"isAnalysis || $route.query.id"
>
<div
class=
"tit"
>
答案解析
</div>
<div
class=
"tit"
>
答案解析
</div>
<div
class=
"txt"
>
正确答案:
<span>
{{ dItem.answerOpt }}
</span></div>
<div
class=
"txt"
>
正确答案:
<span>
{{ dItem.answerOpt.toString().replace(new RegExp(',', 'g'), '') }}
</span></div>
<
template
v-if=
"requestData[item.id]"
>
<div
class=
"txt"
v-if=
"requestData[item.id][dItem.id]"
>
您的答案:
<span>
{{
requestData
[
item
.
id
][
dItem
.
id
].
opaVal
.
toString
().
replace
(
new
RegExp
(
','
,
'g'
),
''
)
}}
</span></div>
<div
class=
"txt"
v-else
>
您的答案:
<span>
{{
dItem
.
opaVal
}}
</span></div>
</
template
>
<
template
v-else
>
<div
class=
"txt"
>
您的答案:
<span>
{{
dItem
.
opaVal
}}
</span></div>
<div
class=
"txt"
>
您的答案:
<span>
{{
dItem
.
opaVal
}}
</span></div>
</
template
>
<!-- <div class="txt">您的答案:<span>{{ dItem.opaVal }}</span></div> -->
<div
class=
"exp"
>
<div
class=
"exp"
>
<p
class=
"name"
>
解析:
</p>
<p
class=
"name"
>
解析:
</p>
<p
class=
"nr"
v-html=
"dItem.question_analysis"
></p>
<p
class=
"nr"
v-html=
"dItem.question_analysis"
></p>
...
@@ -63,7 +70,7 @@
...
@@ -63,7 +70,7 @@
</div>
</div>
<div
class=
"btn-box"
v-show=
"!topicCard.isShow"
>
<div
class=
"btn-box"
v-show=
"!topicCard.isShow"
>
<div
class=
"padd"
>
<div
class=
"padd"
>
<div
class=
"analysis"
@
click=
"analyShow"
v-if=
"$route.query.id == undefined &&
$route.query.course_id || $route.query.tag_id
"
>
查看解析
</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 left"
@
click=
"switchQuestions('left')"
v-show=
"currentNum !== 1"
>
上一题
</div>
<div
class=
"btn right"
@
click=
"switchQuestions('right')"
v-show=
"nextBtnShow"
>
下一题
</div>
<div
class=
"btn right"
@
click=
"switchQuestions('right')"
v-show=
"nextBtnShow"
>
下一题
</div>
</div>
</div>
...
@@ -109,6 +116,16 @@ export default {
...
@@ -109,6 +116,16 @@ export default {
directives
:
{
directives
:
{
swiper
:
directive
swiper
:
directive
},
},
metaInfo
()
{
if
(
this
.
$route
.
query
.
id
!==
undefined
)
{
return
{
title
:
'题目解析'
,
meta
:
[
// { vmid: 'description', name: 'description', content: this.description }
]
}
}
},
data
()
{
data
()
{
const
_this
=
this
const
_this
=
this
return
{
return
{
...
@@ -381,16 +398,19 @@ export default {
...
@@ -381,16 +398,19 @@ export default {
if
(
!
this
.
requestData
[
oData
.
id
][
cData
.
id
])
{
if
(
!
this
.
requestData
[
oData
.
id
][
cData
.
id
])
{
this
.
requestData
[
oData
.
id
][
cData
.
id
]
=
{
this
.
requestData
[
oData
.
id
][
cData
.
id
]
=
{
sign
:
false
,
sign
:
false
,
answer
:
[
checkId
]
answer
:
[
checkId
],
opaVal
:
[
cData
.
opaVal
]
}
}
}
else
{
}
else
{
this
.
requestData
[
oData
.
id
][
cData
.
id
].
answer
=
[
checkId
]
this
.
requestData
[
oData
.
id
][
cData
.
id
].
answer
=
[
checkId
]
this
.
requestData
[
oData
.
id
][
cData
.
id
].
opaVal
=
[
cData
.
opaVal
]
}
}
}
else
{
}
else
{
this
.
requestData
[
oData
.
id
]
=
{
this
.
requestData
[
oData
.
id
]
=
{
[
cData
.
id
]:
{
[
cData
.
id
]:
{
sign
:
false
,
sign
:
false
,
answer
:
[
checkId
]
answer
:
[
checkId
],
opaVal
:
[
cData
.
opaVal
]
}
}
}
}
}
}
...
@@ -406,28 +426,35 @@ export default {
...
@@ -406,28 +426,35 @@ export default {
if
(
this
.
requestData
[
oData
.
id
])
{
if
(
this
.
requestData
[
oData
.
id
])
{
if
(
this
.
requestData
[
oData
.
id
][
cData
.
id
])
{
if
(
this
.
requestData
[
oData
.
id
][
cData
.
id
])
{
const
arr
=
this
.
requestData
[
oData
.
id
][
cData
.
id
].
answer
const
arr
=
this
.
requestData
[
oData
.
id
][
cData
.
id
].
answer
const
arr2
=
this
.
requestData
[
oData
.
id
][
cData
.
id
].
opaVal
this
.
requestData
[
oData
.
id
][
cData
.
id
]
=
{
this
.
requestData
[
oData
.
id
][
cData
.
id
]
=
{
sign
:
this
.
requestData
[
oData
.
id
][
cData
.
id
].
sign
sign
:
this
.
requestData
[
oData
.
id
][
cData
.
id
].
sign
}
}
arr
.
push
(
checkId
)
arr
.
push
(
checkId
)
console
.
log
(
arr2
)
arr2
.
push
(
this
.
opaKey
[
index
])
this
.
requestData
[
oData
.
id
][
cData
.
id
].
answer
=
arr
this
.
requestData
[
oData
.
id
][
cData
.
id
].
answer
=
arr
this
.
requestData
[
oData
.
id
][
cData
.
id
].
opaVal
=
arr2
}
else
{
}
else
{
this
.
requestData
[
oData
.
id
][
cData
.
id
]
=
{
this
.
requestData
[
oData
.
id
][
cData
.
id
]
=
{
sign
:
false
,
sign
:
false
,
answer
:
[
checkId
]
answer
:
[
checkId
],
opaVal
:
[
this
.
opaKey
[
index
]]
}
}
}
}
}
else
{
}
else
{
this
.
requestData
[
oData
.
id
]
=
{
this
.
requestData
[
oData
.
id
]
=
{
[
cData
.
id
]:
{
[
cData
.
id
]:
{
sign
:
false
,
sign
:
false
,
answer
:
[
checkId
]
answer
:
[
checkId
],
opaVal
:
[
this
.
opaKey
[
index
]]
}
}
}
}
}
}
}
else
{
}
else
{
const
index
=
this
.
requestData
[
oData
.
id
][
cData
.
id
].
answer
.
indexOf
(
checkId
)
const
index
=
this
.
requestData
[
oData
.
id
][
cData
.
id
].
answer
.
indexOf
(
checkId
)
this
.
requestData
[
oData
.
id
][
cData
.
id
].
answer
.
splice
(
index
,
1
)
this
.
requestData
[
oData
.
id
][
cData
.
id
].
answer
.
splice
(
index
,
1
)
this
.
requestData
[
oData
.
id
][
cData
.
id
].
opaVal
.
splice
(
index
,
1
)
}
}
const
opa
=
this
.
opaKey
const
opa
=
this
.
opaKey
const
opaArr
=
[]
const
opaArr
=
[]
...
@@ -452,7 +479,7 @@ export default {
...
@@ -452,7 +479,7 @@ export default {
param
.
user_id
=
window
.
localStorage
.
userId
param
.
user_id
=
window
.
localStorage
.
userId
}
}
Exam
.
getExam
(
param
,
this
.
requestParam
.
papersUrl
).
then
(
res
=>
{
Exam
.
getExam
(
param
,
this
.
requestParam
.
papersUrl
).
then
(
res
=>
{
const
times
=
res
.
sheet
.
remainingTime
?
res
.
sheet
.
remainingTime
:
res
.
sheet
.
duration
const
times
=
this
.
$route
.
query
.
id
===
undefined
?
res
.
sheet
.
remainingTime
?
res
.
sheet
.
remainingTime
:
res
.
sheet
.
duration
:
res
.
sheet
.
duration
if
(
this
.
$route
.
query
.
id
===
-
1
||
this
.
$route
.
query
.
id
===
'-1'
)
{
if
(
this
.
$route
.
query
.
id
===
-
1
||
this
.
$route
.
query
.
id
===
'-1'
)
{
this
.
errorQuestion
(
res
)
this
.
errorQuestion
(
res
)
}
else
{
}
else
{
...
@@ -460,18 +487,25 @@ export default {
...
@@ -460,18 +487,25 @@ export default {
}
}
window
.
localStorage
.
userId
=
res
.
user_id
window
.
localStorage
.
userId
=
res
.
user_id
this
.
remainingTime
=
this
.
secondToDate
(
times
)
this
.
remainingTime
=
this
.
secondToDate
(
times
)
if
(
this
.
$route
.
query
.
id
===
undefined
)
{
this
.
setClock
(
times
)
this
.
setClock
(
times
)
if
(
res
.
sheet
.
status
===
1
||
res
.
sheet
.
status
===
2
)
{
if
(
res
.
sheet
.
remainingTime
===
undefined
)
{
this
.
setClock
(
res
.
sheet
.
duration
)
}
else
{
if
(
res
.
sheet
.
remainingTime
>
0
)
{
this
.
setClock
(
res
.
sheet
.
remainingTime
)
}
else
{
this
.
examEnd
()
this
.
scrollDom
()
}
}
if
(
parseInt
(
res
.
status
)
===
1
||
parseInt
(
res
.
status
)
===
2
)
{
if
(
this
.
$route
.
query
.
tag_id
!==
undefined
&&
this
.
$route
.
query
.
id
===
undefined
)
{
this
.
$emit
(
'goExamResult'
,
this
.
requestParam
)
}
}
this
.
examEnd
()
this
.
scrollDom
()
// if (res.sheet.remainingTime === undefined) {
// this.setClock(res.sheet.duration)
// } else {
// if (res.sheet.remainingTime > 0) {
// this.setClock(res.sheet.remainingTime)
// } else {
// this.examEnd()
// this.scrollDom()
// }
// }
}
}
// clearTimeout(this.cache)
// clearTimeout(this.cache)
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
@@ -489,6 +523,7 @@ export default {
...
@@ -489,6 +523,7 @@ export default {
}
}
this
.
requestData
=
res
.
answers
this
.
requestData
=
res
.
answers
this
.
requestData2
=
Object
.
keys
(
datas
).
length
this
.
requestData2
=
Object
.
keys
(
datas
).
length
console
.
log
(
this
.
requestData
)
}
else
{
}
else
{
this
.
requestData
=
{}
this
.
requestData
=
{}
this
.
requestData2
=
0
this
.
requestData2
=
0
...
@@ -534,7 +569,7 @@ export default {
...
@@ -534,7 +569,7 @@ export default {
if
(
res
.
exm_status
===
1
)
{
if
(
res
.
exm_status
===
1
)
{
clearInterval
(
this
.
initTime
)
clearInterval
(
this
.
initTime
)
clearInterval
(
this
.
clockCount
)
clearInterval
(
this
.
clockCount
)
if
(
this
.
requestParam
.
course_id
!==
undefined
||
this
.
questionsData
.
sheet
.
remainingTime
>
0
)
{
if
(
this
.
requestParam
.
course_id
!==
undefined
||
this
.
requestParam
.
tag_id
!==
undefined
||
this
.
questionsData
.
sheet
.
remainingTime
>
0
)
{
if
(
isSub
)
{
if
(
isSub
)
{
this
.
goExamResult
()
this
.
goExamResult
()
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论