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
b183f1f3
Commit
b183f1f3
authored
Aug 12, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
01db8f6f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
254 additions
and
89 deletions
+254
-89
question.js
src/api/question/question.js
+13
-0
examtemplate-form.vue
src/components/exam/examtemplate-form.vue
+141
-0
examCreate.vue
src/pages/exam/examCreate.vue
+100
-89
No files found.
src/api/question/question.js
View file @
b183f1f3
...
...
@@ -254,3 +254,16 @@ export function queryQuestionCategoryList(data) {
})
}
/**
* 获取试卷组卷模板
* @param {*} data
*/
export
function
queryExaminationTemplatePage
(
data
)
{
return
request
({
url
:
'/Exam/GetExaminationTemplatePage'
,
method
:
'post'
,
data
})
}
\ No newline at end of file
src/components/exam/examtemplate-form.vue
0 → 100644
View file @
b183f1f3
<
template
>
<q-dialog
v-model=
"persistent"
content-class=
"bg-grey-1"
persistent
transition-show=
"scale"
transition-hide=
"scale"
>
<q-card
style=
"width: 850px;max-width:900px;"
>
<q-card-section>
<div
class=
"text-h6"
>
模板信息
</div>
</q-card-section>
<q-card-section
class=
"q-pt-none scroll"
style=
"max-height: 70vh"
>
<div
class=
"page-search row items-center"
>
<div
class=
"col row wrap q-mr-lg q-col-gutter-md"
>
<div
class=
"col-12"
>
<q-input
@
input=
"research"
clearable
standout=
"bg-primary text-white"
v-model=
"msg.TemplateName"
label=
"关键字"
@
clear=
"research"
maxlength=
"20"
/>
</div>
</div>
</div>
<div
class=
"page-content"
>
<q-table
:pagination=
"msg"
:loading=
"loading"
no-data-label=
"暂无相关数据"
flat
class=
"sticky-column-table sticky-header-column-table"
style=
"max-height: 550px"
separator=
"none"
:data=
"dataList"
:columns=
"columns"
row-key=
"TemplateId"
selection=
"single"
:selected
.
sync=
"selectedQuestionBank"
>
<template
v-slot:top=
"props"
>
<div
class=
"col-2 q-table__title"
>
模板列表
</div>
<q-space
/>
</
template
>
<
template
v-slot:body-cell-Title=
"props"
>
<td
style=
"width:400px;"
>
<div
@
click=
"goDetail(props.row)"
v-html=
"props.row.Title"
class=
"quetion_Title"
>
</div>
</td>
</
template
>
<
template
v-slot:bottom
>
<q-pagination
class=
"full-width justify-end"
v-model=
"msg.pageIndex"
color=
"primary"
:max=
"pageCount"
:input=
"true"
@
input=
"changePage"
/>
</
template
>
</q-table>
</div>
</q-card-section>
<q-separator
/>
<q-card-actions
align=
"right"
class=
"bg-white"
>
<q-btn
label=
"取消"
flat
color=
"grey-10"
style=
"font-weight:400 !important"
@
click=
"closeSaveForm"
/>
<q-btn
label=
"确认选择"
color=
"accent q-px-md"
style=
"font-weight:400 !important"
@
click=
"sureQuestionBank"
/>
</q-card-actions>
</q-card>
</q-dialog>
</template>
<
script
>
import
{
queryExaminationTemplatePage
,
}
from
'../../api/question/question'
;
export
default
{
data
()
{
return
{
persistent
:
true
,
msg
:
{
pageIndex
:
1
,
pageSize
:
12
,
rowsPerPage
:
12
,
TemplateName
:
''
},
pageCount
:
0
,
//总页数
loading
:
false
,
//表格加载进度条
columns
:
[{
name
:
'TemplateId'
,
label
:
'编号'
,
field
:
'TemplateId'
,
align
:
'left'
},
{
name
:
'TemplateName'
,
label
:
'模板名称'
,
field
:
'TemplateName'
,
align
:
'left'
,
},
{
name
:
'TemplateScore'
,
label
:
'总分'
,
field
:
'TemplateScore'
,
align
:
'left'
,
},
{
name
:
'TemplateDifficultyTypeName'
,
label
:
'难度'
,
field
:
'TemplateDifficultyTypeName'
,
align
:
'left'
},
{
name
:
'QuestionStructure'
,
label
:
'题型结构'
,
field
:
'QuestionStructure'
,
align
:
'left'
},
],
dataList
:
[],
//数据列表
selectedQuestionBank
:
[],
//选择的题库
}
},
mounted
()
{
this
.
getExaminationTemplatePage
();
},
methods
:
{
//获取题库分页列表
getExaminationTemplatePage
()
{
queryExaminationTemplatePage
(
this
.
msg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
dataList
=
res
.
Data
.
PageData
;
this
.
pageCount
=
res
.
Data
.
PageCount
;
}
})
},
//翻页
changePage
(
val
)
{
this
.
msg
.
pageIndex
=
val
;
this
.
getExaminationTemplatePage
()
},
research
()
{
this
.
msg
.
pageIndex
=
1
;
this
.
getExaminationTemplatePage
();
},
//关闭弹窗
closeSaveForm
()
{
this
.
$emit
(
'close'
)
this
.
persistent
=
false
},
//确认选择
sureQuestionBank
()
{
this
.
persistent
=
false
;
var
tempArray
=
[];
if
(
this
.
selectedQuestionBank
&&
this
.
selectedQuestionBank
.
length
>
0
)
{
this
.
selectedQuestionBank
.
forEach
(
item
=>
{
tempArray
.
push
(
item
)
})
}
this
.
$emit
(
'success'
,
tempArray
);
},
},
}
</
script
>
<
style
lang=
"sass"
>
@import
url('~assets/css/table.sass')
</
style
>
src/pages/exam/examCreate.vue
View file @
b183f1f3
...
...
@@ -24,15 +24,16 @@
<div
class=
"page-body"
>
组卷题库(*):
{{
ShowBankName
}}
<br
/>
<a
style=
"cursor:pointer;color:blue;margin:10px 0;display:inline-block;"
@
click=
"showQuestionBank"
>
选择题库
</a>
<br
/>
<q-btn
color=
"accent"
size=
"sm"
@
click=
"changeExamGroupType(1)"
class=
"q-mr-md"
label=
"智能组卷"
/>
<q-btn
color=
"accent"
size=
"sm"
@
click=
"changeExamGroupType(2)"
class=
"q-mr-md"
label=
"手动组卷"
/>
<br
/>
<br
/>
<template
v-if=
"postMsg.GenerateType==1"
>
<br
/>
<br
/>
<a
style=
"cursor:pointer;color:blue;margin:10px 0;display:inline-block;"
@
click=
"showExamTemplate"
>
选择模板
</a>
<br
/>
<div
class=
"row"
>
<q-input
filled
stack-label
maxlength=
"100"
:dense=
"false"
v-model=
"templateMsg.TemplateName"
class=
"col-6 q-pb-lg q-pr-lg"
label=
"试卷标题"
/>
<q-input
filled
stack-label
maxlength=
"5"
:dense=
"false"
v-model=
"templateMsg.TemplateScore
"
class=
"col-6 q-pb-lg"
label=
"满分"
/>
<q-input
filled
stack-label
maxlength=
"5"
:dense=
"false"
v-model=
"templateMsg.TemplateScore"
class=
"col-6 q-pb-lg
"
label=
"满分"
/>
</div>
<div
class=
"row"
>
<q-input
filled
stack-label
maxlength=
"5"
:dense=
"false"
v-model=
"templateMsg.TemplateNum"
...
...
@@ -50,8 +51,8 @@
<div
class=
"row"
>
<q-input
filled
stack-label
maxlength=
"5"
:dense=
"false"
v-model=
"item.QuestionScore"
class=
"col-6 q-pb-lg q-pr-lg"
label=
"总分"
/>
<q-input
filled
stack-label
maxlength=
"100"
:dense=
"false"
v-model=
"item.QuestionDesc
"
class=
"col-6 q-pb-lg"
label=
"题型说明"
/>
<q-input
filled
stack-label
maxlength=
"100"
:dense=
"false"
v-model=
"item.QuestionDesc"
class=
"col-6 q-pb-lg
"
label=
"题型说明"
/>
</div>
<span>
<q-radio
v-model=
"item.ChooseType"
:val=
"1"
label=
"从题库选题"
/>
...
...
@@ -84,21 +85,19 @@
<q-checkbox
v-model=
"templateMsg.IsSaveTemplate"
label=
"同时保存为组卷模板"
/>
</div>
</
template
>
<br
/>
<br
/>
<div
class=
"row"
>
<q-btn
color=
"accent"
size=
"sm"
@
click=
"setPaperTemplate"
class=
"q-mr-md"
label=
"保存"
/>
</div>
</template>
<
template
v-if=
"postMsg.GenerateType==2"
>
手动组卷
</
template
>
<questionbankForm
v-if=
"isShowQuestionBank"
@
close=
"closeQuestionBankForm"
@
success=
"getBankData"
>
<questionbankForm
v-if=
"isShowQuestionBank"
@
close=
"closeExamForm"
@
success=
"getBankData"
>
</questionbankForm>
<examtemplateForm
v-if=
"isShowExamTemplate"
@
close=
"closeExamForm"
@
success=
"getTemplateData"
>
</examtemplateForm>
</div>
</template>
<
script
>
import
questionbankForm
from
'../../components/exam/questionbank-form'
import
examtemplateForm
from
'../../components/exam/examtemplate-form'
import
{
queryQuestionTypeList
,
queryDifficultyType
,
...
...
@@ -112,7 +111,8 @@
}
from
'../../api/teacher/index'
;
export
default
{
components
:
{
questionbankForm
questionbankForm
,
examtemplateForm
},
meta
:
{
title
:
"组卷"
...
...
@@ -120,13 +120,7 @@
data
()
{
return
{
isShowQuestionBank
:
false
,
//是否显示题库列表
postMsg
:
{
PaperId
:
0
,
//试卷编号
PaperName
:
"新建试卷"
,
//试卷名称
QuestionBandIds
:
""
,
//题库编号【多个逗号分割】
DifficultyType
:
1
,
//难易程度
GenerateType
:
0
,
//组卷类型(1-智能组卷,2-手动组卷,3-智能导入)
},
isShowExamTemplate
:
false
,
//是否显示模板列表
questionDifficultyTypeList
:
[],
//难易程度列表
//末班数据
templateMsg
:
{
...
...
@@ -134,9 +128,9 @@
TemplateName
:
""
,
//模板名称
TemplateScore
:
0
,
//模板分数
TemplateNum
:
0
,
//随机组卷数量
TemplateDifficultyType
:
0
,
//难易程度
TemplateDifficultyType
:
1
,
//难易程度
TemplateData
:
[],
TemplateBankIds
:
""
,
TemplateBankIds
:
""
,
IsSaveTemplate
:
false
,
},
ShowBankName
:
""
,
//显示题库名称
...
...
@@ -187,7 +181,7 @@
//获取题库题目分类列表
getQuestionCategoryList
()
{
var
qMsg
=
{
QBankIds
:
this
.
postMsg
.
QuestionBand
Ids
QBankIds
:
this
.
templateMsg
.
TemplateBank
Ids
}
queryQuestionCategoryList
(
qMsg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
...
...
@@ -206,10 +200,6 @@
}
})
},
//切换组卷类型
changeExamGroupType
(
typeId
)
{
this
.
postMsg
.
GenerateType
=
typeId
;
},
//获取问题难易程度列表
getDifficultyType
()
{
queryDifficultyType
().
then
(
res
=>
{
...
...
@@ -222,9 +212,14 @@
showQuestionBank
()
{
this
.
isShowQuestionBank
=
true
;
},
//显示试卷模板
showExamTemplate
()
{
this
.
isShowExamTemplate
=
true
;
},
//关闭题库
close
QuestionBank
Form
()
{
close
Exam
Form
()
{
this
.
isShowQuestionBank
=
false
;
this
.
isShowExamTemplate
=
false
;
},
//获取选择的题库
getBankData
(
bankArray
)
{
...
...
@@ -243,23 +238,39 @@
if
(
sBankName
.
substr
(
0
,
1
)
==
','
)
{
sBankName
=
sBankName
.
substr
(
1
);
}
this
.
postMsg
.
QuestionBandIds
=
qBankIds
;
this
.
templateMsg
.
TemplateBankIds
=
qBankIds
;
this
.
templateMsg
.
TemplateBankIds
=
qBankIds
;
this
.
ShowBankName
=
sBankName
;
this
.
getQuestionCategoryList
();
},
//保存试卷信息
setExamPaper
()
{
savePaperInfo
(
this
.
postMsg
).
then
(
res
=>
{
});
//获取模板数据
getTemplateData
(
tempArray
)
{
console
.
log
(
"tempArray"
,
tempArray
);
},
//根据模板生成试卷
setPaperTemplate
()
{
savePaperTemplate
(
this
.
templateMsg
).
then
(
res
=>
{
console
.
log
(
"res=>"
,
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
:
`操作失败!`
})
}
});
}
}
}
...
...
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