@zykjcommon/questions 0.0.26 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.browserslistrc +0 -1
- package/dist/zykjcommon-questions.common.js +8999 -1392
- package/dist/zykjcommon-questions.css +1 -0
- package/dist/zykjcommon-questions.umd.js +8999 -1392
- package/dist/zykjcommon-questions.umd.min.js +5 -5
- package/package.json +2 -2
- package/src/assets/scss/questions/zykjcommon-questions.scss +5 -1
- package/src/components/questions/Question_BriefAnswer.vue +6 -2
- package/src/components/questions/Question_Classify.vue +28 -27
- package/src/components/questions/Question_FillBlank.vue +6 -1
- package/src/components/questions/Question_MultipleChoice.vue +10 -4
- package/src/components/questions/Question_Programming.vue +6 -2
- package/src/components/questions/Question_Reading.vue +6 -2
- package/src/components/questions/Question_SingleChoice.vue +16 -8
- package/src/components/questions/buildEntry.js +2 -0
- package/src/components/questions/developmentEntry.js +1 -0
- package/src/main.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zykjcommon/questions",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
4
4
|
"main": "src/components/questions/entry.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "vue-cli-service serve",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"build:lib": "vue-cli-service build --target lib src/components/questions/buildEntry.js --name zykjcommon-questions"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@zykjcommon/questions": "^0.0.
|
|
15
|
+
"@zykjcommon/questions": "^0.0.27",
|
|
16
16
|
"alife-logger": "^1.8.30",
|
|
17
17
|
"axios": "^0.26.0",
|
|
18
18
|
"cookie": "^0.4.1",
|
|
@@ -16,7 +16,6 @@ $greenItemFontSize:0.14em;
|
|
|
16
16
|
}
|
|
17
17
|
.question-type{
|
|
18
18
|
font-size: 18px;
|
|
19
|
-
font-family: PingFang-SC-Medium, PingFang-SC;
|
|
20
19
|
font-weight: bold;
|
|
21
20
|
color: #000000;
|
|
22
21
|
margin-bottom: 20px;
|
|
@@ -26,6 +25,11 @@ $greenItemFontSize:0.14em;
|
|
|
26
25
|
font-weight: normal;
|
|
27
26
|
}
|
|
28
27
|
}
|
|
28
|
+
.question-hint{
|
|
29
|
+
margin-bottom: 20px;
|
|
30
|
+
font-size: 16px;
|
|
31
|
+
color: #333333;
|
|
32
|
+
}
|
|
29
33
|
.question-box{
|
|
30
34
|
padding-left: 30px;
|
|
31
35
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="zykjcommon-question">
|
|
3
|
-
<div v-if="!isSub"
|
|
3
|
+
<div class="question-type" v-if="!isSub">{{questionInfo.questionIndex}}、{{ questionInfo.question_type_str }}<span v-if="questionInfo.score!=='null' && showScore">({{questionInfo.score}}分)</span>
|
|
4
4
|
<span class="score fr" v-if="mode==='analysis'">得分:{{questionInfo.answerMap ? questionInfo.answerMap.user_score : '-'}}分</span>
|
|
5
5
|
</div>
|
|
6
6
|
<div class="question-box">
|
|
7
|
-
|
|
7
|
+
<div class="question-hint" v-if="questionInfo.hint && !isSub">{{ questionInfo.hint }}</div>
|
|
8
8
|
<div class="editor-content" v-html="questionInfo.htmlContent"></div>
|
|
9
9
|
|
|
10
10
|
<!-- <div class="editor-tit">样例输入</div>
|
|
@@ -74,6 +74,10 @@ export default {
|
|
|
74
74
|
mode: {
|
|
75
75
|
type: String,
|
|
76
76
|
default: 'exam'
|
|
77
|
+
},
|
|
78
|
+
showScore: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
default: false
|
|
77
81
|
}
|
|
78
82
|
},
|
|
79
83
|
mounted() {
|
|
@@ -60,7 +60,7 @@ export default {
|
|
|
60
60
|
},
|
|
61
61
|
screenScale:{
|
|
62
62
|
type: Number,
|
|
63
|
-
default:
|
|
63
|
+
default: 1
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
created() {
|
|
@@ -170,34 +170,36 @@ export default {
|
|
|
170
170
|
parseLists(nv){
|
|
171
171
|
this.classify_question_info = nv.classify_question_info
|
|
172
172
|
let exam_options_data = nv.exam_options_data
|
|
173
|
-
if(this.classify_question_info
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
173
|
+
if(this.classify_question_info){
|
|
174
|
+
if(this.classify_question_info.background_file){
|
|
175
|
+
this.bigBgCss = `background: url(${this.classify_question_info.background_file.file_url}) no-repeat center;background-size: 100% 100%`
|
|
176
|
+
}
|
|
177
|
+
if(this.classify_question_info.bottom_img_file){
|
|
178
|
+
this.bottomBgCss = `background: url(${this.classify_question_info.bottom_img_file.file_url}) no-repeat center;background-size: 100% 100%`
|
|
179
|
+
}
|
|
180
|
+
let optionList = []
|
|
181
|
+
exam_options_data.forEach((item)=>{
|
|
182
|
+
optionList.push({
|
|
183
|
+
content:item.data.option_content,
|
|
184
|
+
bgUrlCss:`background: url(${item.data.file_url}) no-repeat center;background-size: 100% 100%`,
|
|
185
|
+
idx:item.index
|
|
186
|
+
})
|
|
185
187
|
})
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
this.listItemBgCss = !optionList[0]?'':optionList[0].bgUrlCss
|
|
188
|
+
this.optionList = optionList
|
|
189
|
+
this.listItemBgCss = !optionList[0]?'':optionList[0].bgUrlCss
|
|
189
190
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
191
|
+
let bigBoxItemList = []
|
|
192
|
+
let big_type_box_image_list = this.classify_question_info.big_type_box_image_list
|
|
193
|
+
let big_type_option_list = this.classify_question_info.big_type_option_list
|
|
194
|
+
big_type_box_image_list.forEach((item,index)=>{
|
|
195
|
+
bigBoxItemList.push({
|
|
196
|
+
imgUrl:big_type_option_list[index].file_url,
|
|
197
|
+
bgUrl:item.file_url,
|
|
198
|
+
bgUrlCss:`background: url(${item.file_url}) no-repeat center;background-size: 100% 100%`
|
|
199
|
+
})
|
|
198
200
|
})
|
|
199
|
-
|
|
200
|
-
|
|
201
|
+
this.bigBoxItemList = bigBoxItemList
|
|
202
|
+
}
|
|
201
203
|
},
|
|
202
204
|
setRootFontSize() {
|
|
203
205
|
// setRemFixedHeight(1000,140,1.08)
|
|
@@ -206,7 +208,6 @@ export default {
|
|
|
206
208
|
unmountedDo(){
|
|
207
209
|
window.removeEventListener('resize',this.setRootFontSize)
|
|
208
210
|
document.removeEventListener('gesturestart', this.gesturestartListener)
|
|
209
|
-
this.$el
|
|
210
211
|
$(this.$el).find('.question-classify .append-item').off(this.mousedown)
|
|
211
212
|
$(this.$el).find('.question-classify .list-item').off(this.mousedown)
|
|
212
213
|
$(document).off(this.mouseup)
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="zykjcommon-question">
|
|
3
|
-
<div class="question-type" v-if="!isSub">{{questionInfo.questionIndex}}、{{
|
|
3
|
+
<div class="question-type" v-if="!isSub">{{questionInfo.questionIndex}}、{{ questionInfo.question_type_str }}<span v-if="questionInfo.score!=='null' && showScore">({{questionInfo.score}}分)</span>
|
|
4
4
|
<span class="score fr" v-if="mode==='analysis'">得分:{{questionInfo.answerMap ? questionInfo.answerMap.user_score : '-'}}分</span>
|
|
5
5
|
</div>
|
|
6
6
|
<div class="question-box">
|
|
7
|
+
<div class="question-hint" v-if="questionInfo.hint && !isSub">{{ questionInfo.hint }}</div>
|
|
7
8
|
<div class="editor-content"
|
|
8
9
|
style="line-height: 40px;"
|
|
9
10
|
v-if="questionInfo.htmlContent" v-html="questionInfo.htmlContent"></div>
|
|
@@ -53,6 +54,10 @@ export default {
|
|
|
53
54
|
mode: {
|
|
54
55
|
type: String,
|
|
55
56
|
default: 'exam'
|
|
57
|
+
},
|
|
58
|
+
showScore: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false
|
|
56
61
|
}
|
|
57
62
|
},
|
|
58
63
|
mounted() {
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="zykjcommon-question">
|
|
3
|
-
<div class="question-type" v-if="!isSub">{{questionInfo.questionIndex}}、{{
|
|
3
|
+
<div class="question-type" v-if="!isSub">{{questionInfo.questionIndex}}、{{ questionInfo.question_type_str }}<span v-if="questionInfo.score!=='null' && showScore">({{questionInfo.score}}分)</span>
|
|
4
4
|
<span class="score fr" v-if="mode==='analysis'">得分:{{questionInfo.answerMap ? questionInfo.answerMap.user_score : '-'}}分</span>
|
|
5
5
|
</div>
|
|
6
6
|
<div class="question-box">
|
|
7
|
-
|
|
8
|
-
<div class="question-stem" v-if="isSub"><span v-if="questionInfo.hint">{{questionInfo.questionIndex2}}、</span>{{questionInfo.hint}}</div>
|
|
7
|
+
<div class="question-hint" v-if="questionInfo.hint && !isSub">{{ questionInfo.hint }}</div>
|
|
9
8
|
<div class="editor-content" v-if="!isSub" v-html="questionInfo.htmlContent"></div>
|
|
9
|
+
|
|
10
|
+
<div class="question-stem" v-if="isSub"><span v-if="questionInfo.hint">{{questionInfo.questionIndex2}}、</span>{{questionInfo.hint}}</div>
|
|
10
11
|
<div class="editor-content" style="display: flex" v-if="isSub">
|
|
11
12
|
<span v-if="!questionInfo.hint">{{questionInfo.questionIndex2}}、</span><div style="display: inline-block;flex:1;" v-html="questionInfo.htmlContent"></div>
|
|
12
13
|
</div>
|
|
13
|
-
|
|
14
|
+
|
|
15
|
+
<div class="question-option-list" :style="(!questionInfo.htmlContent && !questionInfo.hint)?{'margin-top':0}:{}">
|
|
14
16
|
<div class="question-option" v-for="(item,index) in exam_options_data">
|
|
15
17
|
<div class="checkbox-box" :class="{'checked':checkboxList.indexOf(item.index) > -1}">
|
|
16
18
|
<input type="checkbox"
|
|
@@ -95,6 +97,10 @@ export default {
|
|
|
95
97
|
mode: {
|
|
96
98
|
type: String,
|
|
97
99
|
default: 'exam'
|
|
100
|
+
},
|
|
101
|
+
showScore: {
|
|
102
|
+
type: Boolean,
|
|
103
|
+
default: false
|
|
98
104
|
}
|
|
99
105
|
},
|
|
100
106
|
mounted() {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="zykjcommon-question">
|
|
3
|
-
<div class="question-type" v-if="!isSub">{{questionInfo.questionIndex}}、{{
|
|
3
|
+
<div class="question-type" v-if="!isSub">{{questionInfo.questionIndex}}、{{ questionInfo.question_type_str }}<span v-if="questionInfo.score!=='null' && showScore">({{questionInfo.score}}分)</span>
|
|
4
4
|
<span class="score fr" v-if="mode==='analysis'">得分:{{questionInfo.answerMap ? questionInfo.answerMap.user_score : '-'}}分</span>
|
|
5
5
|
</div>
|
|
6
6
|
<div class="question-box">
|
|
7
|
-
|
|
7
|
+
<div class="question-hint" v-if="questionInfo.hint && !isSub">{{ questionInfo.hint }}</div>
|
|
8
8
|
<div class="editor-content" v-html="questionInfo.htmlContent"></div>
|
|
9
9
|
<button class="bcdt-btn"
|
|
10
10
|
v-if="(mode==='exam' && !oss_temp_url) || mode==='review'"
|
|
@@ -103,6 +103,10 @@ export default {
|
|
|
103
103
|
mode: {
|
|
104
104
|
type: String,
|
|
105
105
|
default: 'exam'
|
|
106
|
+
},
|
|
107
|
+
showScore: {
|
|
108
|
+
type: Boolean,
|
|
109
|
+
default: false
|
|
106
110
|
}
|
|
107
111
|
},
|
|
108
112
|
mounted() {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="zykjcommon-question">
|
|
3
|
-
<div class="question-type">{{questionInfo.questionIndex}}、{{
|
|
3
|
+
<div class="question-type">{{questionInfo.questionIndex}}、{{ questionInfo.question_type_str }}<span v-if="questionInfo.score!=='null' && showScore">({{questionInfo.score}}分)</span>
|
|
4
4
|
<span class="score fr" v-if="mode==='analysis'">得分:{{questionInfo.answerMap ? questionInfo.answerMap.user_score : '-'}}分</span>
|
|
5
5
|
</div>
|
|
6
6
|
<div class="question-box">
|
|
7
|
-
|
|
7
|
+
<div class="question-hint" v-if="questionInfo.hint">{{ questionInfo.hint }}</div>
|
|
8
8
|
<div class="editor-content editor-content-bor" v-html="questionInfo.htmlContent"></div>
|
|
9
9
|
<div class="question-tabs">
|
|
10
10
|
<div class="question-tab-item"
|
|
@@ -63,6 +63,10 @@ export default {
|
|
|
63
63
|
mode: {
|
|
64
64
|
type: String,
|
|
65
65
|
default: 'exam'
|
|
66
|
+
},
|
|
67
|
+
showScore: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: false
|
|
66
70
|
}
|
|
67
71
|
},
|
|
68
72
|
created() {
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="zykjcommon-question">
|
|
3
|
-
<div class="question-type" v-if="!isSub">{{questionInfo.questionIndex}}、{{
|
|
3
|
+
<div class="question-type" v-if="!isSub">{{questionInfo.questionIndex}}、{{ questionInfo.question_type_str }}<span v-if="questionInfo.score!=='null' && showScore">({{questionInfo.score}}分)</span>
|
|
4
4
|
<span class="score fr" v-if="mode==='analysis'">得分:{{questionInfo.answerMap ? questionInfo.answerMap.user_score : '-'}}分</span>
|
|
5
5
|
</div>
|
|
6
6
|
<div class="question-box">
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
<div class="question-hint" v-if="questionInfo.hint && !isSub">{{ questionInfo.hint }}</div>
|
|
8
|
+
<div class="editor-content" v-if="!isSub" v-html="questionInfo.htmlContent"></div>
|
|
9
|
+
|
|
10
|
+
<div class="question-stem" v-if="isSub"><span v-if="questionInfo.hint">{{questionInfo.questionIndex2}}、</span>{{questionInfo.hint}}</div>
|
|
11
|
+
<div class="editor-content" style="display: flex" v-if="isSub">
|
|
12
|
+
<span v-if="!questionInfo.hint">{{questionInfo.questionIndex2}}、</span><div style="display: inline-block;flex:1;" v-html="questionInfo.htmlContent"></div>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
13
17
|
<div class="question-option-list" :style="(!questionInfo.htmlContent && !questionInfo.hint)?{'margin-top':0}:{}">
|
|
14
18
|
<div class="question-option" v-for="(item,index) in exam_options_data">
|
|
15
19
|
<div class="radio-box" :class="{'checked':radio == item.index}">
|
|
@@ -67,7 +71,7 @@
|
|
|
67
71
|
v-model:visible="visible"
|
|
68
72
|
-->
|
|
69
73
|
<MediaLooker :visible.sync="visible"
|
|
70
|
-
|
|
74
|
+
v-model:visible="visible"
|
|
71
75
|
v-if="visible"
|
|
72
76
|
:mediaCount="curMediaCount"
|
|
73
77
|
:mediaLookerList="mediaLookerList"></MediaLooker>
|
|
@@ -101,6 +105,10 @@ export default {
|
|
|
101
105
|
mode: {
|
|
102
106
|
type: String,
|
|
103
107
|
default: 'exam'
|
|
108
|
+
},
|
|
109
|
+
showScore: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: false
|
|
104
112
|
}
|
|
105
113
|
},
|
|
106
114
|
mounted() {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Created by Allen Liu on 2023/7/14.
|
|
3
3
|
*/
|
|
4
4
|
//此文件作为打包入口,打包后的dist文件给vue3用
|
|
5
|
+
import '../../assets/scss/questions/zykjcommon-questions.scss';
|
|
5
6
|
import Question_SingleChoice from './Question_SingleChoice.vue'
|
|
6
7
|
import Question_MultipleChoice from './Question_MultipleChoice.vue'
|
|
7
8
|
import Question_Reading from './Question_Reading.vue'
|
|
@@ -128,6 +129,7 @@ export default function(store){
|
|
|
128
129
|
Vue.component('Question_Programming',Question_Programming)
|
|
129
130
|
Vue.component('Question_Classify',Question_Classify)
|
|
130
131
|
},
|
|
132
|
+
questionMapper,
|
|
131
133
|
Question_SingleChoice,
|
|
132
134
|
Question_MultipleChoice,
|
|
133
135
|
Question_Reading,
|
|
@@ -128,6 +128,7 @@ export default function(store){
|
|
|
128
128
|
Vue.component('Question_Programming',Question_Programming)
|
|
129
129
|
Vue.component('Question_Classify',Question_Classify)
|
|
130
130
|
},
|
|
131
|
+
questionMapper,
|
|
131
132
|
Question_SingleChoice,
|
|
132
133
|
Question_MultipleChoice,
|
|
133
134
|
Question_Reading,
|
package/src/main.ts
CHANGED
|
@@ -179,8 +179,8 @@ import ZYKJQuestionsPlugin from "@src/components/questions/developmentEntry.js"
|
|
|
179
179
|
// import ZYKJQuestionsPlugin from "../dist/zykjcommon-questions.umd.min"
|
|
180
180
|
// import ZYKJQuestionsPlugin from "@zykjcommon/questions"
|
|
181
181
|
vueInstance.use((ZYKJQuestionsPlugin as any)(store))
|
|
182
|
+
import '@zykjcommon/questions/dist/zykjcommon-questions.css';
|
|
182
183
|
// import '@zykjcommon/questions/src/assets/scss/questions/zykjcommon-questions.scss';
|
|
183
|
-
import '@src/assets/scss/questions/zykjcommon-questions.scss';
|
|
184
184
|
// import '@src/assets/scss/questions/zykjcommon-questions.scss';
|
|
185
185
|
|
|
186
186
|
|