@zykjcommon/questions 0.0.27 → 0.0.29

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zykjcommon/questions",
3
- "version": "0.0.27",
3
+ "version": "0.0.29",
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.24",
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",
@@ -32,17 +32,15 @@ export let setRem = function(){
32
32
  //动态设置html的font-size ----end
33
33
  }
34
34
 
35
- export let setRemFixedHeight = function(designWidth=1440,repairH = 0,scale=1){
35
+ export let setRemFixedHeight = function(designWidth=1440,repairH = 0,scale=1,parent){
36
36
  let baseNum = 100;
37
37
  let winWidth = document.documentElement.clientWidth || document.body.clientWidth;
38
38
  let winHeight = document.documentElement.clientHeight || document.body.clientHeight;
39
39
  winHeight = winHeight - repairH
40
40
  let html = document.getElementsByTagName('html')[0];
41
- let frameBili = 4 / 3
41
+ let frameBili = 4.3 / 3
42
42
  let b = frameBili / (winWidth / winHeight)
43
43
  let realW = parseInt(winWidth * b)
44
- let parent = document.querySelector('.zykjcommon-question')
45
44
  parent.style.fontSize = (realW / designWidth) * baseNum * scale + 'px';
46
- // html.style.fontSize = (realW / designWidth) * baseNum * scale + 'px';
47
45
  console.log(html.style.fontSize);
48
46
  }
@@ -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" class="question-type">{{questionInfo.questionIndex}}、{{questionInfo.hint ? questionInfo.hint : questionInfo.question_type_str}}<span v-if="questionInfo.score!=='null'"><!--({{questionInfo.score}}分)--></span>
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-stem">{{questionInfo.hint}}</div>-->
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: 0
63
+ default: 1
64
64
  }
65
65
  },
