@zykjcommon/questions 0.0.25 → 0.0.27

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.
@@ -64,8 +64,8 @@ export default {
64
64
  }
65
65
  },
66
66
  created() {
67
- this.setRootFontSize()
68
- window.addEventListener('resize',this.setRootFontSize)
67
+ // this.setRootFontSize()
68
+ // window.addEventListener('resize',this.setRootFontSize)
69
69
  },
70
70
  unmounted() {
71
71
  this.unmountedDo()
@@ -74,6 +74,8 @@ export default {
74
74
  this.unmountedDo()
75
75
  },
76
76
  mounted() {
77
+ this.setRootFontSize()
78
+ window.addEventListener('resize',this.setRootFontSize)
77
79
  this.init()
78
80
  this.$watch('optionList',(nv)=>{
79
81
  if(nv && nv.length){
@@ -88,6 +90,7 @@ export default {
88
90
  },
89
91
  data() {
90
92
  return {
93
+ animationing:false,
91
94
  analyCorrectAnswer:'',
92
95
  classify_question_info:{},
93
96
  answerMap:{},
@@ -167,34 +170,36 @@ export default {
167
170
  parseLists(nv){
168
171
  this.classify_question_info = nv.classify_question_info
169
172
  let exam_options_data = nv.exam_options_data
170
- if(this.classify_question_info.background_file){
171
- this.bigBgCss = `background: url(${this.classify_question_info.background_file.file_url}) no-repeat center;background-size: 100% 100%`
172
- }
173
- if(this.classify_question_info.bottom_img_file){
174
- this.bottomBgCss = `background: url(${this.classify_question_info.bottom_img_file.file_url}) no-repeat center;background-size: 100% 100%`
175
- }
176
- let optionList = []
177
- exam_options_data.forEach((item)=>{
178
- optionList.push({
179
- content:item.data.option_content,
180
- bgUrlCss:`background: url(${item.data.file_url}) no-repeat center;background-size: 100% 100%`,
181
- idx:item.index
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
+ })
182
187
  })
183
- })
184
- this.optionList = optionList
185
- this.listItemBgCss = !optionList[0]?'':optionList[0].bgUrlCss
188
+ this.optionList = optionList
189
+ this.listItemBgCss = !optionList[0]?'':optionList[0].bgUrlCss
186
190
 
187
- let bigBoxItemList = []
188
- let big_type_box_image_list = this.classify_question_info.big_type_box_image_list
189
- let big_type_option_list = this.classify_question_info.big_type_option_list
190
- big_type_box_image_list.forEach((item,index)=>{
191
- bigBoxItemList.push({
192
- imgUrl:big_type_option_list[index].file_url,
193
- bgUrl:item.file_url,
194
- bgUrlCss:`background: url(${item.file_url}) no-repeat center;background-size: 100% 100%`
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
+ })
195
200
  })
196
- })
197
- this.bigBoxItemList = bigBoxItemList
201
+ this.bigBoxItemList = bigBoxItemList
202
+ }
198
203
  },
199
204
  setRootFontSize() {
200
205
  // setRemFixedHeight(1000,140,1.08)
@@ -203,7 +208,6 @@ export default {
203
208
  unmountedDo(){
204
209
  window.removeEventListener('resize',this.setRootFontSize)
205
210
  document.removeEventListener('gesturestart', this.gesturestartListener)
206
- this.$el
207
211
  $(this.$el).find('.question-classify .append-item').off(this.mousedown)
208
212
  $(this.$el).find('.question-classify .list-item').off(this.mousedown)
209
213
  $(document).off(this.mouseup)
@@ -268,7 +272,8 @@ export default {
268
272
  let idx = self.listItem.attr('idx')
269
273
  self.moveDiv = $(`<div class="question-classify-moveDiv" idx="${idx}" style="${self.listItemBgCss}"><div class="list-item-text">${self.listItem.find('.list-item-text').text()}</div></div>`)
270
274
  self.moveDiv.css({left:`${self.p1.moveX}px`,top:`${self.p1.moveY}px`})
271
- $('body').append(self.moveDiv)
275
+ $(self.$el).append(self.moveDiv)
276
+ // $('body').append(self.moveDiv)
272
277
  $(document).on(self.mousemove,function(e2){
273
278
  // e2.preventDefault()
274
279
  e2.stopPropagation()
@@ -296,6 +301,7 @@ export default {
296
301
  let appendLeft = appendItem.offset().left
297
302
  let appendTop = appendItem.offset().top
298
303
  //transitionend事件会执行2次,所以使用标记避免
304
+ self.animationing = true
299
305
  self.moveDiv.css({
300
306
  transition:'all 0.5s',
301
307
  left:appendLeft,
@@ -308,6 +314,7 @@ export default {
308
314
  appendItem.css({opacity:1})
309
315
  self.answeredNotify()
310
316
  self.bindDragDomEvent(appendItem,options.op)
317
+ self.animationing = false
311
318
  }
312
319
  self.flag = true
313
320
  })
@@ -332,6 +339,9 @@ export default {
332
339
  }
333
340
  self.bindDragDomEvent($(this.$el).find('.question-classify .list-item'),'go')
334
341
  $(document).on(self.mouseup,function(e){
342
+ if(self.animationing){
343
+ return
344
+ }
335
345
  // e.preventDefault()
336
346
  if(self.dragWay === 'go'){
337
347
  $(document).off(self.mousemove)
@@ -389,8 +399,6 @@ export default {
389
399
 
390
400
  console.log(specArr.length);
391
401
  }
392
-
393
-
394
402
  }
395
403
  })
396
404
  self.bindNextPrevEvent('next')
@@ -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'
package/src/main.ts CHANGED
@@ -179,8 +179,9 @@ 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
+ // import '@src/assets/scss/questions/zykjcommon-questions.scss';
184
185
 
185
186
 
186
187
  // console.log(ZYKJQuestionsPlugin,111);
@@ -117,6 +117,40 @@ export default defineComponent({
117
117
  "have_not_auto_check_question": false,
118
118
  "size": 23,
119
119
  "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
+ },
120
154
  {
121
155
  "question_type_str": "分类题",
122
156
  "is_need_judge": "",