Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
confucius
Commits
ca1218f3
Commit
ca1218f3
authored
Aug 18, 2021
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
11103e1f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
14 deletions
+23
-14
paperEdit.vue
src/pages/exam/paperEdit.vue
+23
-14
No files found.
src/pages/exam/paperEdit.vue
View file @
ca1218f3
...
@@ -451,7 +451,7 @@
...
@@ -451,7 +451,7 @@
watch
:
{
watch
:
{
'ChooseItem.Title'
:
{
'ChooseItem.Title'
:
{
handler
(
newValue
)
{
handler
(
newValue
)
{
this
.
ChooseItem
.
ShowTitle
=
newValue
;
this
.
ChooseItem
.
ShowTitle
=
this
.
getRegItem
(
newValue
)
;
},
},
deep
:
true
deep
:
true
},
},
...
@@ -800,9 +800,16 @@
...
@@ -800,9 +800,16 @@
this
.
ChooseItem
.
AnswerParse
=
questionItem
.
AnswerParse
;
this
.
ChooseItem
.
AnswerParse
=
questionItem
.
AnswerParse
;
this
.
$forceUpdate
();
this
.
$forceUpdate
();
},
},
//正则匹配替换
getRegItem
(
val
){
let
Item
=
val
.
replace
(
/<iframe
(([\s\S])
*
?)
<
\/
iframe>/ig
,
'[音频]'
).
replace
(
/<img.*
?(?:
>|
\/
>
)
/gi
,
'[图片]'
);
return
Item
},
//保存题目
//保存题目
SavePaper
()
{
SavePaper
()
{
if
(
this
.
validateType
())
{
if
(
this
.
validateType
())
{
console
.
log
(
'进入'
);
return
;
savePaperInfo
(
this
.
DataObj
).
then
(
res
=>
{
savePaperInfo
(
this
.
DataObj
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
if
(
res
.
Code
==
1
)
{
this
.
$q
.
notify
({
this
.
$q
.
notify
({
...
@@ -848,10 +855,10 @@
...
@@ -848,10 +855,10 @@
}
}
}
}
}
}
//单选题
//单选题 多选题
if
(
this
.
DataObj
.
GroupList
[
k
].
QuestionTypeKey
==
'single'
)
{
if
(
this
.
DataObj
.
GroupList
[
k
].
QuestionTypeKey
==
'single'
||
this
.
DataObj
.
GroupList
[
k
].
QuestionTypeKey
==
'multiple'
)
{
var
Num
=
0
;
for
(
let
i
=
0
;
i
<
this
.
DataObj
.
GroupList
[
k
].
DetailsList
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
DataObj
.
GroupList
[
k
].
DetailsList
.
length
;
i
++
)
{
var
Num
=
0
;
if
(
this
.
DataObj
.
GroupList
[
k
].
DetailsList
[
i
].
Title
==
''
)
{
if
(
this
.
DataObj
.
GroupList
[
k
].
DetailsList
[
i
].
Title
==
''
)
{
this
.
$q
.
notify
({
this
.
$q
.
notify
({
type
:
'negative'
,
type
:
'negative'
,
...
@@ -875,18 +882,20 @@
...
@@ -875,18 +882,20 @@
Num
++
Num
++
}
}
}
}
}
if
(
Num
==
0
)
{
if
(
Num
==
0
)
{
this
.
$q
.
notify
({
this
.
$q
.
notify
({
type
:
'negative'
,
type
:
'negative'
,
position
:
"top"
,
position
:
"top"
,
message
:
`请设置单选
题答案选项`
message
:
`请设置
${
this
.
DataObj
.
GroupList
[
k
].
GroupName
}
第
${
i
+
1
}
题答案选项`
})
})
result
=
false
;
result
=
false
;
return
;
return
;
}
}
}
}
}
}
//填空题
}
return
result
;
return
result
;
},
},
//js 判断重复
//js 判断重复
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment