@zykjcommon/questions 0.0.52 → 0.0.53
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.
|
|
3
|
+
"version": "0.0.53",
|
|
4
4
|
"main": "src/components/questions/entry.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "vue-cli-service serve",
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
"md5": "^2.2.1",
|
|
22
22
|
"mitt": "^3.0.0",
|
|
23
23
|
"mobile-detect": "^1.4.5",
|
|
24
|
-
"video.js": "^7.6.0"
|
|
24
|
+
"video.js": "^7.6.0",
|
|
25
|
+
"vue": "^3.0.0",
|
|
26
|
+
"vue-router": "^4.0.0-0",
|
|
27
|
+
"vuex": "^4.0.0-0",
|
|
28
|
+
"vuex-composition-helpers": "^2.0.1"
|
|
25
29
|
},
|
|
26
30
|
"devDependencies": {
|
|
27
31
|
"@types/node": "^18.11.9",
|
|
@@ -51,11 +55,7 @@
|
|
|
51
55
|
"unplugin-vue-components": "^0.17.18",
|
|
52
56
|
"url-loader": "^4.1.1",
|
|
53
57
|
"webpack": "^5.88.1",
|
|
54
|
-
"yargs": "^16.2.0"
|
|
55
|
-
"vue": "^3.0.0",
|
|
56
|
-
"vue-router": "^4.0.0-0",
|
|
57
|
-
"vuex": "^4.0.0-0",
|
|
58
|
-
"vuex-composition-helpers": "^2.0.1"
|
|
58
|
+
"yargs": "^16.2.0"
|
|
59
59
|
},
|
|
60
60
|
"publishConfig": {
|
|
61
61
|
"access": "public",
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="zykjcommon-question">
|
|
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>
|
|
3
|
+
<div class="question-type" v-if="!isSub">{{questionInfo.questionIndex}}、{{ questionInfo.question_type_str }}<span v-if="questionInfo.score!=='null' && showScore">({{questionInfo.score}}分1111)</span>
|
|
6
4
|
<span class="score fr" v-if="mode==='analysis'">得分:{{questionInfo.answerMap ? questionInfo.answerMap.user_score : '-'}}分</span>
|
|
7
5
|
</div>
|
|
8
6
|
<div class="question-box">
|
|
9
|
-
<div class="question-hint"
|
|
10
|
-
:class="{'bold':!showQuestionType}" v-if="showQuestionHint && questionInfo.hint && !isSub">{{ questionInfo.hint }}</div>
|
|
7
|
+
<div class="question-hint" v-if="questionInfo.hint && !isSub">{{ questionInfo.hint }}</div>
|
|
11
8
|
<div class="editor-content"
|
|
12
9
|
style="line-height: 40px;"
|
|
13
10
|
v-if="questionInfo.htmlContent" v-html="questionInfo.htmlContent"></div>
|
|
@@ -61,18 +58,6 @@ export default {
|
|
|
61
58
|
showScore: {
|
|
62
59
|
type: Boolean,
|
|
63
60
|
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
|
|
76
61
|
}
|
|
77
62
|
},
|
|
78
63
|
mounted() {
|
|
@@ -83,10 +68,37 @@ export default {
|
|
|
83
68
|
this.answerMap = nv.answerMap
|
|
84
69
|
let fillBlank = jQuery(this.$el).find('.fill-blank')
|
|
85
70
|
fillBlank.replaceWith(jQuery(`<span class="fill-blank" contenteditable="${self.mode==='exam'?'true':'false'}"> </span>`))
|
|
71
|
+
|
|
72
|
+
//先解绑
|
|
73
|
+
jQuery(this.$el).find('.fill-blank').unbind('input')
|
|
74
|
+
jQuery(this.$el).find('.fill-blank').unbind('keydown')
|
|
75
|
+
jQuery(this.$el).find('.fill-blank').unbind('paste')
|
|
76
|
+
|
|
77
|
+
jQuery(this.$el).bind('keydown',function(e){
|
|
78
|
+
if(e.keyCode === 13){
|
|
79
|
+
e.preventDefault()
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
jQuery(this.$el).bind('paste', function(e) {
|
|
84
|
+
// self.pasteMark = true
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
|
|
86
89
|
jQuery(this.$el).find('.fill-blank').bind('input',function(e){
|
|
87
90
|
let ipt = jQuery(e.target)
|
|
88
|
-
let iptValue = ipt.
|
|
91
|
+
let iptValue = ipt.text()
|
|
89
92
|
iptValue = self.getIptValue(iptValue)
|
|
93
|
+
console.log(iptValue,123456);
|
|
94
|
+
//黏贴后过滤掉格式,只留文本
|
|
95
|
+
// if(self.pasteMark){
|
|
96
|
+
// ipt.text(iptValue)
|
|
97
|
+
// var selection = window.getSelection();
|
|
98
|
+
// selection.selectAllChildren(ipt.get(0));
|
|
99
|
+
// selection.collapseToEnd();
|
|
100
|
+
// self.pasteMark = false
|
|
101
|
+
// }
|
|
90
102
|
if(iptValue.length <= 0){
|
|
91
103
|
ipt.html(' ')
|
|
92
104
|
}
|
|
@@ -132,6 +144,7 @@ export default {
|
|
|
132
144
|
return {
|
|
133
145
|
analyCorrectAnswer:'',
|
|
134
146
|
answerMap:{},
|
|
147
|
+
pasteMark:false,
|
|
135
148
|
...JSON.parse(commonData)
|
|
136
149
|
};
|
|
137
150
|
},
|
|
@@ -143,7 +156,7 @@ export default {
|
|
|
143
156
|
let fillBlank = jQuery(this.$el).find('.fill-blank')
|
|
144
157
|
let gap_data = []
|
|
145
158
|
fillBlank.each((index,item)=>{
|
|
146
|
-
let iptValue = jQuery(item).
|
|
159
|
+
let iptValue = jQuery(item).text()
|
|
147
160
|
iptValue = this.getIptValue(iptValue)
|
|
148
161
|
gap_data.push(iptValue)
|
|
149
162
|
})
|
|
@@ -151,7 +164,7 @@ export default {
|
|
|
151
164
|
},
|
|
152
165
|
isAnswered(){
|
|
153
166
|
let answerResult = this.getAnswer().gap_data
|
|
154
|
-
let answered = answerResult.
|
|
167
|
+
let answered = answerResult.every((item)=>{
|
|
155
168
|
return item !== ''
|
|
156
169
|
})
|
|
157
170
|
return answered
|