Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-qa
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-qa
Commits
15bafdeb
提交
15bafdeb
authored
2月 28, 2022
作者:
pengxiaohui
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
https://gitlab-pro.ezijing.com/ezijing-web/qbs
上级
a6cadadb
377a5bf5
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
162 行增加
和
53 行删除
+162
-53
ExamSetting.vue
src/modules/exam/components/ExamSetting.vue
+2
-2
Detail.vue
src/modules/exam/views/Detail.vue
+3
-5
api.js
src/modules/question/api.js
+13
-0
AddChidren.vue
src/modules/question/components/AddChidren.vue
+10
-11
QTypeCheckbox.vue
src/modules/question/components/QTypeCheckbox.vue
+8
-2
QTypeJudgment.vue
src/modules/question/components/QTypeJudgment.vue
+7
-4
QTypeRadio.vue
src/modules/question/components/QTypeRadio.vue
+4
-1
QTypeSituation.vue
src/modules/question/components/QTypeSituation.vue
+24
-15
QuestionsChidren.vue
src/modules/question/components/QuestionsChidren.vue
+6
-6
importQuestion.vue
src/modules/question/components/importQuestion.vue
+69
-0
Create.vue
src/modules/question/views/Create.vue
+7
-2
List.vue
src/modules/question/views/List.vue
+9
-5
没有找到文件。
src/modules/exam/components/ExamSetting.vue
浏览文件 @
15bafdeb
...
...
@@ -110,7 +110,7 @@ export default {
type
:
'config'
,
config
:
{
enabled_ip_limit
:
this
.
config
.
enabled_ip_limit
,
ip_limits
:
this
.
config
.
ip_limits
,
ip_limits
:
this
.
config
.
ip_limits
.
toString
()
,
enabled_promise
:
this
.
config
.
enabled_promise
,
enabled_lock
:
this
.
config
.
enabled_lock
,
max_login_times
:
this
.
config
.
max_login_times
,
...
...
@@ -132,7 +132,7 @@ export default {
getExamPaperDetail
(
params
).
then
(
res
=>
{
const
config
=
JSON
.
parse
(
res
.
data
.
exam_info
.
config
)
this
.
config
.
enabled_ip_limit
=
config
.
enabled_ip_limit
this
.
config
.
ip_limits
=
config
.
ip_limits
this
.
config
.
ip_limits
=
config
.
ip_limits
.
toString
()
this
.
config
.
enabled_promise
=
config
.
enabled_promise
this
.
config
.
enabled_lock
=
config
.
enabled_lock
this
.
config
.
max_login_times
=
config
.
max_login_times
...
...
src/modules/exam/views/Detail.vue
浏览文件 @
15bafdeb
...
...
@@ -13,9 +13,7 @@
<el-dropdown-item
@
click
.
native=
"dialogVisible = true"
:disabled=
"this.multipleSelection.length === 0"
>
转移考生
</el-dropdown-item
>
<el-dropdown-item
@
click
.
native=
"exportDetail"
:disabled=
"this.multipleSelection.length === 0"
>
导出明细
</el-dropdown-item
>
<el-dropdown-item
@
click
.
native=
"exportDetail"
>
导出明细
</el-dropdown-item>
<el-dropdown-item
@
click
.
native=
"delStudent"
:disabled=
"this.multipleSelection.length === 0"
>
删除考生
</el-dropdown-item
>
...
...
@@ -113,13 +111,13 @@ export default {
columns
:
[
{
type
:
'selection'
,
minWidth
:
'50px'
,
fixed
:
'left'
},
{
label
:
'
考生
状态'
,
label
:
'
试卷
状态'
,
prop
:
'sheet.status'
,
computed
({
row
})
{
if
(
row
.
sheet
.
status
===
0
)
{
return
'未提交'
}
else
if
(
row
.
sheet
.
status
===
1
)
{
return
'
已提交
'
return
'
待批阅
'
}
else
if
(
row
.
sheet
.
status
===
2
)
{
return
'已批改'
}
...
...
src/modules/question/api.js
浏览文件 @
15bafdeb
...
...
@@ -55,3 +55,16 @@ export function updateQuestion(id, data) {
export
function
questionDetail
(
id
)
{
return
httpRequest
.
get
(
`/api/qbs/admin/v1/question/
${
id
}
`
)
}
/**
* 导入题
*/
export
function
importQuestion
(
data
)
{
return
httpRequest
({
url
:
'/api/qbs/admin/v1/question/import/x1'
,
method
:
'post'
,
headers
:
{
'Content-Type'
:
'multipart/form-data'
},
timeout
:
900000
,
data
,
withCredentials
:
true
})
}
src/modules/question/components/AddChidren.vue
浏览文件 @
15bafdeb
...
...
@@ -84,10 +84,7 @@ export default {
{
label
:
'单选题'
,
value
:
1
},
{
label
:
'多选题'
,
value
:
2
},
{
label
:
'问答题'
,
value
:
3
},
{
label
:
'案例题'
,
value
:
5
},
{
label
:
'判断题'
,
value
:
6
},
{
label
:
'实操题'
,
value
:
7
},
{
label
:
'情景题'
,
value
:
8
}
{
label
:
'判断题'
,
value
:
6
}
]
},
{
...
...
@@ -125,6 +122,7 @@ export default {
remote
:
{
httpRequest
:
getAppList
,
params
:
{
question_types
:
[
1
,
2
,
3
,
6
],
permission
:
this
.
questionBank
,
project_prefix
:
'x1'
,
question_category
:
this
.
treeValue
.
id
...
...
@@ -141,8 +139,9 @@ export default {
2
:
'中'
,
3
:
'难'
}
return
data
.
data
.
reduce
((
a
,
b
)
=>
{
return
data
.
data
.
reduce
((
a
,
b
,
index
)
=>
{
const
type
=
b
.
question_type
b
.
order
=
index
+
1
b
.
question_type
=
questionType
[
b
.
question_type
]
b
.
question_difficulty
=
questionDifficulty
[
b
.
question_difficulty
]
if
(
type
!==
5
&&
type
!==
7
&&
type
!==
8
)
a
.
push
(
b
)
...
...
@@ -152,7 +151,7 @@ export default {
},
columns
:
[
{
type
:
'selection'
,
minWidth
:
'50px'
,
fixed
:
'left'
},
{
label
:
'序号'
,
prop
:
'
question_
order'
},
{
label
:
'序号'
,
prop
:
'order'
},
{
label
:
'题目类型'
,
prop
:
'question_type'
},
{
label
:
'试题分类'
,
prop
:
'question_category.category_name'
},
{
label
:
'题目标题'
,
prop
:
'question_title'
},
...
...
@@ -195,14 +194,14 @@ export default {
if
(
this
.
type
!==
3
)
{
if
(
this
.
type
===
1
||
this
.
type
===
2
)
{
options
=
[
{
option
:
''
,
checked
:
true
},
{
option
:
''
,
checked
:
false
},
{
option
:
''
,
checked
:
false
}
{
option
:
''
,
checked
:
true
,
id
:
'0'
},
{
option
:
''
,
checked
:
false
,
id
:
'0'
},
{
option
:
''
,
checked
:
false
,
id
:
'0'
}
]
}
else
{
options
=
[
{
option
:
'正确'
,
checked
:
true
},
{
option
:
'错误'
,
checked
:
false
}
{
option
:
'正确'
,
checked
:
true
,
id
:
'0'
},
{
option
:
'错误'
,
checked
:
false
,
id
:
'0'
}
]
}
data
.
question_options
=
options
...
...
src/modules/question/components/QTypeCheckbox.vue
浏览文件 @
15bafdeb
<
template
>
<div
class=
"radio-box"
>
<template
v-for=
"(item, index) in
option ||
datas"
>
<template
v-for=
"(item, index) in datas"
>
<div
class=
"opt"
:key=
"index"
>
<el-checkbox
v-model=
"checkboxValue"
:label=
"index"
@
change=
"checkboxChange"
>
<el-tag>
{{
A_Z
()[
index
]
}}
</el-tag>
...
...
@@ -44,7 +44,13 @@ export default {
}
},
mounted
()
{
if
(
this
.
option
)
this
.
datas
=
this
.
option
if
(
this
.
option
)
{
this
.
datas
=
this
.
option
this
.
checkboxValue
=
[
0
]
this
.
datas
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
checked
)
this
.
checkboxValue
.
push
(
index
)
})
}
},
methods
:
{
add
()
{
...
...
src/modules/question/components/QTypeJudgment.vue
浏览文件 @
15bafdeb
<
template
>
<div>
<el-radio
v-model=
"radio"
label=
"0"
@
change=
"radioChange"
><i
class=
"el-icon-check"
></i></el-radio>
<el-radio
v-model=
"radio"
label=
"1"
@
change=
"radioChange"
><i
class=
"el-icon-close"
></i></el-radio>
<el-radio
v-model=
"radio"
:label=
0
@
change=
"radioChange"
><i
class=
"el-icon-check"
></i></el-radio>
<el-radio
v-model=
"radio"
:label=
1
@
change=
"radioChange"
><i
class=
"el-icon-close"
></i></el-radio>
</div>
</
template
>
...
...
@@ -14,7 +14,7 @@ export default {
},
data
()
{
return
{
radio
:
'0'
,
radio
:
0
,
datas
:
[
{
option
:
'正确'
,
...
...
@@ -28,7 +28,10 @@ export default {
}
},
mounted
()
{
if
(
this
.
option
)
this
.
datas
=
this
.
option
if
(
this
.
option
)
{
this
.
datas
=
this
.
option
this
.
radio
=
this
.
datas
.
findIndex
(
item
=>
item
.
checked
)
}
},
methods
:
{
radioChange
()
{
...
...
src/modules/question/components/QTypeRadio.vue
浏览文件 @
15bafdeb
...
...
@@ -41,7 +41,10 @@ export default {
}
},
mounted
()
{
if
(
this
.
option
)
this
.
datas
=
this
.
option
if
(
this
.
option
)
{
this
.
datas
=
this
.
option
this
.
radioValue
=
this
.
datas
.
findIndex
(
item
=>
item
.
checked
)
}
},
methods
:
{
add
()
{
...
...
src/modules/question/components/QTypeSituation.vue
浏览文件 @
15bafdeb
<
template
>
<div>
<div
class=
"tool-btn"
>
<div
class=
"tool-btn"
v-if=
"!!!($route.query.type === 'view')"
>
<el-button
type=
"primary"
@
click=
"drawer = true"
>
添加子题目
</el-button>
<el-button
type=
"primary"
@
click=
"
resetForm('ruleForm')
"
>
保存主题目
</el-button>
<el-button
type=
"primary"
@
click=
"
cacheQuestion
"
>
保存主题目
</el-button>
</div>
<el-form
:model=
"ruleForm"
:rules=
"rules"
ref=
"ruleForm"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-form
:
disabled=
"!!($route.query.type === 'view')"
:
model=
"ruleForm"
:rules=
"rules"
ref=
"ruleForm"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"题库范围"
prop=
"permission"
>
<el-radio
v-model=
"ruleForm.permission"
label=
"1"
>
我的题库
</el-radio>
<el-radio
v-model=
"ruleForm.permission"
label=
"2"
>
公共题库
</el-radio>
...
...
@@ -25,7 +25,7 @@
<el-input
v-model=
"ruleForm.question_title"
></el-input>
</el-form-item>
<el-form-item
label=
"公共题干"
prop=
"common_content"
>
<v-editor
v-model=
"ruleForm.common_content"
></v-editor>
<v-editor
:disabled=
"!!($route.query.type === 'view')"
v-model=
"ruleForm.common_content"
></v-editor>
</el-form-item>
<!--
</el-form-item>
-->
<!--
<el-form-item>
-->
...
...
@@ -68,7 +68,7 @@
<questions-chidren
:chidrenList=
"chidrenList"
@
submitForm=
"submitForm"
@
addChidren=
"drawer = true
"
@
cacheChidren=
"cacheQuestion
"
></questions-chidren>
<el-drawer
size=
"90%"
title=
"新建试题"
:visible
.
sync=
"drawer"
direction=
"rtl"
:before-close=
"handleCloseDrawer"
>
<add-chidren
@
haveQuestion=
"haveQuestion"
@
questionList=
"questionList"
:dataForm=
"ruleForm"
></add-chidren>
...
...
@@ -135,6 +135,7 @@ export default {
}
},
created
()
{
this
.
ruleForm
.
question_type
=
this
.
questionTypeNumber
if
(
this
.
detailData
)
{
this
.
ruleForm
=
this
.
detailData
this
.
treeValue
.
name
=
this
.
detailData
.
question_category
.
category_name
...
...
@@ -143,11 +144,15 @@ export default {
this
.
pointOptions
.
push
(
this
.
detailData
.
knowledge_point
)
this
.
ruleForm
.
knowledge_point
=
this
.
detailData
.
knowledge_point
.
id
this
.
chidrenList
=
this
.
ruleForm
.
children
console
.
log
(
this
.
ruleForm
,
'123'
)
}
else
{
const
cacheData
=
window
.
localStorage
.
cacheQuestion
if
(
cacheData
)
this
.
ruleForm
=
JSON
.
parse
(
cacheData
).
form
this
.
treeValue
=
JSON
.
parse
(
cacheData
).
tree
this
.
pointOptions
=
JSON
.
parse
(
cacheData
).
pointOptions
this
.
chidrenList
=
JSON
.
parse
(
cacheData
).
children
}
},
mounted
()
{
this
.
ruleForm
.
question_type
=
this
.
questionTypeNumber
this
.
getTreeList
()
},
methods
:
{
...
...
@@ -168,16 +173,20 @@ export default {
path
:
'/question/list'
})
})
window
.
localStorage
.
removeItem
(
'cacheQuestion'
)
}
},
resetForm
(
formName
)
{
this
.
$refs
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
console
.
log
(
this
.
chidrenList
)
}
else
{
console
.
log
(
'error submit!!'
)
return
false
}
cacheQuestion
()
{
const
cacheData
=
{
form
:
this
.
ruleForm
,
tree
:
this
.
treeValue
,
pointOptions
:
this
.
pointOptions
,
children
:
this
.
chidrenList
}
window
.
localStorage
.
cacheQuestion
=
JSON
.
stringify
(
cacheData
)
this
.
$message
({
message
:
'保存成功'
,
type
:
'success'
})
},
questionTypeChange
()
{
...
...
src/modules/question/components/QuestionsChidren.vue
浏览文件 @
15bafdeb
<
template
>
<div>
<el-form
:model=
"data"
ref=
"ruleForm"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-form
:
disabled=
"!!($route.query.type === 'view')"
:
model=
"data"
ref=
"ruleForm"
label-width=
"100px"
class=
"demo-ruleForm"
>
<div
v-for=
"(ruleForm, index) in dataList"
:key=
"index"
>
<el-divider
content-position=
"center"
class=
"divider"
>
子题目
{{
index
+
1
}}
</el-divider>
<el-form-item
style=
"text-align: right;"
>
<el-button
type=
"primary"
@
click=
"$emit('
addChidren')"
>
添加
子题目
</el-button>
<el-form-item
style=
"text-align: right;"
v-if=
"!!!($route.query.type === 'view')"
>
<el-button
type=
"primary"
@
click=
"$emit('
cacheChidren')"
>
保存
子题目
</el-button>
<el-button
type=
"primary"
@
click=
"removeChidren(index)"
>
删除子题目
</el-button>
</el-form-item>
<el-form-item
label=
"子题目类型"
prop=
"child_question_type"
>
...
...
@@ -19,7 +19,7 @@
<el-input
v-model=
"ruleForm.question_title"
></el-input>
</el-form-item>
<el-form-item
label=
"子题目内容"
prop=
"question_content"
>
<v-editor
v-model=
"ruleForm.question_content"
></v-editor>
<v-editor
:disabled=
"!!($route.query.type === 'view')"
v-model=
"ruleForm.question_content"
></v-editor>
</el-form-item>
<el-form-item
label=
"选项"
prop=
"question_options"
v-if=
"ruleForm.child_question_type != 3"
>
<!-- 单选题 -->
...
...
@@ -30,10 +30,10 @@
<judgment
ref=
"options"
:option=
"ruleForm.question_options"
v-if=
"ruleForm.child_question_type == 6"
></judgment>
</el-form-item>
<el-form-item
label=
"子题目解析"
prop=
"question_analysis"
>
<v-editor
v-model=
"ruleForm.question_analysis"
></v-editor>
<v-editor
:disabled=
"!!($route.query.type === 'view')"
v-model=
"ruleForm.question_analysis"
></v-editor>
</el-form-item>
<el-form-item
style=
"text-align: center;"
v-if=
"index + 1 == dataList.length"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
保存
</el-button>
<el-button
v-if=
"!!!($route.query.type === 'view')"
type=
"primary"
@
click=
"submitForm"
>
保存
</el-button>
</el-form-item>
</div>
</el-form>
...
...
src/modules/question/components/importQuestion.vue
0 → 100644
浏览文件 @
15bafdeb
<
template
>
<el-dialog
v-bind=
"$attrs"
v-on=
"$listeners"
>
<el-upload
style=
"text-align: center"
class=
"file-import"
ref=
"upload"
action=
"#"
:auto-upload=
"false"
:file-list=
"fileList"
:limit=
"1"
:before-upload=
"beforeUpload"
:http-request=
"fetchFileUpload"
accept=
".xls,.xlsx"
drag
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
</el-upload>
<div
style=
"text-align: center"
>
<el-button
size=
"mini"
@
click=
"cancel"
>
取消
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"submitUpload"
style=
"margin-right: 5px"
>
确认提交
</el-button>
</div>
</el-dialog>
</
template
>
<
script
>
import
{
splitStrLast
}
from
'@/utils/util'
import
{
importQuestion
}
from
'../api'
export
default
{
props
:
{
id
:
{
type
:
String
,
default
:
''
}
},
data
()
{
return
{
fileList
:
[]
}
},
methods
:
{
beforeUpload
(
file
)
{
const
suffix
=
splitStrLast
(
file
.
name
,
'.'
)
if
(
!
[
'xlsx'
,
'xls'
].
includes
(
suffix
))
{
this
.
$message
.
error
(
'只能上传excel文件'
)
return
false
}
else
{
return
true
}
},
fetchFileUpload
(
data
)
{
importQuestion
({
file
:
data
.
file
,
exam_id
:
this
.
id
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
$message
.
success
(
'导入数据成功'
)
history
.
go
(
0
)
}
})
},
submitUpload
()
{
this
.
$refs
.
upload
.
submit
()
},
cancel
()
{
this
.
$router
.
push
({
name
:
'teacher'
})
}
}
}
</
script
>
src/modules/question/views/Create.vue
浏览文件 @
15bafdeb
<
template
>
<app-card>
<template
v-if=
"[1, 2, 3, 6].includes(questionTypeNum)"
>
<template
v-if=
"[1, 2, 3, 6].includes(questionTypeNum)
&& !cacheData
"
>
<template
v-if=
"$route.query.id"
>
<detail
v-if=
"Object.keys(detailData).length"
:detailData=
"detailData"
@
questionType=
"questionType"
></detail>
</
template
>
...
...
@@ -10,7 +10,7 @@
<template
v-if=
"$route.query.id"
>
<situation-question
v-if=
"$route.query.id && Object.keys(detailData).length"
:detailData=
"detailData"
:questionTypeNumber=
"questionTypeNum"
@
questionType=
"questionType"
></situation-question>
</
template
>
<situation-question
v-else
:questionTypeNumber=
"questionTypeNum"
@
questionType=
"questionType"
></situation-question>
<situation-question
v-else
:questionTypeNumber=
"questionTypeNum"
@
questionType=
"questionType"
></situation-question>
</template>
</app-card>
</template>
...
...
@@ -27,6 +27,11 @@ export default {
detailData
:
{}
}
},
computed
:
{
cacheData
()
{
return
window
.
localStorage
.
cacheQuestion
}
},
mounted
()
{
if
(
this
.
$route
.
query
.
id
)
{
questionDetail
(
this
.
$route
.
query
.
id
).
then
(
res
=>
{
...
...
src/modules/question/views/List.vue
浏览文件 @
15bafdeb
...
...
@@ -15,8 +15,8 @@
<el-button
type=
"primary"
icon=
"el-icon-plus"
@
click=
"$router.push({ path: '/question/create' })"
>
新建试题
</el-button
>
<el-button
type=
"primary"
icon=
"el-icon-plus"
@
click=
"
v
isible = true"
>
批量导入试题
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-plus"
@
click=
"
deleteQuestion
()"
>
批量删除
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-plus"
@
click=
"
importDialogV
isible = true"
>
批量导入试题
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-plus"
@
click=
"
handleDelete
()"
>
批量删除
</el-button>
</div>
<
template
v-slot:table-x=
"{ row }"
>
<el-button
type=
"text"
@
click=
"handleSettings(row)"
>
编辑
</el-button>
...
...
@@ -36,15 +36,18 @@
</span>
</el-dialog>
</app-list>
<import-question
:visible
.
sync=
"importDialogVisible"
/>
</app-card>
</template>
<
script
>
import
{
getAppList
,
getQuestionCategory
,
deleteQuestion
}
from
'../api'
import
importQuestion
from
'../components/importQuestion.vue'
export
default
{
components
:
{
importQuestion
},
data
()
{
return
{
importDialogVisible
:
false
,
deleteQuestions
:
[],
dialogVisible
:
false
,
visible
:
false
,
...
...
@@ -136,7 +139,8 @@ export default {
2
:
'中'
,
3
:
'难'
}
return
data
.
data
.
reduce
((
a
,
b
)
=>
{
return
data
.
data
.
reduce
((
a
,
b
,
index
)
=>
{
b
.
order
=
index
+
1
b
.
question_type
=
questionType
[
b
.
question_type
]
b
.
question_difficulty
=
questionDifficulty
[
b
.
question_difficulty
]
a
.
push
(
b
)
...
...
@@ -146,7 +150,7 @@ export default {
},
columns
:
[
{
type
:
'selection'
,
minWidth
:
'50px'
,
fixed
:
'left'
},
{
label
:
'序号'
,
prop
:
'
question_
order'
},
{
label
:
'序号'
,
prop
:
'order'
},
{
label
:
'题目类型'
,
prop
:
'question_type'
},
{
label
:
'试题分类'
,
prop
:
'question_category.category_name'
},
{
label
:
'题目标题'
,
prop
:
'question_title'
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论