ExamPaperAdd.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731
  1. <template>
  2. <el-container>
  3. <el-header height="220">
  4. <el-steps :active="curStep" simple>
  5. <el-step title="组卷配置" icon="el-icon-edit" />
  6. <el-step title="考试权限" icon="el-icon-lock" />
  7. <el-step title="补充配置" icon="el-icon-setting" />
  8. </el-steps>
  9. <el-button v-show="curStep !== 1" style="margin-top: 10px" @click="curStep--">
  10. 上一步
  11. </el-button>
  12. <el-button v-show="curStep !== 3" style="float:right;margin-top: 10px" type="primary" @click="curStep++">
  13. 下一步
  14. </el-button>
  15. <el-button v-show="curStep === 3" style="float:right;margin-top: 10px" type="primary" @click="createExamPaper">
  16. 创建试卷
  17. </el-button>
  18. </el-header>
  19. <el-main>
  20. <!--设置试题信息-->
  21. <el-card v-show="curStep === 1">
  22. <el-radio-group
  23. v-model="makeModel"
  24. size="medium"
  25. @change="makeModelChange"
  26. >
  27. <el-radio :label="1" border>自由组卷</el-radio>
  28. <el-radio :label="2" border>题库组卷</el-radio>
  29. </el-radio-group>
  30. <span v-show="makeModel === 1" style="float: right;color: red;font-weight: bold">
  31. {{ '试卷总分:' + sumTotalScore }}
  32. </span>
  33. <!-- 自由组卷内容-->
  34. <div v-show="makeModel === 1" style="margin-top: 25px">
  35. <el-button icon="el-icon-plus" size="mini" @click="showAddDialog">添加试题</el-button>
  36. <el-table :data="addExamQuestion1" border style="margin-top: 10px">
  37. <el-table-column type="index" label="顺序" />
  38. <el-table-column label="题目内容" align="center">
  39. <template slot-scope="scope">
  40. {{ scope.row.content.substr(0, 20) }}
  41. </template>
  42. </el-table-column>
  43. <el-table-column
  44. align="center"
  45. label="题目类型"
  46. prop="type"
  47. />
  48. <el-table-column label="单题分数" align="center">
  49. <template slot-scope="scope">
  50. <div v-if="scope.row.typeCode !== 8">
  51. <el-input-number v-model="scope.row.score" :min="1" :max="20" style="margin-left: 5px" />
  52. </div>
  53. <div v-else>
  54. <el-button icon="el-icon-plus" size="mini" @click="showGroupDialog(scope.row.questionId)">
  55. 设置组合题分数
  56. </el-button>
  57. <span>{{scope.row.score}}</span>
  58. </div>
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="操作" width="80" align="center">
  62. <template slot-scope="scope">
  63. <el-button
  64. type="danger"
  65. icon="el-icon-delete"
  66. circle
  67. @click="delQuestion(scope.row.questionId)"
  68. />
  69. </template>
  70. </el-table-column>
  71. </el-table>
  72. </div>
  73. <!-- 题库组卷内容-->
  74. <div v-show="makeModel === 2" style="margin-top: 25px">
  75. <el-button icon="el-icon-plus" size="mini" @click="addBank">添加题库</el-button>
  76. <!--存放题目的信息-->
  77. <el-table :data="addExamQuestion2" border style="margin-top: 10px">
  78. <el-table-column label="题库" width="155" align="center">
  79. <template slot-scope="scope">
  80. <el-select
  81. v-model="scope.row.bankName"
  82. clearable
  83. placeholder="请选择题库"
  84. style="margin-left: 5px"
  85. >
  86. <el-option
  87. v-for="item in allSubject"
  88. :key="item.questionBank.bankId"
  89. :label="item.questionBank.bankName"
  90. :value="item.questionBank.bankName"
  91. />
  92. </el-select>
  93. </template>
  94. </el-table-column>
  95. <el-table-column label="单选题分数" align="center">
  96. <template slot-scope="scope">
  97. <el-input v-model="scope.row.singleScore" style="margin-left: 5px" />
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="多选题分数" align="center">
  101. <template slot-scope="scope">
  102. <el-input v-model="scope.row.multipleScore" style="margin-left: 5px" />
  103. </template>
  104. </el-table-column>
  105. <el-table-column label="判断题分数" align="center">
  106. <template slot-scope="scope">
  107. <el-input v-model="scope.row.judgeScore" style="margin-left: 5px" />
  108. </template>
  109. </el-table-column>
  110. <el-table-column label="简答题分数" align="center">
  111. <template slot-scope="scope">
  112. <el-input v-model="scope.row.shortScore" style="margin-left: 5px" />
  113. </template>
  114. </el-table-column>
  115. <el-table-column label="操作" width="80" align="center">
  116. <template slot-scope="scope">
  117. <el-button type="danger" icon="el-icon-delete" circle @click="delBank(scope.row.bankId)" />
  118. </template>
  119. </el-table-column>
  120. </el-table>
  121. </div>
  122. </el-card>
  123. <!--设置考试权限-->
  124. <el-card v-show="curStep === 2">
  125. <el-radio-group v-model="examAuthority" size="medium">
  126. <el-radio :label="1" border>完全公开</el-radio>
  127. <el-radio :label="2" border>需要密码</el-radio>
  128. </el-radio-group>
  129. <el-alert
  130. style="margin-top: 15px"
  131. :title="examAuthority === 1? '开放的,任何人都可以进行考试!' : '半开放的,知道密码的人员才可以考试!'"
  132. type="warning"
  133. />
  134. <el-input
  135. v-show="examAuthority === 2"
  136. v-model="examPassword"
  137. style="margin-top: 15px;width: 20%"
  138. type="password"
  139. show-password
  140. placeholder="输入考试密码"
  141. />
  142. </el-card>
  143. <!--设置考试信息-->
  144. <el-card v-show="curStep === 3">
  145. <el-form ref="examInfoForm" :model="examInfo" :rules="examInfoRules" label-width="100px">
  146. <el-form-item label="考试名称" prop="examName">
  147. <el-input v-model="examInfo.examName" />
  148. </el-form-item>
  149. <el-form-item label="考试描述" prop="examDesc">
  150. <el-input v-model="examInfo.examDesc" />
  151. </el-form-item>
  152. <el-form-item v-show="makeModel === 1" label="总分数" prop="totalScore">
  153. <el-input-number :value="sumTotalScore" :disabled="true" />
  154. </el-form-item>
  155. <el-form-item label="及格分数" prop="passScore">
  156. <el-input-number v-model="examInfo.passScore" :min="1" :max="parseInt(sumTotalScore)" />
  157. </el-form-item>
  158. <el-form-item label="考试时长(分钟)" prop="examDuration">
  159. <el-input-number v-model="examInfo.examDuration" :min="1" :max="120" />
  160. </el-form-item>
  161. <el-form-item label="考试开始时间" prop="startTime">
  162. <el-date-picker
  163. v-model="examInfo.startTime"
  164. style="margin-left: 5px"
  165. type="datetime"
  166. placeholder="考试开始时间"
  167. />
  168. </el-form-item>
  169. <el-form-item label="考试结束时间" prop="endTime">
  170. <el-date-picker
  171. v-model="examInfo.endTime"
  172. style="margin-left: 5px"
  173. type="datetime"
  174. placeholder="考试结束时间"
  175. />
  176. </el-form-item>
  177. </el-form>
  178. </el-card>
  179. </el-main>
  180. <el-dialog title="添加试题" :visible.sync="showQuestionDialog" width="80%" center>
  181. <el-row>
  182. <el-select
  183. v-model="queryInfo.subjectId"
  184. clearable
  185. placeholder="请选择科目"
  186. style="margin-left: 5px"
  187. @change="subjectChange"
  188. >
  189. <el-option
  190. v-for="item in allSubject"
  191. :key="item.key"
  192. :label="item.value"
  193. :value="item.key"
  194. />
  195. </el-select>
  196. <el-select v-model="queryInfo.questionType" clearable placeholder="请选择试题类型" @change="typeChange">
  197. <el-option
  198. v-for="item in allType"
  199. :key="item.key"
  200. :label="item.value"
  201. :value="item.key"
  202. />
  203. </el-select>
  204. <el-input
  205. v-model="queryInfo.questionContent"
  206. placeholder="题目内容"
  207. style="margin-left: 5px;width: 220px"
  208. prefix-icon="el-icon-search"
  209. @blur="getQuestionInfo"
  210. />
  211. <el-button type="primary" style="float: right" @click="addQuToFree">确认{{ selectedTable.length }}项</el-button>
  212. </el-row>
  213. <el-table
  214. ref="questionTable"
  215. v-loading="loading"
  216. highlight-current-row
  217. :border="true"
  218. :data="dataList"
  219. tooltip-effect="dark"
  220. style="width: 100%;margin-top: 25px;"
  221. @selection-change="handleTableSectionChange"
  222. >
  223. <el-table-column
  224. align="center"
  225. type="selection"
  226. width="55"
  227. />
  228. <el-table-column
  229. align="center"
  230. label="题目类型"
  231. prop="type"
  232. />
  233. <el-table-column align="center" label="题目内容">
  234. <template slot-scope="scope">
  235. <span class="quContent">{{ scope.row.content.substr(0, 20) }}</span>
  236. </template>
  237. </el-table-column>
  238. <el-table-column
  239. align="center"
  240. label="难度"
  241. prop="level"
  242. />
  243. <el-table-column
  244. align="center"
  245. prop="subject"
  246. label="所属科目"
  247. />
  248. <el-table-column
  249. align="center"
  250. prop="createBy"
  251. label="创建人"
  252. />
  253. <el-table-column
  254. align="center"
  255. label="创建时间"
  256. >
  257. <template slot-scope="scope">
  258. {{ scope.row.createAt }}
  259. </template>
  260. </el-table-column>
  261. </el-table>
  262. <!--分页-->
  263. <el-pagination
  264. style="margin-top: 25px"
  265. layout="total, sizes, prev, pager, next, jumper"
  266. :page-sizes="[10, 20, 50]"
  267. :page-size="pageSize"
  268. :current-page="currentPage"
  269. :total="totalSize"
  270. @current-change="handleCurrentChange"
  271. @prev-click="handleCurrentChange"
  272. @next-click="handleCurrentChange"
  273. />
  274. </el-dialog>
  275. <el-dialog title="组合题分数设置" :visible.sync="showGroupQuestionDialog" width="80%" center>
  276. <el-button icon="el-icon-plus" size="mini" @click="confirmChildScore">确定</el-button>
  277. <el-table
  278. highlight-current-row
  279. :border="true"
  280. :data="groupQuestionList"
  281. tooltip-effect="dark"
  282. style="width: 100%;margin-top: 25px;"
  283. >
  284. <el-table-column
  285. align="center"
  286. type="selection"
  287. width="55"
  288. />
  289. <el-table-column
  290. align="center"
  291. label="题目类型"
  292. prop="type"
  293. />
  294. <el-table-column align="center" label="题目内容">
  295. <template slot-scope="scope">
  296. <span class="quContent">{{ scope.row.content.substr(0, 20) }}</span>
  297. </template>
  298. </el-table-column>
  299. <el-table-column
  300. align="center"
  301. label="单题分数"
  302. prop="score"
  303. >
  304. <template slot-scope="scope">
  305. <el-input-number v-model="scope.row.score" :min="1" :max="20" style="margin-left: 5px" />
  306. </template>
  307. </el-table-column>
  308. <el-table-column
  309. align="center"
  310. prop="subject"
  311. label="所属科目"
  312. />
  313. </el-table>
  314. </el-dialog>
  315. </el-container>
  316. </template>
  317. <script>
  318. import { getQuestions, getQuestionType, getSubjectKV, addPaper, getQuestion } from '@/api/exam'
  319. import { validFormAndInvoke } from '@/utils/util'
  320. export default {
  321. name: 'ExamPaperAdd',
  322. props: ['tagInfo'],
  323. data() {
  324. return {
  325. currentPage: 1,
  326. pageSize: 20,
  327. totalSize: 0,
  328. dataList: [],
  329. // 查询题目的参数
  330. queryInfo: {
  331. subjectId: null,
  332. type: null,
  333. level: null,
  334. pageNumber: 1,
  335. pageSize: 10
  336. },
  337. // 所有题库信息
  338. allSubject: [],
  339. allType: [],
  340. // 当前的步骤
  341. curStep: 1,
  342. // 组卷模式
  343. makeModel: 1,
  344. // 添加考试题目信息(makeModel = 1的时候)
  345. addExamQuestion1: [],
  346. // 添加考试题目信息(makeModel = 2 的时候)
  347. addExamQuestion2: [],
  348. // 所有题目的对话框
  349. groupQuestionId: null,
  350. showQuestionDialog: false,
  351. showGroupQuestionDialog: false,
  352. groupQuestionList: [],
  353. // 对话框中题目表格的加载
  354. loading: true,
  355. // 所有题目的信息
  356. questionInfo: [],
  357. // 所有题目的对话框中表格被选中
  358. selectedTable: [],
  359. // 所有题目总数
  360. total: 0,
  361. // 考试权限(1公开, 2密码)
  362. examAuthority: 1,
  363. // 考试密码(权限为2时的密码)
  364. examPassword: '',
  365. // 补充的考试信息
  366. examInfo: {
  367. examId: null,
  368. examDesc: null,
  369. passScore: 0,
  370. examDuration: 0,
  371. startTime: null,
  372. endTime: null
  373. },
  374. // 补充的考试信息的表单验证
  375. examInfoRules: {
  376. examName: [
  377. {
  378. required: true,
  379. message: '请输入考试名称',
  380. trigger: 'blur'
  381. }
  382. ],
  383. passScore: [
  384. {
  385. required: true,
  386. message: '请输入通过分数',
  387. trigger: 'blur'
  388. }
  389. ],
  390. examDuration: [
  391. {
  392. required: true,
  393. message: '请输入考试时长',
  394. trigger: 'blur'
  395. }
  396. ]
  397. }
  398. }
  399. },
  400. computed: {
  401. // 计算总分
  402. sumTotalScore() {
  403. if (this.makeModel === 1) {
  404. let score = 0
  405. this.addExamQuestion1.forEach(item => {
  406. score += parseInt(item.score)
  407. })
  408. return score
  409. }
  410. }
  411. },
  412. created() {
  413. document.title = '组卷管理'
  414. // 一创建就改变头部的面包屑
  415. this.$emit('giveChildChangeBreakInfo', '添加考试', '添加考试')
  416. // this.createTagsInParent()
  417. this.getSubjects()
  418. this.getQuestionTypes()
  419. },
  420. methods: {
  421. // 向父组件中添加头部的tags标签
  422. createTagsInParent() {
  423. let flag = false
  424. this.tagInfo.map(item => {
  425. // 如果tags全部符合
  426. if (item.name === '添加考试' && item.url === this.$route.path) {
  427. flag = true
  428. } else if (item.name === '添加考试' && item.url !== this.$route.path) {
  429. this.$emit('updateTagInfo', '添加考试', this.$route.path)
  430. flag = true
  431. }
  432. })
  433. if (!flag) this.$emit('giveChildAddTag', '添加考试', this.$route.path)
  434. },
  435. // 获取所有的题库信息
  436. getSubjects() {
  437. getSubjectKV().then((resp) => {
  438. if (resp.code === 0) {
  439. this.allSubject = resp.data
  440. } else {
  441. this.$notify({
  442. title: 'Tips',
  443. message: resp.message,
  444. type: 'error',
  445. duration: 2000
  446. })
  447. }
  448. })
  449. },
  450. getQuestionTypes() {
  451. getQuestionType().then((resp) => {
  452. if (resp.code === 0) {
  453. this.allType = resp.data
  454. } else {
  455. this.$notify({
  456. title: 'Tips',
  457. message: resp.message,
  458. type: 'error',
  459. duration: 2000
  460. })
  461. }
  462. })
  463. },
  464. // 删除当前需要去除的题库
  465. delBank(bankId) {
  466. this.addExamQuestion2.forEach((item, index) => {
  467. if (item.bankId === bankId) this.addExamQuestion2.splice(index, 1)
  468. })
  469. },
  470. // 添加题库组卷中的题库
  471. addBank() {
  472. this.addExamQuestion2.push({
  473. 'bankName': '',
  474. 'singleScore': 1,
  475. 'multipleScore': 1,
  476. 'judgeScore': 1,
  477. 'shortScore': 1
  478. })
  479. },
  480. // 自由组卷时添加试题
  481. showAddDialog() {
  482. this.showQuestionDialog = true
  483. this.queryInfo.subjectId = null
  484. this.queryInfo.type = null
  485. this.queryInfo.level = null
  486. this.queryInfo.pageNumber = this.currentPage
  487. this.queryInfo.pageSize = this.pageSize
  488. this.getQuestionInfo()
  489. },
  490. // 自由组卷时删除试题
  491. delQuestion(questionId) {
  492. this.addExamQuestion1.forEach((item, index) => {
  493. if (item.questionId === questionId) this.addExamQuestion1.splice(index, 1)
  494. })
  495. },
  496. // 题目类型变化
  497. typeChange(val) {
  498. this.queryInfo.type = val
  499. this.queryInfo.pageNumber = this.currentPage
  500. this.queryInfo.pageSize = this.pageSize
  501. this.getQuestionInfo()
  502. },
  503. // 题库变化
  504. subjectChange(val) {
  505. this.queryInfo.subjectId = val
  506. this.queryInfo.pageNumber = this.currentPage
  507. this.queryInfo.pageSize = this.pageSize
  508. this.getQuestionInfo()
  509. },
  510. // 获取题目信息
  511. getQuestionInfo() {
  512. this.dataList = []
  513. getQuestions(this.queryInfo).then(resp => {
  514. if (resp.code === 0) {
  515. this.dataList = resp.data.list
  516. this.totalSize = resp.data.totalSize
  517. this.loading = false
  518. } else {
  519. this.$notify({
  520. title: '提示',
  521. message: resp.msg,
  522. type: 'warning',
  523. duration: 3000
  524. })
  525. }
  526. }).catch(error => {
  527. this.$notify({
  528. title: '提示',
  529. message: error.message,
  530. type: 'error',
  531. duration: 3000
  532. })
  533. })
  534. },
  535. // 处理表格被选中
  536. handleTableSectionChange(val) {
  537. this.selectedTable = val
  538. },
  539. // 分页页面大小改变
  540. handleSizeChange(val) {
  541. this.queryInfo.pageSize = val
  542. this.getQuestionInfo()
  543. },
  544. // 分页插件的页数
  545. handleCurrentChange(val) {
  546. this.queryInfo.pageNo = val
  547. this.getQuestionInfo()
  548. },
  549. // 自由组卷中选中的题目添加进去
  550. addQuToFree() {
  551. this.selectedTable.forEach(item => {
  552. // 不存在有当前题目
  553. if (!this.addExamQuestion1.some(i2 => { return i2.questionId === item.id })) {
  554. this.addExamQuestion1.push({
  555. 'pos': this.addExamQuestion1.length + 1,
  556. 'questionId': item.questionId,
  557. 'content': item.content,
  558. 'type': item.type,
  559. 'typeCode': item.typeCode,
  560. 'score': 1,
  561. 'children': []
  562. })
  563. }
  564. })
  565. this.showQuestionDialog = false
  566. },
  567. // 组卷模式变化
  568. makeModelChange() {
  569. this.$confirm('此操作将丢失当前组卷数据, 是否继续?', 'Tips', {
  570. confirmButtonText: '确定',
  571. cancelButtonText: '取消',
  572. type: 'warning'
  573. }).then(() => {
  574. this.makeModel === 1 ? this.addExamQuestion1 = [] : this.addExamQuestion2 = []
  575. }).catch(() => {
  576. })
  577. },
  578. // 创建试卷
  579. createExamPaper() {
  580. validFormAndInvoke(this.$refs['examInfoForm'], () => {
  581. if ((this.makeModel === 1 && this.addExamQuestion1.length === 0) ||
  582. (this.makeModel === 2 && this.addExamQuestion2.length === 0)) {
  583. this.$message.error('试卷还没有添加试题')
  584. return false
  585. }
  586. // 构造数据对象(考试信息)
  587. const exam = this.examInfo
  588. exam.totalScore = this.sumTotalScore
  589. exam.status = 1
  590. // 权限id设置
  591. exam.examAuthority = this.examAuthority
  592. if (this.examAuthority === 2) { // 考试密码
  593. if (this.examPassword === '') { // 当前用户选择了需要密码权限,但是密码为空
  594. this.$message.error('当前权限为需要密码,但是密码为空')
  595. return false
  596. }
  597. exam.examPassword = this.examPassword
  598. }
  599. if (this.makeModel === 1 && !this.addExamQuestion1.some(item => item.bankId === '')) {
  600. var questions = []
  601. const questionIds = []
  602. const scores = []
  603. this.addExamQuestion1.forEach(item => {
  604. questions.push({
  605. pos: item.pos,
  606. questionId: item.questionId,
  607. score: item.score,
  608. children: item.children
  609. })
  610. questionIds.push(item.questionId)
  611. scores.push(item.score)
  612. })
  613. // exam.questionIds = questionIds.join(',')
  614. // exam.scores = scores.join(',')
  615. exam.questions = questions
  616. this.addExamPaper(exam)
  617. } else if (this.makeModel === 2) {
  618. const bankNames = []
  619. this.addExamQuestion2.forEach(item => bankNames.push(item.bankName))
  620. exam.bankNames = bankNames.join(',')
  621. exam.singleScore = this.addExamQuestion2[0].singleScore
  622. exam.multipleScore = this.addExamQuestion2[0].multipleScore
  623. exam.judgeScore = this.addExamQuestion2[0].judgeScore
  624. exam.shortScore = this.addExamQuestion2[0].shortScore
  625. this.addExamPaper(exam)
  626. } else {
  627. this.$message.error('请检查考试规则设置是否完整')
  628. }
  629. }, '请检查考试规则设置是否完整')
  630. },
  631. addExamPaper(examInfo) {
  632. addPaper(examInfo).then(resp => {
  633. if (resp.code === 0) {
  634. this.$notify({
  635. title: '提示',
  636. message: '试卷已创建',
  637. type: 'warning',
  638. duration: 3000
  639. })
  640. this.$router.push('/exam/paper')
  641. } else {
  642. this.$notify({
  643. title: '提示',
  644. message: resp.msg,
  645. type: 'warning',
  646. duration: 3000
  647. })
  648. }
  649. }).catch(error => {
  650. this.$notify({
  651. title: '提示',
  652. message: error.message,
  653. type: 'error',
  654. duration: 3000
  655. })
  656. })
  657. },
  658. showGroupDialog(questionId) {
  659. this.groupQuestionId = questionId
  660. this.showGroupQuestionDialog = true
  661. getQuestion(questionId).then(resp => {
  662. if (resp.code === 0) {
  663. this.groupQuestionList = resp.data.children
  664. for (const item of this.groupQuestionList) {
  665. item.score = 0
  666. }
  667. }
  668. })
  669. },
  670. confirmChildScore() {
  671. this.showGroupQuestionDialog = false
  672. var childIds = []
  673. var score = 0
  674. for (const item of this.groupQuestionList) {
  675. score += item.score
  676. childIds.push({
  677. pid: this.groupQuestionId,
  678. questionId: item.questionId,
  679. score: item.score
  680. })
  681. }
  682. for (const item of this.addExamQuestion1) {
  683. if (item.questionId === this.groupQuestionId) {
  684. item.score = score
  685. item.children = childIds
  686. }
  687. }
  688. }
  689. }
  690. }
  691. </script>
  692. <style scoped lang="scss">
  693. .el-container {
  694. width: 100%;
  695. height: 100%;
  696. }
  697. .el-container {
  698. animation: leftMoveIn .7s ease-in;
  699. }
  700. @keyframes leftMoveIn {
  701. 0% {
  702. transform: translateX(-100%);
  703. opacity: 0;
  704. }
  705. 100% {
  706. transform: translateX(0%);
  707. opacity: 1;
  708. }
  709. }
  710. </style>