66
66
  created() {
@@ -203,7 +203,7 @@ export default {
203
203
  },
204
204
  setRootFontSize() {
205
205
  // setRemFixedHeight(1000,140,1.08)
206
- setRemFixedHeight(1000,this.screenRepairH,this.screenScale)
206
+ setRemFixedHeight(1000,this.screenRepairH,this.screenScale,this.$el)
207
207
  },
208
208
  unmountedDo(){
209
209
  window.removeEventListener('resize',this.setRootFontSize)
@@ -1,9 +1,10 @@
1
1
  <template>
2
2
  <div class="zykjcommon-question">
3
- <div class="question-type" v-if="!isSub">{{questionInfo.questionIndex}}、{{questionInfo.hint ? questionInfo.hint :questionInfo.question_type_str}}<span v-if="questionInfo.score!=='null'"><!--({{questionInfo.score}}分)--></span>
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}}、{{questionInfo.hint ? questionInfo.hint : questionInfo.question_type_str}}<span v-if="questionInfo.score!=='null'"><!--({{questionInfo.score}}分)--></span>
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-stem" v-if="!isSub">{{questionInfo.hint}}</div>-->
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
- <div class="question-option-list">
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}}、{{questionInfo.hint ? questionInfo.hint : questionInfo.question_type_str}}<span v-if="questionInfo.score!=='null'"><!--({{questionInfo.score}}分)--></span>
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-stem">{{questionInfo.hint}}</div>-->
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}}、{{questionInfo.hint ? questionInfo.hint : questionInfo.question_type_str}}<span v-if="questionInfo.score!=='null'"><!--({{questionInfo.score}}分)--></span>
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
- <!-- <div class="question-stem">{{questionInfo.hint}}</div>-->
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}}、{{questionInfo.hint ? questionInfo.hint : questionInfo.question_type_str}}<span v-if="questionInfo.score!=='null'"><!--({{questionInfo.score}}分)--></span>
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-stem" v-if="questionInfo.hint">{{questionInfo.hint}}</div>-->
8
- <!-- <div class="question-stem" v-if="isSub"><span v-if="questionInfo.hint">{{questionInfo.questionIndex2}}、</span>{{questionInfo.hint}}</div>-->
9
- <div class="editor-content" v-if="questionInfo.htmlContent" v-html="questionInfo.htmlContent"></div>
10
- <!-- <div class="editor-content" style="display: flex" v-if="isSub">
11
- <span v-if="!questionInfo.hint">{{questionInfo.questionIndex2}}、</span><div style="display: inline-block;flex: 1;" v-html="questionInfo.htmlContent"></div>
12
- </div>-->
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
- v-model:visible="visible"
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() {
@@ -129,6 +129,7 @@ export default function(store){
129
129
  Vue.component('Question_Programming',Question_Programming)
130
130
  Vue.component('Question_Classify',Question_Classify)
131
131
  },
132
+ questionMapper,
132
133
  Question_SingleChoice,
133
134
  Question_MultipleChoice,
134
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,7 +179,7 @@ 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
+ import '@zykjcommon/questions/dist/zykjcommon-questions.css';
183
183
  // import '@zykjcommon/questions/src/assets/scss/questions/zykjcommon-questions.scss';
184
184
  // import '@src/assets/scss/questions/zykjcommon-questions.scss';
185
185
 
@@ -7,7 +7,6 @@
7
7
  :questionInfo="responsiveObj.curQuestionInfo"
8
8
  :screenRepairH="140"
9
9
  @getIsAnswered="getIsAnswered"
10
- :screenScale="1.08"
11
10
  :ref="'question'"/>
12
11
  </div>
13
12
  <div class="footer" @click="submit">{{isAnswered}}</div>
@@ -117,40 +116,6 @@ export default defineComponent({
117
116
  "have_not_auto_check_question": false,
118
117
  "size": 23,
119
118
  "question_list": [
120
- {
121
- "question_type_str": "编程题",
122
- "data_mode": 1,
123
- "correct_judge": "",
124
- "is_auto_check": "",
125
- "content": "[{\"<>\":\"p\",\"text\":\"1、准备工作\"},{\"<>\":\"p\",\"text\":\" (1) 选择背景 Desert,Galaxy;\"},{\"<>\":\"p\",\"text\":\" (2) 选择角色 Rocketship。\"},{\"<>\":\"p\",\"text\":\" 2、功能实现\"},{\"<>\":\"p\",\"text\":\" (1)火箭初始造型为 rocketship-a,初始位置为舞台下端,初始背景为 Dessert;\"},{\"<>\":\"p\",\"text\":\" (2)点击绿旗,火箭垂直向上移动,一直移动到舞台顶端,并在移动过 程中切换造型;\"},{\"<>\":\"p\",\"text\":\" (3)当火箭达到舞台顶端时,背景切换为 Galaxy;\"},{\"<>\":\"p\",\"html\":[{\"<>\":\"span\",\"style\":\"\",\"text\":\" (4)火箭最后移到舞台下端的位置(初始位置),造型不限。\"}]},{\"<>\":\"p\",\"html\":[{\"<>\":\"span\",\"style\":\"\",\"html\":[{\"<>\":\"img\",\"src\":\"https://dev-resource.thedeer.cn/pre/resource-testing/image/3ae47ad6586554f0cd57b4858b800034qve9a1g4zs6twrc5.jpg\",\"width\":\"89\",\"height\":\"89\",\"base_src\":\"resource-testing/image/3ae47ad6586554f0cd57b4858b800034qve9a1g4zs6twrc5.jpg\"}]}]}]",
126
- "correct_subjective_answer": "",
127
- "auto_check": false,
128
- "options_data": [],
129
- "score": "30.00",
130
- "sub_questions": [],
131
- "style_type": "CODING",
132
- "template_file_full_url": "https://dev-resource.thedeer.cn/pre/resource-testing/coding/d489ef8637c0198c9905b9628536ef875jsskgofnaulimvh.sb3",
133
- "question_name": "1、准备工作 (1) 选择背景 Desert,Galaxy; (2) 选择角色 Rocketship。 2、功能实现 (1)火箭初始造型为 rocketship-a,初始位置为舞台下端,初始背景为 Dessert; (2)点击绿旗,火箭垂直向上移动,一直移动到舞台顶端,并在移动过 程中切换造型; (3)当火箭达到舞台顶端时,背景切换为 Galaxy; (4)火箭最后移到舞台下端的位置(初始位置),造型不限。",
134
- "correct_rate": "",
135
- "knowledge_name": "",
136
- "page_location_list": [],
137
- "code_type": 1,
138
- "difficulty_level": "2",
139
- "question_index": "",
140
- "correct_single_index": 0,
141
- "question_type": "16",
142
- "media_resources": [],
143
- "analysis": "",
144
- "question_id": "12918",
145
- "difficulty_level_str": "困难",
146
- "update_date": "2023-05-13 10:09:59",
147
- "exam_options_data": [],
148
- "exam_link_answer_data": [],
149
- "reference_file_full_url": "",
150
- "correct_multiple_index_set": [],
151
- "hint": "飞向太空",
152
- "knowledge_id": ""
153
- },
154
119
  {
155
120
  "question_type_str": "分类题",
156
121
  "is_need_judge": "",