@zykjcommon/questions 0.0.1
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 +3 -0
- package/.env +7 -0
- package/.env.buildTest +9 -0
- package/.env.development +9 -0
- package/.env.production +13 -0
- package/.env.test +12 -0
- package/@types/global.d.ts +33 -0
- package/@types/shims-vue.d.ts +6 -0
- package/@types/shims-vuex.d.ts +15 -0
- package/auto-imports.d.ts +6 -0
- package/babel.config.js +5 -0
- package/components.d.ts +23 -0
- package/design/App.vue +60 -0
- package/design/main.js +23 -0
- package/design/views/dialog/contentDialog.vue +18 -0
- package/design/views/dialog/contentDialog2.vue +18 -0
- package/design/views/dialog/contentDialog3.vue +19 -0
- package/design/views/exam/analysis.vue +208 -0
- package/design/views/exam/exam.vue +355 -0
- package/design/views/home/illustrate.vue +45 -0
- package/design/views/home/login.vue +43 -0
- package/design/vueMapper.js +8 -0
- package/design/vueMapperTree.js +2 -0
- package/dist/demo.html +1 -0
- package/dist/zykjcommon-questions.common.js +12817 -0
- package/dist/zykjcommon-questions.css +1 -0
- package/dist/zykjcommon-questions.umd.js +12836 -0
- package/dist/zykjcommon-questions.umd.min.js +18 -0
- package/index.js +10 -0
- package/package.json +61 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +19 -0
- package/public/static/js/jquery.html2json.js +169 -0
- package/public/static/js/jquery.json2html.js +137 -0
- package/public/static/js/jquery.min.js +2 -0
- package/public/static/js/json2html.js +447 -0
- package/readme +8 -0
- package/src/App.vue +37 -0
- package/src/assets/img/afei.jpg +0 -0
- package/src/assets/img/audio-ico.gif +0 -0
- package/src/assets/img/audio-ico.png +0 -0
- package/src/assets/img/bc-type-bg.png +0 -0
- package/src/assets/img/big-close.png +0 -0
- package/src/assets/img/big-next.png +0 -0
- package/src/assets/img/big-pre.png +0 -0
- package/src/assets/img/book-bg.png +0 -0
- package/src/assets/img/checkbox-cur.png +0 -0
- package/src/assets/img/checkbox.png +0 -0
- package/src/assets/img/cpp-bg.png +0 -0
- package/src/assets/img/deer-logo.png +0 -0
- package/src/assets/img/header-bg-2.png +0 -0
- package/src/assets/img/header-bg.png +0 -0
- package/src/assets/img/illustrate-bg.png +0 -0
- package/src/assets/img/loading.gif +0 -0
- package/src/assets/img/login-bg.png +0 -0
- package/src/assets/img/login-box-bg.png +0 -0
- package/src/assets/img/login-box-logo.png +0 -0
- package/src/assets/img/logo.png +0 -0
- package/src/assets/img/logoByText.png +0 -0
- package/src/assets/img/py-bg.png +0 -0
- package/src/assets/img/pygame-bg.png +0 -0
- package/src/assets/img/radio-cur.png +0 -0
- package/src/assets/img/radio.png +0 -0
- package/src/assets/img/return-top-hover.png +0 -0
- package/src/assets/img/return-top.png +0 -0
- package/src/assets/img/sb3-bg.png +0 -0
- package/src/assets/img/star-ico.png +0 -0
- package/src/assets/img/tab-mark.png +0 -0
- package/src/assets/img/video-play-btn.png +0 -0
- package/src/assets/js/arms.js +16 -0
- package/src/assets/js/bus.js +14 -0
- package/src/assets/js/fun.js +883 -0
- package/src/assets/js/helper.js +575 -0
- package/src/assets/js/http.js +219 -0
- package/src/assets/js/md5.js +260 -0
- package/src/assets/js/rem.js +33 -0
- package/src/assets/js/validation.js +216 -0
- package/src/assets/js/zykjcommon-questions.umd.min.js +18 -0
- package/src/assets/logo.png +0 -0
- package/src/assets/scss/dialog/dialog.scss +144 -0
- package/src/assets/scss/exam/exam.scss +256 -0
- package/src/assets/scss/home/home.scss +222 -0
- package/src/assets/scss/index.scss +80 -0
- package/src/assets/scss/questions/index.scss +345 -0
- package/src/common/const.ts +15 -0
- package/src/components/common/ContentDialog.vue +172 -0
- package/src/components/common/IframeComponent.vue +101 -0
- package/src/components/common/Loading.vue +45 -0
- package/src/components/common/MediaLooker.vue +171 -0
- package/src/components/common/TextAreaEditor.vue +121 -0
- package/src/components/exam/QuestionCard.vue +494 -0
- package/src/components/exam/QuestionHeader.vue +87 -0
- package/src/components/exam/TimeCounter.vue +107 -0
- package/src/components/questions/QuestionReader.js +20 -0
- package/src/components/questions/Question_SingleChoice.vue +208 -0
- package/src/components/questions/buildEntry.js +12 -0
- package/src/components/questions/developmentEntry.js +11 -0
- package/src/components/questions/mixin.js +64 -0
- package/src/main.ts +176 -0
- package/src/router/exam.ts +50 -0
- package/src/router/index.ts +33 -0
- package/src/store/exam.ts +199 -0
- package/src/store/index.ts +22 -0
- package/src/types/common/index.ts +4 -0
- package/src/types/exam/exam.ts +10 -0
- package/src/views/exam/Analysis.vue +516 -0
- package/src/views/exam/Default.vue +28 -0
- package/src/views/exam/Exam.vue +594 -0
- package/src/views/exam/ReviewPaper.vue +178 -0
- package/src/views/exam/ReviewQuestion.vue +167 -0
- package/tasks/vueMapper.js +37 -0
- package/tasks/vueMapperTree.js +42 -0
- package/tsconfig.json +46 -0
- package/tslint.json +19 -0
- package/vue.config.js +107 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
let api = {
|
|
2
|
+
getCodeFreeCreationGoToUrl: '/exam/list',
|
|
3
|
+
getExamPaper: '/recruit-exam-online/get-exam-paper',
|
|
4
|
+
getExamReview: '/exam/get-exam-review',
|
|
5
|
+
saveAnswers: '/recruit-exam-online/save-answers',
|
|
6
|
+
submitExam: '/recruit-exam-online/submit-exam',
|
|
7
|
+
editorUrl: '/open/editor-url',
|
|
8
|
+
getQuestionInfo:'/open/question-info',
|
|
9
|
+
resetExam:'/recruit-exam-online/reset-exam',
|
|
10
|
+
ongoingExam:'/recruit-exam-online/ongoing-exam'
|
|
11
|
+
}
|
|
12
|
+
import {postWeb,getWeb} from "@src/assets/js/http.js";
|
|
13
|
+
import {actionFnObj} from "@src/types/common/index.ts";
|
|
14
|
+
/**
|
|
15
|
+
* user模块
|
|
16
|
+
*/
|
|
17
|
+
interface ExamState {
|
|
18
|
+
hasExamOver:boolean,
|
|
19
|
+
hasNotExam:boolean,
|
|
20
|
+
examInfoLoaded:boolean,
|
|
21
|
+
examInfo:any,
|
|
22
|
+
pythonCodeWebPath:string,
|
|
23
|
+
scratchCodeWebPath:string,
|
|
24
|
+
cplusCodeWebPath:string,
|
|
25
|
+
hasError:boolean,
|
|
26
|
+
userId:string
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const state: ExamState = {
|
|
30
|
+
hasExamOver:false,
|
|
31
|
+
hasNotExam:false,
|
|
32
|
+
examInfoLoaded:false,
|
|
33
|
+
examInfo:{},
|
|
34
|
+
pythonCodeWebPath:'',
|
|
35
|
+
scratchCodeWebPath:'',
|
|
36
|
+
cplusCodeWebPath:'',
|
|
37
|
+
hasError:false,
|
|
38
|
+
userId:''
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
let timer:any = null
|
|
42
|
+
export default {
|
|
43
|
+
namespaced: true,
|
|
44
|
+
state,
|
|
45
|
+
getters: {},
|
|
46
|
+
mutations: {
|
|
47
|
+
setHasNotExam(state: ExamState,payload:boolean){
|
|
48
|
+
state.hasNotExam = false
|
|
49
|
+
timer && clearTimeout(timer)
|
|
50
|
+
timer = setTimeout(()=>{
|
|
51
|
+
state.hasNotExam = payload
|
|
52
|
+
})
|
|
53
|
+
},
|
|
54
|
+
setHasExamOver(state: ExamState,payload:boolean){
|
|
55
|
+
state.hasExamOver = false
|
|
56
|
+
timer && clearTimeout(timer)
|
|
57
|
+
timer = setTimeout(()=>{
|
|
58
|
+
state.hasExamOver = payload
|
|
59
|
+
})
|
|
60
|
+
},
|
|
61
|
+
setExamInfo(state: ExamState,payload:any){
|
|
62
|
+
state.examInfo = payload
|
|
63
|
+
state.examInfoLoaded = true
|
|
64
|
+
},
|
|
65
|
+
setExamPaperInfo(state: ExamState, payload: string) {
|
|
66
|
+
state.userId = payload
|
|
67
|
+
},
|
|
68
|
+
setCodeWebPath(state: ExamState, payload: {pythonCodeWebPath:string, scratchCodeWebPath:string,cplusCodeWebPath:string }) {
|
|
69
|
+
state.pythonCodeWebPath = payload.pythonCodeWebPath
|
|
70
|
+
state.scratchCodeWebPath = payload.scratchCodeWebPath
|
|
71
|
+
state.cplusCodeWebPath = payload.cplusCodeWebPath
|
|
72
|
+
},
|
|
73
|
+
//设置为true,异常情况下可退出iframe
|
|
74
|
+
setHasError(state: ExamState, payload: boolean){
|
|
75
|
+
state.hasError = payload
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
actions: {
|
|
79
|
+
ongoingExamActions({commit,dispatch}:actionFnObj,params:any){
|
|
80
|
+
return new Promise((resolve, reject) => {
|
|
81
|
+
getWeb(`${api.ongoingExam}`).then((res) => {
|
|
82
|
+
let {error_code,data} = res;
|
|
83
|
+
if(!error_code){
|
|
84
|
+
// data = null
|
|
85
|
+
if(data){
|
|
86
|
+
commit('setExamInfo', data)
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
resolve(res)
|
|
90
|
+
}, (err) => {
|
|
91
|
+
reject(err)
|
|
92
|
+
})
|
|
93
|
+
})
|
|
94
|
+
},
|
|
95
|
+
getCodeFreeCreationGoToUrlActions({commit,dispatch}:actionFnObj,params:any){
|
|
96
|
+
return new Promise((resolve, reject) => {
|
|
97
|
+
postWeb(`${api.getCodeFreeCreationGoToUrl}`,params).then((res) => {
|
|
98
|
+
resolve(res)
|
|
99
|
+
}, (err) => {
|
|
100
|
+
reject(err)
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
},
|
|
104
|
+
getExamPaperActions({commit,dispatch}:actionFnObj,params:any){
|
|
105
|
+
return new Promise((resolve, reject) => {
|
|
106
|
+
getWeb(`${api.getExamPaper}/${params.examId}`).then((res) => {
|
|
107
|
+
let {error_code,data} = res;
|
|
108
|
+
if(error_code){
|
|
109
|
+
if(error_code == 39002){
|
|
110
|
+
commit('setHasNotExam', true)
|
|
111
|
+
}
|
|
112
|
+
commit('setHasError',true)
|
|
113
|
+
}
|
|
114
|
+
if(data && data.applicant_simple_info && data.applicant_simple_info.applicant_id){
|
|
115
|
+
window.applicant_id = data.applicant_simple_info.applicant_id
|
|
116
|
+
let e = new Event('getStudentIdSuccess')
|
|
117
|
+
document.dispatchEvent(e)
|
|
118
|
+
}
|
|
119
|
+
resolve(res)
|
|
120
|
+
}, (err) => {
|
|
121
|
+
commit('setHasError',true)
|
|
122
|
+
reject(err)
|
|
123
|
+
})
|
|
124
|
+
})
|
|
125
|
+
},
|
|
126
|
+
getExamReviewActions({commit,dispatch}:actionFnObj,params:any){
|
|
127
|
+
return new Promise((resolve, reject) => {
|
|
128
|
+
getWeb(`${api.getExamReview}/${params.examId}`).then((res) => {
|
|
129
|
+
let {error_code} = res;
|
|
130
|
+
if(error_code){
|
|
131
|
+
if(error_code == 39002){
|
|
132
|
+
commit('setHasNotExam', true)
|
|
133
|
+
}
|
|
134
|
+
commit('setHasError',true)
|
|
135
|
+
}
|
|
136
|
+
resolve(res)
|
|
137
|
+
}, (err) => {
|
|
138
|
+
commit('setHasError',true)
|
|
139
|
+
reject(err)
|
|
140
|
+
})
|
|
141
|
+
})
|
|
142
|
+
},
|
|
143
|
+
getEditorUrlActions({commit,dispatch}:actionFnObj){
|
|
144
|
+
return new Promise((resolve, reject) => {
|
|
145
|
+
getWeb(`${api.editorUrl}`).then((res) => {
|
|
146
|
+
let {error_code, data} = res;
|
|
147
|
+
if (!error_code){
|
|
148
|
+
let {pythonCodeWebPath,scratchCodeWebPath,cplusCodeWebPath} = data
|
|
149
|
+
commit('setCodeWebPath',{pythonCodeWebPath,scratchCodeWebPath,cplusCodeWebPath})
|
|
150
|
+
}
|
|
151
|
+
resolve(res)
|
|
152
|
+
}, (err) => {
|
|
153
|
+
reject(err)
|
|
154
|
+
})
|
|
155
|
+
})
|
|
156
|
+
},
|
|
157
|
+
getQuestionInfoActions({commit,dispatch}:actionFnObj,params:any){
|
|
158
|
+
return new Promise((resolve, reject) => {
|
|
159
|
+
getWeb(`${api.getQuestionInfo}/${params.questionId}`).then((res) => {
|
|
160
|
+
resolve(res)
|
|
161
|
+
}, (err) => {
|
|
162
|
+
reject(err)
|
|
163
|
+
})
|
|
164
|
+
})
|
|
165
|
+
},
|
|
166
|
+
saveAnswersActions({commit,dispatch}:actionFnObj,params:any){
|
|
167
|
+
return new Promise((resolve, reject) => {
|
|
168
|
+
postWeb(`${api.saveAnswers}`,params).then((res) => {
|
|
169
|
+
let {error_code, data} = res;
|
|
170
|
+
if (error_code == 39003){
|
|
171
|
+
commit('setHasExamOver',true)
|
|
172
|
+
}
|
|
173
|
+
resolve(res)
|
|
174
|
+
}, (err) => {
|
|
175
|
+
reject(err)
|
|
176
|
+
})
|
|
177
|
+
})
|
|
178
|
+
},
|
|
179
|
+
submitExamActions({commit,dispatch}:actionFnObj,params:any){
|
|
180
|
+
return new Promise((resolve, reject) => {
|
|
181
|
+
postWeb(`${api.submitExam}`,params).then((res) => {
|
|
182
|
+
resolve(res)
|
|
183
|
+
}, (err) => {
|
|
184
|
+
reject(err)
|
|
185
|
+
})
|
|
186
|
+
})
|
|
187
|
+
},
|
|
188
|
+
resetExamActions({commit,dispatch}:actionFnObj,params:any){
|
|
189
|
+
return new Promise((resolve, reject) => {
|
|
190
|
+
postWeb(`${api.resetExam}/${params.examId}`).then((res) => {
|
|
191
|
+
resolve(res)
|
|
192
|
+
}, (err) => {
|
|
193
|
+
reject(err)
|
|
194
|
+
})
|
|
195
|
+
})
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {createStore} from 'vuex'
|
|
2
|
+
import exam from './exam'
|
|
3
|
+
|
|
4
|
+
interface RootState {
|
|
5
|
+
token: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export default createStore({
|
|
10
|
+
state: {
|
|
11
|
+
token: ''
|
|
12
|
+
} as RootState,
|
|
13
|
+
mutations: {
|
|
14
|
+
setToken(state: RootState, payload: string) {
|
|
15
|
+
state.token = payload
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
actions: {},
|
|
19
|
+
modules: {
|
|
20
|
+
exam
|
|
21
|
+
}
|
|
22
|
+
})
|