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
31e8dd5f
Commit
31e8dd5f
authored
Aug 17, 2021
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
a4519573
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
100 additions
and
25 deletions
+100
-25
common.css
src/assets/css/common.css
+1
-1
question-form.vue
src/components/exam/question-form.vue
+0
-2
examEdit.vue
src/pages/exam/examEdit.vue
+99
-22
No files found.
src/assets/css/common.css
View file @
31e8dd5f
...
...
@@ -73,7 +73,7 @@
color
:
#6BA9FF
;
}
.InpDIV
{
width
:
765px
;
/* width: 765px; */
min-height
:
38px
;
border-radius
:
4px
;
border
:
1px
solid
#E1EAF4
;
...
...
src/components/exam/question-form.vue
View file @
31e8dd5f
...
...
@@ -184,12 +184,10 @@
//关闭弹窗
closeSaveForm
()
{
this
.
$emit
(
'close'
)
this
.
persistent
=
false
;
},
//确认问题
sureQuestion
()
{
this
.
$emit
(
'success'
,
this
.
selectedQuestion
)
this
.
persistent
=
false
;
},
},
}
...
...
src/pages/exam/examEdit.vue
View file @
31e8dd5f
...
...
@@ -639,7 +639,6 @@
},
//添加问题
AddQuestion
(
qArray
)
{
console
.
log
(
"qArray"
,
qArray
)
if
(
this
.
DataObj
)
{
if
(
!
this
.
DataObj
.
GroupList
)
{
this
.
DataObj
.
GroupList
=
[];
...
...
@@ -760,7 +759,9 @@
if
(
x
.
DetailsList
&&
x
.
DetailsList
.
length
>
0
)
{
this
.
examNum
+=
x
.
DetailsList
.
length
;
x
.
DetailsList
.
forEach
(
y
=>
{
this
.
examScore
+=
parseInt
(
y
.
Score
);
if
(
y
.
Score
){
this
.
examScore
+=
parseInt
(
y
.
Score
);
}
})
}
})
...
...
@@ -772,32 +773,106 @@
this
.
ComCheckIndex
=
index2
;
this
.
ChooseItem
=
questionItem
;
this
.
$refs
.
UE_Title
.
reloadNewValue
();
console
.
log
(
this
.
ChooseItem
,
'choose'
)
this
.
$forceUpdate
();
},
//保存题目
SavePaper
()
{
savePaperInfo
(
this
.
DataObj
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
'操作成功!'
,
position
:
'top'
})
this
.
$router
.
push
({
path
:
'/exam/examManagement'
,
query
:
{}
});
}
else
{
this
.
$q
.
notify
({
type
:
'negative'
,
position
:
"top"
,
message
:
`操作失败!`
})
console
.
log
(
this
.
DataObj
,
'dataobj'
);
console
.
log
(
this
.
validateType
());
return
if
(
this
.
validateType
()){
savePaperInfo
(
this
.
DataObj
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
'操作成功!'
,
position
:
'top'
})
this
.
$router
.
push
({
path
:
'/exam/examManagement'
,
query
:
{}
});
}
else
{
this
.
$q
.
notify
({
type
:
'negative'
,
position
:
"top"
,
message
:
`操作失败!`
})
}
})
}
},
//验证
validateType
()
{
var
result
=
true
;
for
(
let
k
=
0
;
k
<
this
.
DataObj
.
GroupList
.
length
;
k
++
){
//连线题
if
(
this
.
DataObj
.
GroupList
[
k
].
QuestionTypeKey
==
'matching'
)
{
for
(
let
j
=
0
;
j
<
this
.
DataObj
.
GroupList
[
k
].
DetailsList
.
length
;
j
++
){
if
(
this
.
DataObj
.
GroupList
[
k
].
DetailsList
[
j
].
QuestionContentObj
.
length
>
0
){
for
(
let
p
=
0
;
p
<
this
.
DataObj
.
GroupList
[
k
].
DetailsList
[
j
].
QuestionContentObj
[
0
].
length
;
p
++
){
if
(
this
.
DataObj
.
GroupList
[
k
].
DetailsList
[
j
].
QuestionContentObj
[
0
][
p
].
Content
==
''
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
position
:
"top"
,
message
:
`第一组第
${
p
+
1
}
行数据内容为空!`
})
result
=
false
;
return
;
}
}
}
}
}
})
}
return
result
;
},
//js 判断重复
isRepeat
(
Arr
,
type
)
{
var
result
=
true
;
var
msg
=
''
;
switch
(
type
)
{
case
1
:
msg
=
'第1组数据选项不能相同'
break
;
case
2
:
msg
=
'第2组数据选项不能相同'
break
;
case
3
:
msg
=
'选项内容不能相同'
break
;
case
4
:
msg
=
'题干内容不能相同!'
;
break
;
default
:
}
let
num
=
0
;
for
(
var
i
=
0
;
i
<
Arr
.
length
-
1
;
i
++
)
{
for
(
var
j
=
i
+
1
;
j
<
Arr
.
length
;
j
++
)
{
if
(
Arr
[
i
].
Content
===
Arr
[
j
].
Content
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
position
:
"top"
,
message
:
msg
})
num
++
;
}
}
}
if
(
num
>
0
)
{
result
=
false
;
}
else
{
result
=
true
;
}
return
result
;
},
closeQuestForm
()
{
this
.
isShowQuestion
=
false
;
},
...
...
@@ -809,6 +884,7 @@
var
qObj
=
this
.
getDetailsObj
();
qObj
.
QuestionId
=
eItem
.
QuestionId
;
qObj
.
Title
=
eItem
.
SourceTitle
;
qObj
.
ShowTitle
=
eItem
.
SourceTitle
;
qObj
.
QuestionContent
=
eItem
.
QuestionContent
;
qObj
.
DifficultyType
=
eItem
.
DifficultyType
;
qObj
.
AnswerParse
=
eItem
.
AnswerParse
;
...
...
@@ -834,6 +910,7 @@
});
}
this
.
AddQuestion
(
tempArray
);
this
.
isShowQuestion
=
false
;
},
//删除分组及问题
removeFather
(
item
,
index
)
{
...
...
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