Merge remote-tracking branch 'origin/master'
| | |
| | | |
| | | export default { |
| | | pageList: query => post('/api/admin/exam/paper/page', query), |
| | | taskExamPage: query => post('/api/admin/exam/paper/taskExamPage', query), |
| | | addPaper: query => post('/api/admin/exam/paper/addPaper', query), |
| | | edit: query => post('/api/admin/exam/paper/edit', query), |
| | | select: id => post('/api/admin/exam/paper/select/' + id), |
| | | deletePaper: id => post('/api/admin/exam/paper/delete/' + id), |
| | |
| | | <tags-view/> |
| | | </div> |
| | | <app-main /> |
| | | <div class="foot-copyright"> |
| | | <span>Copyright ©2019-2024 武汉思维跳跃科技有限公司 版权所有</span> |
| | | </div> |
| | | <back-to-top :visibility-height="100" :back-position="0" transition-name="fade" ref="backTop"/> |
| | | </div> |
| | | </div> |
| | |
| | | name: 'audioPage', |
| | | meta: { title: '语音题编辑', noCache: true, activeMenu: '/exam/question/list' }, |
| | | hidden: true |
| | | }, |
| | | { |
| | | path: 'question/edit/calculate', |
| | | component: () => import('@/views/exam/question/edit/calculate'), |
| | | name: 'audioPage', |
| | | meta: { title: '计算题编辑', noCache: true, activeMenu: '/exam/question/list' }, |
| | | hidden: true |
| | | }, |
| | | { |
| | | path: 'question/edit/analysis', |
| | | component: () => import('@/views/exam/question/edit/analysis'), |
| | | name: 'audioPage', |
| | | meta: { title: '分析题编辑', noCache: true, activeMenu: '/exam/question/list' }, |
| | | hidden: true |
| | | } |
| | | ] |
| | | }, |
| | |
| | | }, |
| | | exam: { |
| | | examPaper: { |
| | | paperTypeEnum: [{ key: 1, value: '固定试卷' }, { key: 4, value: '时段试卷' }, { key: 6, value: '任务试卷' }] |
| | | paperTypeEnum: [{ key: 1, value: '固定试卷' }, { key: 2, value: '随机试卷' }, { key: 3, value: '随序试卷' }] |
| | | }, |
| | | question: { |
| | | typeEnum: [{ key: 1, value: '单选题' }, { key: 2, value: '多选题' }, { key: 3, value: '判断题' }, { key: 4, value: '填空题' }, { key: 5, value: '简答题' }, { key: 6, value: '语音题' }], |
| | | typeEnum: [{ key: 1, value: '单选题' }, { key: 2, value: '多选题' }, { key: 3, value: '判断题' }, { key: 4, value: '填空题' }, { key: 5, value: '简答题' }, { key: 6, value: '语音题' }, { key: 7, value: '计算题' }, { key: 8, value: '分析题' }], |
| | | editUrlEnum: [{ key: 1, value: '/exam/question/edit/singleChoice', name: '单选题' }, |
| | | { key: 2, value: '/exam/question/edit/multipleChoice', name: '多选题' }, |
| | | { key: 3, value: '/exam/question/edit/trueFalse', name: '判断题' }, |
| | | { key: 4, value: '/exam/question/edit/gapFilling', name: '填空题' }, |
| | | { key: 5, value: '/exam/question/edit/shortAnswer', name: '简答题' }, |
| | | { key: 6, value: '/exam/question/edit/audio', name: '语音题' }] |
| | | { key: 6, value: '/exam/question/edit/audio', name: '语音题' }, |
| | | { key: 7, value: '/exam/question/edit/calculate', name: '计算题' }, |
| | | { key: 8, value: '/exam/question/edit/analysis', name: '分析题' }] |
| | | } |
| | | } |
| | | } |
| | |
| | | <template> |
| | | <div v-loading="qLoading" style="line-height:1.8"> |
| | | <div v-if="qType == 1 || qType == 2 || qType == 3 || qType == 4 || qType == 5 || qType == 6"> |
| | | <div v-if="qType == 1 || qType == 2 || qType == 3 || qType == 4 || qType == 5 || qType == 6 || qType == 7 || qType == 8"> |
| | | <div v-if="qType == 1 || qType == 6"> |
| | | <div class="q-title" v-html="question.title" /> |
| | | <div class="q-content"> |
| | |
| | | </el-form-item> |
| | | </div> |
| | | </div> |
| | | <div v-else-if="qType == 5"> |
| | | <div v-else-if="qType == 5 || qType == 7 || qType == 8"> |
| | | <div class="q-title" v-html="question.title" /> |
| | | <div> |
| | | <el-input v-model="answer.content" type="textarea" rows="5"></el-input> |
| | |
| | | </div> |
| | | <div class="question-answer-show-item"> |
| | | <span class="question-show-item">正确答案:</span> |
| | | <span v-if="qType == 1 || qType == 2 || qType == 5 || qType == 6" v-html="question.correct" class="q-item-span-content" /> |
| | | <span v-if="qType == 1 || qType == 2 || qType == 5 || qType == 6 || qType == 7 || qType == 8" v-html="question.correct" class="q-item-span-content" /> |
| | | <span v-if="qType == 3" v-html="trueFalseFormatter(question)" class="q-item-span-content" /> |
| | | <span v-if="qType == 4">{{ question.correctArray }}</span> |
| | | </div> |
| | |
| | | <div class="app-container"> |
| | | <el-form :inline="true" :model="queryParam" class="demo-form-inline" label-width="80px"> |
| | | <el-form-item> |
| | | <el-input v-model="queryParam.examName" placeholder="请输入考试名称" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-input v-model="queryParam.name" placeholder="请输入试卷名称" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | |
| | | </el-form> |
| | | |
| | | <el-table v-loading="listLoading" :data="tableData" border style="width: 100%;"> |
| | | <el-table-column align="center" prop="examName" label="考试名称" /> |
| | | <el-table-column align="center" prop="paperName" label="试卷名称" /> |
| | | <el-table-column align="center" prop="subjectName" label="科目" /> |
| | | <el-table-column align="center" prop="paperType" label="试卷类型" width="150px"> |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="form" ref="form" label-width="100px" v-loading="formLoading" :rules="rules"> |
| | | <el-form-item label="年级:" prop="level" required> |
| | | <el-select v-model="form.level" placeholder="年级" @change="levelChange"> |
| | | <el-option v-for="item in levelEnum" :key="item.key" :value="item.key" :label="item.value"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form :model="form" ref="form" label-width="150px" v-loading="formLoading" :rules="rules"> |
| | | <el-form-item label="学科:" prop="subjectId" required> |
| | | <el-select v-model="form.subjectId" placeholder="学科"> |
| | | <el-option v-for="item in subjectFilter" :key="item.id" :value="item.id" |
| | | :label="item.name+' ( '+item.levelName+' )'"></el-option> |
| | | <el-option v-for="item in subjects" :key="item.id" :label="item.name" :value="item.id"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="试卷类型:" prop="paperType" required> |
| | |
| | | <el-option v-for="item in paperTypeEnum" :key="item.key" :value="item.key" :label="item.value"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="时间限制:" required v-show="form.paperType===4"> |
| | | <el-date-picker v-model="form.limitDateTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" |
| | | range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"> |
| | | </el-date-picker> |
| | | <el-form-item label="试卷名称:" prop="name" required> |
| | | <el-input style="width: 300px" v-model="form.name"/> |
| | | </el-form-item> |
| | | <el-form-item label="试卷名称:" prop="name" required> |
| | | <el-input v-model="form.name"/> |
| | | </el-form-item> |
| | | <el-form-item :key="index" :label="'标题'+(index+1)+':'" required v-for="(titleItem,index) in form.titleItems"> |
| | | <el-input v-model="titleItem.name" style="width: 80%"/> |
| | | <el-form-item :key="index" :label="'标题'+(index+1)+':'" required |
| | | v-for="(titleItem,index) in form.questionTitleList" v-show="form.paperType===1"> |
| | | <el-input v-model="titleItem.title" style="width: 50%"/> |
| | | <el-select @change="addQuestionType" v-model="titleItem.questionType" style="margin-left: 20px" |
| | | placeholder="请选择题目类型"> |
| | | <el-option |
| | | v-for="item in questionTypeList" |
| | | :key="item.value" |
| | | :label="item.name" |
| | | :value="item.value" |
| | | :disabled="addedQuestionTypes.includes(item.value)"/><!-- 禁用已添加的选项 --> |
| | | </el-select> |
| | | <el-input-number v-show ="titleItem.questionList.length > 0" v-model="titleItem.eachScore" @change="updateScores(titleItem)" :min="0" :precision="1" |
| | | style="margin-left: 20px" placeholder="每题分数"></el-input-number> |
| | | <el-button type="text" class="link-left" style="margin-left: 20px" size="mini" @click="addQuestion(titleItem)"> |
| | | 添加题目 |
| | | </el-button> |
| | | <el-button type="text" class="link-left" size="mini" @click="form.titleItems.splice(index,1)">删除</el-button> |
| | | <el-card class="exampaper-item-box" v-if="titleItem.questionItems.length!==0"> |
| | | <el-button type="text" class="link-left" size="mini" @click="removeTitleItem(titleItem,index)">删除</el-button> |
| | | <el-card class="exampaper-item-box" v-if="titleItem.questionList.length!==0"> |
| | | <el-form-item :key="questionIndex" :label="'题目'+(questionIndex+1)+':'" |
| | | v-for="(questionItem,questionIndex) in titleItem.questionItems" style="margin-bottom: 15px"> |
| | | v-for="(questionItem,questionIndex) in titleItem.questionList" style="margin-bottom: 15px"> |
| | | <el-row> |
| | | <el-col :span="23"> |
| | | <QuestionShow :qType="questionItem.questionType" :question="questionItem"/> |
| | | <el-col :span="18"> |
| | | <QuestionShow :qType="titleItem.questionType" :question="questionItem"/> |
| | | </el-col> |
| | | <el-col :span="1"> |
| | | <el-button type="text" size="mini" @click="titleItem.questionItems.splice(questionIndex,1)">删除 |
| | | <el-col :span="3"> |
| | | <el-input-number v-model="questionItem.score" size="mini" :min="0" :precision="1" placeholder="分数" |
| | | :controls="false" @change="updateTotalScore"/> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <el-button type="text" size="mini" @click="removeQuestion(titleItem,questionItem)">删除 |
| | | </el-button> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form-item> |
| | | </el-card> |
| | | </el-form-item> |
| | | <el-form-item label="建议时长:" prop="suggestTime" required> |
| | | <el-input v-model="form.suggestTime" placeholder="分钟"/> |
| | | <el-form-item label="多选题得分类型:" prop="deductType"> |
| | | <div> |
| | | <el-select v-model="form.deductType" placeholder="请选择多选题得分类型" style="width: 200px;margin-right: 30px"> |
| | | <el-option |
| | | v-for="item in deductTypeList" |
| | | :key="item.value" |
| | | :label="item.name" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | <el-input-number v-model="form.deductTypeScore" placeholder="请输入多选评分" |
| | | v-show="form.deductType === 2 || form.deductType === 3" :min="0"/> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item label="建议时长(分钟):" prop="suggestTime" required> |
| | | <el-input-number v-model="form.suggestTime" placeholder="分钟" :min="0"/> |
| | | </el-form-item> |
| | | <el-form-item label="权限:" prop="visibility"> |
| | | <el-radio v-model="form.visibility" :label="'1'">私有</el-radio> |
| | | <el-radio v-model="form.visibility" :label="'2'">公开</el-radio> |
| | | </el-form-item> |
| | | <el-form-item v-show="form.paperType ===2 ||form.paperType ===3" :key="index" |
| | | :label="translateQuestionType(item.questionType)+':'" v-for="(item,index) in form.questionSetting"> |
| | | <div style="display: flex;"> |
| | | <span style="margin-right: 10px">{{ '标题' }}</span> |
| | | <el-input v-model="item.title" style="margin-right: 50px;width: 500px"/> |
| | | <span style="margin-right: 10px">{{ '数量' }}</span> |
| | | <el-input-number v-model="item.num" :precision="0" :min="0" style="margin-right: 50px"/> |
| | | <span style="margin-right: 10px">{{ '每题分数' }}</span> |
| | | <el-input-number v-model="item.score" :min="0" :precision="1"/> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item label="合计:"> |
| | | <div style="display: flex;"> |
| | | <span style="margin-right: 10px">{{ '数量:' }}</span> |
| | | <span v-if ="form.paperType ===2 || (form.paperType ===3 && !form.id)" style="margin-right: 50px;width: 100px">{{ totalNum }}</span> |
| | | <span v-if ="form.paperType ===1" style="margin-right: 50px;width: 100px">{{ form.num }}</span> |
| | | <span style="margin-right: 10px">{{ '总分:' }}</span> |
| | | <span v-if ="form.paperType ===2 || (form.paperType ===3 && !form.id)" style="width: 100px">{{ totalScore }}</span> |
| | | <span v-if ="form.paperType ===1" style="width: 100px">{{ form.score }}</span> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="submitForm">提交</el-button> |
| | | <el-button @click="resetForm">重置</el-button> |
| | | <el-button type="success" @click="addTitle">添加标题</el-button> |
| | | <el-button type="success" @click="addTitle" v-show="form.paperType ===1">添加标题</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-dialog :visible.sync="questionPage.showDialog" width="70%"> |
| | | |
| | | <el-dialog :visible.sync="questionPage.showDialog" width="70%"> |
| | | <el-form :model="questionPage.queryParam" ref="queryForm" :inline="true"> |
| | | <el-form-item label="ID:"> |
| | | <el-input v-model="questionPage.queryParam.id" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="题型:"> |
| | | <el-select v-model="questionPage.queryParam.questionType" clearable> |
| | | <el-option v-for="item in questionTypeEnum" :key="item.key" :value="item.key" :label="item.value"></el-option> |
| | | </el-select> |
| | | <el-input v-model="questionPage.queryParam.id" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="queryForm">查询</el-button> |
| | |
| | | @selection-change="handleSelectionChange" border fit highlight-current-row style="width: 100%"> |
| | | <el-table-column type="selection" width="35"></el-table-column> |
| | | <el-table-column prop="id" label="Id" width="60px"/> |
| | | <el-table-column prop="questionType" label="题型" :formatter="questionTypeFormatter" width="70px"/> |
| | | <el-table-column prop="questionType" label="题型" width="70px"> |
| | | <template slot-scope="scope"> |
| | | <div> {{ translateQuestionType(scope.row.questionType) }}</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="shortTitle" label="题干" show-overflow-tooltip/> |
| | | </el-table> |
| | | <pagination v-show="questionPage.total>0" :total="questionPage.total" |
| | | :page.sync="questionPage.queryParam.pageIndex" :limit.sync="questionPage.queryParam.pageSize" |
| | | @pagination="search"/> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="questionPage.showDialog = false">取 消</el-button> |
| | | <el-button type="primary" @click="confirmQuestionSelect">确定</el-button> |
| | | </span> |
| | | <el-button @click="questionPage.showDialog = false">取 消</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { mapGetters, mapState, mapActions } from 'vuex' |
| | | import { mapState, mapActions } from 'vuex' |
| | | import Pagination from '@/components/Pagination' |
| | | import subjectApi from '@/api/subject' |
| | | import QuestionShow from '../question/components/Show' |
| | | import examPaperApi from '@/api/examPaper' |
| | | import questionApi from '@/api/question' |
| | |
| | | return { |
| | | form: { |
| | | id: null, |
| | | level: null, |
| | | subjectId: null, |
| | | paperType: 1, |
| | | limitDateTime: [], |
| | | name: '', |
| | | suggestTime: null, |
| | | titleItems: [] |
| | | num: 0, |
| | | score: 0, |
| | | suggestTime: 0, |
| | | deductType: 1, |
| | | deductTypeScore: 0, |
| | | visibility: '1', |
| | | questionSetting: [ |
| | | { questionType: 1, title: '单选题', score: null, num: null }, |
| | | { questionType: 2, title: '多选题', score: null, num: null }, |
| | | { questionType: 3, title: '判断题', score: null, num: null }, |
| | | { questionType: 4, title: '填空题', score: null, num: null }, |
| | | { questionType: 5, title: '简答题', score: null, num: null }, |
| | | { questionType: 6, title: '语音题', score: null, num: null }, |
| | | { questionType: 7, title: '计算题', score: null, num: null }, |
| | | { questionType: 8, title: '分析题', score: null, num: null }, |
| | | ], |
| | | questionTitleList: [] |
| | | }, |
| | | subjectFilter: null, |
| | | deductTypeList: [ |
| | | { name: '答错不得分', value: 1 }, |
| | | { name: '漏选得固定分值,包含错误选项不得分', value: 2 }, |
| | | { name: '每对一题得相应分值,包含错误选项不得分', value: 3 }, |
| | | ], |
| | | questionTypeList: [ |
| | | { name: '单选题', value: 1 }, |
| | | { name: '多选题', value: 2 }, |
| | | { name: '判断题', value: 3 }, |
| | | { name: '填空题', value: 4 }, |
| | | { name: '简答题', value: 5 }, |
| | | { name: '语音题', value: 6 }, |
| | | { name: '计算题', value: 7 }, |
| | | { name: '分析题', value: 8 }, |
| | | ], |
| | | addedQuestionTypes: [], // 已添加的题目类型 |
| | | subjects: [], |
| | | formLoading: false, |
| | | rules: { |
| | | level: [ |
| | |
| | | showDialog: false, |
| | | queryParam: { |
| | | id: null, |
| | | questionType: null, |
| | | subjectId: 1, |
| | | questionType: [], |
| | | subjectId: [], |
| | | pageIndex: 1, |
| | | pageSize: 5 |
| | | }, |
| | |
| | | created () { |
| | | let id = this.$route.query.id |
| | | let _this = this |
| | | this.initSubject(function () { |
| | | _this.subjectFilter = _this.subjects |
| | | }) |
| | | this.getSubjects() |
| | | if (id && parseInt(id) !== 0) { |
| | | _this.formLoading = true |
| | | examPaperApi.select(id).then(re => { |
| | | _this.form = re.response |
| | | _this.form = re.data |
| | | _this.formLoading = false |
| | | }) |
| | | } |
| | | }, |
| | | methods: { |
| | | updateTotalScore () { |
| | | this.form.score = 0 |
| | | this.form.questionTitleList.forEach(titleItem => { |
| | | titleItem.questionList.forEach(questionItem => { |
| | | if (questionItem.score) { |
| | | this.form.score += questionItem.score |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | updateScores (titleItem) { |
| | | if (titleItem && titleItem.questionList) { |
| | | titleItem.questionList.forEach(questionItem => { |
| | | questionItem.score = titleItem.eachScore // 更新每个题目的分数 |
| | | }) |
| | | } |
| | | this.updateTotalScore() |
| | | }, |
| | | // 添加题目类型 |
| | | addQuestionType () { |
| | | if (this.form.questionTitleList.length > 0) { |
| | | this.addedQuestionTypes = [] |
| | | // 遍历题目列表 |
| | | this.form.questionTitleList.forEach((titleItem) => { |
| | | // 检查当前题目的类型是否还没有被添加到已添加的题目类型数组中 |
| | | if (!this.addedQuestionTypes.includes(titleItem.questionType)) { |
| | | // 如果还没有被添加,则添加到数组中 |
| | | this.addedQuestionTypes.push(titleItem.questionType) |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | // 获取科目 |
| | | getSubjects () { |
| | | subjectApi.list().then(re => { |
| | | this.subjects = re.data |
| | | }) |
| | | }, |
| | | translateQuestionType (questionTypeId) { |
| | | const questionType = this.questionTypeList.find(questionType => questionType.value === questionTypeId) |
| | | return questionType ? questionType.name : '未知' |
| | | }, |
| | | submitForm () { |
| | | let _this = this |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | this.formLoading = true |
| | | examPaperApi.edit(this.form).then(re => { |
| | | if (re.code === 1) { |
| | | _this.$message.success(re.message) |
| | | _this.delCurrentView(_this).then(() => { |
| | | _this.$router.push('/exam/paper/list') |
| | | }) |
| | | } else { |
| | | _this.$message.error(re.message) |
| | | if (this.form.id) { |
| | | examPaperApi.edit(this.form).then(re => { |
| | | if (re.code === 1) { |
| | | _this.$message.success(re.message) |
| | | _this.delCurrentView(_this).then(() => { |
| | | _this.$router.push('/exam/paper/list') |
| | | }) |
| | | } else { |
| | | _this.$message.error(re.message) |
| | | this.formLoading = false |
| | | } |
| | | }).catch(e => { |
| | | this.formLoading = false |
| | | } |
| | | }).catch(e => { |
| | | this.formLoading = false |
| | | }) |
| | | }) |
| | | } else { |
| | | examPaperApi.addPaper(this.form).then(re => { |
| | | if (re.code === 1) { |
| | | _this.$message.success(re.message) |
| | | _this.delCurrentView(_this).then(() => { |
| | | _this.$router.push('/exam/paper/list') |
| | | }) |
| | | } else { |
| | | _this.$message.error(re.message) |
| | | this.formLoading = false |
| | | } |
| | | }).catch(e => { |
| | | this.formLoading = false |
| | | }) |
| | | } |
| | | } else { |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | addTitle () { |
| | | this.form.titleItems.push({ |
| | | name: '', |
| | | questionItems: [] |
| | | this.form.questionTitleList.push({ |
| | | questionList: [] |
| | | }) |
| | | }, |
| | | addQuestion (titleItem) { |
| | | this.currentTitleItem = titleItem |
| | | this.questionPage.queryParam.questionType = [] |
| | | this.questionPage.queryParam.questionType.push(titleItem.questionType) |
| | | this.questionPage.showDialog = true |
| | | this.search() |
| | | }, |
| | | removeTitleItem (titleItem) { |
| | | this.form.titleItems.remove(titleItem) |
| | | removeTitleItem (titleItem ,index) { |
| | | this.form.questionTitleList.splice(index, 1) |
| | | this.form.num = this.form.num - titleItem.questionList.length |
| | | this.updateTotalScore(); |
| | | if (!this.form.questionTitleList || this.form.questionTitleList.length === 0) { |
| | | this.addedQuestionTypes = [] |
| | | } else { |
| | | this.addQuestionType() |
| | | } |
| | | }, |
| | | removeQuestion (titleItem, questionItem) { |
| | | titleItem.questionItems.remove(questionItem) |
| | | removeQuestion (titleItem ,questionIndex) { |
| | | titleItem.questionList.splice(questionIndex ,1) |
| | | this.updateTotalScore(); |
| | | this.form.num = this.form.num - 1 |
| | | }, |
| | | queryForm () { |
| | | this.questionPage.queryParam.pageIndex = 1 |
| | |
| | | let _this = this |
| | | this.questionPage.multipleSelection.forEach(q => { |
| | | questionApi.select(q.id).then(re => { |
| | | _this.currentTitleItem.questionItems.push(re.response) |
| | | _this.currentTitleItem.questionList.push(re.data) |
| | | this.form.num += 1 |
| | | }) |
| | | }) |
| | | this.questionPage.showDialog = false |
| | | }, |
| | | levelChange () { |
| | | this.form.subjectId = null |
| | | this.subjectFilter = this.subjects.filter(data => data.level === this.form.level) |
| | | }, |
| | | search () { |
| | | this.questionPage.queryParam.subjectId = this.form.subjectId |
| | | this.questionPage.queryParam.subjectId = [] |
| | | this.questionPage.queryParam.subjectId.push(this.form.subjectId) |
| | | this.questionPage.listLoading = true |
| | | questionApi.pageList(this.questionPage.queryParam).then(data => { |
| | | const re = data.response |
| | | const re = data.data |
| | | this.questionPage.tableData = re.list |
| | | this.questionPage.total = re.total |
| | | this.questionPage.queryParam.pageIndex = re.pageNum |
| | |
| | | handleSelectionChange (val) { |
| | | this.questionPage.multipleSelection = val |
| | | }, |
| | | questionTypeFormatter (row, column, cellValue, index) { |
| | | return this.enumFormat(this.questionTypeEnum, cellValue) |
| | | }, |
| | | subjectFormatter (row, column, cellValue, index) { |
| | | return this.subjectEnumFormat(cellValue) |
| | | }, |
| | | resetForm () { |
| | | let lastId = this.form.id |
| | | this.$refs['form'].resetFields() |
| | | this.form = { |
| | | id: null, |
| | | level: null, |
| | | subjectId: null, |
| | | paperType: 1, |
| | | limitDateTime: [], |
| | | name: '', |
| | | suggestTime: null, |
| | | titleItems: [] |
| | | num: 0, |
| | | score: 0, |
| | | suggestTime: 0, |
| | | deductType: 1, |
| | | deductTypeScore: 0, |
| | | visibility: '1', |
| | | questionSetting: [ |
| | | { questionType: 1, title: '单选题', score: null, num: null }, |
| | | { questionType: 2, title: '多选题', score: null, num: null }, |
| | | { questionType: 3, title: '判断题', score: null, num: null }, |
| | | { questionType: 4, title: '填空题', score: null, num: null }, |
| | | { questionType: 5, title: '简答题', score: null, num: null }, |
| | | { questionType: 6, title: '计算题', score: null, num: null }, |
| | | ], |
| | | questionTitleList: [] |
| | | } |
| | | this.form.id = lastId |
| | | }, |
| | | ...mapActions('exam', { initSubject: 'initSubject' }), |
| | | ...mapActions('tagsView', { delCurrentView: 'delCurrentView' }) |
| | | }, |
| | | computed: { |
| | | ...mapGetters('enumItem', ['enumFormat']), |
| | | ...mapState('enumItem', { |
| | | questionTypeEnum: state => state.exam.question.typeEnum, |
| | | paperTypeEnum: state => state.exam.examPaper.paperTypeEnum, |
| | | levelEnum: state => state.user.levelEnum |
| | | }), |
| | | ...mapState('exam', { subjects: state => state.subjects }) |
| | | totalNum () { |
| | | if (this.form.paperType === 2 || this.form.paperType === 3) { |
| | | let total = 0 |
| | | for (let item of this.form.questionSetting) { |
| | | total += parseInt(item.num || 0, 10) |
| | | } |
| | | this.form.num = total |
| | | return total |
| | | } else { |
| | | |
| | | } |
| | | }, |
| | | totalScore () { |
| | | if (this.form.paperType === 2 || this.form.paperType === 3) { |
| | | let total = 0 |
| | | for (let item of this.form.questionSetting) { |
| | | const num = parseInt(item.num || 0, 10) |
| | | const score = parseFloat(item.score || 0) |
| | | total += num * score |
| | | } |
| | | this.form.score = total.toFixed(1) |
| | | return total.toFixed(1) // 保留一位小数 |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .exampaper-item-box { |
| | | .q-title { |
| | | margin: 0px 5px 0px 5px; |
| | | } |
| | | .q-item-content { |
| | | } |
| | | .exampaper-item-box { |
| | | .q-title { |
| | | margin: 0px 5px 0px 5px; |
| | | } |
| | | |
| | | .q-item-content { |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParam" ref="queryForm" :inline="true"> |
| | | <el-form-item label="题目ID:"> |
| | | <el-form-item label="试卷ID:"> |
| | | <el-input v-model="queryParam.id" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="年级:"> |
| | | <el-select v-model="queryParam.level" placeholder="年级" @change="levelChange" clearable> |
| | | <el-option v-for="item in levelEnum" :key="item.key" :value="item.key" :label="item.value"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="学科:" > |
| | | <el-select v-model="queryParam.subjectId" clearable> |
| | | <el-option v-for="item in subjectFilter" :key="item.id" :value="item.id" :label="item.name+' ( '+item.levelName+' )'"></el-option> |
| | | <el-select |
| | | v-model="queryParam.subjectId" |
| | | placeholder="全部科目" |
| | | clearable |
| | | > |
| | | <el-option v-for="item in subjects" :key="item.id" :label="item.name" :value="item.id"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-table v-loading="listLoading" :data="tableData" border fit highlight-current-row style="width: 100%"> |
| | | <el-table-column prop="id" label="Id" width="90px"/> |
| | | <el-table-column prop="subjectId" label="学科" :formatter="subjectFormatter" width="120px" /> |
| | | <el-table-column prop="name" label="名称" /> |
| | | <el-table-column prop="createTime" label="创建时间" width="160px"/> |
| | | <el-table-column align="center" prop="id" label="Id" width="90px"/> |
| | | <el-table-column align="center" prop="subjectId" label="学科" width="120px" > |
| | | <template slot-scope="scope"> |
| | | {{ translate(scope.row.subjectId) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="name" label="名称" /> |
| | | <el-table-column |
| | | align="center" |
| | | prop="paperType" |
| | | label="试卷类型" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <div v-if="scope.row.paperType === 1">固定试卷</div> |
| | | <div v-else-if="scope.row.paperType === 2">随机试卷</div> |
| | | <div v-else-if="scope.row.paperType === 3">随序试卷</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | prop="suggestTime" |
| | | label="建议时长(分钟)" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | prop="num" |
| | | label="题目数量" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | prop="score" |
| | | label="总分" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="createTime" label="创建时间" width="160px"/> |
| | | <el-table-column label="操作" align="center" width="160px"> |
| | | <template slot-scope="{row}"> |
| | | <el-button size="mini" @click="$router.push({path:'/exam/paper/edit',query:{id:row.id}})" >编辑</el-button> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { mapGetters, mapState, mapActions } from 'vuex' |
| | | import Pagination from '@/components/Pagination' |
| | | import subjectApi from '@/api/subject' |
| | | import examPaperApi from '@/api/examPaper' |
| | | |
| | | export default { |
| | |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | }, |
| | | subjectFilter: null, |
| | | listLoading: true, |
| | | tableData: [], |
| | | subjects: [], |
| | | total: 0 |
| | | } |
| | | }, |
| | | created () { |
| | | this.initSubject() |
| | | this.getSubjects() |
| | | this.search() |
| | | }, |
| | | methods: { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | levelChange () { |
| | | this.queryParam.subjectId = null |
| | | this.subjectFilter = this.subjects.filter(data => data.level === this.queryParam.level) |
| | | // 获取科目 |
| | | getSubjects() { |
| | | subjectApi.list().then(re => { |
| | | this.subjects = re.data |
| | | }) |
| | | }, |
| | | subjectFormatter (row, column, cellValue, index) { |
| | | return this.subjectEnumFormat(cellValue) |
| | | }, |
| | | ...mapActions('exam', { initSubject: 'initSubject' }) |
| | | }, |
| | | computed: { |
| | | ...mapGetters('enumItem', ['enumFormat']), |
| | | ...mapState('enumItem', { |
| | | levelEnum: state => state.user.levelEnum |
| | | }), |
| | | ...mapGetters('exam', ['subjectEnumFormat']), |
| | | ...mapState('exam', { subjects: state => state.subjects }) |
| | | translate(subjectId) { |
| | | const subject = this.subjects.find(subject => subject.id == subjectId); |
| | | return subject ? subject.name : '未知'; |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <div v-else-if="qType==4" v-loading="qLoading"> |
| | | <div class="q-title" v-html="question.title"/> |
| | | </div> |
| | | <div v-else-if="qType==5" v-loading="qLoading"> |
| | | <div v-else-if="qType==5 || qType == 7 || qType == 8" v-loading="qLoading"> |
| | | <div class="q-title" v-html="question.title"/> |
| | | </div> |
| | | <div v-else> |
New file |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="form" ref="form" label-width="100px" v-loading="formLoading" :rules="rules"> |
| | | <el-form-item label="学科:" prop="subjectId" required> |
| | | <el-select v-model="form.subjectId" placeholder="学科" > |
| | | <el-option v-for="item in subjects" :key="item.id" :value="item.id" :label="item.name"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="题干:" prop="title" required> |
| | | <el-input v-model="form.title" @focus="inputClick(form,'title')" /> |
| | | </el-form-item> |
| | | <el-form-item label="答案:" prop="correct" required> |
| | | <el-input v-model="form.correct" @focus="inputClick(form,'correct')" /> |
| | | </el-form-item> |
| | | <el-form-item label="解析:" prop="analyze" required> |
| | | <el-input v-model="form.analyze" @focus="inputClick(form,'analyze')" /> |
| | | </el-form-item> |
| | | <el-form-item label="难度:" required> |
| | | <el-rate v-model="form.difficult" class="question-item-rate"></el-rate> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="submitForm">提交</el-button> |
| | | <el-button @click="resetForm">重置</el-button> |
| | | <el-button type="success" @click="showQuestion">预览</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-dialog :visible.sync="richEditor.dialogVisible" append-to-body :close-on-click-modal="false" style="width: 100%;height: 100%" :show-close="false" center> |
| | | <Ueditor @ready="editorReady"/> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="editorConfirm">确 定</el-button> |
| | | <el-button @click="richEditor.dialogVisible = false">取 消</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="questionShow.dialog" style="width: 100%;height: 100%"> |
| | | <QuestionShow :qType="questionShow.qType" :question="questionShow.question" :qLoading="questionShow.loading"/> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import QuestionShow from '../components/Show' |
| | | import Ueditor from '@/components/Ueditor' |
| | | import { mapGetters, mapState, mapActions } from 'vuex' |
| | | import questionApi from '@/api/question' |
| | | |
| | | export default { |
| | | components: { |
| | | Ueditor, QuestionShow |
| | | }, |
| | | data () { |
| | | return { |
| | | form: { |
| | | id: null, |
| | | questionType: 8, |
| | | gradeLevel: null, |
| | | subjectId: null, |
| | | title: '', |
| | | items: [], |
| | | analyze: '', |
| | | correct: '', |
| | | score: '', |
| | | difficult: 0 |
| | | }, |
| | | subjectFilter: null, |
| | | formLoading: false, |
| | | rules: { |
| | | gradeLevel: [ |
| | | { required: true, message: '请选择年级', trigger: 'change' } |
| | | ], |
| | | subjectId: [ |
| | | { required: true, message: '请选择学科', trigger: 'change' } |
| | | ], |
| | | title: [ |
| | | { required: true, message: '请输入题干', trigger: 'blur' } |
| | | ], |
| | | correct: [ |
| | | { required: true, message: '请输入答案', trigger: 'blur' } |
| | | ], |
| | | analyze: [ |
| | | { required: true, message: '请输入解析', trigger: 'blur' } |
| | | ], |
| | | score: [ |
| | | { required: true, message: '请输入分数', trigger: 'blur' } |
| | | ] |
| | | }, |
| | | richEditor: { |
| | | dialogVisible: false, |
| | | object: null, |
| | | parameterName: '', |
| | | instance: null |
| | | }, |
| | | questionShow: { |
| | | qType: 0, |
| | | dialog: false, |
| | | question: null, |
| | | loading: false |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | let id = this.$route.query.id |
| | | let _this = this |
| | | this.initSubject(function () { |
| | | _this.subjectFilter = _this.subjects |
| | | }) |
| | | if (id && parseInt(id) !== 0) { |
| | | _this.formLoading = true |
| | | questionApi.select(id).then(re => { |
| | | _this.form = re.data |
| | | _this.formLoading = false |
| | | }) |
| | | } |
| | | }, |
| | | methods: { |
| | | editorReady (instance) { |
| | | this.richEditor.instance = instance |
| | | let currentContent = this.richEditor.object[this.richEditor.parameterName] |
| | | this.richEditor.instance.setContent(currentContent) |
| | | // 光标定位到Ueditor |
| | | this.richEditor.instance.focus(true) |
| | | }, |
| | | inputClick (object, parameterName) { |
| | | this.richEditor.object = object |
| | | this.richEditor.parameterName = parameterName |
| | | this.richEditor.dialogVisible = true |
| | | }, |
| | | editorConfirm () { |
| | | let content = this.richEditor.instance.getContent() |
| | | this.richEditor.object[this.richEditor.parameterName] = content |
| | | this.richEditor.dialogVisible = false |
| | | }, |
| | | submitForm () { |
| | | let _this = this |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | this.formLoading = true |
| | | questionApi.edit(this.form).then(re => { |
| | | if (re.code === 1) { |
| | | _this.$message.success(re.message) |
| | | _this.delCurrentView(_this).then(() => { |
| | | _this.$router.push('/exam/question/list') |
| | | }) |
| | | } else { |
| | | _this.$message.error(re.message) |
| | | this.formLoading = false |
| | | } |
| | | }).catch(e => { |
| | | this.formLoading = false |
| | | }) |
| | | } else { |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | resetForm () { |
| | | let lastId = this.form.id |
| | | this.$refs['form'].resetFields() |
| | | this.form = { |
| | | id: null, |
| | | questionType: 5, |
| | | gradeLevel: null, |
| | | subjectId: null, |
| | | title: '', |
| | | items: [], |
| | | analyze: '', |
| | | correct: '', |
| | | score: '', |
| | | difficult: 0 |
| | | } |
| | | this.form.id = lastId |
| | | }, |
| | | levelChange () { |
| | | this.form.subjectId = null |
| | | this.subjectFilter = this.subjects.filter(data => data.level === this.form.gradeLevel) |
| | | }, |
| | | showQuestion () { |
| | | this.questionShow.dialog = true |
| | | this.questionShow.qType = this.form.questionType |
| | | this.questionShow.question = this.form |
| | | }, |
| | | ...mapActions('exam', { initSubject: 'initSubject' }), |
| | | ...mapActions('tagsView', { delCurrentView: 'delCurrentView' }) |
| | | }, |
| | | computed: { |
| | | ...mapGetters('enumItem', ['enumFormat']), |
| | | ...mapState('enumItem', { |
| | | questionTypeEnum: state => state.exam.question.typeEnum, |
| | | levelEnum: state => state.user.levelEnum |
| | | }), |
| | | ...mapState('exam', { subjects: state => state.subjects }) |
| | | } |
| | | } |
| | | </script> |
| | |
| | | </el-form-item> |
| | | <el-form-item label="语音:" prop="audioFile" required> |
| | | <el-upload v-model="form.audioFile" :action="uploadUrl" :limit="1" accept="audio/*" :on-success="uploadSuccess" |
| | | :file-list="audioList"> |
| | | :on-remove="handleRemove" :file-list="audioList"> |
| | | <el-button size="small" type="primary">点击上传</el-button> |
| | | <el-button v-if="form.audioFile" size="small" type="primary" @click.stop="audioPlay(form.audioFile)">{{ |
| | | audioInstance ? '暂停' : '试听' }}</el-button> |
| | | </el-upload> |
| | | </el-form-item> |
| | | <el-form-item label="选项:" required> |
| | |
| | | dialog: false, |
| | | question: null, |
| | | loading: false |
| | | } |
| | | }, |
| | | audioInstance: null |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | handleRemove() { |
| | | this.form.audioFile = '' |
| | | }, |
| | | audioPlay(url) { |
| | | if (this.audioInstance) { |
| | | this.audioInstance.pause(); |
| | | this.audioInstance = null; |
| | | } else { |
| | | this.audioInstance = new Audio('/api/files/' + url); |
| | | this.audioInstance.play(); |
| | | } |
| | | }, |
| | | uploadSuccess(response) { |
| | | this.form.audioFile = response.data.url; |
| | | this.form.originalFile = response.data.name; |
New file |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="form" ref="form" label-width="100px" v-loading="formLoading" :rules="rules"> |
| | | <el-form-item label="学科:" prop="subjectId" required> |
| | | <el-select v-model="form.subjectId" placeholder="学科" > |
| | | <el-option v-for="item in subjects" :key="item.id" :value="item.id" :label="item.name"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="题干:" prop="title" required> |
| | | <el-input v-model="form.title" @focus="inputClick(form,'title')" /> |
| | | </el-form-item> |
| | | <el-form-item label="答案:" prop="correct" required> |
| | | <el-input v-model="form.correct" @focus="inputClick(form,'correct')" /> |
| | | </el-form-item> |
| | | <el-form-item label="解析:" prop="analyze" required> |
| | | <el-input v-model="form.analyze" @focus="inputClick(form,'analyze')" /> |
| | | </el-form-item> |
| | | <el-form-item label="难度:" required> |
| | | <el-rate v-model="form.difficult" class="question-item-rate"></el-rate> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="submitForm">提交</el-button> |
| | | <el-button @click="resetForm">重置</el-button> |
| | | <el-button type="success" @click="showQuestion">预览</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-dialog :visible.sync="richEditor.dialogVisible" append-to-body :close-on-click-modal="false" style="width: 100%;height: 100%" :show-close="false" center> |
| | | <Ueditor @ready="editorReady"/> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="editorConfirm">确 定</el-button> |
| | | <el-button @click="richEditor.dialogVisible = false">取 消</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="questionShow.dialog" style="width: 100%;height: 100%"> |
| | | <QuestionShow :qType="questionShow.qType" :question="questionShow.question" :qLoading="questionShow.loading"/> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import QuestionShow from '../components/Show' |
| | | import Ueditor from '@/components/Ueditor' |
| | | import { mapGetters, mapState, mapActions } from 'vuex' |
| | | import questionApi from '@/api/question' |
| | | |
| | | export default { |
| | | components: { |
| | | Ueditor, QuestionShow |
| | | }, |
| | | data () { |
| | | return { |
| | | form: { |
| | | id: null, |
| | | questionType: 7, |
| | | gradeLevel: null, |
| | | subjectId: null, |
| | | title: '', |
| | | items: [], |
| | | analyze: '', |
| | | correct: '', |
| | | score: '', |
| | | difficult: 0 |
| | | }, |
| | | subjectFilter: null, |
| | | formLoading: false, |
| | | rules: { |
| | | gradeLevel: [ |
| | | { required: true, message: '请选择年级', trigger: 'change' } |
| | | ], |
| | | subjectId: [ |
| | | { required: true, message: '请选择学科', trigger: 'change' } |
| | | ], |
| | | title: [ |
| | | { required: true, message: '请输入题干', trigger: 'blur' } |
| | | ], |
| | | correct: [ |
| | | { required: true, message: '请输入答案', trigger: 'blur' } |
| | | ], |
| | | analyze: [ |
| | | { required: true, message: '请输入解析', trigger: 'blur' } |
| | | ], |
| | | score: [ |
| | | { required: true, message: '请输入分数', trigger: 'blur' } |
| | | ] |
| | | }, |
| | | richEditor: { |
| | | dialogVisible: false, |
| | | object: null, |
| | | parameterName: '', |
| | | instance: null |
| | | }, |
| | | questionShow: { |
| | | qType: 0, |
| | | dialog: false, |
| | | question: null, |
| | | loading: false |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | let id = this.$route.query.id |
| | | let _this = this |
| | | this.initSubject(function () { |
| | | _this.subjectFilter = _this.subjects |
| | | }) |
| | | if (id && parseInt(id) !== 0) { |
| | | _this.formLoading = true |
| | | questionApi.select(id).then(re => { |
| | | _this.form = re.data |
| | | _this.formLoading = false |
| | | }) |
| | | } |
| | | }, |
| | | methods: { |
| | | editorReady (instance) { |
| | | this.richEditor.instance = instance |
| | | let currentContent = this.richEditor.object[this.richEditor.parameterName] |
| | | this.richEditor.instance.setContent(currentContent) |
| | | // 光标定位到Ueditor |
| | | this.richEditor.instance.focus(true) |
| | | }, |
| | | inputClick (object, parameterName) { |
| | | this.richEditor.object = object |
| | | this.richEditor.parameterName = parameterName |
| | | this.richEditor.dialogVisible = true |
| | | }, |
| | | editorConfirm () { |
| | | let content = this.richEditor.instance.getContent() |
| | | this.richEditor.object[this.richEditor.parameterName] = content |
| | | this.richEditor.dialogVisible = false |
| | | }, |
| | | submitForm () { |
| | | let _this = this |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | this.formLoading = true |
| | | questionApi.edit(this.form).then(re => { |
| | | if (re.code === 1) { |
| | | _this.$message.success(re.message) |
| | | _this.delCurrentView(_this).then(() => { |
| | | _this.$router.push('/exam/question/list') |
| | | }) |
| | | } else { |
| | | _this.$message.error(re.message) |
| | | this.formLoading = false |
| | | } |
| | | }).catch(e => { |
| | | this.formLoading = false |
| | | }) |
| | | } else { |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | resetForm () { |
| | | let lastId = this.form.id |
| | | this.$refs['form'].resetFields() |
| | | this.form = { |
| | | id: null, |
| | | questionType: 5, |
| | | gradeLevel: null, |
| | | subjectId: null, |
| | | title: '', |
| | | items: [], |
| | | analyze: '', |
| | | correct: '', |
| | | score: '', |
| | | difficult: 0 |
| | | } |
| | | this.form.id = lastId |
| | | }, |
| | | levelChange () { |
| | | this.form.subjectId = null |
| | | this.subjectFilter = this.subjects.filter(data => data.level === this.form.gradeLevel) |
| | | }, |
| | | showQuestion () { |
| | | this.questionShow.dialog = true |
| | | this.questionShow.qType = this.form.questionType |
| | | this.questionShow.question = this.form |
| | | }, |
| | | ...mapActions('exam', { initSubject: 'initSubject' }), |
| | | ...mapActions('tagsView', { delCurrentView: 'delCurrentView' }) |
| | | }, |
| | | computed: { |
| | | ...mapGetters('enumItem', ['enumFormat']), |
| | | ...mapState('enumItem', { |
| | | questionTypeEnum: state => state.exam.question.typeEnum, |
| | | levelEnum: state => state.user.levelEnum |
| | | }), |
| | | ...mapState('exam', { subjects: state => state.subjects }) |
| | | } |
| | | } |
| | | </script> |