|
|
|
@ -1,209 +1,219 @@ |
|
|
|
|
<template> |
|
|
|
|
<div class="page"> |
|
|
|
|
<Breadcrumb :data="crumbs" /> |
|
|
|
|
<el-form :model="form" :rules="rules" class="input-form model" ref="form" label-width="140px"> |
|
|
|
|
<p class="page-name mb">试卷基础信息</p> |
|
|
|
|
<el-form-item prop="name" label="试卷名称"> |
|
|
|
|
<el-input style="width: 940px" placeholder="请输入试卷名称" v-model="form.name" clearable maxlength="100" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<div class="item-line"> |
|
|
|
|
<el-form-item prop="particularYear" label="年份"> |
|
|
|
|
<el-date-picker v-model="form.particularYear" type="year" placeholder="请选择年份" format="yyyy" |
|
|
|
|
value-format="yyyy"> |
|
|
|
|
</el-date-picker> |
|
|
|
|
<div v-loading="loading"> |
|
|
|
|
<el-form :model="form" :rules="rules" class="input-form model" ref="form" label-width="140px"> |
|
|
|
|
<p class="page-name mb">试卷基础信息</p> |
|
|
|
|
<el-form-item prop="name" label="试卷名称"> |
|
|
|
|
<el-input style="width: 940px" placeholder="请输入试卷名称" v-model="form.name" clearable maxlength="100" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="classificationId" label="所属试卷分类"> |
|
|
|
|
<el-cascader filterable placeholder="请选择所属试卷分类" :options="types" v-model="form.classificationId" |
|
|
|
|
:props="cascaderProps" style="width: 100%"> |
|
|
|
|
</el-cascader> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<div class="item-line"> |
|
|
|
|
<el-form-item prop="paperType" label="建议用途"> |
|
|
|
|
<el-select v-model="form.paperType" clearable placeholder="请选择建议用途"> |
|
|
|
|
<el-option v-for="(item, i) in paperTypes" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="suggestTime" label="估计用时"> |
|
|
|
|
<el-input placeholder="请输入估计用时" v-model.number="form.suggestTime"> |
|
|
|
|
<template slot="append">分钟</template> |
|
|
|
|
</el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<div class="item-line"> |
|
|
|
|
<el-form-item prop="professionals" label="所属专业"> |
|
|
|
|
<el-select v-model="form.professionalId" filterable multiple clearable placeholder="请选择所属专业"> |
|
|
|
|
<el-option v-for="(item, i) in professionals" :key="i" :label="item.professionalName" |
|
|
|
|
:value="item.professionalId" filter></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="difficult" label="试卷难度"> |
|
|
|
|
<el-select v-model="form.difficult" clearable placeholder="系统自动评估,也可手动选择" |
|
|
|
|
@change="val => difficultSelected = !!val"> |
|
|
|
|
<el-option v-for="(item, i) in difficults" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
<el-tooltip placement="top"> |
|
|
|
|
<div class="diff-text" slot="content"> |
|
|
|
|
<p>基础题:难度系数0.2</p> |
|
|
|
|
<p>普通题:难度系数0.4</p> |
|
|
|
|
<p>较难题:难度系数0.6</p> |
|
|
|
|
<p>困难题:难度系数0.8</p> |
|
|
|
|
<p>(1)<span class="em">题型难度系数</span>=对应题型所有试题的难度系数之和/总试题数</p> |
|
|
|
|
<p>(2)<span class="em">试卷总难度系数</span>=所有试题的难度系数之和/总试题数</p> |
|
|
|
|
<p>(3)<span class="em">难度系数评价</span>:</p> |
|
|
|
|
<div class="coe"> |
|
|
|
|
<p>简单:系数 <=0.3</p> |
|
|
|
|
<p>普通:0.3<系数<=0.4</p> |
|
|
|
|
<p>较难:0.4<系数<0.5</p> |
|
|
|
|
<p>困难:系数>=0.5</p> |
|
|
|
|
<div class="item-line"> |
|
|
|
|
<el-form-item prop="particularYear" label="年份"> |
|
|
|
|
<el-date-picker v-model="form.particularYear" type="year" placeholder="请选择年份" format="yyyy" |
|
|
|
|
value-format="yyyy"> |
|
|
|
|
</el-date-picker> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="classificationId" label="所属试卷分类"> |
|
|
|
|
<el-cascader filterable placeholder="请选择所属试卷分类" :options="types" v-model="form.classificationId" |
|
|
|
|
:props="cascaderProps" style="width: 100%"> |
|
|
|
|
</el-cascader> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<div class="item-line"> |
|
|
|
|
<el-form-item prop="paperType" label="建议用途"> |
|
|
|
|
<el-select v-model="form.paperType" clearable placeholder="请选择建议用途"> |
|
|
|
|
<el-option v-for="(item, i) in paperTypes" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="suggestTime" label="估计用时"> |
|
|
|
|
<el-input placeholder="请输入估计用时" v-model.number="form.suggestTime"> |
|
|
|
|
<template slot="append">分钟</template> |
|
|
|
|
</el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<div class="item-line"> |
|
|
|
|
<el-form-item prop="professionals" label="所属专业"> |
|
|
|
|
<el-select v-model="form.professionalId" filterable multiple clearable placeholder="请选择所属专业"> |
|
|
|
|
<el-option v-for="(item, i) in professionals" :key="i" :label="item.professionalName" |
|
|
|
|
:value="item.professionalId" filter></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="difficult" label="试卷难度"> |
|
|
|
|
<el-select v-model="form.difficult" clearable placeholder="系统自动评估,也可手动选择" |
|
|
|
|
@change="val => difficultSelected = !!val"> |
|
|
|
|
<el-option v-for="(item, i) in difficults" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
<el-tooltip placement="top"> |
|
|
|
|
<div class="diff-text" slot="content"> |
|
|
|
|
<p>基础题:难度系数0.2</p> |
|
|
|
|
<p>普通题:难度系数0.4</p> |
|
|
|
|
<p>较难题:难度系数0.6</p> |
|
|
|
|
<p>困难题:难度系数0.8</p> |
|
|
|
|
<p>(1)<span class="em">题型难度系数</span>=对应题型所有试题的难度系数之和/总试题数</p> |
|
|
|
|
<p>(2)<span class="em">试卷总难度系数</span>=所有试题的难度系数之和/总试题数</p> |
|
|
|
|
<p>(3)<span class="em">难度系数评价</span>:</p> |
|
|
|
|
<div class="coe"> |
|
|
|
|
<p>简单:系数 <=0.3</p> |
|
|
|
|
<p>普通:0.3<系数<=0.4</p> |
|
|
|
|
<p>较难:0.4<系数<0.5</p> |
|
|
|
|
<p>困难:系数>=0.5</p> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<i class="el-icon-question m-l-10" style="font-size: 16px;color: #8f8f8f;cursor: pointer;"></i> |
|
|
|
|
</el-tooltip> |
|
|
|
|
<i class="el-icon-question m-l-10" style="font-size: 16px;color: #8f8f8f;cursor: pointer;"></i> |
|
|
|
|
</el-tooltip> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<el-form-item prop="remarks" label="试卷说明"> |
|
|
|
|
<UeditorPlus ref="remarks" @ready="remarksReady" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<el-form-item prop="remarks" label="试卷说明"> |
|
|
|
|
<UeditorPlus ref="remarks" @ready="remarksReady" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
<div class="line"></div> |
|
|
|
|
<div class="line"></div> |
|
|
|
|
|
|
|
|
|
<p class="page-name mb">试卷大纲</p> |
|
|
|
|
<div class="relative text-center m-b-40"> |
|
|
|
|
<p class="fs-16">{{ templateName }}</p> |
|
|
|
|
<el-button class="tem-btn" type="primary" size="small" @click="showTemplate">选择大纲模板</el-button> |
|
|
|
|
</div> |
|
|
|
|
<el-table :data="form.paperOutline" stripe header-align="center" row-key="id"> |
|
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
|
|
|
|
<el-table-column label="大题" align="center" min-width="120"> |
|
|
|
|
<template slot-scope="scope">第{{ arabicToChinese(scope.$index + 1) }}大题</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="name" label="题型" align="center" min-width="120"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-select v-model="scope.row.questionType" placeholder="请选择题型" @change="questionTypeChange(scope.row)"> |
|
|
|
|
<el-option v-for="(item, i) in questionTypes" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="name" label="目标题数" align="center" min-width="120"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input placeholder="请输入目标题数" v-model.number="scope.row.questionNum" type="number" /> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="name" label="目标分值" align="center" min-width="120"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input placeholder="请输入目标分值" v-model="scope.row.targetScore" /> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="操作" align="center" width="120"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<i class="el-icon-circle-plus-outline action-icon m-r-10" @click="addLine(scope.$index)"></i> |
|
|
|
|
<i v-if="form.paperOutline.length > 1" class="el-icon-remove-outline action-icon" |
|
|
|
|
@click="delLine(scope.$index)"></i> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<p class="m-t-10 m-b-20 text-right">目标总题数:{{ questionCount }};目标总分:{{ score }}</p> |
|
|
|
|
|
|
|
|
|
<div class="line"></div> |
|
|
|
|
|
|
|
|
|
<div class="flex j-between a-center"> |
|
|
|
|
<h6 class="page-name" style="margin-bottom: 0">试卷试题</h6> |
|
|
|
|
<div> |
|
|
|
|
<el-button type="primary" @click="allocationAll">一键分配分值</el-button> |
|
|
|
|
<el-button type="primary" @click="showAuto">自动选题</el-button> |
|
|
|
|
<p class="page-name mb">试卷大纲</p> |
|
|
|
|
<div class="relative text-center m-b-40"> |
|
|
|
|
<p class="fs-16">{{ templateName }}</p> |
|
|
|
|
<el-button class="tem-btn" type="primary" size="small" @click="showTemplate">选择大纲模板</el-button> |
|
|
|
|
</div> |
|
|
|
|
<el-table :data="form.paperOutline" stripe header-align="center" row-key="id"> |
|
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
|
|
|
|
<el-table-column label="大题" align="center" min-width="120"> |
|
|
|
|
<template slot-scope="scope">第{{ arabicToChinese(scope.$index + 1) }}大题</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="name" label="题型" align="center" min-width="120"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-select v-model="scope.row.questionType" placeholder="请选择题型" @change="questionTypeChange(scope.row)"> |
|
|
|
|
<el-option v-for="(item, i) in questionTypes" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="name" label="目标题数" align="center" min-width="120"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input placeholder="请输入目标题数" v-model.number="scope.row.questionNum" type="number" /> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="name" label="目标分值" align="center" min-width="120"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input placeholder="请输入目标分值" v-model="scope.row.targetScore" /> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="操作" align="center" width="120"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<i class="el-icon-circle-plus-outline action-icon m-r-10" @click="addLine(scope.$index)"></i> |
|
|
|
|
<i v-if="form.paperOutline.length > 1" class="el-icon-remove-outline action-icon" |
|
|
|
|
@click="delLine(scope.$index)"></i> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<p class="m-t-10 m-b-20 text-right">目标总题数:{{ questionCount }};目标总分:{{ score }}</p> |
|
|
|
|
|
|
|
|
|
<div class="line"></div> |
|
|
|
|
|
|
|
|
|
<div class="flex j-between a-center"> |
|
|
|
|
<h6 class="page-name" style="margin-bottom: 0">试卷试题</h6> |
|
|
|
|
<div> |
|
|
|
|
<el-button type="primary" @click="allocationAll">一键分配分值</el-button> |
|
|
|
|
<el-button type="primary" @click="showAuto">自动选题</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<ul class="ques"> |
|
|
|
|
<li v-for="(item, i) in form.paperOutline" :key="i"> |
|
|
|
|
<div class="top"> |
|
|
|
|
<div> |
|
|
|
|
<span class="serial">第{{ arabicToChinese(i + 1) }}大题</span> |
|
|
|
|
<el-input placeholder="请输入大题名称" v-model="item.outlineName" /> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
<el-button type="primary" @click="allocation(item)">一键分配分值</el-button> |
|
|
|
|
<el-button type="primary" @click="showManualDia(item)">批量添加</el-button> |
|
|
|
|
<el-button type="danger" @click="batchDelQues(item)">批量移除试题</el-button> |
|
|
|
|
<img :class="['shrink', { active: item.shrink }]" src="@/assets/images/shrink.svg" alt="" |
|
|
|
|
@click="item.shrink = !item.shrink"> |
|
|
|
|
<ul class="ques"> |
|
|
|
|
<li v-for="(item, i) in form.paperOutline" :key="i"> |
|
|
|
|
<div class="top"> |
|
|
|
|
<div> |
|
|
|
|
<span class="serial">第{{ arabicToChinese(i + 1) }}大题</span> |
|
|
|
|
<el-input placeholder="请输入大题名称" v-model="item.outlineName" /> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
<el-button type="primary" @click="allocation(item)">一键分配分值</el-button> |
|
|
|
|
<el-button type="primary" @click="showManualDia(item)">批量添加</el-button> |
|
|
|
|
<el-button type="danger" @click="batchDelQues(item)">批量移除试题</el-button> |
|
|
|
|
<img :class="['shrink', { active: item.shrink }]" src="@/assets/images/shrink.svg" alt="" |
|
|
|
|
@click="item.shrink = !item.shrink"> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<p class="sum">本大题共{{ item.questionNum }}小题,共{{ item.targetScore }}分</p> |
|
|
|
|
<el-checkbox v-if="item.examQuestions && item.examQuestions.length" class="m-l-15" v-model="item.checkAll" |
|
|
|
|
@change="e => item.examQuestions.map(n => n.check = e)">全选</el-checkbox> |
|
|
|
|
|
|
|
|
|
<div :class="['ques-wrap', { hide: item.shrink }]"> |
|
|
|
|
<draggable v-model="item.examQuestions" :group="dragGroup" chosenClass="chosen" animation="1000" |
|
|
|
|
@update="e => updateSort(e, item)"> |
|
|
|
|
<div v-for="(ques, j) in item.examQuestions" :key="j" class="ques-item"> |
|
|
|
|
<el-checkbox v-model="ques.check"></el-checkbox> |
|
|
|
|
{{ ques.repeat }} |
|
|
|
|
<div :class="['ques-info', { disabled: !ques.status, del: ques.isDel, repeat: ques.repeat }]"> |
|
|
|
|
<div class="top-line"> |
|
|
|
|
<div class="stem-info"> |
|
|
|
|
<div class="labels"> |
|
|
|
|
<span class="label">{{ j + 1 }} / {{ item.examQuestions.length }}</span> |
|
|
|
|
<span class="label">{{ questionTypes.find(e => e.id === item.questionType).name }}</span> |
|
|
|
|
<p class="sum">本大题共{{ item.questionNum }}小题,共{{ item.targetScore }}分</p> |
|
|
|
|
<el-checkbox v-if="item.examQuestions && item.examQuestions.length" class="m-l-15" v-model="item.checkAll" |
|
|
|
|
@change="e => item.examQuestions.map(n => n.check = e)">全选</el-checkbox> |
|
|
|
|
|
|
|
|
|
<div :class="['ques-wrap', { hide: item.shrink }]"> |
|
|
|
|
<draggable v-model="item.examQuestions" :group="dragGroup" chosenClass="chosen" animation="1000" |
|
|
|
|
@update="e => updateSort(e, item)"> |
|
|
|
|
<div v-for="(ques, j) in item.examQuestions" :key="j" class="ques-item"> |
|
|
|
|
<el-checkbox v-model="ques.check"></el-checkbox> |
|
|
|
|
{{ ques.repeat }} |
|
|
|
|
<div :class="['ques-info', { disabled: !ques.status, del: ques.isDel, repeat: ques.repeat }]"> |
|
|
|
|
<div class="top-line"> |
|
|
|
|
<div class="stem-info"> |
|
|
|
|
<div class="labels"> |
|
|
|
|
<span class="label">{{ j + 1 }} / {{ item.examQuestions.length }}</span> |
|
|
|
|
<span class="label">{{ questionTypes.find(e => e.id === item.questionType).name }}</span> |
|
|
|
|
<span v-if="ques.givenYear" class="label">{{ ques.givenYear }}</span> |
|
|
|
|
</div> |
|
|
|
|
<el-tag v-if="ques.difficult" :type="ques.difficultTheme">{{ ques.difficult }}</el-tag> |
|
|
|
|
</div> |
|
|
|
|
<div class="stem" :id="'stem' + ques.questionVersionId" v-html="ques.stem"></div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<!-- 单选、多选、判断的选项 --> |
|
|
|
|
<template |
|
|
|
|
v-if="item.questionType !== 'fill_blank' && item.questionType !== 'essay' && ques.questionAnswerVersionsList"> |
|
|
|
|
<div v-for="(opt, j) in ques.questionAnswerVersionsList" :key="j" class="opt"> |
|
|
|
|
<span>{{ numToLetter(j) }}. </span> |
|
|
|
|
<div class="text" v-html="opt.optionText"></div> |
|
|
|
|
<div class="actions"> |
|
|
|
|
<p v-if="item.questionType !== 'fill_blank'" class="m-r-10 input-wrap"> |
|
|
|
|
(<el-input class="l-input" placeholder="请输入分值" v-model="ques.score" />分)</p> |
|
|
|
|
|
|
|
|
|
<el-popover v-else placement="bottom" width="400" trigger="click"> |
|
|
|
|
<div v-if="ques.fillScores" class="fill-scores"> |
|
|
|
|
<p class="fill-title">每空分值</p> |
|
|
|
|
<div v-for="(score, k) in ques.fillScores" :key="k" class="input-wrap"> |
|
|
|
|
<el-input class="l-input" placeholder="请输入分值" v-model="score.val" |
|
|
|
|
@change="fillScoreChange(ques)" />分 填空项{{ k + 1 }} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div slot="reference" class="input-wrap"> |
|
|
|
|
查看每空分值<el-input class="l-input" placeholder="请输入分值" v-model="ques.score" readonly /> |
|
|
|
|
</div> |
|
|
|
|
</el-popover> |
|
|
|
|
<el-button type="text" @click="toQues(item, j, ques)">编辑试题</el-button> |
|
|
|
|
<el-button type="text" @click="showManualDia(item, j, ques)">更换试题</el-button> |
|
|
|
|
<el-button type="text" @click="showManualDia(item, j)">添加试题</el-button> |
|
|
|
|
<el-button type="text" @click="delQues(item, j)">移除试题</el-button> |
|
|
|
|
<div class="input-wrap"> |
|
|
|
|
<span>排序</span> |
|
|
|
|
<el-input class="l-input sort-input" v-model="ques.serialNumber" |
|
|
|
|
@change="sortChange(item, ques)" /> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<div class="stem" :id="'stem' + ques.questionVersionId" v-html="ques.stem"></div> |
|
|
|
|
|
|
|
|
|
<!-- 单选、多选、判断的选项 --> |
|
|
|
|
<template |
|
|
|
|
v-if="item.questionType !== 'fill_blank' && item.questionType !== 'essay' && ques.questionAnswerVersionsList"> |
|
|
|
|
<div v-for="(opt, j) in ques.questionAnswerVersionsList" :key="j" class="opt"> |
|
|
|
|
<span>{{ numToLetter(j) }}. </span> |
|
|
|
|
<div class="text" v-html="opt.optionText"></div> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<div class="bottom-line"> |
|
|
|
|
<div class="correct"> |
|
|
|
|
<div class="bottom-line"> |
|
|
|
|
【{{ item.questionType === 'essay' ? '参考答案' : '正确答案' }}】: |
|
|
|
|
<div v-html="getCorrectAnswer(ques)"></div> |
|
|
|
|
<div v-html="getCorrectAnswer(ques)" class="ans"></div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="actions"> |
|
|
|
|
<p v-if="item.questionType !== 'fill_blank'" class="m-r-10 input-wrap"> |
|
|
|
|
(<el-input class="l-input" placeholder="请输入分值" v-model="ques.score" />分)</p> |
|
|
|
|
|
|
|
|
|
<el-popover v-else placement="bottom" width="400" trigger="click"> |
|
|
|
|
<div v-if="ques.fillScores" class="fill-scores"> |
|
|
|
|
<p class="fill-title">每空分值</p> |
|
|
|
|
<div v-for="(score, k) in ques.fillScores" :key="k" class="input-wrap"> |
|
|
|
|
<el-input class="l-input" placeholder="请输入分值" v-model="score.val" |
|
|
|
|
@change="fillScoreChange(ques)" />分 填空项{{ k + 1 }} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div slot="reference" class="input-wrap"> |
|
|
|
|
查看每空分值<el-input class="l-input" placeholder="请输入分值" v-model="ques.score" readonly /> |
|
|
|
|
</div> |
|
|
|
|
</el-popover> |
|
|
|
|
<el-button type="text" @click="toQues(item, j, ques)">编辑试题</el-button> |
|
|
|
|
<el-button type="text" @click="showManualDia(item, j, ques)">更换试题</el-button> |
|
|
|
|
<el-button type="text" @click="showManualDia(item, j)">添加试题</el-button> |
|
|
|
|
<el-button type="text" @click="delQues(item, j)">移除试题</el-button> |
|
|
|
|
<div class="input-wrap"> |
|
|
|
|
<span>排序</span> |
|
|
|
|
<el-input class="l-input sort-input" v-model="ques.serialNumber" |
|
|
|
|
@change="sortChange(item, ques)" /> |
|
|
|
|
|
|
|
|
|
<div v-if="ques.knowledgePointList && ques.knowledgePointList.length" class="bottom-line"> |
|
|
|
|
<span>【知识点】</span> |
|
|
|
|
<el-tag v-for="(kp, k) in ques.knowledgePointList" :key="k" class="m-r-5" type="info" |
|
|
|
|
effect="plain">{{ |
|
|
|
|
kp.name }}</el-tag> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</draggable> |
|
|
|
|
</div> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
</el-form> |
|
|
|
|
<div class="btns"> |
|
|
|
|
<el-button @click="submit(0)">保存草稿</el-button> |
|
|
|
|
<el-button type="primary" @click="submit(1)">发布</el-button> |
|
|
|
|
<el-button v-if="paperId" @click="preview">预览</el-button> |
|
|
|
|
<el-button @click="back">取消</el-button> |
|
|
|
|
</draggable> |
|
|
|
|
</div> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
</el-form> |
|
|
|
|
<div class="btns"> |
|
|
|
|
<el-button @click="submit(0)">保存草稿</el-button> |
|
|
|
|
<el-button type="primary" @click="submit(1)">发布</el-button> |
|
|
|
|
<el-button v-if="paperId" @click="preview">预览</el-button> |
|
|
|
|
<el-button @click="back">取消</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<Template :visible.sync="templateVisible" /> |
|
|
|
@ -248,6 +258,7 @@ export default { |
|
|
|
|
paperId: this.$route.query.paperId, |
|
|
|
|
libraryId: this.$route.query.libraryId, |
|
|
|
|
isCopy: this.$route.query.isCopy, |
|
|
|
|
loading: false, |
|
|
|
|
headers: { |
|
|
|
|
token: Util.local.get(Setting.tokenKey) |
|
|
|
|
}, |
|
|
|
@ -400,6 +411,7 @@ export default { |
|
|
|
|
try { |
|
|
|
|
const { paperId } = this |
|
|
|
|
if (paperId) { |
|
|
|
|
this.loading = true |
|
|
|
|
const res = await this.$get(this.api.examPaperDetails, { |
|
|
|
|
id: paperId |
|
|
|
|
}) |
|
|
|
@ -411,7 +423,7 @@ export default { |
|
|
|
|
e.examQuestions.map((n, j) => { |
|
|
|
|
n.originSort = j + 1 |
|
|
|
|
Object.assign(n, n.question) |
|
|
|
|
this.handleFillScore(n) |
|
|
|
|
this.handleQuesInfo(n) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
@ -419,7 +431,9 @@ export default { |
|
|
|
|
r.professionalId = r.professionalId ? r.professionalId.split(',').map(e => +e) : [] |
|
|
|
|
this.form = r |
|
|
|
|
} |
|
|
|
|
} catch (e) { } |
|
|
|
|
} finally { |
|
|
|
|
this.loading = false |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 获取试卷分类 |
|
|
|
|
async getType () { |
|
|
|
@ -605,10 +619,21 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 填空题的小空分数处理 |
|
|
|
|
handleFillScore (ques) { |
|
|
|
|
// 处理试题的知识点名称、难度等 |
|
|
|
|
handleQuesInfo (ques) { |
|
|
|
|
try { |
|
|
|
|
// 难度名称 |
|
|
|
|
const { difficults } = QuesConst |
|
|
|
|
if (ques.difficulty) { |
|
|
|
|
const curDiff = difficults.find(m => m.id === ques.difficulty) |
|
|
|
|
if (curDiff) { |
|
|
|
|
ques.difficult = curDiff.name |
|
|
|
|
ques.difficultTheme = curDiff.theme |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const opts = ques.questionAnswerVersionsList |
|
|
|
|
// 填空题的小空分数处理 |
|
|
|
|
if (ques.questionType === 'fill_blank' && opts && opts.length) { |
|
|
|
|
// 填空题小空json |
|
|
|
|
let { answerData } = opts[0] |
|
|
|
@ -1084,7 +1109,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.stem { |
|
|
|
|
max-width: calc(100% - 120px); |
|
|
|
|
margin-bottom: 10px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/deep/.l-input { |
|
|
|
@ -1117,21 +1142,19 @@ export default { |
|
|
|
|
|
|
|
|
|
.bottom-line { |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: space-between; |
|
|
|
|
align-items: center; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.correct { |
|
|
|
|
display: flex; |
|
|
|
|
align-items: baseline; |
|
|
|
|
margin-bottom: 10px; |
|
|
|
|
font-size: 13px; |
|
|
|
|
color: #333; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.ans { |
|
|
|
|
max-width: calc(100% - 100px); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.actions { |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: flex-end; |
|
|
|
|
display: inline-flex; |
|
|
|
|
align-items: center; |
|
|
|
|
margin-top: 10px; |
|
|
|
|
|
|
|
|
|
.el-button { |
|
|
|
|
margin: 0 20px 0 0; |
|
|
|
|