Commit 9736314a authored by 黄奎's avatar 黄奎

页面修改

parent 301a9bf5
......@@ -241,3 +241,16 @@ export function saveBatchQuestionLevel(data) {
data
})
}
/**
* 根据题库编号获取题库题型分类列表【试卷组卷使用】
* @param {*} data
*/
export function queryQuestionCategoryList(data) {
return request({
url: '/Question/GetQuestionCategoryList',
method: 'post',
data
})
}
\ No newline at end of file
......@@ -8,14 +8,63 @@
<template>
<div class="examCreate">
<br />
组卷题库(*): {{ShowBankName}} <a style="cursor:pointer;color:blue" @click="showQuestionBank">选择题库</a> <br />
<q-btn color="accent" size="sm" @click="postMsg.GenerateType==1" class="q-mr-md" label="智能组卷"  />
<q-btn color="accent" size="sm" @click="postMsg.GenerateType==2,setExamPaper" class="q-mr-md" label="手动组卷"  /> <br /> <br />
组卷题库(*): {{ShowBankName}} <br />
<a style="cursor:pointer;color:blue" @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">
<q-input filled stack-label maxlength="100" :dense="false" v-model="templateMsg.TemplateName"
class="col-6 q-pb-lg" label="试卷标题" /> <br />
<q-input filled stack-label maxlength="5" :dense="false" v-model="templateMsg.TemplateScore" class="col-6 q-pb-lg"
label="满分" /> <br />
<q-input filled stack-label maxlength="5" :dense="false" v-model="templateMsg.TemplateNum" class="col-6 q-pb-lg"
label="随机组卷数量" /> <br />
<q-select filled option-value="Id" option-label="Name" :options="questionDifficultyTypeList" emit-value
map-options label="难易程度" use-input clearable v-model="templateMsg.TemplateDifficultyType" /> <br />
分割线<br />
<template v-if="templateMsg&&templateMsg.TemplateData&&templateMsg.TemplateData.length>0">
<div v-for="(item,index) in templateMsg.TemplateData" :key="index" style="border:1px solid grey">
<span> {{item.QuestionTypeName}}</span> &nbsp;&nbsp;<a style="color:blue;cursor:pointer;">删除</a> <br />
<span>
<q-input filled stack-label maxlength="5" :dense="false" v-model="item.QuestionScore" class="col-6 q-pb-lg"
label="总分" /> &nbsp;&nbsp;
<q-input filled stack-label maxlength="100" :dense="false" v-model="item.QuestionDesc" class="col-6 q-pb-lg"
label="题型说明" />
</span> <br />
<span>
<q-radio v-model="item.ChooseType" :val="1" label="从题库选题" />
<template v-if="item.ChooseType==1">
<span>{{item.QuestionTypeNum}} 道 抽
<q-input filled stack-label maxlength="5" :dense="false" v-model="item.ChooseNum" class="col-1 q-pb-lg"
label="" /> &nbsp;&nbsp;</span>
</template>
</span>
<br />
<span>
<q-radio v-model="item.ChooseType" :val="2" label="从题库按照难易度选题" />
<template v-if="item.ChooseType==2">
<span v-for="(subItem,subIndex) in item.ChooseList">{{subItem.DifficultyTypeName}}
{{subItem.DifficultyTypeCount}} 道 抽
<q-input filled stack-label maxlength="5" :dense="false" v-model="subItem.ChooseNum"
class="col-1 q-pb-lg" label="" /> &nbsp;&nbsp;
</span>
</template>
</span>
</div>
</template>
<template v-if="BankList&&BankList.length>0">
<q-select filled option-value="QuestionTypeId" option-label="QuestionTypeName" :options="BankList" emit-value
map-options label="更多题型" use-input clearable v-model="MoreQuestionTypeId" @input="changeQuestion" />
</template>
</template>
<template v-if="postMsg.GenerateType==2">
手动组卷
</template>
<questionbankForm v-if="isShowQuestionBank"  @close="closeQuestionBankForm"  @success="getBankData">
......@@ -28,7 +77,8 @@
queryQuestionTypeList,
queryDifficultyType,
queryQuestionCategory,
queryQuestionLevelType
queryQuestionLevelType,
queryQuestionCategoryList
} from '../../api/question/question'
import {
savePaperInfo,
......@@ -50,16 +100,96 @@
DifficultyType: 1, //难易程度
GenerateType: 0, //组卷类型(1-智能组卷,2-手动组卷,3-智能导入)
},
questionDifficultyTypeList: [], //难易程度列表
//末班数据
templateMsg: {
TemplateId: 0, //模板编号
TemplateName: "", //模板名称
TemplateScore: 0, //模板分数
TemplateNum: 0, //随机组卷数量
TemplateDifficultyType: 0, //难易程度
TemplateData: [],
},
ShowBankName: "", //显示题库名称
BankList: [],
MoreQuestionTypeId: "", //更多题型
}
},
created() {
this.getDifficultyType();
},
mounted() {
},
methods: {
//选择添加题型
changeQuestion() {
if (this.MoreQuestionTypeId && this.MoreQuestionTypeId != '') {
var chooseQuestion = this.BankList.find((item) => {
return item.QuestionTypeId === this.MoreQuestionTypeId;
});
if (chooseQuestion && chooseQuestion.QuestionTypeId > 0) {
if(!this.checkExists(chooseQuestion.QuestionTypeId))
{
this.templateMsg.TemplateData.push(chooseQuestion);
}
else{
this.$q.notify({
type: 'negative',
position: "top",
message: `已存在此题型,请勿重复选择!`
})
}
}
}
},
checkExists(QuestionTypeId) {
var isExists = false;
if (this.templateMsg && this.templateMsg.TemplateData && this.templateMsg.TemplateData.length > 0) {
this.templateMsg.TemplateData.forEach(item => {
if (!isExists) {
if (item.QuestionTypeId == QuestionTypeId) {
isExists = true;
}
}
})
}
return isExists;
},
//获取题库题目分类列表
getQuestionCategoryList() {
var qMsg = {
QBankIds: this.postMsg.QuestionBandIds
}
queryQuestionCategoryList(qMsg).then(res => {
if (res.Code == 1) {
var tempArray = res.Data;
if (tempArray && tempArray.length > 0) {
this.templateMsg.TemplateData = [];
this.BankList = tempArray;
tempArray.forEach(item => {
//默认添加【单选题,多选题、填空题,单选题(数字)】
if (item.QuestionTypeKey == 'single' || item.QuestionTypeKey == 'multiple' || item
.QuestionTypeKey == 'fill-in' || item.QuestionTypeKey == 'single-number') {
this.templateMsg.TemplateData.push(item);
}
})
}
}
})
},
//切换组卷类型
changeExamGroupType(typeId) {
this.postMsg.GenerateType = typeId;
},
//获取问题难易程度列表
getDifficultyType() {
queryDifficultyType().then(res => {
if (res.Code == 1) {
this.questionDifficultyTypeList = res.Data;
}
});
},
//显示题库
showQuestionBank() {
this.isShowQuestionBank = true;
......@@ -87,6 +217,7 @@
}
this.postMsg.QuestionBandIds = qBankIds;
this.ShowBankName = sBankName;
this.getQuestionCategoryList();
},
//保存试卷信息
setExamPaper() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment