@zykjcommon/questions 0.0.48 → 0.0.50

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.48",
3
+ "version": "0.0.50",
4
4
  "main": "src/components/questions/entry.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -25,11 +25,17 @@ $greenItemFontSize:0.13em;
25
25
  color: #666666;
26
26
  font-weight: normal;
27
27
  }
28
+ .question-type-str{
29
+ display: inline-block;
30
+ }
28
31
  }
29
32
  .question-hint{
30
33
  margin-bottom: 20px;
31
34
  font-size: 16px;
32
35
  color: #333333;
36
+ &.bold{
37
+ font-weight: bold;
38
+ }
33
39
  }
34
40
  .question-box{
35
41
  padding-left: 30px;
@@ -400,8 +406,8 @@ $greenItemFontSize:0.13em;
400
406
  //justify-content: space-between;
401
407
  align-content: start;
402
408
  &::-webkit-scrollbar {
403
- width: 7px;
404
- height: 7px;
409
+ width: 17px;
410
+ height: 17px;
405
411
  }
406
412
  &.noScrollBar::-webkit-scrollbar {
407
413
  width: 0;
@@ -1,10 +1,13 @@
1
1
  <template>
2
2
  <div class="zykjcommon-question">
3
- <div class="question-type" v-if="!isSub">{{questionInfo.questionIndex}}、{{ questionInfo.question_type_str }}<span v-if="questionInfo.score!=='null' && showScore">({{questionInfo.score}}分)</span>
3
+ <div class="question-type" v-if="!isSub">
4
+ <div class="question-type-str" v-if="showQuestionType"><span v-if="showQuestionIndex">{{questionInfo.questionIndex}}、</span>{{ questionInfo.question_type_str }}</div>
5
+ <span v-if="questionInfo.score!=='null' && showScore">({{questionInfo.score}}分)</span>
4
6
  <span class="score fr" v-if="mode==='analysis'">得分:{{questionInfo.answerMap ? questionInfo.answerMap.user_score : '-'}}分</span>
5
7
  </div>
6
8
  <div class="question-box">
7
- <div class="question-hint" v-if="questionInfo.hint && !isSub">{{ questionInfo.hint }}</div>
9
+ <div class="question-hint"
10
+ :class="{'bold':!showQuestionType}" v-if="showQuestionHint && questionInfo.hint && !isSub">{{ questionInfo.hint }}</div>
8
11
  <div class="editor-content" v-html="questionInfo.htmlContent"></div>
9
12
 
10
13
  <!-- <div class="editor-tit">样例输入</div>
@@ -78,6 +81,18 @@ export default {
78
81
  showScore: {
79
82
  type: Boolean,
80
83
  default: false
84
+ },
85
+ showQuestionType: {
86
+ type: Boolean,
87
+ default: true
88
+ },
89
+ showQuestionHint: {
90
+ type: Boolean,
91
+ default: true
92
+ },
93
+ showQuestionIndex: {
94
+ type: Boolean,
95
+ default: true
81
96
  }
82
97
  },
83
98
  mounted() {
@@ -163,9 +163,20 @@ export default {
163
163
  }
164
164
  },
165
165
  isAnswered(){
166
- let len = $(this.$el).find('.list .list-item').length
167
- let answerd = len === 0
168
- return answerd
166
+ // let len = $(this.$el).find('.list .list-item').length
167
+ // let answerd = len === 0
168
+ //每个选中框至少要有一个选项才是已答
169
+ let arr = []
170
+ let mainAppend = $(this.$el).find('.main-append')
171
+ mainAppend.each((index,item)=>{
172
+ let appendItem = $(item).find('.append-item')
173
+ arr.push(appendItem.length)
174
+ })
175
+ if(arr.length === 2){
176
+ return arr[0] && arr[1]
177
+ }else{
178
+ return false
179
+ }
169
180
  },
170
181
  isCorrect(){
171
182
  let correct = this.questionInfo.answerMap.is_correct === '1' ? true : false
@@ -1,10 +1,13 @@
1
1
  <template>
2
2
  <div class="zykjcommon-question">
3
- <div class="question-type" v-if="!isSub">{{questionInfo.questionIndex}}、{{ questionInfo.question_type_str }}<span v-if="questionInfo.score!=='null' && showScore">({{questionInfo.score}}分)</span>
3
+ <div class="question-type" v-if="!isSub">
4
+ <div class="question-type-str" v-if="showQuestionType"><span v-if="showQuestionIndex">{{questionInfo.questionIndex}}、</span>{{ questionInfo.question_type_str }}</div>
5
+ <span v-if="questionInfo.score!=='null' && showScore">({{questionInfo.score}}分)</span>
4
6
  <span class="score fr" v-if="mode==='analysis'">得分:{{questionInfo.answerMap ? questionInfo.answerMap.user_score : '-'}}分</span>
5
7
  </div>
6
8
  <div class="question-box">
7
- <div class="question-hint" v-if="questionInfo.hint && !isSub">{{ questionInfo.hint }}</div>
9
+ <div class="question-hint"
10
+ :class="{'bold':!showQuestionType}" v-if="showQuestionHint && questionInfo.hint && !isSub">{{ questionInfo.hint }}</div>
8
11
  <div class="editor-content"
9
12
  style="line-height: 40px;"
10
13
  v-if="questionInfo.htmlContent" v-html="questionInfo.htmlContent"></div>
@@ -58,6 +61,18 @@ export default {
58
61
  showScore: {
59
62
  type: Boolean,
60
63
  default: false
64
+ },
65
+ showQuestionType: {
66
+ type: Boolean,
67
+ default: true
68
+ },
69
+ showQuestionHint: {
70
+ type: Boolean,
71
+ default: true
72
+ },
73
+ showQuestionIndex: {
74
+ type: Boolean,
75
+ default: true
61
76
  }
62
77
  },
63
78
  mounted() {
@@ -1,10 +1,13 @@
1
1
  <template>
2
2
  <div class="zykjcommon-question">
3
- <div class="question-type" v-if="!isSub">{{questionInfo.questionIndex}}、{{ questionInfo.question_type_str }}<span v-if="questionInfo.score!=='null' && showScore">({{questionInfo.score}}分)</span>
3
+ <div class="question-type" v-if="!isSub">
4
+ <div class="question-type-str" v-if="showQuestionType"><span v-if="showQuestionIndex">{{questionInfo.questionIndex}}、</span>{{ questionInfo.question_type_str }}</div>
5
+ <span v-if="questionInfo.score!=='null' && showScore">({{questionInfo.score}}分)</span>
4
6
  <span class="score fr" v-if="mode==='analysis'">得分:{{questionInfo.answerMap ? questionInfo.answerMap.user_score : '-'}}分</span>
5
7
  </div>
6
8
  <div class="question-box">
7
- <div class="question-hint" v-if="questionInfo.hint && !isSub">{{ questionInfo.hint }}</div>
9
+ <div class="question-hint"
10
+ :class="{'bold':!showQuestionType}" v-if="showQuestionHint && questionInfo.hint && !isSub">{{ questionInfo.hint }}</div>
8
11
  <div class="editor-content" v-if="!isSub" v-html="questionInfo.htmlContent"></div>
9
12
 
10
13
  <div class="question-stem" v-if="isSub"><span v-if="questionInfo.hint">{{questionInfo.questionIndex2}}、</span>{{questionInfo.hint}}</div>
@@ -101,6 +104,18 @@ export default {
101
104
  showScore: {
102
105
  type: Boolean,
103
106
  default: false
107
+ },
108
+ showQuestionType: {
109
+ type: Boolean,
110
+ default: true
111
+ },
112
+ showQuestionHint: {
113
+ type: Boolean,
114
+ default: true
115
+ },
116
+ showQuestionIndex: {
117
+ type: Boolean,
118
+ default: true
104
119
  }
105
120
  },
106
121
  mounted() {
@@ -163,7 +178,7 @@ export default {
163
178
  return {multiple_index_set:self.checkboxList}
164
179
  },
165
180
  isAnswered(){
166
- let answerd = this.checkboxList.length !== 0
181
+ let answerd = this.checkboxList.length > 1
167
182
  return answerd
168
183
  },
169
184
  isCorrect(){
@@ -1,10 +1,15 @@
1
1
  <template>
2
2
  <div class="zykjcommon-question">
3
- <div class="question-type" v-show="!isEnterCodeByInit" v-if="!isSub">{{questionInfo.questionIndex}}、{{ questionInfo.question_type_str }}<span v-if="questionInfo.score!=='null' && showScore">({{questionInfo.score}}分)</span>
3
+ <div class="question-type"
4
+ v-show="!isEnterCodeByInit"
5
+ v-if="!isSub">
6
+ <div class="question-type-str" v-if="showQuestionType"><span v-if="showQuestionIndex">{{questionInfo.questionIndex}}、</span>{{ questionInfo.question_type_str }}</div>
7
+ <span v-if="questionInfo.score!=='null' && showScore">({{questionInfo.score}}分)</span>
4
8
  <span class="score fr" v-if="mode==='analysis'">得分:{{questionInfo.answerMap ? questionInfo.answerMap.user_score : '-'}}分</span>
5
9
  </div>
6
10
  <div class="question-box" v-show="!isEnterCodeByInit">
7
- <div class="question-hint" v-if="questionInfo.hint && !isSub">{{ questionInfo.hint }}</div>
11
+ <div class="question-hint"
12
+ :class="{'bold':!showQuestionType}" v-if="showQuestionHint && questionInfo.hint && !isSub">{{ questionInfo.hint }}</div>
8
13
  <div class="editor-content" v-html="questionInfo.htmlContent"></div>
9
14
  <button class="bcdt-btn"
10
15
  v-if="(mode==='exam' && !oss_temp_url) || mode==='review'"
@@ -65,6 +70,7 @@
65
70
  @saveCodeOnly="saveCodeOnly"
66
71
  @iframeLoaded="iframeLoaded"
67
72
  @getQuestionInfo="getQuestionInfo"
73
+ @menuBarloaded="menuBarloaded"
68
74
  v-if="showFrame"></IframeComponent>
69
75
  <Loading :loading="loading"></Loading>
70
76
  </div>
@@ -107,6 +113,18 @@ export default {
107
113
  showScore: {
108
114
  type: Boolean,
109
115
  default: false
116
+ },
117
+ showQuestionType: {
118
+ type: Boolean,
119
+ default: true
120
+ },
121
+ showQuestionHint: {
122
+ type: Boolean,
123
+ default: true
124
+ },
125
+ showQuestionIndex: {
126
+ type: Boolean,
127
+ default: true
110
128
  }
111
129
  },
112
130
  mounted() {
@@ -136,6 +154,7 @@ export default {
136
154
  },
137
155
  data() {
138
156
  return {
157
+ findIframeTimer:null,
139
158
  iframe:null,
140
159
  showFrame:false,
141
160
  analyCorrectAnswer:'',
@@ -182,6 +201,24 @@ export default {
182
201
  },
183
202
  methods: {
184
203
  ...mapActions('zykjcommonQuestions',['getEditorUrlActions']),
204
+ menuBarloaded(){
205
+ this.$emit('menuBarloaded')
206
+ },
207
+ getIframeContentWindow(){
208
+ return new Promise((resolve,reject)=>{
209
+ if(this.iframe){
210
+ resolve(this.iframe.contentWindow)
211
+ }else{
212
+ this.findIframeTimer = setInterval(()=>{
213
+ if(this.iframe){
214
+ this.findIframeTimer && clearInterval(this.findIframeTimer)
215
+ this.findIframeTimer = null
216
+ resolve(this.iframe.contentWindow)
217
+ }
218
+ },200)
219
+ }
220
+ })
221
+ },
185
222
  getAnswer(){
186
223
  return {
187
224
  code_file_oss_temp_path:this.code_file_oss_temp_path,
@@ -1,10 +1,13 @@
1
1
  <template>
2
2
  <div class="zykjcommon-question">
3
- <div class="question-type">{{questionInfo.questionIndex}}、{{ questionInfo.question_type_str }}<span v-if="questionInfo.score!=='null' && showScore">({{questionInfo.score}}分)</span>
3
+ <div class="question-type">
4
+ <div class="question-type-str" v-if="showQuestionType"><span v-if="showQuestionIndex">{{questionInfo.questionIndex}}、</span>{{ questionInfo.question_type_str }}</div>
5
+ <span v-if="questionInfo.score!=='null' && showScore">({{questionInfo.score}}分)</span>
4
6
  <span class="score fr" v-if="mode==='analysis'">得分:{{questionInfo.answerMap ? questionInfo.answerMap.user_score : '-'}}分</span>
5
7
  </div>
6
8
  <div class="question-box">
7
- <div class="question-hint" v-if="questionInfo.hint">{{ questionInfo.hint }}</div>
9
+ <div class="question-hint"
10
+ :class="{'bold':!showQuestionType}" v-if="showQuestionHint && questionInfo.hint">{{ questionInfo.hint }}</div>
8
11
  <div class="editor-content editor-content-bor" v-html="questionInfo.htmlContent"></div>
9
12
  <div class="question-tabs">
10
13
  <div class="question-tab-item"
@@ -67,6 +70,18 @@ export default {
67
70
  showScore: {
68
71
  type: Boolean,
69
72
  default: false
73
+ },
74
+ showQuestionType: {
75
+ type: Boolean,
76
+ default: true
77
+ },
78
+ showQuestionHint: {
79
+ type: Boolean,
80
+ default: true
81
+ },
82
+ showQuestionIndex: {
83
+ type: Boolean,
84
+ default: true
70
85
  }
71
86
  },
72
87
  created() {
@@ -1,10 +1,13 @@
1
1
  <template>
2
2
  <div class="zykjcommon-question">
3
- <div class="question-type" v-if="!isSub">{{questionInfo.questionIndex}}、{{ questionInfo.question_type_str }}<span v-if="questionInfo.score!=='null' && showScore">({{questionInfo.score}}分)</span>
3
+ <div class="question-type" v-if="!isSub">
4
+ <div class="question-type-str" v-if="showQuestionType"><span v-if="showQuestionIndex">{{questionInfo.questionIndex}}、</span>{{ questionInfo.question_type_str }}</div>
5
+ <span v-if="questionInfo.score!=='null' && showScore">({{questionInfo.score}}分)</span>
4
6
  <span class="score fr" v-if="mode==='analysis'">得分:{{questionInfo.answerMap ? questionInfo.answerMap.user_score : '-'}}分</span>
5
7
  </div>
6
8
  <div class="question-box">
7
- <div class="question-hint" v-if="questionInfo.hint && !isSub">{{ questionInfo.hint }}</div>
9
+ <div class="question-hint"
10
+ :class="{'bold':!showQuestionType}" v-if="showQuestionHint && questionInfo.hint && !isSub">{{ questionInfo.hint }}</div>
8
11
  <div class="editor-content" v-if="!isSub" v-html="questionInfo.htmlContent"></div>
9
12
 
10
13
  <div class="question-stem" v-if="isSub"><span v-if="questionInfo.hint">{{questionInfo.questionIndex2}}、</span>{{questionInfo.hint}}</div>
@@ -109,6 +112,18 @@ export default {
109
112
  showScore: {
110
113
  type: Boolean,
111
114
  default: false
115
+ },
116
+ showQuestionType: {
117
+ type: Boolean,
118
+ default: true
119
+ },
120
+ showQuestionHint: {
121
+ type: Boolean,
122
+ default: true
123
+ },
124
+ showQuestionIndex: {
125
+ type: Boolean,
126
+ default: true
112
127
  }
113
128
  },
114
129
  mounted() {