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
3f0e8b5e
Commit
3f0e8b5e
authored
Aug 27, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
1ec9e74c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
341 additions
and
299 deletions
+341
-299
questionconfig.js
src/api/question/questionconfig.js
+247
-0
question-form.vue
src/components/question/question-form.vue
+94
-298
paperEdit.vue
src/pages/exam/paperEdit.vue
+0
-1
No files found.
src/api/question/questionconfig.js
View file @
3f0e8b5e
...
@@ -250,6 +250,7 @@ export function judgeValidate(gName, detailsList) {
...
@@ -250,6 +250,7 @@ export function judgeValidate(gName, detailsList) {
}
}
return
message
;
return
message
;
}
}
/**
/**
* 【简答题、名词解释、论述题、计算题、其它题】验证
* 【简答题、名词解释、论述题、计算题、其它题】验证
*/
*/
...
@@ -440,3 +441,249 @@ export function sharingchooseValidate(gName, detailsList) {
...
@@ -440,3 +441,249 @@ export function sharingchooseValidate(gName, detailsList) {
}
}
return
message
;
return
message
;
}
}
/**
*【题库使用--单题目验证】 (单选题、多选题、数字选择题 验证)
*/
export
function
questionBankChooseValidate
(
gName
,
AnswerList
,
qObj
)
{
var
message
=
""
;
if
(
qObj
&&
qObj
.
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】问题内容!`
;
return
message
;
}
if
(
AnswerList
&&
AnswerList
.
length
>
0
)
{
var
Num
=
0
;
for
(
let
j
=
0
;
j
<
AnswerList
.
length
;
j
++
)
{
if
(
AnswerList
[
j
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】,选项
${
AnswerList
[
j
].
Name
}
内容!`
;
return
message
;
}
if
(
AnswerList
[
j
].
IsAnswer
)
{
Num
++
}
}
if
(
Num
==
0
)
{
message
=
`请设置【
${
gName
}
】正确答案!`
;
return
message
;
}
}
return
message
;
}
/**
* 【题库使用--单题目验证】 (填空题、分录题、资料题 验证)
*/
export
function
questionBankFillInValidate
(
gName
,
AnswerList
,
qObj
)
{
var
message
=
""
;
if
(
qObj
&&
qObj
.
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】问题内容!`
;
return
message
;
}
if
(
AnswerList
&&
AnswerList
.
length
>
0
)
{
for
(
let
j
=
0
;
j
<
AnswerList
.
length
;
j
++
)
{
if
(
AnswerList
[
j
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】,第
${
j
+
1
}
空 答案!`
;
return
message
;
}
}
}
return
message
;
}
/**
* 【题库使用--单题目验证】 (判断题 验证)
*/
export
function
questionBankJudgeValidate
(
gName
,
qObj
)
{
var
message
=
""
;
if
(
qObj
&&
qObj
.
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】问题内容!`
;
return
message
;
}
return
message
;
}
/**
* 【题库使用--单题目验证】 (简答题、名词解释、论述题、计算题、其它题 验证)
*/
export
function
questionBankShortanswerValidate
(
gName
,
qObj
)
{
var
message
=
""
;
if
(
qObj
)
{
if
(
qObj
.
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】问题内容!`
;
return
message
;
}
if
(
qObj
.
Answer
==
''
)
{
message
=
`请填写【
${
gName
}
】问题答案!`
;
return
message
;
}
}
return
message
;
}
/**
* 【题库使用--单题目验证】 (连线题 验证)
*/
export
function
questionBankMatchingValidate
(
gName
,
AnswerList
,
qObj
)
{
var
message
=
""
;
if
(
qObj
&&
qObj
.
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】问题内容!`
;
return
message
;
}
if
(
AnswerList
)
{
if
(
AnswerList
.
length
>
0
)
{
for
(
let
p
=
0
;
p
<
AnswerList
[
0
].
length
;
p
++
)
{
if
(
AnswerList
[
0
][
p
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】 第一组 选项
${
AnswerList
[
0
][
p
].
Name
}
内容!`
return
message
;
}
}
}
if
(
AnswerList
.
length
>
1
)
{
for
(
let
p
=
0
;
p
<
AnswerList
[
1
].
length
;
p
++
)
{
if
(
AnswerList
[
1
][
p
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】 第二组 选项
${
AnswerList
[
1
][
p
].
Name
}
内容!`
return
message
;
}
}
}
}
return
message
;
}
/**
* 【题库使用--单题目验证】 (排序题 验证)
*/
export
function
questionBankSortingproblemValidate
(
gName
,
AnswerList
,
qObj
)
{
var
message
=
""
;
if
(
qObj
&&
qObj
.
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】问题内容!`
;
return
message
;
}
if
(
AnswerList
&&
AnswerList
.
length
>
0
)
{
for
(
let
j
=
0
;
j
<
AnswerList
[
0
].
length
;
j
++
)
{
if
(
AnswerList
[
0
][
j
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】 选项
${
AnswerList
[
0
][
j
].
Name
}
内容!`
return
message
;
}
}
}
return
message
;
}
/**
*【题库使用--单题目验证】 (完型填空 验证)
*/
export
function
questionBankClozeValidate
(
gName
,
AnswerList
,
qObj
)
{
var
message
=
""
;
if
(
qObj
&&
qObj
.
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】问题内容!`
;
return
message
;
}
if
(
AnswerList
&&
AnswerList
.
length
>
0
)
{
for
(
let
j
=
0
;
j
<
AnswerList
.
length
;
j
++
)
{
var
Num
=
0
;
for
(
var
k
=
0
;
k
<
AnswerList
[
j
].
length
;
k
++
)
{
if
(
AnswerList
[
j
][
k
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
j
+
1
}
小题 选项
${
AnswerList
[
j
][
k
].
Name
}
内容!`
;
return
message
;
}
if
(
AnswerList
[
j
][
k
].
IsAnswer
)
{
Num
++
}
}
if
(
Num
==
0
)
{
message
=
`请设置【
${
gName
}
】,第
${
j
+
1
}
小题 正确答案!`
;
return
message
;
}
}
}
return
message
;
}
/**
* 【题库使用--单题目验证】 (阅读理解、听力题 验证)
*/
export
function
questionBankReadingcomprehensioValidate
(
gName
,
AnswerList
,
qObj
)
{
var
message
=
""
;
if
(
qObj
&&
qObj
.
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】问题内容!`
;
return
message
;
}
if
(
AnswerList
&&
AnswerList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
AnswerList
.
length
;
i
++
)
{
var
subQuestion
=
AnswerList
[
i
];
if
(
subQuestion
)
{
if
(
subQuestion
.
SubTitle
==
''
)
{
message
=
`请填写【
${
gName
}
】,第
${
i
+
1
}
小题 问题内容!`
;
return
message
;
}
//单选题、多选题
if
(
subQuestion
.
QuestionKey
==
'single'
||
subQuestion
.
QuestionKey
==
"multiple"
)
{
var
singleNum
=
0
;
for
(
var
k
=
0
;
k
<
subQuestion
.
SubAnwser
.
length
;
k
++
)
{
if
(
subQuestion
.
SubAnwser
[
k
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】,第
${
i
+
1
}
小题 选项
${
subQuestion
.
SubAnwser
[
k
].
Name
}
内容!`
;
return
message
;
}
if
(
subQuestion
.
SubAnwser
[
k
].
IsAnswer
)
{
singleNum
++
}
}
if
(
singleNum
==
0
)
{
message
=
`请设置【
${
gName
}
】,第
${
i
+
1
}
小题 正确答案!`
;
return
message
;
}
}
//填空题
if
(
subQuestion
.
QuestionKey
==
"fill-in"
)
{
for
(
var
k
=
0
;
k
<
subQuestion
.
SubAnwser
.
length
;
k
++
)
{
if
(
subQuestion
.
SubAnwser
[
k
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】,第
${
i
+
1
}
小题 第
${
k
+
1
}
空答案!`
;
return
message
;
}
}
}
//简答题
if
(
subQuestion
.
QuestionKey
==
"short-answer"
)
{
for
(
var
k
=
0
;
k
<
subQuestion
.
SubAnwser
.
length
;
k
++
)
{
if
(
subQuestion
.
SubAnwser
[
k
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】,第
${
i
+
1
}
小题答案!`
;
return
message
;
}
}
}
}
}
}
return
message
;
}
/**
* 【题库使用--单题目验证】 (公用选项题 验证)
*/
export
function
questionBankSharingchooseValidate
(
gName
,
AnswerList
)
{
var
message
=
""
;
if
(
AnswerList
&&
AnswerList
.
length
>
0
)
{
for
(
var
j
=
0
;
j
<
AnswerList
[
0
].
length
;
j
++
)
{
if
(
AnswerList
[
0
][
j
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】,第一组 选项
${
AnswerList
[
0
][
j
].
Name
}
内容!`
;
return
message
;
}
}
for
(
var
j
=
0
;
j
<
AnswerList
[
1
].
length
;
j
++
)
{
if
(
AnswerList
[
1
][
j
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】,第二组 题干
${
j
+
1
}
内容!`
;
return
message
;
}
if
(
AnswerList
[
1
][
j
].
Name
==
''
)
{
message
=
`请选择【
${
gName
}
】, 第二组 题干
${
j
+
1
}
答案!`
;
return
message
;
}
}
return
message
;
}
}
src/components/question/question-form.vue
View file @
3f0e8b5e
This diff is collapsed.
Click to expand it.
src/pages/exam/paperEdit.vue
View file @
3f0e8b5e
...
@@ -650,7 +650,6 @@
...
@@ -650,7 +650,6 @@
sItem
.
Score
=
avgScore
;
sItem
.
Score
=
avgScore
;
})
})
}
}
},
},
//上移下移(IsUp:0上移,1下移)
//上移下移(IsUp:0上移,1下移)
MoveFatherItem
(
subIndex
,
IsUp
)
{
MoveFatherItem
(
subIndex
,
IsUp
)
{
...
...
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