From 99792cd58f4a0c7f78f7be41c6e8388a8c3f604f Mon Sep 17 00:00:00 2001
From: dong <58670809@qq.com>
Date: Mon, 17 Oct 2022 10:01:54 +0800
Subject: [PATCH 1/7] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A2=84=E8=A7=88?=
=?UTF-8?q?=E7=AD=94=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/questionBank.js | 14 +-
.../competitionManage/bankList/index.vue | 19 +-
.../bankList/previewAnswer.vue | 162 ++++++++++++++++++
3 files changed, 190 insertions(+), 5 deletions(-)
create mode 100644 src/views/competitionManage/bankList/previewAnswer.vue
diff --git a/src/api/questionBank.js b/src/api/questionBank.js
index b922b07f0..663ff2a70 100644
--- a/src/api/questionBank.js
+++ b/src/api/questionBank.js
@@ -49,11 +49,12 @@ export function updateOption(data) {
}
// 获取题目信息
-export function getQuestionInfo(questionId) {
+export function getQuestionInfo(questionId, params) {
return request({
// url: `/api/questionBank/questions/${questionId}`,
url: `/api/question/org/${questionId}`,
- method: 'get'
+ method: 'get',
+ params
});
}
@@ -65,3 +66,12 @@ export function importQuestion(data) {
data
});
}
+
+// 预览答题
+export function testAnswer(questionId, data) {
+ return request({
+ url: `/api/question/org/test/answer/${questionId}`,
+ method: 'post',
+ data
+ });
+}
diff --git a/src/views/competitionManage/bankList/index.vue b/src/views/competitionManage/bankList/index.vue
index 95ef2d922..0128b0ad5 100644
--- a/src/views/competitionManage/bankList/index.vue
+++ b/src/views/competitionManage/bankList/index.vue
@@ -2,6 +2,7 @@
@@ -9,17 +10,20 @@
// import { UrlConfig } from '@/scripts/ConstDic';
import { listQuestionPage, deleteQuestion, getLableList } from '@/api/questionBank.js';
import DialogDetail from './dialog-detail';
+import PreviewAnswer from './previewAnswer';
import { convertSheetToList } from '@/jmapNew/theme/parser/util.js';
// import { getCompanyList } from '@/api/company';
import XLSX from 'xlsx';
export default {
components: {
- DialogDetail
+ DialogDetail,
+ PreviewAnswer
},
data() {
return {
// companyList: [],
+ questionId: '',
companyMap: {},
pagerConfig: {
pageSize: 'pageSize',
@@ -114,9 +118,13 @@ export default {
// showControl: (row) => { return row.createUserId == this.userId; },
type: 'danger'
},
+ // {
+ // name: '预 览',
+ // handleClick: this.doDetail
+ // },
{
- name: '预 览',
- handleClick: this.doDetail
+ name: '预览答题',
+ handleClick: this.previewAnswer
}
]
}
@@ -186,6 +194,11 @@ export default {
this.$refs.detail.doShow({index, row});
},
+ previewAnswer(index, row) {
+ this.questionId = row.id;
+ this.$refs.previewAnswer.doShow();
+ },
+
lableTags(row) {
return row.tags ? row.tags.split(',') : '';
},
diff --git a/src/views/competitionManage/bankList/previewAnswer.vue b/src/views/competitionManage/bankList/previewAnswer.vue
new file mode 100644
index 000000000..cab30fbc3
--- /dev/null
+++ b/src/views/competitionManage/bankList/previewAnswer.vue
@@ -0,0 +1,162 @@
+
+
+
+
+
+ 答 案:
+
+ √
+ ×
+
+
+
+
+
+
+
{{ $asc2chart(i+65) }}.
+
+
+
+ 答 案:
+
+ {{ $asc2chart(65+i) }}
+
+
+
+
+
+
{{ $asc2chart(i+65) }}.
+
+
+
+ 答 案:
+
+ {{ $asc2chart(65+i) }}
+
+
+
+
+
+
+
+
+ 答 案:
+
+
+
+
+
+
+
+
+
From fe9bf9b495671b6b0463cec83c7d148d384ada70 Mon Sep 17 00:00:00 2001
From: dong <58670809@qq.com>
Date: Mon, 17 Oct 2022 14:04:56 +0800
Subject: [PATCH 2/7] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../competitionManage/bankList/index.vue | 5 +-
.../bankList/previewAnswer.vue | 60 ++++++++++++++-----
2 files changed, 47 insertions(+), 18 deletions(-)
diff --git a/src/views/competitionManage/bankList/index.vue b/src/views/competitionManage/bankList/index.vue
index 0128b0ad5..389f87a87 100644
--- a/src/views/competitionManage/bankList/index.vue
+++ b/src/views/competitionManage/bankList/index.vue
@@ -39,7 +39,7 @@ export default {
type: 'select',
label: '类 型',
config: {
- data: this.$ConstSelect.QuestionTypeList
+ data: this.$ConstSelect.QuestionTypeList.filter(item => { return !['fill', 'answer'].includes(item.value); })
}
},
topic: {
@@ -63,7 +63,8 @@ export default {
columns: [
{
title: '题 目',
- prop: 'topic'
+ prop: 'topic',
+ type: 'html'
},
{
title: '标 签',
diff --git a/src/views/competitionManage/bankList/previewAnswer.vue b/src/views/competitionManage/bankList/previewAnswer.vue
index cab30fbc3..f2c43ccb4 100644
--- a/src/views/competitionManage/bankList/previewAnswer.vue
+++ b/src/views/competitionManage/bankList/previewAnswer.vue
@@ -1,13 +1,14 @@
-
+
答 案:
-
- √
- ×
-
+
+
+ {{ el.content }}
+
+
@@ -18,9 +19,11 @@
答 案:
-
- {{ $asc2chart(65+i) }}
-
+
+
+ {{ $asc2chart(65+i) }}
+
+
@@ -31,7 +34,7 @@
答 案:
- {{ $asc2chart(65+i) }}
+ {{ $asc2chart(65+i) }}
@@ -47,9 +50,14 @@
+
+ {{ isCorrect ? '答案正确!' : '答案错误!' }}
+