
--- client/views/pages/teacher/QuestionDetail.vue
+++ client/views/pages/teacher/QuestionDetail.vue
... | ... | @@ -18,32 +18,10 @@ |
18 | 18 |
<div class="flex align-center mb20"> |
19 | 19 |
<label for="" class="title2">문제 유형</label> |
20 | 20 |
<select v-model="selectedSearchOption2" class="mr10 data-wrap"> |
21 |
- <option value="prblm_type_001">Chapter3 페이지 문제</option> |
|
22 |
- <option value="prblm_type_002">Chapter3_1 페이지 문제</option> |
|
23 |
- <option value="prblm_type_003">Chapter3_2 페이지 문제</option> |
|
24 |
- <option value="prblm_type_004">Chapter3_3 페이지 문제</option> |
|
25 |
- <option value="prblm_type_005">Chapter3_3_1 페이지 문제</option> |
|
26 |
- <option value="prblm_type_006">Chapter3_4 페이지 문제</option> |
|
27 |
- <option value="prblm_type_007">Chapter3_5 페이지 문제</option> |
|
28 |
- <option value="prblm_type_008">Chapter3_6 페이지 문제</option> |
|
29 |
- <option value="prblm_type_009">Chapter3_7 페이지 문제</option> |
|
30 |
- <option value="prblm_type_010">Chapter3_8 페이지 문제</option> |
|
31 |
- <option value="prblm_type_011">Chapter3_9 페이지 문제</option> |
|
32 |
- <option value="prblm_type_012">Chapter3_10 페이지 문제</option> |
|
33 |
- <option value="prblm_type_013">Chapter3_11 페이지 문제</option> |
|
34 |
- <option value="prblm_type_014">Chapter3_12 페이지 문제</option> |
|
35 |
- <option value="prblm_type_015">Chapter3_13 페이지 문제</option> |
|
36 |
- <option value="prblm_type_016">Chapter3_14 페이지 문제</option> |
|
37 |
- <option value="prblm_type_017">Chapter3_15 페이지 문제</option> |
|
38 |
- <option value="prblm_type_018">Chapter2_8 페이지 문제</option> |
|
39 |
- <option value="prblm_type_019">Chapter2_7 페이지 문제</option> |
|
40 |
- <option value="prblm_type_020">Chapter2_5 페이지 문제</option> |
|
41 |
- <option value="prblm_type_021">Chapter2_6 페이지 문제</option> |
|
42 |
- <option value="prblm_type_022">Chapter2_10 페이지 문제</option> |
|
43 |
- <option value="prblm_type_023">Chapter2_11 페이지 문제</option> |
|
44 |
- <option value="prblm_type_024">Chapter2_13 페이지 문제</option> |
|
21 |
+ <option v-for="prblmT in problemType" :key="prblmT.prblm_type_id" :value="prblmT"> |
|
22 |
+ {{ prblmT.prblm_type_nm }} |
|
23 |
+ </option> |
|
45 | 24 |
</select> |
46 |
- |
|
47 | 25 |
</div> |
48 | 26 |
|
49 | 27 |
<div class="flex align-center"> |
... | ... | @@ -90,7 +68,7 @@ |
90 | 68 |
<input type="file" ref="fileInput" @change="handleFileUpload" multiple /> |
91 | 69 |
</div> |
92 | 70 |
<hr> |
93 |
- <div v-if="selectedSearchOption2 === ('prblm_type_008')"> |
|
71 |
+ <div v-if="selectedSearchOption2.prblm_type_cls === '5지선다'"> |
|
94 | 72 |
<!--5지선다--> |
95 | 73 |
<div class="gd-col2 " v-for="i in 5" :key="i"> |
96 | 74 |
<div> |
... | ... | @@ -107,7 +85,7 @@ |
107 | 85 |
</div> |
108 | 86 |
<div class="flex align-center mb20"> |
109 | 87 |
<label :for="'file' + i" class="title2">첨부파일</label> |
110 |
- <div v-for="(data, index) in prblmDetail.answers[i].fileInfo" :key="index"> |
|
88 |
+ <div v-if="prblmDetail.answers[i] && prblmDetail.answers[i].fileInfo" v-for="(data, index) in prblmDetail.answers[i].fileInfo" :key="index"> |
|
111 | 89 |
<label>{{ data.fileNm }}</label> |
112 | 90 |
</div> |
113 | 91 |
|
... | ... | @@ -116,7 +94,7 @@ |
116 | 94 |
</div> |
117 | 95 |
|
118 | 96 |
</div> |
119 |
- <div v-else-if="['prblm_type_004', 'prblm_type_006', 'prblm_type_024'].includes(selectedSearchOption2)"> |
|
97 |
+ <div v-else-if="selectedSearchOption2.prblm_type_cls === '4지선다'"> |
|
120 | 98 |
<!--4지선다--> |
121 | 99 |
<div class="gd-col2 " v-for="i in 4" :key="i"> |
122 | 100 |
<div> |
... | ... | @@ -133,7 +111,7 @@ |
133 | 111 |
</div> |
134 | 112 |
<div class="flex align-center mb20"> |
135 | 113 |
<label :for="'file' + i" class="title2">첨부파일</label> |
136 |
- <div v-for="(data, index) in prblmDetail.answers[i].fileInfo" :key="index"> |
|
114 |
+ <div v-if="prblmDetail.answers[i] && prblmDetail.answers[i].fileInfo" v-for="(data, index) in prblmDetail.answers[i].fileInfo" :key="index"> |
|
137 | 115 |
<label>{{ data.fileNm }}</label> |
138 | 116 |
</div> |
139 | 117 |
|
... | ... | @@ -142,8 +120,7 @@ |
142 | 120 |
|
143 | 121 |
</div> |
144 | 122 |
</div> |
145 |
- <div |
|
146 |
- v-else-if="['prblm_type_001', 'prblm_type_005', 'prblm_type_018', 'prblm_type_019', 'prblm_type_022'].includes(selectedSearchOption2)"> |
|
123 |
+ <div v-else-if="selectedSearchOption2.prblm_type_cls === '3지선다'"> |
|
147 | 124 |
<!--3지선다--> |
148 | 125 |
<div class="gd-col2 " v-for="i in 3" :key="i"> |
149 | 126 |
<div> |
... | ... | @@ -160,15 +137,14 @@ |
160 | 137 |
</div> |
161 | 138 |
<div class="flex align-center mb20"> |
162 | 139 |
<label :for="'file' + i" class="title2">첨부파일</label> |
163 |
- <div v-for="(data, index) in prblmDetail.answers[i].fileInfo" :key="index"> |
|
140 |
+ <div v-if="prblmDetail.answers[i] && prblmDetail.answers[i].fileInfo" v-for="(data, index) in prblmDetail.answers[i].fileInfo" :key="index"> |
|
164 | 141 |
<label>{{ data.fileNm }}</label> |
165 | 142 |
</div> |
166 | 143 |
<input type="file" :ref="'fileInput' + i" @change="handleDetailFileUpload(i)" multiple /> |
167 | 144 |
</div> |
168 | 145 |
</div> |
169 | 146 |
</div> |
170 |
- <div |
|
171 |
- v-else-if="['prblm_type_002', 'prblm_type_003', 'prblm_type_007', 'prblm_type_023'].includes(selectedSearchOption2)"> |
|
147 |
+ <div v-else-if="selectedSearchOption2.prblm_type_cls === '2지선다'"> |
|
172 | 148 |
<!--2지선다--> |
173 | 149 |
<div class="gd-col2 " v-for="i in 2" :key="i"> |
174 | 150 |
<div> |
... | ... | @@ -185,7 +161,7 @@ |
185 | 161 |
</div> |
186 | 162 |
<div class="flex align-center mb20"> |
187 | 163 |
<label :for="'file' + i" class="title2">첨부파일</label> |
188 |
- <div v-for="(data, index) in prblmDetail.answers[i].fileInfo" :key="index"> |
|
164 |
+ <div v-if="prblmDetail.answers[i] && prblmDetail.answers[i].fileInfo" v-for="(data, index) in prblmDetail.answers[i].fileInfo" :key="index"> |
|
189 | 165 |
<label>{{ data.fileNm }}</label> |
190 | 166 |
</div> |
191 | 167 |
|
... | ... | @@ -194,7 +170,7 @@ |
194 | 170 |
|
195 | 171 |
</div> |
196 | 172 |
</div> |
197 |
- <div v-else-if="selectedSearchOption2 === 'prblm_type_009'"> |
|
173 |
+ <div v-else-if="selectedSearchOption2.prblm_type_cls === 'OX 문제'"> |
|
198 | 174 |
<!--OX문제--> |
199 | 175 |
<div class="flex align-center mb20"> |
200 | 176 |
<label for="" class="title2">답</label> |
... | ... | @@ -205,16 +181,14 @@ |
205 | 181 |
</div> |
206 | 182 |
<div class="flex align-center mb20"> |
207 | 183 |
<label :for="'file' + i" class="title2">첨부파일</label> |
208 |
- <div v-for="(data, index) in prblmDetail.answers[i].fileInfo" :key="index"> |
|
184 |
+ <div v-if="prblmDetail.answers[i] && prblmDetail.answers[i].fileInfo" v-for="(data, index) in prblmDetail.answers[i].fileInfo" :key="index"> |
|
209 | 185 |
<label>{{ data.fileNm }}</label> |
210 | 186 |
</div> |
211 | 187 |
|
212 | 188 |
<input type="file" :ref="'fileInput' + 1" @change="handleDetailFileUpload(1)" multiple /> |
213 | 189 |
</div> |
214 | 190 |
</div> |
215 |
- <div |
|
216 |
- v-else-if="['prblm_type_010', 'prblm_type_011', 'prblm_type_012', 'prblm_type_013', 'prblm_type_014', |
|
217 |
- 'prblm_type_015', 'prblm_type_016', 'prblm_type_017', 'prblm_type_020', 'prblm_type_021'].includes(selectedSearchOption2)"> |
|
191 |
+ <div v-else-if="selectedSearchOption2.prblm_type_cls === '서술형'"> |
|
218 | 192 |
<!--서술형--> |
219 | 193 |
<div class="gd-col2 "> |
220 | 194 |
<div class="flex align-center mb20"> |
... | ... | @@ -223,7 +197,7 @@ |
223 | 197 |
</div> |
224 | 198 |
<div class="flex align-center mb20"> |
225 | 199 |
<label :for="'file' + i" class="title2">첨부파일</label> |
226 |
- <div v-for="(data, index) in prblmDetail.answers[i].fileInfo" :key="index"> |
|
200 |
+ <div v-if="prblmDetail.answers[i] && prblmDetail.answers[i].fileInfo" v-for="(data, index) in prblmDetail.answers[i].fileInfo" :key="index"> |
|
227 | 201 |
<label>{{ data.fileNm }}</label> |
228 | 202 |
</div> |
229 | 203 |
|
... | ... | @@ -293,8 +267,10 @@ |
293 | 267 |
dataList: [], |
294 | 268 |
problemDetail: [], |
295 | 269 |
|
270 |
+ problemType: [], |
|
296 | 271 |
selectedSearchOption: '', |
297 |
- selectedSearchOption2: '', |
|
272 |
+ selectedSearchOption2: { |
|
273 |
+ }, |
|
298 | 274 |
book_id: '', |
299 | 275 |
unit_id: '', |
300 | 276 |
text_id: '', |
... | ... | @@ -365,7 +341,9 @@ |
365 | 341 |
}); |
366 | 342 |
|
367 | 343 |
vm.selectedSearchOption = vm.dataList.prblmCtgryId; |
368 |
- vm.selectedSearchOption2 = vm.dataList.prblmTypeId; |
|
344 |
+ vm.selectedSearchOption2.prblm_type_id = vm.dataList.prblmTypeId; |
|
345 |
+ vm.selectedSearchOption2.prblm_type_cls = vm.dataList.prblmTypeCls; |
|
346 |
+ vm.selectedSearchOption2.prblm_type_nm = vm.dataList.prblmTypeNm; |
|
369 | 347 |
vm.book_id = vm.dataList.bookId; |
370 | 348 |
vm.unit_id = vm.dataList.unitId; |
371 | 349 |
vm.text_id = vm.dataList.textId; |
... | ... | @@ -397,7 +375,7 @@ |
397 | 375 |
text: detail.prblmDtlExpln, |
398 | 376 |
isCorrect: detail.prblmYn === 'Y' ? 'Y' : 'N', |
399 | 377 |
fileMngId: detail.fileMngId || null, |
400 |
- fileInfo: fileInfo |
|
378 |
+ fileInfo: fileInfo || null, |
|
401 | 379 |
}; |
402 | 380 |
} |
403 | 381 |
|
... | ... | @@ -425,7 +403,7 @@ |
425 | 403 |
return; |
426 | 404 |
} |
427 | 405 |
|
428 |
- if (!this.selectedSearchOption2) { |
|
406 |
+ if (!this.selectedSearchOption2.prblm_type_id) { |
|
429 | 407 |
alert("문제 유형을 지정해 주세요."); |
430 | 408 |
return; |
431 | 409 |
} |
... | ... | @@ -443,7 +421,7 @@ |
443 | 421 |
const payload = { |
444 | 422 |
prblmId: this.dataList.prblmId, |
445 | 423 |
prblmCtgryId: this.selectedSearchOption, // 카테고리 |
446 |
- prblmTypeId: this.selectedSearchOption2, // 문제 유형 |
|
424 |
+ prblmTypeId: this.selectedSearchOption2.prblm_type_id, // 문제 유형 |
|
447 | 425 |
prblmScr: this.prblm_scr, // 문제 배점 |
448 | 426 |
prblmExpln: this.prblm_expln, // 내용 |
449 | 427 |
prblmHint: this.prblm_hint, // 힌트 |
... | ... | @@ -503,17 +481,18 @@ |
503 | 481 |
|
504 | 482 |
let answerCount = 0; |
505 | 483 |
|
506 |
- if (this.selectedSearchOption2 === 'prblm_type_008') { |
|
484 |
+ if (this.selectedSearchOption2.prblm_type_cls === '5지선다') { |
|
507 | 485 |
answerCount = 5; |
508 |
- } else if (['prblm_type_004', 'prblm_type_006', 'prblm_type_024'].includes(this.selectedSearchOption2)) { |
|
486 |
+ } else if (this.selectedSearchOption2.prblm_type_cls === '4지선다') { |
|
509 | 487 |
answerCount = 4; |
510 |
- } else if (['prblm_type_001', 'prblm_type_005', 'prblm_type_018', 'prblm_type_019', 'prblm_type_022'].includes(this.selectedSearchOption2)) { |
|
488 |
+ } else if (this.selectedSearchOption2.prblm_type_cls === '3지선다') { |
|
511 | 489 |
answerCount = 3; |
512 |
- } else if (['prblm_type_002', 'prblm_type_003', 'prblm_type_007', 'prblm_type_023'].includes(this.selectedSearchOption2)) { |
|
490 |
+ } else if (this.selectedSearchOption2.prblm_type_cls === '2지선다') { |
|
513 | 491 |
answerCount = 2; |
514 | 492 |
} else { |
515 | 493 |
answerCount = 1; |
516 | 494 |
} |
495 |
+ |
|
517 | 496 |
|
518 | 497 |
for (let i = 1; i <= answerCount; i++) { |
519 | 498 |
if (this.selectedFiles[i] && this.selectedFiles[i].length > 0) { |
... | ... | @@ -545,11 +524,11 @@ |
545 | 524 |
this.prblmDetail = { |
546 | 525 |
|
547 | 526 |
answers: { |
548 |
- 1: { text: '', isCorrect: 'N', fileMngId: null }, |
|
549 |
- 2: { text: '', isCorrect: 'N', fileMngId: null }, |
|
550 |
- 3: { text: '', isCorrect: 'N', fileMngId: null }, |
|
551 |
- 4: { text: '', isCorrect: 'N', fileMngId: null }, |
|
552 |
- 5: { text: '', isCorrect: 'N', fileMngId: null }, |
|
527 |
+ 1: { text: '', isCorrect: 'N', fileMngId: null, fileInfo: '' }, |
|
528 |
+ 2: { text: '', isCorrect: 'N', fileMngId: null, fileInfo: '' }, |
|
529 |
+ 3: { text: '', isCorrect: 'N', fileMngId: null, fileInfo: '' }, |
|
530 |
+ 4: { text: '', isCorrect: 'N', fileMngId: null, fileInfo: '' }, |
|
531 |
+ 5: { text: '', isCorrect: 'N', fileMngId: null, fileInfo: '' }, |
|
553 | 532 |
}, |
554 | 533 |
correctIndex: null, |
555 | 534 |
}; |
... | ... | @@ -695,10 +674,32 @@ |
695 | 674 |
console.log("result - error : ", error); |
696 | 675 |
return []; |
697 | 676 |
} |
698 |
- } |
|
677 |
+ }, |
|
699 | 678 |
|
679 |
+ // 문제 유형 정보 가져오기 |
|
680 |
+ selectProblemType(){ |
|
681 |
+ axios({ |
|
682 |
+ url: "/problem/selectType.json", |
|
683 |
+ method: "post", |
|
684 |
+ headers: { |
|
685 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
686 |
+ }, |
|
687 |
+ }) |
|
688 |
+ .then(response => { |
|
689 |
+ this.problemType = response.data; |
|
690 |
+ }) |
|
691 |
+ .catch(error => { |
|
692 |
+ console.error("selectProblemType - error: ", error); |
|
693 |
+ }); |
|
694 |
+ }, |
|
700 | 695 |
}, |
701 | 696 |
watch: { |
697 |
+ selectedSearchOption2(newVal, oldVal) { |
|
698 |
+ if (newVal !== oldVal) { |
|
699 |
+ this.resetPrblmDetail(); |
|
700 |
+ } |
|
701 |
+ } |
|
702 |
+ |
|
702 | 703 |
}, |
703 | 704 |
computed: { |
704 | 705 |
|
... | ... | @@ -715,6 +716,7 @@ |
715 | 716 |
this.fetchUnits(); |
716 | 717 |
this.fetchTexts(); |
717 | 718 |
|
719 |
+ this.selectProblemType(); |
|
718 | 720 |
this.problemSearch(); |
719 | 721 |
} |
720 | 722 |
} |
--- client/views/pages/teacher/QuestionInsert.vue
+++ client/views/pages/teacher/QuestionInsert.vue
... | ... | @@ -40,30 +40,9 @@ |
40 | 40 |
<div class="flex align-center mb20"> |
41 | 41 |
<label for="" class="title2">문제 유형</label> |
42 | 42 |
<select v-model="selectedSearchOption2" class="mr10 data-wrap"> |
43 |
- <option value="prblm_type_001">Chapter3 페이지 문제</option> |
|
44 |
- <option value="prblm_type_002">Chapter3_1 페이지 문제</option> |
|
45 |
- <option value="prblm_type_003">Chapter3_2 페이지 문제</option> |
|
46 |
- <option value="prblm_type_004">Chapter3_3 페이지 문제</option> |
|
47 |
- <option value="prblm_type_005">Chapter3_3_1 페이지 문제</option> |
|
48 |
- <option value="prblm_type_006">Chapter3_4 페이지 문제</option> |
|
49 |
- <option value="prblm_type_007">Chapter3_5 페이지 문제</option> |
|
50 |
- <option value="prblm_type_008">Chapter3_6 페이지 문제</option> |
|
51 |
- <option value="prblm_type_009">Chapter3_7 페이지 문제</option> |
|
52 |
- <option value="prblm_type_010">Chapter3_8 페이지 문제</option> |
|
53 |
- <option value="prblm_type_011">Chapter3_9 페이지 문제</option> |
|
54 |
- <option value="prblm_type_012">Chapter3_10 페이지 문제</option> |
|
55 |
- <option value="prblm_type_013">Chapter3_11 페이지 문제</option> |
|
56 |
- <option value="prblm_type_014">Chapter3_12 페이지 문제</option> |
|
57 |
- <option value="prblm_type_015">Chapter3_13 페이지 문제</option> |
|
58 |
- <option value="prblm_type_016">Chapter3_14 페이지 문제</option> |
|
59 |
- <option value="prblm_type_017">Chapter3_15 페이지 문제</option> |
|
60 |
- <option value="prblm_type_018">Chapter2_8 페이지 문제</option> |
|
61 |
- <option value="prblm_type_019">Chapter2_7 페이지 문제</option> |
|
62 |
- <option value="prblm_type_020">Chapter2_5 페이지 문제</option> |
|
63 |
- <option value="prblm_type_021">Chapter2_6 페이지 문제</option> |
|
64 |
- <option value="prblm_type_022">Chapter2_10 페이지 문제</option> |
|
65 |
- <option value="prblm_type_023">Chapter2_11 페이지 문제</option> |
|
66 |
- <option value="prblm_type_024">Chapter2_13 페이지 문제</option> |
|
43 |
+ <option v-for="prblmT in problemType" :key="prblmT.prblm_type_id" :value="prblmT"> |
|
44 |
+ {{ prblmT.prblm_type_nm }} |
|
45 |
+ </option> |
|
67 | 46 |
</select> |
68 | 47 |
|
69 | 48 |
</div> |
... | ... | @@ -109,18 +88,19 @@ |
109 | 88 |
<input type="file" ref="fileInput" @change="handleFileUpload" multiple /> |
110 | 89 |
</div> |
111 | 90 |
<hr> |
112 |
- <div v-if="selectedSearchOption2 === ('prblm_type_008')"> |
|
91 |
+ <div v-if="selectedSearchOption2.prblm_type_cls === '5지선다'"> |
|
113 | 92 |
<!--5지선다--> |
114 | 93 |
<div class="gd-col2 " v-for="i in 5" :key="i"> |
115 | 94 |
<div> |
116 | 95 |
<div class="flex align-center mb20 mr40"> |
117 |
- <label :for="'answer' + i" class="title2">답{{ i }}</label> |
|
118 |
- <input :id="'answer' + i" type="text" class="data-wrap" v-model="prblmDetail.answers[i].text" /> |
|
119 |
- </div> |
|
120 |
- <div class="flex align-center mb20"> |
|
121 |
- <label :for="'correct' + i" class="title2">정답여부</label> |
|
122 |
- <input :id="'correct' + i" type="checkbox" class="ui-checkbox" |
|
123 |
- :checked="prblmDetail.correctIndex === i" @change="setCorrectAnswer(i)" /> |
|
96 |
+ <label :for="'answer' + i" class="title2">답{{ i }}</label> |
|
97 |
+ <input :id="'answer' + i" type="text" class="data-wrap" |
|
98 |
+ v-model="prblmDetail.answers[i].text" /> |
|
99 |
+ </div> |
|
100 |
+ <div class="flex align-center mb20"> |
|
101 |
+ <label :for="'correct' + i" class="title2">정답여부</label> |
|
102 |
+ <input :id="'correct' + i" type="checkbox" class="ui-checkbox" |
|
103 |
+ :checked="prblmDetail.correctIndex === i" @change="setCorrectAnswer(i)" /> |
|
124 | 104 |
</div> |
125 | 105 |
</div> |
126 | 106 |
<div class="flex align-center mb20"> |
... | ... | @@ -130,18 +110,19 @@ |
130 | 110 |
</div> |
131 | 111 |
|
132 | 112 |
</div> |
133 |
- <div v-else-if="['prblm_type_004', 'prblm_type_006', 'prblm_type_024'].includes(selectedSearchOption2)"> |
|
113 |
+ <div v-else-if="selectedSearchOption2.prblm_type_cls === '4지선다'"> |
|
134 | 114 |
<!--4지선다--> |
135 | 115 |
<div class="gd-col2 " v-for="i in 4" :key="i"> |
136 | 116 |
<div> |
137 | 117 |
<div class="flex align-center mb20 mr40"> |
138 |
- <label :for="'answer' + i" class="title2">답{{ i }}</label> |
|
139 |
- <input :id="'answer' + i" type="text" class="data-wrap" v-model="prblmDetail.answers[i].text" /> |
|
140 |
- </div> |
|
141 |
- <div class="flex align-center mb20"> |
|
142 |
- <label :for="'correct' + i" class="title2">정답여부</label> |
|
143 |
- <input :id="'correct' + i" type="checkbox" class="ui-checkbox" |
|
144 |
- :checked="prblmDetail.correctIndex === i" @change="setCorrectAnswer(i)" /> |
|
118 |
+ <label :for="'answer' + i" class="title2">답{{ i }}</label> |
|
119 |
+ <input :id="'answer' + i" type="text" class="data-wrap" |
|
120 |
+ v-model="prblmDetail.answers[i].text" /> |
|
121 |
+ </div> |
|
122 |
+ <div class="flex align-center mb20"> |
|
123 |
+ <label :for="'correct' + i" class="title2">정답여부</label> |
|
124 |
+ <input :id="'correct' + i" type="checkbox" class="ui-checkbox" |
|
125 |
+ :checked="prblmDetail.correctIndex === i" @change="setCorrectAnswer(i)" /> |
|
145 | 126 |
</div> |
146 | 127 |
</div> |
147 | 128 |
<div class="flex align-center mb20"> |
... | ... | @@ -152,18 +133,19 @@ |
152 | 133 |
</div> |
153 | 134 |
</div> |
154 | 135 |
<div |
155 |
- v-else-if="['prblm_type_001', 'prblm_type_005', 'prblm_type_019', 'prblm_type_022'].includes(selectedSearchOption2)"> |
|
136 |
+ v-else-if="selectedSearchOption2.prblm_type_cls === '3지선다'"> |
|
156 | 137 |
<!--3지선다--> |
157 | 138 |
<div class="gd-col2 " v-for="i in 3" :key="i"> |
158 | 139 |
<div> |
159 | 140 |
<div class="flex align-center mb20 mr40"> |
160 |
- <label :for="'answer' + i" class="title2">답{{ i }}</label> |
|
161 |
- <input :id="'answer' + i" type="text" class="data-wrap" v-model="prblmDetail.answers[i].text" /> |
|
162 |
- </div> |
|
163 |
- <div class="flex align-center mb20"> |
|
164 |
- <label :for="'correct' + i" class="title2">정답여부</label> |
|
165 |
- <input :id="'correct' + i" type="checkbox" class="ui-checkbox" |
|
166 |
- :checked="prblmDetail.correctIndex === i" @change="setCorrectAnswer(i)" /> |
|
141 |
+ <label :for="'answer' + i" class="title2">답{{ i }}</label> |
|
142 |
+ <input :id="'answer' + i" type="text" class="data-wrap" |
|
143 |
+ v-model="prblmDetail.answers[i].text" /> |
|
144 |
+ </div> |
|
145 |
+ <div class="flex align-center mb20"> |
|
146 |
+ <label :for="'correct' + i" class="title2">정답여부</label> |
|
147 |
+ <input :id="'correct' + i" type="checkbox" class="ui-checkbox" |
|
148 |
+ :checked="prblmDetail.correctIndex === i" @change="setCorrectAnswer(i)" /> |
|
167 | 149 |
</div> |
168 | 150 |
</div> |
169 | 151 |
<div class="flex align-center mb20"> |
... | ... | @@ -174,18 +156,19 @@ |
174 | 156 |
</div> |
175 | 157 |
</div> |
176 | 158 |
<div |
177 |
- v-else-if="['prblm_type_002', 'prblm_type_003', 'prblm_type_007', 'prblm_type_023'].includes(selectedSearchOption2)"> |
|
159 |
+ v-else-if="selectedSearchOption2.prblm_type_cls === '2지선다'"> |
|
178 | 160 |
<!--2지선다--> |
179 | 161 |
<div class="gd-col2 " v-for="i in 2" :key="i"> |
180 | 162 |
<div> |
181 | 163 |
<div class="flex align-center mb20 mr40"> |
182 |
- <label :for="'answer' + i" class="title2">답{{ i }}</label> |
|
183 |
- <input :id="'answer' + i" type="text" class="data-wrap" v-model="prblmDetail.answers[i].text" /> |
|
184 |
- </div> |
|
185 |
- <div class="flex align-center mb20"> |
|
186 |
- <label :for="'correct' + i" class="title2">정답여부</label> |
|
187 |
- <input :id="'correct' + i" type="checkbox" class="ui-checkbox" |
|
188 |
- :checked="prblmDetail.correctIndex === i" @change="setCorrectAnswer(i)" /> |
|
164 |
+ <label :for="'answer' + i" class="title2">답{{ i }}</label> |
|
165 |
+ <input :id="'answer' + i" type="text" class="data-wrap" |
|
166 |
+ v-model="prblmDetail.answers[i].text" /> |
|
167 |
+ </div> |
|
168 |
+ <div class="flex align-center mb20"> |
|
169 |
+ <label :for="'correct' + i" class="title2">정답여부</label> |
|
170 |
+ <input :id="'correct' + i" type="checkbox" class="ui-checkbox" |
|
171 |
+ :checked="prblmDetail.correctIndex === i" @change="setCorrectAnswer(i)" /> |
|
189 | 172 |
</div> |
190 | 173 |
</div> |
191 | 174 |
<div class="flex align-center mb20"> |
... | ... | @@ -195,7 +178,7 @@ |
195 | 178 |
|
196 | 179 |
</div> |
197 | 180 |
</div> |
198 |
- <div v-else-if="selectedSearchOption2 === 'prblm_type_009'"> |
|
181 |
+ <div v-else-if="selectedSearchOption2.prblm_type_cls === 'OX 문제'"> |
|
199 | 182 |
<!--OX문제--> |
200 | 183 |
<div class="flex align-center mb20"> |
201 | 184 |
<label for="" class="title2">답</label> |
... | ... | @@ -205,14 +188,12 @@ |
205 | 188 |
</select> |
206 | 189 |
</div> |
207 | 190 |
<div class="flex align-center mb20"> |
208 |
- <label :for="'file' + i" class="title2">첨부파일</label> |
|
209 |
- <input type="file" :ref="'fileInput' + 1" @change="handleDetailFileUpload(1)" multiple /> |
|
210 |
- </div> |
|
191 |
+ <label :for="'file' + i" class="title2">첨부파일</label> |
|
192 |
+ <input type="file" :ref="'fileInput' + 1" @change="handleDetailFileUpload(1)" multiple /> |
|
193 |
+ </div> |
|
211 | 194 |
|
212 | 195 |
</div> |
213 |
- <div |
|
214 |
- v-else-if="['prblm_type_010', 'prblm_type_011', 'prblm_type_012', 'prblm_type_013', 'prblm_type_014', |
|
215 |
- 'prblm_type_015', 'prblm_type_016', 'prblm_type_017', 'prblm_type_018', 'prblm_type_020', 'prblm_type_021'].includes(selectedSearchOption2)"> |
|
196 |
+ <div v-else-if="selectedSearchOption2.prblm_type_cls === '서술형'"> |
|
216 | 197 |
<!--서술형--> |
217 | 198 |
<div class="gd-col2 "> |
218 | 199 |
<div class="flex align-center mb20"> |
... | ... | @@ -325,7 +306,7 @@ |
325 | 306 |
mdiMagnify: mdiMagnify, |
326 | 307 |
selectedTab: '1', |
327 | 308 |
selectedSearchOption: '1', // 카테고리 선택 |
328 |
- selectedSearchOption2: 'prblm_type_001', |
|
309 |
+ selectedSearchOption2: '', |
|
329 | 310 |
text_id: '', |
330 | 311 |
prblm_ctgry_id: '', // 카테고리 ID |
331 | 312 |
prblm_type_id: '', // 문제 유형 ID |
... | ... | @@ -348,6 +329,7 @@ |
348 | 329 |
prblm_mtr6: '', |
349 | 330 |
selectedFiles: {}, |
350 | 331 |
|
332 |
+ problemType: [], |
|
351 | 333 |
prblmDetail: { |
352 | 334 |
answers: { |
353 | 335 |
1: { text: '', isCorrect: 'N', fileMngId: null }, |
... | ... | @@ -406,7 +388,7 @@ |
406 | 388 |
return; |
407 | 389 |
} |
408 | 390 |
|
409 |
- if (!this.selectedSearchOption2) { |
|
391 |
+ if (!this.selectedSearchOption2.prblm_type_id) { |
|
410 | 392 |
alert("문제 유형을 지정해 주세요."); |
411 | 393 |
return; |
412 | 394 |
} |
... | ... | @@ -423,7 +405,7 @@ |
423 | 405 |
|
424 | 406 |
const payload = { |
425 | 407 |
prblmCtgryId: this.selectedSearchOption, // 카테고리 |
426 |
- prblmTypeId: this.selectedSearchOption2, // 문제 유형 |
|
408 |
+ prblmTypeId: this.selectedSearchOption2.prblm_type_id, // 문제 유형 |
|
427 | 409 |
prblmScr: this.prblm_scr, // 문제 배점 |
428 | 410 |
prblmExpln: this.prblm_expln, // 내용 |
429 | 411 |
prblmHint: this.prblm_hint, // 힌트 |
... | ... | @@ -431,7 +413,7 @@ |
431 | 413 |
textId: this.text_id, // 지문 아이디 |
432 | 414 |
unitId: this.unit_id, // 단원 아이디 |
433 | 415 |
bookId: this.book_id, // 교재 아이디 |
434 |
- // userId: this.user_id, // 유저 아이디 |
|
416 |
+ // userId: this.user_id, // 유저 아이디 |
|
435 | 417 |
userId: 'USID_000000000000004', // 유저 아이디 |
436 | 418 |
prblmMtr1: this.prblm_mtr1, // 문제 지표 |
437 | 419 |
prblmMtr2: this.prblm_mtr2, |
... | ... | @@ -482,13 +464,13 @@ |
482 | 464 |
|
483 | 465 |
let answerCount = 0; |
484 | 466 |
|
485 |
- if (this.selectedSearchOption2 === 'prblm_type_008') { |
|
467 |
+ if (this.selectedSearchOption2.prblm_type_cls === '5지선다') { |
|
486 | 468 |
answerCount = 5; |
487 |
- } else if (['prblm_type_004', 'prblm_type_006', 'prblm_type_024'].includes(this.selectedSearchOption2)) { |
|
469 |
+ } else if (this.selectedSearchOption2.prblm_type_cls === '4지선다') { |
|
488 | 470 |
answerCount = 4; |
489 |
- } else if (['prblm_type_001', 'prblm_type_005', 'prblm_type_019', 'prblm_type_022'].includes(this.selectedSearchOption2)) { |
|
471 |
+ } else if (this.selectedSearchOption2.prblm_type_cls === '3지선다') { |
|
490 | 472 |
answerCount = 3; |
491 |
- } else if (['prblm_type_002', 'prblm_type_003', 'prblm_type_007', 'prblm_type_023'].includes(this.selectedSearchOption2)) { |
|
473 |
+ } else if (this.selectedSearchOption2.prblm_type_cls === '2지선다') { |
|
492 | 474 |
answerCount = 2; |
493 | 475 |
} else { |
494 | 476 |
answerCount = 1; |
... | ... | @@ -521,7 +503,7 @@ |
521 | 503 |
|
522 | 504 |
resetPrblmDetail() { |
523 | 505 |
this.prblmDetail = { |
524 |
- |
|
506 |
+ |
|
525 | 507 |
answers: { |
526 | 508 |
1: { text: '', isCorrect: 'N', fileMngId: null }, |
527 | 509 |
2: { text: '', isCorrect: 'N', fileMngId: null }, |
... | ... | @@ -598,6 +580,22 @@ |
598 | 580 |
alert("지문 목록을 불러오는 중 오류가 발생했습니다."); |
599 | 581 |
}); |
600 | 582 |
}, |
583 |
+ // 문제 유형 정보 가져오기 |
|
584 |
+ selectProblemType() { |
|
585 |
+ axios({ |
|
586 |
+ url: "/problem/selectType.json", |
|
587 |
+ method: "post", |
|
588 |
+ headers: { |
|
589 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
590 |
+ }, |
|
591 |
+ }) |
|
592 |
+ .then(response => { |
|
593 |
+ this.problemType = response.data; |
|
594 |
+ }) |
|
595 |
+ .catch(error => { |
|
596 |
+ console.error("selectProblemType - error: ", error); |
|
597 |
+ }); |
|
598 |
+ }, |
|
601 | 599 |
|
602 | 600 |
}, |
603 | 601 |
watch: { |
... | ... | @@ -621,6 +619,7 @@ |
621 | 619 |
this.fetchBooks(); |
622 | 620 |
this.fetchUnits(); |
623 | 621 |
this.fetchTexts(); |
622 |
+ this.selectProblemType(); |
|
624 | 623 |
} |
625 | 624 |
} |
626 | 625 |
|
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?