

240820 정다정 중간/최종 평가 제출하기 버튼 추가
@04e497f72b37cc3de89fffbe156d7dd0512ecf20
--- client/views/pages/main/Chapter/Chapter3_10.vue
+++ client/views/pages/main/Chapter/Chapter3_10.vue
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 |
<div id="Chapter1_1" class="content-wrap"> |
3 | 3 |
<div style="margin: 30px 0px 50px; width: 20%"> |
4 | 4 |
<router-link to="/MyPlan.page"> |
5 |
- <div class="logo mb25"><img src="../../../../resources/img/logo2.png" alt=""></div> |
|
5 |
+ <div class="logo mb25"><img src="../../../../resources/img/logo2.png" alt="" /></div> |
|
6 | 6 |
</router-link> |
7 | 7 |
</div> |
8 | 8 |
<div class="title-box mb25 flex align-center mt40"> |
... | ... | @@ -10,12 +10,14 @@ |
10 | 10 |
<span class="subtitle">my name is dd</span> |
11 | 11 |
</div> |
12 | 12 |
<div class="flex justify-between align-center"> |
13 |
- <div class="pre-btn" @click="goToPage('Chapter3_9')"><img src="../../../../resources/img/left.png" alt=""></div> |
|
13 |
+ <div class="pre-btn" @click="goToPage('Chapter3_9')"><img src="../../../../resources/img/left.png" alt="" /></div> |
|
14 | 14 |
<div class="content title-box"> |
15 | 15 |
<p class="title mt25 title-bg">step3.</p> |
16 | 16 |
<div class="flex align-center mb30"> |
17 | 17 |
<p class="subtitle2 mr20">듣고 알맞은 것을 고르세요.</p> |
18 |
- <button><img src="../../../../resources/img/btn10_s.png" alt=""> |
|
18 |
+ <button @click="playAudio"> |
|
19 |
+ <img src="../../../../resources/img/btn10_s.png" alt="" /> |
|
20 |
+ <audio id="audio-player" src="client/resources/audio/bank.wav" preload="auto"></audio> |
|
19 | 21 |
</button> |
20 | 22 |
</div> |
21 | 23 |
|
... | ... | @@ -31,19 +33,17 @@ |
31 | 33 |
</div> |
32 | 34 |
</div> |
33 | 35 |
</div> |
34 |
- <div class="imgGroup mt20"> |
|
35 |
- <img src="../../../../resources/img/img116_59s.png" alt=""> |
|
36 |
- <p class="title1 mt10" style="width: auto;"><strong>진수가 거절한 제안</strong>은 무엇인지 우리말로 쓰세요.</p> |
|
37 |
- <div class=" mt20"> |
|
38 |
- <input class="yellow-bd" type="text" name="" id="" placeholder="답을 입력하세요."> |
|
39 |
- |
|
36 |
+ <div class="imgGroup mt20"> |
|
37 |
+ <img src="../../../../resources/img/img116_59s.png" alt="" /> |
|
38 |
+ <p class="title1 mt10" style="width: auto"><strong>진수가 거절한 제안</strong>은 무엇인지 우리말로 쓰세요.</p> |
|
39 |
+ <div class="mt20"> |
|
40 |
+ <input class="yellow-bd" v-model="answer" type="text" placeholder="답을 입력하세요." /> |
|
40 | 41 |
</div> |
41 | 42 |
</div> |
42 |
- |
|
43 | 43 |
</div> |
44 |
+ <button class="submit-button" @click="handleSubmit()">제출하기</button> |
|
44 | 45 |
</div> |
45 |
- <div class="next-btn" @click="goToPage('Chapter3_11')"><img src="../../../../resources/img/right.png" alt=""> |
|
46 |
- </div> |
|
46 |
+ <div class="next-btn" @click="goToPage('Chapter3_11')"><img src="../../../../resources/img/right.png" alt="" /></div> |
|
47 | 47 |
</div> |
48 | 48 |
</div> |
49 | 49 |
</template> |
... | ... | @@ -52,40 +52,13 @@ |
52 | 52 |
export default { |
53 | 53 |
data() { |
54 | 54 |
return { |
55 |
- timer: '00', |
|
56 |
- showButton1: false, |
|
57 |
- showButton2: false, |
|
58 |
- showButton3: false, |
|
59 |
- showButton4: false, |
|
60 |
- } |
|
55 |
+ timer: "00", |
|
56 |
+ answer: null, |
|
57 |
+ }; |
|
61 | 58 |
}, |
62 | 59 |
methods: { |
63 | 60 |
goToPage(page) { |
64 | 61 |
this.$router.push({ name: page }); |
65 |
- }, |
|
66 |
- handleDrag(dragNumber) { |
|
67 |
- // Drag 버튼 숨기기 |
|
68 |
- // 여기서는 상태 관리를 통해 버튼을 제어합니다. |
|
69 |
- if (dragNumber === 1) { |
|
70 |
- this.showButton1 = false; |
|
71 |
- } else if (dragNumber === 2) { |
|
72 |
- this.showButton2 = false; |
|
73 |
- } else if (dragNumber === 3) { |
|
74 |
- this.showButton3 = false; |
|
75 |
- } |
|
76 |
- }, |
|
77 |
- showButton(dropNumber) { |
|
78 |
- // Drop 영역의 이미지 클릭 이벤트 핸들러 설정 |
|
79 |
- // 여기서는 상태 관리를 통해 버튼을 보이게 합니다. |
|
80 |
- if (dropNumber === 1) { |
|
81 |
- this.showButton1 = true; |
|
82 |
- } else if (dropNumber === 2) { |
|
83 |
- this.showButton2 = true; |
|
84 |
- } else if (dropNumber === 3) { |
|
85 |
- this.showButton3 = true; |
|
86 |
- } else if (dropNumber === 4) { |
|
87 |
- this.showButton4 = true; |
|
88 |
- } |
|
89 | 62 |
}, |
90 | 63 |
startTimer() { |
91 | 64 |
if (this.intervalId) { |
... | ... | @@ -99,20 +72,22 @@ |
99 | 72 |
clearInterval(this.intervalId); |
100 | 73 |
} |
101 | 74 |
}, 1000); |
102 |
- } |
|
75 |
+ }, |
|
76 |
+ playAudio() { |
|
77 |
+ const audio = document.getElementById("audio-player"); |
|
78 |
+ audio.play(); |
|
79 |
+ console.log("playing"); |
|
80 |
+ }, |
|
81 |
+ handleSubmit() { |
|
82 |
+ console.log("정답 : ", this.answer); |
|
83 |
+ this.answer = null; |
|
84 |
+ }, |
|
103 | 85 |
}, |
104 |
- watch: { |
|
105 |
- |
|
106 |
- }, |
|
107 |
- computed: { |
|
108 |
- |
|
109 |
- }, |
|
110 |
- components: { |
|
111 |
- }, |
|
112 |
- mounted() { |
|
113 |
- |
|
114 |
- } |
|
115 |
-} |
|
86 |
+ watch: {}, |
|
87 |
+ computed: {}, |
|
88 |
+ components: {}, |
|
89 |
+ mounted() {}, |
|
90 |
+}; |
|
116 | 91 |
</script> |
117 | 92 |
<style scoped> |
118 | 93 |
input.yellow-bd { |
... | ... | @@ -128,7 +103,7 @@ |
128 | 103 |
} |
129 | 104 |
|
130 | 105 |
.dragGroup { |
131 |
- background-color: #F2F4F8; |
|
106 |
+ background-color: #f2f4f8; |
|
132 | 107 |
padding: 30px 50px; |
133 | 108 |
width: max-content; |
134 | 109 |
border-radius: 20px; |
... | ... | @@ -136,4 +111,16 @@ |
136 | 111 |
|
137 | 112 |
.dragGroup button p { |
138 | 113 |
font-size: 48px; |
139 |
-}</style>(No newline at end of file) |
|
114 |
+} |
|
115 |
+ |
|
116 |
+.submit-button { |
|
117 |
+ position: absolute; |
|
118 |
+ background-color: #ffba08; |
|
119 |
+ padding: 10px 30px; |
|
120 |
+ border-radius: 10px; |
|
121 |
+ font-size: 28px; |
|
122 |
+ font-family: "ONEMobilePOPOTF"; |
|
123 |
+ right: 5rem; |
|
124 |
+ bottom: 3rem; |
|
125 |
+} |
|
126 |
+</style> |
--- client/views/pages/main/Chapter/Chapter3_11.vue
+++ client/views/pages/main/Chapter/Chapter3_11.vue
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 |
<div id="Chapter1_1" class="content-wrap"> |
3 | 3 |
<div style="margin: 30px 0px 50px; width: 20%"> |
4 | 4 |
<router-link to="/MyPlan.page"> |
5 |
- <div class="logo mb25"><img src="../../../../resources/img/logo2.png" alt=""></div> |
|
5 |
+ <div class="logo mb25"><img src="../../../../resources/img/logo2.png" alt="" /></div> |
|
6 | 6 |
</router-link> |
7 | 7 |
</div> |
8 | 8 |
<div class="title-box mb25 flex align-center mt40"> |
... | ... | @@ -10,7 +10,7 @@ |
10 | 10 |
<span class="subtitle">my name is dd</span> |
11 | 11 |
</div> |
12 | 12 |
<div class="flex justify-between align-center"> |
13 |
- <div class="pre-btn" @click="goToPage('Chapter3_10')"><img src="../../../../resources/img/left.png" alt=""></div> |
|
13 |
+ <div class="pre-btn" @click="goToPage('Chapter3_10')"><img src="../../../../resources/img/left.png" alt="" /></div> |
|
14 | 14 |
<div class="content title-box"> |
15 | 15 |
<p class="title mt25 title-bg">step3.</p> |
16 | 16 |
<div class="flex align-center mb30"> |
... | ... | @@ -31,20 +31,19 @@ |
31 | 31 |
</div> |
32 | 32 |
</div> |
33 | 33 |
</div> |
34 |
- <div class="imgGroup mt20"> |
|
35 |
- <img src="../../../../resources/img/img115_58s.png" alt=""> |
|
34 |
+ <div class="imgGroup mt20"> |
|
35 |
+ <img src="../../../../resources/img/img115_58s.png" alt="" /> |
|
36 | 36 |
<!-- <p class="title1 mt10"><strong>진수가 거절한 제안</strong>은 무엇인지 우리말로 쓰세요.</p> --> |
37 |
- <div class=" mt50 flex justify-center" style="gap: 50px;"> |
|
38 |
- <input class="yellow-bd" type="text" name="" id=""> |
|
37 |
+ <div class="mt50 flex justify-center" style="gap: 50px"> |
|
38 |
+ <input class="yellow-bd" type="text" v-model="answer1" /> |
|
39 | 39 |
<p class="title3">e</p> |
40 |
- <input class="yellow-bd" type="text" name="" id=""> |
|
40 |
+ <input class="yellow-bd" type="text" v-model="answer2" /> |
|
41 | 41 |
</div> |
42 | 42 |
</div> |
43 |
- |
|
44 | 43 |
</div> |
44 |
+ <button class="submit-button" @click="handleSubmit()">제출하기</button> |
|
45 | 45 |
</div> |
46 |
- <div class="next-btn" @click="goToPage('Chapter3_12')"><img src="../../../../resources/img/right.png" alt=""> |
|
47 |
- </div> |
|
46 |
+ <div class="next-btn" @click="goToPage('Chapter3_12')"><img src="../../../../resources/img/right.png" alt="" /></div> |
|
48 | 47 |
</div> |
49 | 48 |
</div> |
50 | 49 |
</template> |
... | ... | @@ -53,40 +52,15 @@ |
53 | 52 |
export default { |
54 | 53 |
data() { |
55 | 54 |
return { |
56 |
- timer: '00', |
|
57 |
- showButton1: false, |
|
58 |
- showButton2: false, |
|
59 |
- showButton3: false, |
|
60 |
- showButton4: false, |
|
61 |
- } |
|
55 |
+ timer: "00", |
|
56 |
+ answer1: null, |
|
57 |
+ answer2: null, |
|
58 |
+ text: "e", |
|
59 |
+ }; |
|
62 | 60 |
}, |
63 | 61 |
methods: { |
64 | 62 |
goToPage(page) { |
65 | 63 |
this.$router.push({ name: page }); |
66 |
- }, |
|
67 |
- handleDrag(dragNumber) { |
|
68 |
- // Drag 버튼 숨기기 |
|
69 |
- // 여기서는 상태 관리를 통해 버튼을 제어합니다. |
|
70 |
- if (dragNumber === 1) { |
|
71 |
- this.showButton1 = false; |
|
72 |
- } else if (dragNumber === 2) { |
|
73 |
- this.showButton2 = false; |
|
74 |
- } else if (dragNumber === 3) { |
|
75 |
- this.showButton3 = false; |
|
76 |
- } |
|
77 |
- }, |
|
78 |
- showButton(dropNumber) { |
|
79 |
- // Drop 영역의 이미지 클릭 이벤트 핸들러 설정 |
|
80 |
- // 여기서는 상태 관리를 통해 버튼을 보이게 합니다. |
|
81 |
- if (dropNumber === 1) { |
|
82 |
- this.showButton1 = true; |
|
83 |
- } else if (dropNumber === 2) { |
|
84 |
- this.showButton2 = true; |
|
85 |
- } else if (dropNumber === 3) { |
|
86 |
- this.showButton3 = true; |
|
87 |
- } else if (dropNumber === 4) { |
|
88 |
- this.showButton4 = true; |
|
89 |
- } |
|
90 | 64 |
}, |
91 | 65 |
startTimer() { |
92 | 66 |
if (this.intervalId) { |
... | ... | @@ -100,20 +74,19 @@ |
100 | 74 |
clearInterval(this.intervalId); |
101 | 75 |
} |
102 | 76 |
}, 1000); |
103 |
- } |
|
77 |
+ }, |
|
78 |
+ handleSubmit() { |
|
79 |
+ let answer = this.answer1 + this.text + this.answer2; |
|
80 |
+ console.log("정답 : ", answer); |
|
81 |
+ this.answer1 = null; |
|
82 |
+ this.answer2 = null; |
|
83 |
+ }, |
|
104 | 84 |
}, |
105 |
- watch: { |
|
106 |
- |
|
107 |
- }, |
|
108 |
- computed: { |
|
109 |
- |
|
110 |
- }, |
|
111 |
- components: { |
|
112 |
- }, |
|
113 |
- mounted() { |
|
114 |
- |
|
115 |
- } |
|
116 |
-} |
|
85 |
+ watch: {}, |
|
86 |
+ computed: {}, |
|
87 |
+ components: {}, |
|
88 |
+ mounted() {}, |
|
89 |
+}; |
|
117 | 90 |
</script> |
118 | 91 |
<style scoped> |
119 | 92 |
input.yellow-bd { |
... | ... | @@ -129,7 +102,7 @@ |
129 | 102 |
} |
130 | 103 |
|
131 | 104 |
.dragGroup { |
132 |
- background-color: #F2F4F8; |
|
105 |
+ background-color: #f2f4f8; |
|
133 | 106 |
padding: 30px 50px; |
134 | 107 |
width: max-content; |
135 | 108 |
border-radius: 20px; |
... | ... | @@ -138,4 +111,15 @@ |
138 | 111 |
.dragGroup button p { |
139 | 112 |
font-size: 48px; |
140 | 113 |
} |
141 |
-</style>(No newline at end of file) |
|
114 |
+ |
|
115 |
+.submit-button { |
|
116 |
+ position: absolute; |
|
117 |
+ background-color: #ffba08; |
|
118 |
+ padding: 10px 30px; |
|
119 |
+ border-radius: 10px; |
|
120 |
+ font-size: 28px; |
|
121 |
+ font-family: "ONEMobilePOPOTF"; |
|
122 |
+ right: 5rem; |
|
123 |
+ bottom: 3rem; |
|
124 |
+} |
|
125 |
+</style> |
--- client/views/pages/main/Chapter/Chapter3_12.vue
+++ client/views/pages/main/Chapter/Chapter3_12.vue
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 |
<div id="Chapter1_1" class="content-wrap"> |
3 | 3 |
<div style="margin: 30px 0px 50px; width: 20%"> |
4 | 4 |
<router-link to="/MyPlan.page"> |
5 |
- <div class="logo mb25"><img src="../../../../resources/img/logo2.png" alt=""></div> |
|
5 |
+ <div class="logo mb25"><img src="../../../../resources/img/logo2.png" alt="" /></div> |
|
6 | 6 |
</router-link> |
7 | 7 |
</div> |
8 | 8 |
<div class="title-box mb25 flex align-center mt40"> |
... | ... | @@ -10,67 +10,51 @@ |
10 | 10 |
<span class="subtitle">my name is dd</span> |
11 | 11 |
</div> |
12 | 12 |
<div class="flex justify-between align-center"> |
13 |
- <div class="pre-btn" @click="goToPage('Chapter3_11')"><img src="../../../../resources/img/left.png" alt=""></div> |
|
13 |
+ <div class="pre-btn" @click="goToPage('Chapter3_11')"><img src="../../../../resources/img/left.png" alt="" /></div> |
|
14 | 14 |
<div class="content title-box"> |
15 | 15 |
<p class="title mt25 title-bg">step3</p> |
16 | 16 |
<div class="flex align-center mb30"> |
17 |
- <p class="subtitle2 mr20">그림을 보고 빈칸을 채우세요.</p> |
|
18 |
- <!-- <button><img src="../../../../resources/img/btn10_s.png" alt=""> |
|
17 |
+ <p class="subtitle2 mr20">단어를 바르게 배열해 문장을 완성하세요</p> |
|
18 |
+ <!-- <button><img src="../../../../resources/img/btn10_s.png" alt=""> |
|
19 | 19 |
</button> --> |
20 |
- </div> |
|
20 |
+ </div> |
|
21 | 21 |
|
22 |
- <div class=" text-ct"> |
|
22 |
+ <div class="text-ct"> |
|
23 | 23 |
<div class="time-hint"> |
24 |
- <button class="hint-btn">HINT</button> |
|
24 |
+ <button class="hint-btn">HINT</button> |
|
25 | 25 |
<div class="time-bg mt20"> |
26 |
- <div> |
|
27 |
- <div class="time"> |
|
28 |
- <p class="second">{{ timer }}</p> |
|
29 |
- <p class="text">sec</p> |
|
26 |
+ <div> |
|
27 |
+ <div class="time"> |
|
28 |
+ <p class="second">{{ timer }}</p> |
|
29 |
+ <p class="text">sec</p> |
|
30 |
+ </div> |
|
31 |
+ </div> |
|
32 |
+ </div> |
|
33 |
+ </div> |
|
34 |
+ <div class="dragGroup mt40"> |
|
35 |
+ <div class="flex justify-center" style="gap: 20px"> |
|
36 |
+ <div class="dropContainer" id="sourceContainer"> |
|
37 |
+ <button v-for="(word, index) in question" :key="index" draggable="true" @dragstart="onDragStart($event, word, index)"> |
|
38 |
+ <p>{{ word }}</p> |
|
39 |
+ </button> |
|
40 |
+ </div> |
|
41 |
+ </div> |
|
42 |
+ </div> |
|
43 |
+ <div class="dropContainer flex align-center justify-center mt30" id="targetContainer"> |
|
44 |
+ <div class="dropSlot" v-for="(slot, index) in questionLength" :key="index" @dragover.prevent @drop="onDrop($event, index)"> |
|
45 |
+ <div class="dropSlot-inner" draggable="true" @dragstart="onDragStart($event, userAnswer[index], index)"> |
|
46 |
+ <div class="dropSlot-inner"> |
|
47 |
+ <div v-if="userAnswer[index]" class="dropped-char"> |
|
48 |
+ {{ userAnswer[index] }} |
|
30 | 49 |
</div> |
31 | 50 |
</div> |
32 | 51 |
</div> |
33 |
- </div> |
|
34 |
- <div class="dragGroup mt40"> |
|
35 |
- <div class="flex justify-center" style="gap: 20px;"> |
|
36 |
- <button><img src="../../../../resources/img/img63_37s.png" alt=""> |
|
37 |
- <p @click="handleDrag(1)">A</p> |
|
38 |
- </button> |
|
39 |
- <button><img src="../../../../resources/img/img63_37s_1.png" alt=""> |
|
40 |
- <p @click="handleDrag(1)">A</p> |
|
41 |
- </button> |
|
42 |
- <button><img src="../../../../resources/img/img63_37s.png" alt=""> |
|
43 |
- <p @click="handleDrag(1)">A</p> |
|
44 |
- </button> |
|
45 |
- <button><img src="../../../../resources/img/img63_37s_2.png" alt=""> |
|
46 |
- <p @click="handleDrag(1)">A</p> |
|
47 |
- </button> |
|
48 |
- <button><img src="../../../../resources/img/img63_37s_1.png" alt=""> |
|
49 |
- <p @click="handleDrag(1)">A</p> |
|
50 |
- </button> |
|
51 |
- <button><img src="../../../../resources/img/img63_37s_2.png" alt=""> |
|
52 |
- <p @click="handleDrag(1)">A</p> |
|
53 |
- </button> |
|
54 | 52 |
</div> |
55 |
- |
|
56 | 53 |
</div> |
57 |
- <div class="dropGroup flex align-center justify-center mt30"> |
|
58 |
- <div class="flex" style="gap: 20px;"> |
|
59 |
- <div class="bd-bt textbox" @click="showButton(1)"> |
|
60 |
- <p v-if="showButton1">A</p></div> |
|
61 |
- <div class="bd-bt textbox" @click="showButton(2)"> |
|
62 |
- <p v-if="showButton2">A</p></div> |
|
63 |
- <div class="bd-bt textbox" @click="showButton(3)"> |
|
64 |
- <p v-if="showButton3">A</p></div> |
|
65 |
- <div class="bd-bt textbox" @click="showButton(4)"> |
|
66 |
- <p v-if="showButton4">A</p></div> |
|
67 |
- </div> |
|
68 |
- |
|
69 |
- </div> |
|
70 |
- |
|
71 | 54 |
</div> |
55 |
+ <button class="submit-button" @click="handleSubmit()">제출하기</button> |
|
72 | 56 |
</div> |
73 |
- <div class="next-btn" @click="goToPage('Chapter3_13')"><img src="../../../../resources/img/right.png" alt=""></div> |
|
57 |
+ <div class="next-btn" @click="goToPage('Chapter3_13')"><img src="../../../../resources/img/right.png" alt="" /></div> |
|
74 | 58 |
</div> |
75 | 59 |
</div> |
76 | 60 |
</template> |
... | ... | @@ -79,40 +63,19 @@ |
79 | 63 |
export default { |
80 | 64 |
data() { |
81 | 65 |
return { |
82 |
- timer: '00', |
|
83 |
- showButton1: false, |
|
84 |
- showButton2: false, |
|
85 |
- showButton3: false, |
|
86 |
- showButton4: false, |
|
87 |
- } |
|
66 |
+ timer: "00", |
|
67 |
+ question: [`don't`, "banana", "i", "like"], |
|
68 |
+ questionLength: null, |
|
69 |
+ answer: null, |
|
70 |
+ |
|
71 |
+ userAnswer: [], // 초기화 시 빈 배열로 설정 |
|
72 |
+ draggedChar: null, // 드래그한 문자를 임시로 저장 |
|
73 |
+ draggedCharIndex: null, // 드래그한 문자의 인덱스 저장 |
|
74 |
+ }; |
|
88 | 75 |
}, |
89 | 76 |
methods: { |
90 | 77 |
goToPage(page) { |
91 | 78 |
this.$router.push({ name: page }); |
92 |
- }, |
|
93 |
- handleDrag(dragNumber) { |
|
94 |
- // Drag 버튼 숨기기 |
|
95 |
- // 여기서는 상태 관리를 통해 버튼을 제어합니다. |
|
96 |
- if (dragNumber === 1) { |
|
97 |
- this.showButton1 = false; |
|
98 |
- } else if (dragNumber === 2) { |
|
99 |
- this.showButton2 = false; |
|
100 |
- } else if (dragNumber === 3) { |
|
101 |
- this.showButton3 = false; |
|
102 |
- } |
|
103 |
- }, |
|
104 |
- showButton(dropNumber) { |
|
105 |
- // Drop 영역의 이미지 클릭 이벤트 핸들러 설정 |
|
106 |
- // 여기서는 상태 관리를 통해 버튼을 보이게 합니다. |
|
107 |
- if (dropNumber === 1) { |
|
108 |
- this.showButton1 = true; |
|
109 |
- } else if (dropNumber === 2) { |
|
110 |
- this.showButton2 = true; |
|
111 |
- } else if (dropNumber === 3) { |
|
112 |
- this.showButton3 = true; |
|
113 |
- } else if (dropNumber === 4) { |
|
114 |
- this.showButton4 = true; |
|
115 |
- } |
|
116 | 79 |
}, |
117 | 80 |
startTimer() { |
118 | 81 |
if (this.intervalId) { |
... | ... | @@ -126,24 +89,48 @@ |
126 | 89 |
clearInterval(this.intervalId); |
127 | 90 |
} |
128 | 91 |
}, 1000); |
129 |
- } |
|
92 |
+ }, |
|
93 |
+ initializeAnswer() { |
|
94 |
+ this.questionLength = this.question.length; |
|
95 |
+ this.userAnswer = new Array(this.questionLength).fill(null); // userAnswer 배열을 question 길이만큼 초기화 |
|
96 |
+ }, |
|
97 |
+ // 드래그 시작 시 호출 |
|
98 |
+ onDragStart(event, char, index) { |
|
99 |
+ this.draggedChar = char; |
|
100 |
+ this.draggedCharIndex = index; |
|
101 |
+ }, |
|
102 |
+ // 드롭 시 호출 |
|
103 |
+ onDrop(event, index) { |
|
104 |
+ if (!this.userAnswer[index]) { |
|
105 |
+ // 해당 슬롯이 비어있는 경우에만 드롭 |
|
106 |
+ this.userAnswer.splice(index, 1, this.draggedChar); // userAnswer에 드래그한 문자 추가 |
|
107 |
+ this.draggedChar = null; |
|
108 |
+ this.draggedCharIndex = null; |
|
109 |
+ } |
|
110 |
+ }, |
|
111 |
+ handleSubmit() { |
|
112 |
+ // 정답을 체크하거나 제출 시 로직 처리 |
|
113 |
+ let answer = this.userAnswer.join(" "); |
|
114 |
+ console.log("정답 : ", answer); |
|
115 |
+ }, |
|
130 | 116 |
}, |
131 |
- watch: { |
|
132 |
- |
|
133 |
- }, |
|
134 |
- computed: { |
|
135 |
- |
|
136 |
- }, |
|
137 |
- components: { |
|
138 |
- }, |
|
117 |
+ watch: {}, |
|
118 |
+ computed: {}, |
|
119 |
+ components: {}, |
|
139 | 120 |
mounted() { |
140 |
- |
|
141 |
- } |
|
142 |
-} |
|
121 |
+ this.initializeAnswer(); |
|
122 |
+ }, |
|
123 |
+}; |
|
143 | 124 |
</script> |
144 | 125 |
<style scoped> |
145 |
-.textbox {height: 60px;} |
|
146 |
-.textbox p{font-size: 28px; font-weight: bold; line-height: 65px;} |
|
126 |
+.textbox { |
|
127 |
+ height: 60px; |
|
128 |
+} |
|
129 |
+.textbox p { |
|
130 |
+ font-size: 28px; |
|
131 |
+ font-weight: bold; |
|
132 |
+ line-height: 65px; |
|
133 |
+} |
|
147 | 134 |
.dropGroup button { |
148 | 135 |
position: relative; |
149 | 136 |
} |
... | ... | @@ -155,4 +142,42 @@ |
155 | 142 |
.dragGroup button p { |
156 | 143 |
font-size: 48px; |
157 | 144 |
} |
158 |
-</style>(No newline at end of file) |
|
145 |
+ |
|
146 |
+#sourceContainer { |
|
147 |
+ margin-top: 100px; |
|
148 |
+ display: flex; |
|
149 |
+ flex-direction: row; |
|
150 |
+ gap: 230px; |
|
151 |
+} |
|
152 |
+ |
|
153 |
+#targetContainer { |
|
154 |
+ margin-top: 15rem; |
|
155 |
+ height: 100px; |
|
156 |
+ display: flex; |
|
157 |
+ flex-direction: row; |
|
158 |
+ gap: 80px; |
|
159 |
+} |
|
160 |
+ |
|
161 |
+#targetContainer .dropSlot { |
|
162 |
+ width: 250px; |
|
163 |
+ height: 70px; |
|
164 |
+ padding: 10px; |
|
165 |
+ border-bottom: 8px solid #ffba08; |
|
166 |
+} |
|
167 |
+ |
|
168 |
+#targetContainer .dropSlot .dropped-char { |
|
169 |
+ font-size: 48px; |
|
170 |
+ font-family: "ONEMobilePOPOTF"; |
|
171 |
+} |
|
172 |
+ |
|
173 |
+.submit-button { |
|
174 |
+ position: absolute; |
|
175 |
+ background-color: #ffba08; |
|
176 |
+ padding: 10px 30px; |
|
177 |
+ border-radius: 10px; |
|
178 |
+ font-size: 28px; |
|
179 |
+ font-family: "ONEMobilePOPOTF"; |
|
180 |
+ right: 5rem; |
|
181 |
+ bottom: 3rem; |
|
182 |
+} |
|
183 |
+</style> |
--- client/views/pages/main/Chapter/Chapter3_13.vue
+++ client/views/pages/main/Chapter/Chapter3_13.vue
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 |
<div id="Chapter1_1" class="content-wrap"> |
3 | 3 |
<div style="margin: 30px 0px 50px; width: 20%"> |
4 | 4 |
<router-link to="/MyPlan.page"> |
5 |
- <div class="logo mb25"><img src="../../../../resources/img/logo2.png" alt=""></div> |
|
5 |
+ <div class="logo mb25"><img src="../../../../resources/img/logo2.png" alt="" /></div> |
|
6 | 6 |
</router-link> |
7 | 7 |
</div> |
8 | 8 |
<div class="title-box mb25 flex align-center mt40"> |
... | ... | @@ -10,90 +10,57 @@ |
10 | 10 |
<span class="subtitle">my name is dd</span> |
11 | 11 |
</div> |
12 | 12 |
<div class="flex justify-between align-center"> |
13 |
- <div class="pre-btn" @click="goToPage('Chapter3_12')"><img src="../../../../resources/img/left.png" alt=""></div> |
|
13 |
+ <div class="pre-btn" @click="goToPage('Chapter3_12')"><img src="../../../../resources/img/left.png" alt="" /></div> |
|
14 | 14 |
<div class="content title-box"> |
15 | 15 |
<p class="title mt25 title-bg">step3</p> |
16 | 16 |
<div class="flex align-center mb30"> |
17 |
- <p class="subtitle2 mr20">그림과 일치하는 올바른 단어를 연결하세요.</p> |
|
18 |
- <!-- <button><img src="../../../../resources/img/btn10_s.png" alt=""> |
|
17 |
+ <p class="subtitle2 mr20">그림과 일치하는 올바른 단어를 연결하세요.</p> |
|
18 |
+ <!-- <button><img src="../../../../resources/img/btn10_s.png" alt=""> |
|
19 | 19 |
</button> --> |
20 |
- </div> |
|
20 |
+ </div> |
|
21 | 21 |
|
22 | 22 |
<div class="text-ct"> |
23 | 23 |
<div class="time-hint"> |
24 |
- <button class="hint-btn">HINT</button> |
|
24 |
+ <button class="hint-btn">HINT</button> |
|
25 | 25 |
<div class="time-bg mt20"> |
26 |
- <div> |
|
27 |
- <div class="time"> |
|
28 |
- <p class="second">{{ timer }}</p> |
|
29 |
- <p class="text">sec</p> |
|
30 |
- </div> |
|
26 |
+ <div> |
|
27 |
+ <div class="time"> |
|
28 |
+ <p class="second">{{ timer }}</p> |
|
29 |
+ <p class="text">sec</p> |
|
31 | 30 |
</div> |
32 | 31 |
</div> |
33 |
- </div> |
|
34 |
- <div class="flex justify-center "> |
|
35 |
- <div class=" flex justify-between align-center" style="width: 50%;"> |
|
32 |
+ </div> |
|
33 |
+ </div> |
|
34 |
+ <div class="flex justify-center"> |
|
35 |
+ <div class="flex justify-between align-center" style="width: 50%"> |
|
36 |
+ <!-- SVG Container for Drawing Lines --> |
|
37 |
+ <svg class="line-container" xmlns="http://www.w3.org/2000/svg" :style="{ width: svgWidth, height: svgHeight }"> |
|
38 |
+ <line v-for="(pair, index) in pairs" :key="'line-' + index" :x1="pair.leftPos.x" :y1="pair.leftPos.y" :x2="pair.rightPos.x" :y2="pair.rightPos.y" stroke="blue" stroke-width="2" /> |
|
39 |
+ </svg> |
|
40 |
+ |
|
36 | 41 |
<div class="pickGroup left"> |
37 | 42 |
<div> |
38 |
- <article class="flex align-center justify-between mb20" style="gap: 60px;"> |
|
39 |
- <img src="../../../../resources/img/img121_62s.png" alt=""> |
|
40 |
- <div > |
|
41 |
- <button class="blue-c"> |
|
42 |
- </button> |
|
43 |
- </div> |
|
44 |
- </article> |
|
45 |
- <article class="flex align-center justify-between mb20" style="gap: 60px;"> |
|
46 |
- <img src="../../../../resources/img/img122_62s.png" alt=""> |
|
47 |
- <div > |
|
48 |
- <button class="blue-c"> |
|
49 |
- </button> |
|
50 |
- </div> |
|
51 |
- </article> |
|
52 |
- <article class="flex align-center justify-between mb20" style="gap: 60px;"> |
|
53 |
- <img src="../../../../resources/img/img123_62s.png" alt=""> |
|
54 |
- <div class="flex"> |
|
55 |
- <button class="blue-c"> |
|
56 |
- </button> |
|
43 |
+ <article class="flex align-center justify-between mb20" style="gap: 60px" v-for="(image, index) in images" :key="'left-' + index"> |
|
44 |
+ <img :src="image.src" :alt="image.alt" /> |
|
45 |
+ <div> |
|
46 |
+ <button class="blue-c" @click="selectLeft(index, $event)"></button> |
|
57 | 47 |
</div> |
58 | 48 |
</article> |
59 | 49 |
</div> |
60 |
- |
|
61 | 50 |
</div> |
62 |
- <div class="pickGroup right"> |
|
63 |
- <div> |
|
64 |
- <article class="flex align-center justify-between mb20" style="gap: 60px;"> |
|
65 |
- <div class="flex"> |
|
66 |
- <button class="blue-c"> |
|
67 |
- </button> |
|
68 |
- </div> |
|
69 |
- <img src="../../../../resources/img/img121_62s.png" alt=""> |
|
70 |
- |
|
71 |
- </article> |
|
72 |
- <article class="flex align-center justify-between mb20" style="gap: 60px;"> |
|
73 |
- <div class="flex"> |
|
74 |
- <button class="blue-c"> |
|
75 |
- </button> |
|
76 |
- </div> |
|
77 |
- <img src="../../../../resources/img/img122_62s.png" alt=""> |
|
78 |
- |
|
79 |
- </article> |
|
80 |
- <article class="flex align-center justify-between mb20" style="gap: 60px;"> |
|
81 |
- <div class="flex"> |
|
82 |
- <button class="blue-c"> |
|
83 |
- </button> |
|
84 |
- </div> |
|
85 |
- <img src="../../../../resources/img/img123_62s.png" alt=""> |
|
86 |
- |
|
87 |
- </article> |
|
88 |
- </div> |
|
89 |
- |
|
90 |
- </div> |
|
91 |
- </div> |
|
92 |
- </div> |
|
93 | 51 |
|
52 |
+ <div class="pickGroup right"> |
|
53 |
+ <article v-for="(word, index) in question" :key="index" class="flex align-center justify-start mb20" style="gap: 30px"> |
|
54 |
+ <button class="blue-c" @click="selectRight(index, $event)"></button> |
|
55 |
+ <p class="word">{{ word }}</p> |
|
56 |
+ </article> |
|
57 |
+ </div> |
|
58 |
+ </div> |
|
59 |
+ </div> |
|
94 | 60 |
</div> |
61 |
+ <button class="submit-button" @click="handleSubmit()">제출하기</button> |
|
95 | 62 |
</div> |
96 |
- <div class="next-btn" @click="goToPage('Chapter3_14')"><img src="../../../../resources/img/right.png" alt=""></div> |
|
63 |
+ <div class="next-btn" @click="goToPage('Chapter3_14')"><img src="../../../../resources/img/right.png" alt="" /></div> |
|
97 | 64 |
</div> |
98 | 65 |
</div> |
99 | 66 |
</template> |
... | ... | @@ -102,40 +69,24 @@ |
102 | 69 |
export default { |
103 | 70 |
data() { |
104 | 71 |
return { |
105 |
- timer: '00', |
|
106 |
- showButton1: false, |
|
107 |
- showButton2: false, |
|
108 |
- showButton3: false, |
|
109 |
- showButton4: false, |
|
110 |
- } |
|
72 |
+ timer: "00", |
|
73 |
+ question: ["Australia", "Brazil", "China"], |
|
74 |
+ images: [ |
|
75 |
+ { src: "client/resources/img/img121_62s.png", alt: "Australia" }, |
|
76 |
+ { src: "client/resources/img/img122_62s.png", alt: "Brazil" }, |
|
77 |
+ { src: "client/resources/img/img123_62s.png", alt: "China" }, |
|
78 |
+ ], |
|
79 |
+ |
|
80 |
+ selectedLeft: null, // 왼쪽에서 선택된 인덱스 저장 |
|
81 |
+ selectedRight: null, // 오른쪽에서 선택된 인덱스 저장 |
|
82 |
+ pairs: [], // 매칭된 쌍을 저장 |
|
83 |
+ svgWidth: "100%", // SVG의 너비 |
|
84 |
+ svgHeight: "100%", // SVG의 높이 |
|
85 |
+ }; |
|
111 | 86 |
}, |
112 | 87 |
methods: { |
113 | 88 |
goToPage(page) { |
114 | 89 |
this.$router.push({ name: page }); |
115 |
- }, |
|
116 |
- handleDrag(dragNumber) { |
|
117 |
- // Drag 버튼 숨기기 |
|
118 |
- // 여기서는 상태 관리를 통해 버튼을 제어합니다. |
|
119 |
- if (dragNumber === 1) { |
|
120 |
- this.showButton1 = false; |
|
121 |
- } else if (dragNumber === 2) { |
|
122 |
- this.showButton2 = false; |
|
123 |
- } else if (dragNumber === 3) { |
|
124 |
- this.showButton3 = false; |
|
125 |
- } |
|
126 |
- }, |
|
127 |
- showButton(dropNumber) { |
|
128 |
- // Drop 영역의 이미지 클릭 이벤트 핸들러 설정 |
|
129 |
- // 여기서는 상태 관리를 통해 버튼을 보이게 합니다. |
|
130 |
- if (dropNumber === 1) { |
|
131 |
- this.showButton1 = true; |
|
132 |
- } else if (dropNumber === 2) { |
|
133 |
- this.showButton2 = true; |
|
134 |
- } else if (dropNumber === 3) { |
|
135 |
- this.showButton3 = true; |
|
136 |
- } else if (dropNumber === 4) { |
|
137 |
- this.showButton4 = true; |
|
138 |
- } |
|
139 | 90 |
}, |
140 | 91 |
startTimer() { |
141 | 92 |
if (this.intervalId) { |
... | ... | @@ -149,33 +100,122 @@ |
149 | 100 |
clearInterval(this.intervalId); |
150 | 101 |
} |
151 | 102 |
}, 1000); |
152 |
- } |
|
153 |
- }, |
|
154 |
- watch: { |
|
103 |
+ }, |
|
155 | 104 |
|
156 |
- }, |
|
157 |
- computed: { |
|
105 |
+ selectLeft(index, event) { |
|
106 |
+ this.selectedLeft = { index, element: event.target }; |
|
107 |
+ this.checkMatch(); // 매칭을 시도 |
|
108 |
+ }, |
|
109 |
+ selectRight(index, event) { |
|
110 |
+ this.selectedRight = { index, element: event.target }; |
|
111 |
+ this.checkMatch(); // 매칭을 시도 |
|
112 |
+ }, |
|
113 |
+ checkMatch() { |
|
114 |
+ if (this.selectedLeft !== null && this.selectedRight !== null) { |
|
115 |
+ // 매칭 성공 시 좌표를 계산하여 저장 |
|
116 |
+ const leftPos = this.getElementPosition(this.selectedLeft.element); |
|
117 |
+ const rightPos = this.getElementPosition(this.selectedRight.element); |
|
158 | 118 |
|
119 |
+ this.pairs.push({ |
|
120 |
+ left: this.selectedLeft.index, |
|
121 |
+ right: this.selectedRight.index, |
|
122 |
+ leftPos, |
|
123 |
+ rightPos, |
|
124 |
+ }); |
|
125 |
+ |
|
126 |
+ // 매칭이 된 후 선택 해제 |
|
127 |
+ this.selectedLeft = null; |
|
128 |
+ this.selectedRight = null; |
|
129 |
+ } |
|
130 |
+ }, |
|
131 |
+ getElementPosition(element) { |
|
132 |
+ const rect = element.getBoundingClientRect(); |
|
133 |
+ return { |
|
134 |
+ x: rect.left + rect.width / 2, |
|
135 |
+ y: rect.top + rect.height / 2, |
|
136 |
+ }; |
|
137 |
+ }, |
|
138 |
+ handleSubmit() { |
|
139 |
+ // 매칭된 결과를 확인하거나 제출 시 로직 처리 |
|
140 |
+ console.log("Matched pairs: ", this.pairs); |
|
141 |
+ }, |
|
142 |
+ updateSVGSize() { |
|
143 |
+ const container = document.querySelector(".position-relative"); |
|
144 |
+ if (container) { |
|
145 |
+ this.svgWidth = `${container.clientWidth}px`; |
|
146 |
+ this.svgHeight = `${container.clientHeight}px`; |
|
147 |
+ } |
|
148 |
+ }, |
|
159 | 149 |
}, |
160 |
- components: { |
|
161 |
- }, |
|
150 |
+ watch: {}, |
|
151 |
+ computed: {}, |
|
152 |
+ components: {}, |
|
162 | 153 |
mounted() { |
163 |
- |
|
164 |
- } |
|
165 |
-} |
|
154 |
+ // SVG의 크기를 동적으로 설정 |
|
155 |
+ this.updateSVGSize(); |
|
156 |
+ window.addEventListener("resize", this.updateSVGSize); |
|
157 |
+ }, |
|
158 |
+ beforeDestroy() { |
|
159 |
+ window.removeEventListener("resize", this.updateSVGSize); |
|
160 |
+ }, |
|
161 |
+}; |
|
166 | 162 |
</script> |
167 | 163 |
<style scoped> |
168 |
-.textbox {height: 60px;} |
|
169 |
-.textbox p{font-size: 28px; font-weight: bold; line-height: 65px;} |
|
164 |
+.textbox { |
|
165 |
+ height: 60px; |
|
166 |
+} |
|
167 |
+.textbox p { |
|
168 |
+ font-size: 28px; |
|
169 |
+ font-weight: bold; |
|
170 |
+ line-height: 65px; |
|
171 |
+} |
|
170 | 172 |
.dropGroup button { |
171 | 173 |
position: relative; |
172 | 174 |
} |
173 | 175 |
|
174 |
-.dropGroup button p { |
|
176 |
+.pickGroup { |
|
177 |
+ display: flex; |
|
178 |
+ flex-direction: column; |
|
179 |
+ gap: 60px; |
|
180 |
+} |
|
181 |
+ |
|
182 |
+.pickGroup .word { |
|
175 | 183 |
font-size: 48px; |
184 |
+ font-family: "ONEMobilePOPOTF"; |
|
176 | 185 |
} |
177 | 186 |
|
178 | 187 |
.dragGroup button p { |
179 | 188 |
font-size: 48px; |
180 | 189 |
} |
181 |
-</style>(No newline at end of file) |
|
190 |
+ |
|
191 |
+.submit-button { |
|
192 |
+ position: absolute; |
|
193 |
+ background-color: #ffba08; |
|
194 |
+ padding: 10px 30px; |
|
195 |
+ border-radius: 10px; |
|
196 |
+ font-size: 28px; |
|
197 |
+ font-family: "ONEMobilePOPOTF"; |
|
198 |
+ right: 5rem; |
|
199 |
+ bottom: 3rem; |
|
200 |
+} |
|
201 |
+ |
|
202 |
+.position-relative { |
|
203 |
+ position: relative; |
|
204 |
+} |
|
205 |
+ |
|
206 |
+.line-container { |
|
207 |
+ position: absolute; |
|
208 |
+ bottom: 215px; |
|
209 |
+ right: 125px; |
|
210 |
+ pointer-events: none; |
|
211 |
+} |
|
212 |
+ |
|
213 |
+.blue-c { |
|
214 |
+ width: 20px; |
|
215 |
+ height: 20px; |
|
216 |
+ background-color: blue; |
|
217 |
+ border-radius: 50%; |
|
218 |
+ border: none; |
|
219 |
+ cursor: pointer; |
|
220 |
+} |
|
221 |
+</style> |
--- client/views/pages/main/Chapter/Chapter3_14.vue
+++ client/views/pages/main/Chapter/Chapter3_14.vue
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 |
<div id="Chapter1_1" class="content-wrap"> |
3 | 3 |
<div style="margin: 30px 0px 50px; width: 20%"> |
4 | 4 |
<router-link to="/MyPlan.page"> |
5 |
- <div class="logo mb25"><img src="../../../../resources/img/logo2.png" alt=""></div> |
|
5 |
+ <div class="logo mb25"><img src="../../../../resources/img/logo2.png" alt="" /></div> |
|
6 | 6 |
</router-link> |
7 | 7 |
</div> |
8 | 8 |
<div class="title-box mb25 flex align-center mt40"> |
... | ... | @@ -10,46 +10,38 @@ |
10 | 10 |
<span class="subtitle">my name is dd</span> |
11 | 11 |
</div> |
12 | 12 |
<div class="flex justify-between align-center"> |
13 |
- <div class="pre-btn" @click="goToPage('Chapter3_13')"><img src="../../../../resources/img/left.png" alt=""></div> |
|
13 |
+ <div class="pre-btn" @click="goToPage('Chapter3_13')"><img src="../../../../resources/img/left.png" alt="" /></div> |
|
14 | 14 |
<div class="content title-box"> |
15 | 15 |
<p class="title mt25 title-bg">step3</p> |
16 | 16 |
<div class="flex align-center mb30"> |
17 |
- <p class="subtitle2 mr20">그림에 알맞는 낱말을 쓰세요.</p> |
|
18 |
- <!-- <button><img src="../../../../resources/img/btn10_s.png" alt=""> |
|
17 |
+ <p class="subtitle2 mr20">그림에 알맞는 낱말을 쓰세요.</p> |
|
18 |
+ <!-- <button><img src="../../../../resources/img/btn10_s.png" alt=""> |
|
19 | 19 |
</button> --> |
20 |
- </div> |
|
20 |
+ </div> |
|
21 | 21 |
|
22 | 22 |
<div class="text-ct"> |
23 | 23 |
<div class="time-hint"> |
24 |
- <button class="hint-btn">HINT</button> |
|
24 |
+ <button class="hint-btn">HINT</button> |
|
25 | 25 |
<div class="time-bg mt20"> |
26 |
- <div> |
|
27 |
- <div class="time"> |
|
28 |
- <p class="second">{{ timer }}</p> |
|
29 |
- <p class="text">sec</p> |
|
30 |
- </div> |
|
26 |
+ <div> |
|
27 |
+ <div class="time"> |
|
28 |
+ <p class="second">{{ timer }}</p> |
|
29 |
+ <p class="text">sec</p> |
|
31 | 30 |
</div> |
32 | 31 |
</div> |
33 |
- </div> |
|
34 |
- <div class="imgGroup"><img src="../../../../resources/img/img124_63s.png" alt=""></div> |
|
35 |
- |
|
36 |
- <div class="dropGroup flex align-center justify-center mt30"> |
|
37 |
- <div class="flex" style="gap: 20px;"> |
|
38 |
- <div class="bd-bt textbox" @click="showButton(1)"> |
|
39 |
- <p v-if="showButton1">A</p></div> |
|
40 |
- <div class="bd-bt textbox" @click="showButton(2)"> |
|
41 |
- <p v-if="showButton2">A</p></div> |
|
42 |
- <div class="bd-bt textbox" @click="showButton(3)"> |
|
43 |
- <p v-if="showButton3">A</p></div> |
|
44 |
- <div class="bd-bt textbox" @click="showButton(4)"> |
|
45 |
- <p v-if="showButton4">A</p></div> |
|
46 | 32 |
</div> |
47 |
- |
|
48 | 33 |
</div> |
34 |
+ <div class="imgGroup"><img src="../../../../resources/img/img124_63s.png" alt="" /></div> |
|
49 | 35 |
|
36 |
+ <div class="dropGroup flex align-center justify-center mt30"> |
|
37 |
+ <div class="mt50"> |
|
38 |
+ <input class="yellow-bd" v-model="answer" type="text" placeholder="답을 입력하세요." style="width: 50rem" /> |
|
39 |
+ </div> |
|
40 |
+ </div> |
|
50 | 41 |
</div> |
42 |
+ <button class="submit-button" @click="handleSubmit()">제출하기</button> |
|
51 | 43 |
</div> |
52 |
- <div class="next-btn" @click="goToPage('Chapter3_15')"><img src="../../../../resources/img/right.png" alt=""></div> |
|
44 |
+ <div class="next-btn" @click="goToPage('Chapter3_15')"><img src="../../../../resources/img/right.png" alt="" /></div> |
|
53 | 45 |
</div> |
54 | 46 |
</div> |
55 | 47 |
</template> |
... | ... | @@ -58,40 +50,13 @@ |
58 | 50 |
export default { |
59 | 51 |
data() { |
60 | 52 |
return { |
61 |
- timer: '00', |
|
62 |
- showButton1: false, |
|
63 |
- showButton2: false, |
|
64 |
- showButton3: false, |
|
65 |
- showButton4: false, |
|
66 |
- } |
|
53 |
+ timer: "00", |
|
54 |
+ answer: null, |
|
55 |
+ }; |
|
67 | 56 |
}, |
68 | 57 |
methods: { |
69 | 58 |
goToPage(page) { |
70 | 59 |
this.$router.push({ name: page }); |
71 |
- }, |
|
72 |
- handleDrag(dragNumber) { |
|
73 |
- // Drag 버튼 숨기기 |
|
74 |
- // 여기서는 상태 관리를 통해 버튼을 제어합니다. |
|
75 |
- if (dragNumber === 1) { |
|
76 |
- this.showButton1 = false; |
|
77 |
- } else if (dragNumber === 2) { |
|
78 |
- this.showButton2 = false; |
|
79 |
- } else if (dragNumber === 3) { |
|
80 |
- this.showButton3 = false; |
|
81 |
- } |
|
82 |
- }, |
|
83 |
- showButton(dropNumber) { |
|
84 |
- // Drop 영역의 이미지 클릭 이벤트 핸들러 설정 |
|
85 |
- // 여기서는 상태 관리를 통해 버튼을 보이게 합니다. |
|
86 |
- if (dropNumber === 1) { |
|
87 |
- this.showButton1 = true; |
|
88 |
- } else if (dropNumber === 2) { |
|
89 |
- this.showButton2 = true; |
|
90 |
- } else if (dropNumber === 3) { |
|
91 |
- this.showButton3 = true; |
|
92 |
- } else if (dropNumber === 4) { |
|
93 |
- this.showButton4 = true; |
|
94 |
- } |
|
95 | 60 |
}, |
96 | 61 |
startTimer() { |
97 | 62 |
if (this.intervalId) { |
... | ... | @@ -105,24 +70,26 @@ |
105 | 70 |
clearInterval(this.intervalId); |
106 | 71 |
} |
107 | 72 |
}, 1000); |
108 |
- } |
|
73 |
+ }, |
|
74 |
+ handleSubmit() { |
|
75 |
+ console.log("정답 : ", this.answer); |
|
76 |
+ }, |
|
109 | 77 |
}, |
110 |
- watch: { |
|
111 |
- |
|
112 |
- }, |
|
113 |
- computed: { |
|
114 |
- |
|
115 |
- }, |
|
116 |
- components: { |
|
117 |
- }, |
|
118 |
- mounted() { |
|
119 |
- |
|
120 |
- } |
|
121 |
-} |
|
78 |
+ watch: {}, |
|
79 |
+ computed: {}, |
|
80 |
+ components: {}, |
|
81 |
+ mounted() {}, |
|
82 |
+}; |
|
122 | 83 |
</script> |
123 | 84 |
<style scoped> |
124 |
-.textbox {height: 60px;} |
|
125 |
-.textbox p{font-size: 28px; font-weight: bold; line-height: 65px;} |
|
85 |
+.textbox { |
|
86 |
+ height: 60px; |
|
87 |
+} |
|
88 |
+.textbox p { |
|
89 |
+ font-size: 28px; |
|
90 |
+ font-weight: bold; |
|
91 |
+ line-height: 65px; |
|
92 |
+} |
|
126 | 93 |
.dropGroup button { |
127 | 94 |
position: relative; |
128 | 95 |
} |
... | ... | @@ -134,4 +101,15 @@ |
134 | 101 |
.dragGroup button p { |
135 | 102 |
font-size: 48px; |
136 | 103 |
} |
137 |
-</style>(No newline at end of file) |
|
104 |
+ |
|
105 |
+.submit-button { |
|
106 |
+ position: absolute; |
|
107 |
+ background-color: #ffba08; |
|
108 |
+ padding: 10px 30px; |
|
109 |
+ border-radius: 10px; |
|
110 |
+ font-size: 28px; |
|
111 |
+ font-family: "ONEMobilePOPOTF"; |
|
112 |
+ right: 5rem; |
|
113 |
+ bottom: 3rem; |
|
114 |
+} |
|
115 |
+</style> |
--- client/views/pages/main/Chapter/Chapter3_15.vue
+++ client/views/pages/main/Chapter/Chapter3_15.vue
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 |
<div id="Chapter1_1" class="content-wrap"> |
3 | 3 |
<div style="margin: 30px 0px 50px; width: 20%"> |
4 | 4 |
<router-link to="/MyPlan.page"> |
5 |
- <div class="logo mb25"><img src="../../../../resources/img/logo2.png" alt=""></div> |
|
5 |
+ <div class="logo mb25"><img src="../../../../resources/img/logo2.png" alt="" /></div> |
|
6 | 6 |
</router-link> |
7 | 7 |
</div> |
8 | 8 |
<div class="title-box mb25 flex align-center mt40"> |
... | ... | @@ -10,37 +10,36 @@ |
10 | 10 |
<span class="subtitle">my name is dd</span> |
11 | 11 |
</div> |
12 | 12 |
<div class="flex justify-between align-center"> |
13 |
- <div class="pre-btn" @click="goToPage('Chapter3_14')"><img src="../../../../resources/img/left.png" alt=""></div> |
|
13 |
+ <div class="pre-btn" @click="goToPage('Chapter3_14')"><img src="../../../../resources/img/left.png" alt="" /></div> |
|
14 | 14 |
<div class="content title-box"> |
15 | 15 |
<p class="title mt25 title-bg">step3</p> |
16 | 16 |
<div class="flex align-center mb30"> |
17 |
- <p class="subtitle2 mr20">듣고 올바른 대답을 말해보세요!</p> |
|
18 |
- <button><img src="../../../../resources/img/btn10_s.png" alt=""> |
|
19 |
- </button> |
|
20 |
- </div> |
|
17 |
+ <p class="subtitle2 mr20">듣고 올바른 대답을 말해보세요!</p> |
|
18 |
+ <button><img src="../../../../resources/img/btn10_s.png" alt="" /></button> |
|
19 |
+ </div> |
|
21 | 20 |
|
22 | 21 |
<div class="text-ct"> |
23 | 22 |
<div class="time-hint"> |
24 |
- <button class="hint-btn">HINT</button> |
|
23 |
+ <button class="hint-btn">HINT</button> |
|
25 | 24 |
<div class="time-bg mt20"> |
26 |
- <div> |
|
27 |
- <div class="time"> |
|
28 |
- <p class="second">{{ timer }}</p> |
|
29 |
- <p class="text">sec</p> |
|
30 |
- </div> |
|
25 |
+ <div> |
|
26 |
+ <div class="time"> |
|
27 |
+ <p class="second">{{ timer }}</p> |
|
28 |
+ <p class="text">sec</p> |
|
31 | 29 |
</div> |
32 | 30 |
</div> |
33 |
- </div> |
|
34 |
- <div class="imgGroup"><img src="../../../../resources/img/img125_64s.png" alt=""></div> |
|
35 |
- |
|
36 |
- <div class="dropGroup flex align-center justify-center mt30"> |
|
37 |
- <img src="../../../../resources/img/btn18_64s_normal.png" alt=""> |
|
38 |
- |
|
31 |
+ </div> |
|
39 | 32 |
</div> |
33 |
+ <div class="imgGroup"><img src="../../../../resources/img/img125_64s.png" alt="" /></div> |
|
40 | 34 |
|
35 |
+ <div class="dropGroup flex align-center justify-center mt70"> |
|
36 |
+ <img src="../../../../resources/img/btn18_64s_normal.png" alt="" /> |
|
37 |
+ </div> |
|
41 | 38 |
</div> |
39 |
+ |
|
40 |
+ <button class="submit-button" @click="handleSubmit()">제출하기</button> |
|
42 | 41 |
</div> |
43 |
- <div class="next-btn" @click="goToPage('Chapter4')"><img src="../../../../resources/img/right.png" alt=""></div> |
|
42 |
+ <div class="next-btn" @click="goToPage('Chapter4')"><img src="../../../../resources/img/right.png" alt="" /></div> |
|
44 | 43 |
</div> |
45 | 44 |
</div> |
46 | 45 |
</template> |
... | ... | @@ -49,40 +48,12 @@ |
49 | 48 |
export default { |
50 | 49 |
data() { |
51 | 50 |
return { |
52 |
- timer: '00', |
|
53 |
- showButton1: false, |
|
54 |
- showButton2: false, |
|
55 |
- showButton3: false, |
|
56 |
- showButton4: false, |
|
57 |
- } |
|
51 |
+ timer: "00", |
|
52 |
+ }; |
|
58 | 53 |
}, |
59 | 54 |
methods: { |
60 | 55 |
goToPage(page) { |
61 | 56 |
this.$router.push({ name: page }); |
62 |
- }, |
|
63 |
- handleDrag(dragNumber) { |
|
64 |
- // Drag 버튼 숨기기 |
|
65 |
- // 여기서는 상태 관리를 통해 버튼을 제어합니다. |
|
66 |
- if (dragNumber === 1) { |
|
67 |
- this.showButton1 = false; |
|
68 |
- } else if (dragNumber === 2) { |
|
69 |
- this.showButton2 = false; |
|
70 |
- } else if (dragNumber === 3) { |
|
71 |
- this.showButton3 = false; |
|
72 |
- } |
|
73 |
- }, |
|
74 |
- showButton(dropNumber) { |
|
75 |
- // Drop 영역의 이미지 클릭 이벤트 핸들러 설정 |
|
76 |
- // 여기서는 상태 관리를 통해 버튼을 보이게 합니다. |
|
77 |
- if (dropNumber === 1) { |
|
78 |
- this.showButton1 = true; |
|
79 |
- } else if (dropNumber === 2) { |
|
80 |
- this.showButton2 = true; |
|
81 |
- } else if (dropNumber === 3) { |
|
82 |
- this.showButton3 = true; |
|
83 |
- } else if (dropNumber === 4) { |
|
84 |
- this.showButton4 = true; |
|
85 |
- } |
|
86 | 57 |
}, |
87 | 58 |
startTimer() { |
88 | 59 |
if (this.intervalId) { |
... | ... | @@ -96,24 +67,23 @@ |
96 | 67 |
clearInterval(this.intervalId); |
97 | 68 |
} |
98 | 69 |
}, 1000); |
99 |
- } |
|
70 |
+ }, |
|
100 | 71 |
}, |
101 |
- watch: { |
|
102 |
- |
|
103 |
- }, |
|
104 |
- computed: { |
|
105 |
- |
|
106 |
- }, |
|
107 |
- components: { |
|
108 |
- }, |
|
109 |
- mounted() { |
|
110 |
- |
|
111 |
- } |
|
112 |
-} |
|
72 |
+ watch: {}, |
|
73 |
+ computed: {}, |
|
74 |
+ components: {}, |
|
75 |
+ mounted() {}, |
|
76 |
+}; |
|
113 | 77 |
</script> |
114 | 78 |
<style scoped> |
115 |
-.textbox {height: 60px;} |
|
116 |
-.textbox p{font-size: 28px; font-weight: bold; line-height: 65px;} |
|
79 |
+.textbox { |
|
80 |
+ height: 60px; |
|
81 |
+} |
|
82 |
+.textbox p { |
|
83 |
+ font-size: 28px; |
|
84 |
+ font-weight: bold; |
|
85 |
+ line-height: 65px; |
|
86 |
+} |
|
117 | 87 |
.dropGroup button { |
118 | 88 |
position: relative; |
119 | 89 |
} |
... | ... | @@ -125,4 +95,15 @@ |
125 | 95 |
.dragGroup button p { |
126 | 96 |
font-size: 48px; |
127 | 97 |
} |
128 |
-</style>(No newline at end of file) |
|
98 |
+ |
|
99 |
+.submit-button { |
|
100 |
+ position: absolute; |
|
101 |
+ background-color: #ffba08; |
|
102 |
+ padding: 10px 30px; |
|
103 |
+ border-radius: 10px; |
|
104 |
+ font-size: 28px; |
|
105 |
+ font-family: "ONEMobilePOPOTF"; |
|
106 |
+ right: 5rem; |
|
107 |
+ bottom: 3rem; |
|
108 |
+} |
|
109 |
+</style> |
--- client/views/pages/main/Chapter/Chapter3_7.vue
+++ client/views/pages/main/Chapter/Chapter3_7.vue
... | ... | @@ -1,271 +1,264 @@ |
1 | 1 |
<template> |
2 |
- <div id="Chapter1_1" class="content-wrap"> |
|
3 |
- <div style="margin: 30px 0px 50px; width: 20%"> |
|
4 |
- <router-link to="/MyPlan.page"> |
|
5 |
- <div class="logo mb25"> |
|
6 |
- <img src="../../../../resources/img/logo2.png" alt="" /> |
|
7 |
- </div> |
|
8 |
- </router-link> |
|
2 |
+ <div id="Chapter1_1" class="content-wrap"> |
|
3 |
+ <div style="margin: 30px 0px 50px; width: 20%"> |
|
4 |
+ <router-link to="/MyPlan.page"> |
|
5 |
+ <div class="logo mb25"> |
|
6 |
+ <img src="../../../../resources/img/logo2.png" alt="" /> |
|
9 | 7 |
</div> |
10 |
- <div class="title-box mb25 flex align-center mt40"> |
|
11 |
- <span class="title mr40">1. Hello WORLD</span> |
|
12 |
- <span class="subtitle">my name is dd</span> |
|
13 |
- </div> |
|
14 |
- <div class="flex justify-between align-center"> |
|
15 |
- <div class="pre-btn" @click="goToPage('Chapter3_6')"> |
|
16 |
- <img src="../../../../resources/img/left.png" alt="" /> |
|
17 |
- </div> |
|
18 |
- <div class="content title-box"> |
|
19 |
- <p class="title mt25 title-bg">step3.</p> |
|
20 |
- <div class="flex align-center mb30"> |
|
21 |
- <p class="subtitle2 mr20">O X 퀴즈</p> |
|
22 |
- <button> |
|
23 |
- <img |
|
24 |
- src="../../../../resources/img/btn10_s.png" |
|
25 |
- alt="" |
|
26 |
- /> |
|
27 |
- </button> |
|
28 |
- </div> |
|
29 |
- |
|
30 |
- <div class="text-ct"> |
|
31 |
- <div class="time-hint"> |
|
32 |
- <button class="hint-btn">HINT</button> |
|
33 |
- <div class="time-bg mt20"> |
|
34 |
- <div> |
|
35 |
- <div class="time"> |
|
36 |
- <p class="second">{{ timer }}</p> |
|
37 |
- <p class="text">sec</p> |
|
38 |
- </div> |
|
39 |
- </div> |
|
40 |
- </div> |
|
41 |
- </div> |
|
42 |
- |
|
43 |
- <div |
|
44 |
- class="pickGroup flex align-center justify-between mt80" |
|
45 |
- style="gap: 100px" |
|
46 |
- > |
|
47 |
- <p>Q. {{ dataList.prblmExpln }}</p> |
|
48 |
- <div class="flex justify-center" style="gap: 60px"> |
|
49 |
- <article> |
|
50 |
- <div class="flex align-center"> |
|
51 |
- <button @click="handleCheck('O')" name="O"> |
|
52 |
- <img |
|
53 |
- src="../../../../resources/img/img136_71s.png" |
|
54 |
- alt="" |
|
55 |
- /> |
|
56 |
- <p :class="{ active: answer === 'O' }"> |
|
57 |
- 1 |
|
58 |
- </p> |
|
59 |
- </button> |
|
60 |
- <img |
|
61 |
- src="../../../../resources/img/img111_56s.png" |
|
62 |
- alt="" |
|
63 |
- /> |
|
64 |
- </div> |
|
65 |
- </article> |
|
66 |
- <article> |
|
67 |
- <div class="flex align-center"> |
|
68 |
- <button @click="handleCheck('X')" name="X"> |
|
69 |
- <img |
|
70 |
- src="../../../../resources/img/img136_71s.png" |
|
71 |
- alt="" |
|
72 |
- /> |
|
73 |
- <p :class="{ active: answer === 'X' }"> |
|
74 |
- 2 |
|
75 |
- </p> |
|
76 |
- </button> |
|
77 |
- <img |
|
78 |
- src="../../../../resources/img/img112_56s.png" |
|
79 |
- alt="" |
|
80 |
- /> |
|
81 |
- </div> |
|
82 |
- </article> |
|
83 |
- </div> |
|
84 |
- </div> |
|
85 |
- </div> |
|
86 |
- </div> |
|
87 |
- <div |
|
88 |
- class="next-btn" |
|
89 |
- @click=" |
|
90 |
- [ |
|
91 |
- goToPage('Chapter3_8'), |
|
92 |
- // handleSubmitAnswer() |
|
93 |
- ] |
|
94 |
- " |
|
95 |
- > |
|
96 |
- <img src="../../../../resources/img/right.png" alt="" /> |
|
97 |
- </div> |
|
98 |
- </div> |
|
8 |
+ </router-link> |
|
99 | 9 |
</div> |
10 |
+ <div class="title-box mb25 flex align-center mt40"> |
|
11 |
+ <span class="title mr40">1. Hello WORLD</span> |
|
12 |
+ <span class="subtitle">my name is dd</span> |
|
13 |
+ </div> |
|
14 |
+ <div class="flex justify-between align-center"> |
|
15 |
+ <div class="pre-btn" @click="goToPage('Chapter3_6')"> |
|
16 |
+ <img src="../../../../resources/img/left.png" alt="" /> |
|
17 |
+ </div> |
|
18 |
+ <div class="content title-box"> |
|
19 |
+ <p class="title mt25 title-bg">step3.</p> |
|
20 |
+ <div class="flex align-center mb30"> |
|
21 |
+ <p class="subtitle2 mr20">O X 퀴즈</p> |
|
22 |
+ <button> |
|
23 |
+ <img src="../../../../resources/img/btn10_s.png" alt="" /> |
|
24 |
+ </button> |
|
25 |
+ </div> |
|
26 |
+ |
|
27 |
+ <div class="text-ct"> |
|
28 |
+ <div class="time-hint"> |
|
29 |
+ <button class="hint-btn">HINT</button> |
|
30 |
+ <div class="time-bg mt20"> |
|
31 |
+ <div> |
|
32 |
+ <div class="time"> |
|
33 |
+ <p class="second">{{ timer }}</p> |
|
34 |
+ <p class="text">sec</p> |
|
35 |
+ </div> |
|
36 |
+ </div> |
|
37 |
+ </div> |
|
38 |
+ </div> |
|
39 |
+ |
|
40 |
+ <div class="pickGroup flex align-center justify-between mt80" style="gap: 100px"> |
|
41 |
+ <p>Q. {{ dataList.prblmExpln }}</p> |
|
42 |
+ <div class="flex justify-center" style="gap: 60px"> |
|
43 |
+ <article> |
|
44 |
+ <div class="flex align-center"> |
|
45 |
+ <button @click="handleCheck('O')" name="O"> |
|
46 |
+ <img src="../../../../resources/img/img136_71s.png" alt="" /> |
|
47 |
+ <p :class="{ active: answer === 'O' }">1</p> |
|
48 |
+ </button> |
|
49 |
+ <img src="../../../../resources/img/img111_56s.png" alt="" /> |
|
50 |
+ </div> |
|
51 |
+ </article> |
|
52 |
+ <article> |
|
53 |
+ <div class="flex align-center"> |
|
54 |
+ <button @click="handleCheck('X')" name="X"> |
|
55 |
+ <img src="../../../../resources/img/img136_71s.png" alt="" /> |
|
56 |
+ <p :class="{ active: answer === 'X' }">2</p> |
|
57 |
+ </button> |
|
58 |
+ <img src="../../../../resources/img/img112_56s.png" alt="" /> |
|
59 |
+ </div> |
|
60 |
+ </article> |
|
61 |
+ </div> |
|
62 |
+ </div> |
|
63 |
+ </div> |
|
64 |
+ <button class="submit-button" @click="handleSubmit()">제출하기</button> |
|
65 |
+ </div> |
|
66 |
+ <div |
|
67 |
+ class="next-btn" |
|
68 |
+ @click=" |
|
69 |
+ [ |
|
70 |
+ goToPage('Chapter3_8'), |
|
71 |
+ // handleSubmitAnswer() |
|
72 |
+ ] |
|
73 |
+ " |
|
74 |
+ > |
|
75 |
+ <img src="../../../../resources/img/right.png" alt="" /> |
|
76 |
+ </div> |
|
77 |
+ </div> |
|
78 |
+ </div> |
|
100 | 79 |
</template> |
101 | 80 |
|
102 | 81 |
<script> |
103 | 82 |
import axios from "axios"; |
104 | 83 |
|
105 | 84 |
export default { |
106 |
- data() { |
|
107 |
- return { |
|
108 |
- timer: "00", |
|
109 |
- prblmId: "PROBLEM_000000000000003", |
|
110 |
- problemDetail: [], |
|
111 |
- dataList: [], |
|
112 |
- prblmExpln: null, |
|
113 |
- accessTime: null, |
|
114 |
- answer: null, |
|
115 |
- prblmLogAnsCnt: 0, |
|
116 |
- }; |
|
85 |
+ data() { |
|
86 |
+ return { |
|
87 |
+ timer: "00", |
|
88 |
+ prblmId: "PROBLEM_000000000000003", |
|
89 |
+ problemDetail: [], |
|
90 |
+ dataList: [], |
|
91 |
+ prblmExpln: null, |
|
92 |
+ accessTime: null, |
|
93 |
+ answer: null, |
|
94 |
+ prblmLogAnsCnt: 0, |
|
95 |
+ }; |
|
96 |
+ }, |
|
97 |
+ methods: { |
|
98 |
+ goToPage(page) { |
|
99 |
+ this.$router.push({ name: page }); |
|
117 | 100 |
}, |
118 |
- methods: { |
|
119 |
- goToPage(page) { |
|
120 |
- this.$router.push({ name: page }); |
|
121 |
- }, |
|
122 |
- startTimer() { |
|
123 |
- if (this.intervalId) { |
|
124 |
- clearInterval(this.intervalId); |
|
125 |
- } |
|
126 |
- this.timer = 5; |
|
127 |
- this.intervalId = setInterval(() => { |
|
128 |
- if (this.timer > 0) { |
|
129 |
- this.timer--; |
|
130 |
- } else { |
|
131 |
- clearInterval(this.intervalId); |
|
132 |
- } |
|
133 |
- }, 1000); |
|
134 |
- }, |
|
135 |
- problemSearch() { |
|
136 |
- const vm = this; |
|
137 |
- sessionStorage.setItem("prblmId", JSON.stringify(vm.prblmId)); |
|
138 |
- // vm.prblmId = JSON.parse(sessionStorage.getItem("prblmId")); |
|
139 |
- axios({ |
|
140 |
- url: "problem/problemInfo.json", |
|
141 |
- method: "post", |
|
142 |
- headers: { |
|
143 |
- "Content-Type": "application/json; charset=UTF-8", |
|
144 |
- }, |
|
145 |
- data: { |
|
146 |
- prblmId: vm.prblmId, |
|
147 |
- }, |
|
148 |
- }) |
|
149 |
- .then(function (res) { |
|
150 |
- console.log("problem - response : ", res.data); |
|
151 |
- vm.dataList = res.data.problem; |
|
152 |
- vm.problemDetail = res.data.problemDetail; |
|
153 |
- }) |
|
154 |
- .catch(function (error) { |
|
155 |
- console.log("problem - error : ", error); |
|
156 |
- }); |
|
157 |
- }, |
|
158 |
- |
|
159 |
- // 문제 풀이 전송 |
|
160 |
- handleSubmitAnswer() { |
|
161 |
- const vm = this; |
|
162 |
- // const accessTime = new Date(); |
|
163 |
- // const formattedTime = |
|
164 |
- // this.formatToTimestampWithoutTimeZone(accessTime); |
|
165 |
- axios({ |
|
166 |
- url: "problemLog/insertProblemLog.json", |
|
167 |
- method: "post", |
|
168 |
- headers: { |
|
169 |
- "Content-Type": "application/json; charset=UTF-8", |
|
170 |
- }, |
|
171 |
- data: { |
|
172 |
- prblmAns: vm.answer, |
|
173 |
- prblmLogAnsCnt: vm.prblmLogAnsCnt + 1, |
|
174 |
- stdId: "2", |
|
175 |
- // prblmStrtTm: formattedTime, |
|
176 |
- prblmId: vm.prblmId, |
|
177 |
- }, |
|
178 |
- }) |
|
179 |
- .then(function (res) { |
|
180 |
- console.log("answer submit - response : ", res.data); |
|
181 |
- }) |
|
182 |
- .catch(function (error) { |
|
183 |
- console.log("answer submit - error : ", error); |
|
184 |
- }); |
|
185 |
- }, |
|
186 |
- |
|
187 |
- handleCheck(value) { |
|
188 |
- this.answer = value; |
|
189 |
- console.log(this.answer); |
|
190 |
- }, |
|
191 |
- |
|
192 |
- // 풀이 시작 시간 |
|
193 |
- created() { |
|
194 |
- const now = new Date(); |
|
195 |
- this.accessTime = this.formatToTimestampWithoutTimeZone(now); |
|
196 |
- console.log("Formatted timestamp: ", this.accessTime); |
|
197 |
- }, |
|
198 |
- formatToTimestampWithoutTimeZone(date) { |
|
199 |
- const year = date.getFullYear(); |
|
200 |
- const month = String(date.getMonth() + 1).padStart(2, "0"); |
|
201 |
- const day = String(date.getDate()).padStart(2, "0"); |
|
202 |
- const hours = String(date.getHours()).padStart(2, "0"); |
|
203 |
- const minutes = String(date.getMinutes()).padStart(2, "0"); |
|
204 |
- const seconds = String(date.getSeconds()).padStart(2, "0"); |
|
205 |
- |
|
206 |
- return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
|
207 |
- }, |
|
101 |
+ startTimer() { |
|
102 |
+ if (this.intervalId) { |
|
103 |
+ clearInterval(this.intervalId); |
|
104 |
+ } |
|
105 |
+ this.timer = 5; |
|
106 |
+ this.intervalId = setInterval(() => { |
|
107 |
+ if (this.timer > 0) { |
|
108 |
+ this.timer--; |
|
109 |
+ } else { |
|
110 |
+ clearInterval(this.intervalId); |
|
111 |
+ } |
|
112 |
+ }, 1000); |
|
208 | 113 |
}, |
209 |
- watch: {}, |
|
210 |
- computed: {}, |
|
211 |
- components: {}, |
|
212 |
- mounted() { |
|
213 |
- this.problemSearch(); |
|
214 |
- this.created(); |
|
114 |
+ problemSearch() { |
|
115 |
+ const vm = this; |
|
116 |
+ sessionStorage.setItem("prblmId", JSON.stringify(vm.prblmId)); |
|
117 |
+ // vm.prblmId = JSON.parse(sessionStorage.getItem("prblmId")); |
|
118 |
+ axios({ |
|
119 |
+ url: "problem/problemInfo.json", |
|
120 |
+ method: "post", |
|
121 |
+ headers: { |
|
122 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
123 |
+ }, |
|
124 |
+ data: { |
|
125 |
+ prblmId: vm.prblmId, |
|
126 |
+ }, |
|
127 |
+ }) |
|
128 |
+ .then(function (res) { |
|
129 |
+ console.log("problem - response : ", res.data); |
|
130 |
+ vm.dataList = res.data.problem; |
|
131 |
+ vm.problemDetail = res.data.problemDetail; |
|
132 |
+ }) |
|
133 |
+ .catch(function (error) { |
|
134 |
+ console.log("problem - error : ", error); |
|
135 |
+ }); |
|
215 | 136 |
}, |
216 |
- beforeUnmount() { |
|
217 |
- sessionStorage.removeItem("previewNote"); |
|
137 |
+ |
|
138 |
+ // 문제 풀이 전송 |
|
139 |
+ handleSubmitAnswer() { |
|
140 |
+ const vm = this; |
|
141 |
+ // const accessTime = new Date(); |
|
142 |
+ // const formattedTime = |
|
143 |
+ // this.formatToTimestampWithoutTimeZone(accessTime); |
|
144 |
+ axios({ |
|
145 |
+ url: "problemLog/insertProblemLog.json", |
|
146 |
+ method: "post", |
|
147 |
+ headers: { |
|
148 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
149 |
+ }, |
|
150 |
+ data: { |
|
151 |
+ prblmAns: vm.answer, |
|
152 |
+ prblmLogAnsCnt: vm.prblmLogAnsCnt + 1, |
|
153 |
+ stdId: "2", |
|
154 |
+ // prblmStrtTm: formattedTime, |
|
155 |
+ prblmId: vm.prblmId, |
|
156 |
+ }, |
|
157 |
+ }) |
|
158 |
+ .then(function (res) { |
|
159 |
+ console.log("answer submit - response : ", res.data); |
|
160 |
+ }) |
|
161 |
+ .catch(function (error) { |
|
162 |
+ console.log("answer submit - error : ", error); |
|
163 |
+ }); |
|
218 | 164 |
}, |
165 |
+ |
|
166 |
+ handleCheck(value) { |
|
167 |
+ this.answer = value; |
|
168 |
+ console.log(this.answer); |
|
169 |
+ }, |
|
170 |
+ |
|
171 |
+ // 풀이 시작 시간 |
|
172 |
+ created() { |
|
173 |
+ const now = new Date(); |
|
174 |
+ this.accessTime = this.formatToTimestampWithoutTimeZone(now); |
|
175 |
+ console.log("Formatted timestamp: ", this.accessTime); |
|
176 |
+ }, |
|
177 |
+ formatToTimestampWithoutTimeZone(date) { |
|
178 |
+ const year = date.getFullYear(); |
|
179 |
+ const month = String(date.getMonth() + 1).padStart(2, "0"); |
|
180 |
+ const day = String(date.getDate()).padStart(2, "0"); |
|
181 |
+ const hours = String(date.getHours()).padStart(2, "0"); |
|
182 |
+ const minutes = String(date.getMinutes()).padStart(2, "0"); |
|
183 |
+ const seconds = String(date.getSeconds()).padStart(2, "0"); |
|
184 |
+ |
|
185 |
+ return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
|
186 |
+ }, |
|
187 |
+ handleSubmit() { |
|
188 |
+ console.log("정답 : ", this.answer); |
|
189 |
+ }, |
|
190 |
+ }, |
|
191 |
+ watch: {}, |
|
192 |
+ computed: {}, |
|
193 |
+ components: {}, |
|
194 |
+ mounted() { |
|
195 |
+ this.problemSearch(); |
|
196 |
+ this.created(); |
|
197 |
+ }, |
|
198 |
+ beforeUnmount() { |
|
199 |
+ sessionStorage.removeItem("previewNote"); |
|
200 |
+ }, |
|
219 | 201 |
}; |
220 | 202 |
</script> |
221 | 203 |
<style scoped> |
222 | 204 |
.inputbox { |
223 |
- font-size: 38px; |
|
224 |
- font-family: "Pretendard-ExtraBold"; |
|
205 |
+ font-size: 38px; |
|
206 |
+ font-family: "Pretendard-ExtraBold"; |
|
225 | 207 |
} |
226 | 208 |
|
227 | 209 |
.imgGroup button { |
228 |
- position: relative; |
|
210 |
+ position: relative; |
|
229 | 211 |
} |
230 | 212 |
|
231 | 213 |
.imgGroup button p, |
232 | 214 |
.textbox p { |
233 |
- position: absolute; |
|
234 |
- top: 50%; |
|
235 |
- left: 50%; |
|
236 |
- transform: translate(-50%, -50%); |
|
237 |
- width: fit-content; |
|
238 |
- height: fit-content; |
|
239 |
- background: #ffffffb8; |
|
240 |
- border-radius: 5px; |
|
241 |
- padding: 10px; |
|
242 |
- font-size: 48px; |
|
243 |
- font-family: "ONEMobilePOP"; |
|
215 |
+ position: absolute; |
|
216 |
+ top: 50%; |
|
217 |
+ left: 50%; |
|
218 |
+ transform: translate(-50%, -50%); |
|
219 |
+ width: fit-content; |
|
220 |
+ height: fit-content; |
|
221 |
+ background: #ffffffb8; |
|
222 |
+ border-radius: 5px; |
|
223 |
+ padding: 10px; |
|
224 |
+ font-size: 48px; |
|
225 |
+ font-family: "ONEMobilePOP"; |
|
244 | 226 |
} |
245 | 227 |
|
246 | 228 |
.pickGroup { |
247 |
- padding: 0px 80px; |
|
229 |
+ padding: 0px 80px; |
|
248 | 230 |
} |
249 | 231 |
|
250 | 232 |
.pickGroup p { |
251 |
- font-size: 34px; |
|
252 |
- font-weight: bold; |
|
233 |
+ font-size: 34px; |
|
234 |
+ font-weight: bold; |
|
253 | 235 |
} |
254 | 236 |
|
255 | 237 |
.pickGroup button { |
256 |
- position: relative; |
|
257 |
- margin-right: 30px; |
|
238 |
+ position: relative; |
|
239 |
+ margin-right: 30px; |
|
258 | 240 |
} |
259 | 241 |
|
260 | 242 |
.pickGroup button p { |
261 |
- font-size: 34px; |
|
262 |
- color: #c6c6c6; |
|
263 |
- position: absolute; |
|
264 |
- top: 50%; |
|
265 |
- left: 50%; |
|
266 |
- transform: translate(-50%, -50%); |
|
243 |
+ font-size: 34px; |
|
244 |
+ color: #c6c6c6; |
|
245 |
+ position: absolute; |
|
246 |
+ top: 50%; |
|
247 |
+ left: 50%; |
|
248 |
+ transform: translate(-50%, -50%); |
|
267 | 249 |
} |
268 | 250 |
.pickGroup button p.active { |
269 |
- color: #000000; |
|
251 |
+ color: #000000; |
|
252 |
+} |
|
253 |
+ |
|
254 |
+.submit-button { |
|
255 |
+ position: absolute; |
|
256 |
+ background-color: #ffba08; |
|
257 |
+ padding: 10px 30px; |
|
258 |
+ border-radius: 10px; |
|
259 |
+ font-size: 28px; |
|
260 |
+ font-family: "ONEMobilePOPOTF"; |
|
261 |
+ right: 5rem; |
|
262 |
+ bottom: 3rem; |
|
270 | 263 |
} |
271 | 264 |
</style> |
--- client/views/pages/main/Chapter/Chapter3_8.vue
+++ client/views/pages/main/Chapter/Chapter3_8.vue
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 |
<div id="Chapter1_1" class="content-wrap"> |
3 | 3 |
<div style="margin: 30px 0px 50px; width: 20%"> |
4 | 4 |
<router-link to="/MyPlan.page"> |
5 |
- <div class="logo mb25"><img src="../../../../resources/img/logo2.png" alt=""></div> |
|
5 |
+ <div class="logo mb25"><img src="../../../../resources/img/logo2.png" alt="" /></div> |
|
6 | 6 |
</router-link> |
7 | 7 |
</div> |
8 | 8 |
<div class="title-box mb25 flex align-center mt40"> |
... | ... | @@ -10,11 +10,11 @@ |
10 | 10 |
<span class="subtitle">my name is dd</span> |
11 | 11 |
</div> |
12 | 12 |
<div class="flex justify-between align-center"> |
13 |
- <div class="pre-btn" @click="goToPage('Chapter3_7')"><img src="../../../../resources/img/left.png" alt=""></div> |
|
13 |
+ <div class="pre-btn" @click="goToPage('Chapter3_7')"><img src="../../../../resources/img/left.png" alt="" /></div> |
|
14 | 14 |
<div class="content title-box"> |
15 | 15 |
<p class="title mt25 title-bg">step3.</p> |
16 | 16 |
<div class="flex align-center mb30"> |
17 |
- <p class="subtitle2 mr20">주어진 단어 중 인 것을 고르세요.</p> |
|
17 |
+ <p class="subtitle2 mr20">그림을 보고 철자를 바르게 배열하세요.</p> |
|
18 | 18 |
<!-- <button><img src="../../../../resources/img/btn10_s.png" alt=""> |
19 | 19 |
</button> --> |
20 | 20 |
</div> |
... | ... | @@ -32,50 +32,41 @@ |
32 | 32 |
</div> |
33 | 33 |
</div> |
34 | 34 |
<div class="imgGroup flex align-center justify-center mt50"> |
35 |
- <img src="../../../../resources/img/img114_57s.png" alt=""> |
|
36 |
- <input class="yellow-bd ml50" style="width: 30%;" type="text" name="" id="" placeholder="답을 입력하세요."> |
|
37 |
- |
|
38 |
- </div> |
|
39 |
- <div class="flex justify-center mt40 "> |
|
40 |
- <div class="dragGroup flex " style="gap: 50px;"> |
|
41 |
- <button><img src="../../../../resources/img/img63_37s.png" alt=""> |
|
42 |
- <p @click="handleDrag(1)">A</p> |
|
43 |
- </button> |
|
44 |
- <button><img src="../../../../resources/img/img63_37s_1.png" alt=""> |
|
45 |
- <p @click="handleDrag(1)">A</p> |
|
46 |
- </button> |
|
47 |
- <button><img src="../../../../resources/img/img63_37s.png" alt=""> |
|
48 |
- <p @click="handleDrag(1)">A</p> |
|
49 |
- </button> |
|
50 |
- <button><img src="../../../../resources/img/img63_37s_2.png" alt=""> |
|
51 |
- <p @click="handleDrag(1)">A</p> |
|
52 |
- </button> |
|
53 |
- <button><img src="../../../../resources/img/img63_37s_1.png" alt=""> |
|
54 |
- <p @click="handleDrag(1)">A</p> |
|
55 |
- </button> |
|
56 |
- <button><img src="../../../../resources/img/img63_37s_2.png" alt=""> |
|
57 |
- <p @click="handleDrag(1)">A</p> |
|
58 |
- </button> |
|
35 |
+ <img src="../../../../resources/img/img114_57s.png" alt="" /> |
|
36 |
+ <div class="flex justify-center mt40"> |
|
37 |
+ <div class="dragGroup flex" style="gap: 50px"> |
|
38 |
+ <button v-for="(char, index) in word_shuffle" :key="index"> |
|
39 |
+ <img :src="items_card[index % items_card.length]" alt="" /> |
|
40 |
+ <p>{{ char }}</p> |
|
41 |
+ </button> |
|
42 |
+ </div> |
|
59 | 43 |
</div> |
60 |
- |
|
44 |
+ <input class="yellow-bd" v-model="answer" style="width: 45%" type="text" placeholder="답을 입력하세요." /> |
|
61 | 45 |
</div> |
62 | 46 |
</div> |
47 |
+ <button class="submit-button" @click="handleSubmit()">제출하기</button> |
|
63 | 48 |
</div> |
64 |
- <div class="next-btn" @click="goToPage('Chapter3_9')"><img src="../../../../resources/img/right.png" alt=""></div> |
|
49 |
+ <div class="next-btn" @click="goToPage('Chapter3_9')"><img src="../../../../resources/img/right.png" alt="" /></div> |
|
65 | 50 |
</div> |
66 | 51 |
</div> |
67 | 52 |
</template> |
68 |
- |
|
53 |
+ |
|
69 | 54 |
<script> |
70 | 55 |
export default { |
71 | 56 |
data() { |
72 | 57 |
return { |
73 |
- timer: '00', |
|
74 |
- showButton1: false, |
|
75 |
- showButton2: false, |
|
76 |
- showButton3: false, |
|
77 |
- showButton4: false, |
|
78 |
- } |
|
58 |
+ timer: "00", |
|
59 |
+ items_card: [ |
|
60 |
+ "client/resources/img/img63_37s.png", |
|
61 |
+ "client/resources/img/img63_37s_1.png", |
|
62 |
+ "client/resources/img/img63_37s.png", |
|
63 |
+ "client/resources/img/img63_37s_2.png", |
|
64 |
+ "client/resources/img/img63_37s_1.png", |
|
65 |
+ "client/resources/img/img63_37s_2.png", |
|
66 |
+ ], |
|
67 |
+ word_shuffle: "docul", |
|
68 |
+ answer: null, |
|
69 |
+ }; |
|
79 | 70 |
}, |
80 | 71 |
methods: { |
81 | 72 |
goToPage(page) { |
... | ... | @@ -117,22 +108,20 @@ |
117 | 108 |
clearInterval(this.intervalId); |
118 | 109 |
} |
119 | 110 |
}, 1000); |
120 |
- } |
|
111 |
+ }, |
|
112 |
+ handleSubmit() { |
|
113 |
+ console.log("정답 : ", this.answer); |
|
114 |
+ this.answer = null; |
|
115 |
+ }, |
|
121 | 116 |
}, |
122 |
- watch: { |
|
123 |
- |
|
124 |
- }, |
|
125 |
- computed: { |
|
126 |
- |
|
127 |
- }, |
|
128 |
- components: { |
|
129 |
- }, |
|
130 |
- mounted() { |
|
131 |
- |
|
132 |
- } |
|
133 |
-} |
|
117 |
+ watch: {}, |
|
118 |
+ computed: {}, |
|
119 |
+ components: {}, |
|
120 |
+ mounted() {}, |
|
121 |
+}; |
|
134 | 122 |
</script> |
135 |
-<style scoped>.dropGroup button { |
|
123 |
+<style scoped> |
|
124 |
+.dropGroup button { |
|
136 | 125 |
position: relative; |
137 | 126 |
} |
138 | 127 |
|
... | ... | @@ -141,12 +130,29 @@ |
141 | 130 |
} |
142 | 131 |
|
143 | 132 |
.dragGroup { |
144 |
- background-color: #F2F4F8; |
|
145 |
- padding: 30px 50px; |
|
133 |
+ background-color: #f2f4f8; |
|
134 |
+ padding: 10px 20px; |
|
146 | 135 |
width: max-content; |
147 | 136 |
border-radius: 20px; |
148 | 137 |
} |
149 | 138 |
|
150 |
-.dragGroup button p { |
|
139 |
+.dragGroup p { |
|
151 | 140 |
font-size: 48px; |
152 |
-}</style>(No newline at end of file) |
|
141 |
+} |
|
142 |
+ |
|
143 |
+.imgGroup { |
|
144 |
+ flex-direction: column; |
|
145 |
+ gap: 20px; |
|
146 |
+} |
|
147 |
+ |
|
148 |
+.submit-button { |
|
149 |
+ position: absolute; |
|
150 |
+ background-color: #ffba08; |
|
151 |
+ padding: 10px 30px; |
|
152 |
+ border-radius: 10px; |
|
153 |
+ font-size: 28px; |
|
154 |
+ font-family: "ONEMobilePOPOTF"; |
|
155 |
+ right: 5rem; |
|
156 |
+ bottom: 3rem; |
|
157 |
+} |
|
158 |
+</style> |
--- client/views/pages/main/Chapter/Chapter3_9.vue
+++ client/views/pages/main/Chapter/Chapter3_9.vue
... | ... | @@ -1,218 +1,223 @@ |
1 | 1 |
<template> |
2 |
- <div id="Chapter1_1" class="content-wrap"> |
|
3 |
- <div style="margin: 30px 0px 50px; width: 20%"> |
|
4 |
- <router-link to="/MyPlan.page"> |
|
5 |
- <div class="logo mb25"> |
|
6 |
- <img src="../../../../resources/img/logo2.png" alt="" /> |
|
7 |
- </div> |
|
8 |
- </router-link> |
|
2 |
+ <div id="Chapter1_1" class="content-wrap"> |
|
3 |
+ <div style="margin: 30px 0px 50px; width: 20%"> |
|
4 |
+ <router-link to="/MyPlan.page"> |
|
5 |
+ <div class="logo mb25"> |
|
6 |
+ <img src="../../../../resources/img/logo2.png" alt="" /> |
|
9 | 7 |
</div> |
10 |
- <div class="title-box mb25 flex align-center mt40"> |
|
11 |
- <span class="title mr40">1. Hello WORLD</span> |
|
12 |
- <span class="subtitle">my name is dd</span> |
|
13 |
- </div> |
|
14 |
- <div class="flex justify-between align-center"> |
|
15 |
- <div class="pre-btn" @click="goToPage('Chapter3_8')"> |
|
16 |
- <img src="../../../../resources/img/left.png" alt="" /> |
|
17 |
- </div> |
|
18 |
- <div class="content title-box"> |
|
19 |
- <p class="title mt25 title-bg">step3.</p> |
|
20 |
- <div class="flex align-center mb30"> |
|
21 |
- <p class="subtitle2 mr20">{{ dataList.prblmExpln }}</p> |
|
22 |
- <!-- <button><img src="../../../../resources/img/btn10_s.png" alt=""> |
|
8 |
+ </router-link> |
|
9 |
+ </div> |
|
10 |
+ <div class="title-box mb25 flex align-center mt40"> |
|
11 |
+ <span class="title mr40">1. Hello WORLD</span> |
|
12 |
+ <span class="subtitle">my name is dd</span> |
|
13 |
+ </div> |
|
14 |
+ <div class="flex justify-between align-center"> |
|
15 |
+ <div class="pre-btn" @click="goToPage('Chapter3_8')"> |
|
16 |
+ <img src="../../../../resources/img/left.png" alt="" /> |
|
17 |
+ </div> |
|
18 |
+ <div class="content title-box"> |
|
19 |
+ <p class="title mt25 title-bg">step3.</p> |
|
20 |
+ <div class="flex align-center mb30"> |
|
21 |
+ <p class="subtitle2 mr20">{{ dataList.prblmExpln }}</p> |
|
22 |
+ <!-- <button><img src="../../../../resources/img/btn10_s.png" alt=""> |
|
23 | 23 |
</button> --> |
24 |
- </div> |
|
24 |
+ </div> |
|
25 | 25 |
|
26 |
- <div class="mt50 text-ct"> |
|
27 |
- <div class="time-hint"> |
|
28 |
- <button class="hint-btn">HINT</button> |
|
29 |
- <div class="time-bg mt20"> |
|
30 |
- <div> |
|
31 |
- <div class="time"> |
|
32 |
- <p class="second">{{ timer }}</p> |
|
33 |
- <p class="text">sec</p> |
|
34 |
- </div> |
|
35 |
- </div> |
|
36 |
- </div> |
|
37 |
- </div> |
|
38 |
- <div class="imgGroup mt50"> |
|
39 |
- <!-- <img |
|
26 |
+ <div class="mt50 text-ct"> |
|
27 |
+ <div class="time-hint"> |
|
28 |
+ <button class="hint-btn">HINT</button> |
|
29 |
+ <div class="time-bg mt20"> |
|
30 |
+ <div> |
|
31 |
+ <div class="time"> |
|
32 |
+ <p class="second">{{ timer }}</p> |
|
33 |
+ <p class="text">sec</p> |
|
34 |
+ </div> |
|
35 |
+ </div> |
|
36 |
+ </div> |
|
37 |
+ </div> |
|
38 |
+ <div class="imgGroup mt50"> |
|
39 |
+ <!-- <img |
|
40 | 40 |
src="../../../../resources/img/img115_58s.png" |
41 | 41 |
alt="" |
42 | 42 |
/> --> |
43 |
- <div class="mt50"> |
|
44 |
- <input |
|
45 |
- class="yellow-bd" |
|
46 |
- type="text" |
|
47 |
- name="" |
|
48 |
- id="" |
|
49 |
- placeholder="답을 입력하세요." |
|
50 |
- v-model="answer" |
|
51 |
- @change="submitAnswer" |
|
52 |
- /> |
|
53 |
- </div> |
|
54 |
- </div> |
|
55 |
- </div> |
|
43 |
+ <div class="mt50"> |
|
44 |
+ <input class="yellow-bd" type="text" name="" id="" placeholder="답을 입력하세요." v-model="answer" @change="submitAnswer" /> |
|
56 | 45 |
</div> |
57 |
- <div |
|
58 |
- class="next-btn" |
|
59 |
- @click=" |
|
60 |
- [ |
|
61 |
- goToPage('Chapter3_10'), |
|
62 |
- // handleSubmitAnswer() |
|
63 |
- ] |
|
64 |
- " |
|
65 |
- > |
|
66 |
- <img src="../../../../resources/img/right.png" alt="" /> |
|
67 |
- </div> |
|
46 |
+ </div> |
|
68 | 47 |
</div> |
48 |
+ <!-- <button class="submit-button" @click="handleSubmitAnswer()">제출하기</button> --> |
|
49 |
+ <button class="submit-button" @click="submitAnswer()">제출하기</button> |
|
50 |
+ </div> |
|
51 |
+ <div |
|
52 |
+ class="next-btn" |
|
53 |
+ @click=" |
|
54 |
+ [ |
|
55 |
+ goToPage('Chapter3_10'), |
|
56 |
+ // handleSubmitAnswer() |
|
57 |
+ ] |
|
58 |
+ " |
|
59 |
+ > |
|
60 |
+ <img src="../../../../resources/img/right.png" alt="" /> |
|
61 |
+ </div> |
|
69 | 62 |
</div> |
63 |
+ </div> |
|
70 | 64 |
</template> |
71 | 65 |
|
72 | 66 |
<script> |
73 | 67 |
import axios from "axios"; |
74 | 68 |
export default { |
75 |
- data() { |
|
76 |
- return { |
|
77 |
- timer: "00", |
|
78 |
- showButton1: false, |
|
79 |
- showButton2: false, |
|
80 |
- showButton3: false, |
|
81 |
- showButton4: false, |
|
69 |
+ data() { |
|
70 |
+ return { |
|
71 |
+ timer: "00", |
|
72 |
+ showButton1: false, |
|
73 |
+ showButton2: false, |
|
74 |
+ showButton3: false, |
|
75 |
+ showButton4: false, |
|
82 | 76 |
|
83 |
- problemDetail: [], |
|
84 |
- dataList: [], |
|
85 |
- prblmExpln: null, |
|
86 |
- prblmId: "1004", |
|
87 |
- answer: null, |
|
88 |
- }; |
|
77 |
+ problemDetail: [], |
|
78 |
+ dataList: [], |
|
79 |
+ prblmExpln: null, |
|
80 |
+ prblmId: "1004", |
|
81 |
+ answer: null, |
|
82 |
+ }; |
|
83 |
+ }, |
|
84 |
+ methods: { |
|
85 |
+ goToPage(page) { |
|
86 |
+ this.$router.push({ name: page }); |
|
89 | 87 |
}, |
90 |
- methods: { |
|
91 |
- goToPage(page) { |
|
92 |
- this.$router.push({ name: page }); |
|
88 |
+ handleDrag(dragNumber) { |
|
89 |
+ // Drag 버튼 숨기기 |
|
90 |
+ // 여기서는 상태 관리를 통해 버튼을 제어합니다. |
|
91 |
+ if (dragNumber === 1) { |
|
92 |
+ this.showButton1 = false; |
|
93 |
+ } else if (dragNumber === 2) { |
|
94 |
+ this.showButton2 = false; |
|
95 |
+ } else if (dragNumber === 3) { |
|
96 |
+ this.showButton3 = false; |
|
97 |
+ } |
|
98 |
+ }, |
|
99 |
+ showButton(dropNumber) { |
|
100 |
+ // Drop 영역의 이미지 클릭 이벤트 핸들러 설정 |
|
101 |
+ // 여기서는 상태 관리를 통해 버튼을 보이게 합니다. |
|
102 |
+ if (dropNumber === 1) { |
|
103 |
+ this.showButton1 = true; |
|
104 |
+ } else if (dropNumber === 2) { |
|
105 |
+ this.showButton2 = true; |
|
106 |
+ } else if (dropNumber === 3) { |
|
107 |
+ this.showButton3 = true; |
|
108 |
+ } else if (dropNumber === 4) { |
|
109 |
+ this.showButton4 = true; |
|
110 |
+ } |
|
111 |
+ }, |
|
112 |
+ startTimer() { |
|
113 |
+ if (this.intervalId) { |
|
114 |
+ clearInterval(this.intervalId); |
|
115 |
+ } |
|
116 |
+ this.timer = 5; |
|
117 |
+ this.intervalId = setInterval(() => { |
|
118 |
+ if (this.timer > 0) { |
|
119 |
+ this.timer--; |
|
120 |
+ } else { |
|
121 |
+ clearInterval(this.intervalId); |
|
122 |
+ } |
|
123 |
+ }, 1000); |
|
124 |
+ }, |
|
125 |
+ problemSearch() { |
|
126 |
+ const vm = this; |
|
127 |
+ sessionStorage.setItem("prblmId", JSON.stringify(vm.prblmId)); |
|
128 |
+ // vm.prblmId = JSON.parse(sessionStorage.getItem("prblmId")); |
|
129 |
+ axios({ |
|
130 |
+ url: "problem/problemInfo.json", |
|
131 |
+ method: "post", |
|
132 |
+ headers: { |
|
133 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
93 | 134 |
}, |
94 |
- handleDrag(dragNumber) { |
|
95 |
- // Drag 버튼 숨기기 |
|
96 |
- // 여기서는 상태 관리를 통해 버튼을 제어합니다. |
|
97 |
- if (dragNumber === 1) { |
|
98 |
- this.showButton1 = false; |
|
99 |
- } else if (dragNumber === 2) { |
|
100 |
- this.showButton2 = false; |
|
101 |
- } else if (dragNumber === 3) { |
|
102 |
- this.showButton3 = false; |
|
103 |
- } |
|
135 |
+ data: { |
|
136 |
+ prblmId: vm.prblmId, |
|
104 | 137 |
}, |
105 |
- showButton(dropNumber) { |
|
106 |
- // Drop 영역의 이미지 클릭 이벤트 핸들러 설정 |
|
107 |
- // 여기서는 상태 관리를 통해 버튼을 보이게 합니다. |
|
108 |
- if (dropNumber === 1) { |
|
109 |
- this.showButton1 = true; |
|
110 |
- } else if (dropNumber === 2) { |
|
111 |
- this.showButton2 = true; |
|
112 |
- } else if (dropNumber === 3) { |
|
113 |
- this.showButton3 = true; |
|
114 |
- } else if (dropNumber === 4) { |
|
115 |
- this.showButton4 = true; |
|
116 |
- } |
|
117 |
- }, |
|
118 |
- startTimer() { |
|
119 |
- if (this.intervalId) { |
|
120 |
- clearInterval(this.intervalId); |
|
121 |
- } |
|
122 |
- this.timer = 5; |
|
123 |
- this.intervalId = setInterval(() => { |
|
124 |
- if (this.timer > 0) { |
|
125 |
- this.timer--; |
|
126 |
- } else { |
|
127 |
- clearInterval(this.intervalId); |
|
128 |
- } |
|
129 |
- }, 1000); |
|
130 |
- }, |
|
131 |
- problemSearch() { |
|
132 |
- const vm = this; |
|
133 |
- sessionStorage.setItem("prblmId", JSON.stringify(vm.prblmId)); |
|
134 |
- // vm.prblmId = JSON.parse(sessionStorage.getItem("prblmId")); |
|
135 |
- axios({ |
|
136 |
- url: "problem/problemInfo.json", |
|
137 |
- method: "post", |
|
138 |
- headers: { |
|
139 |
- "Content-Type": "application/json; charset=UTF-8", |
|
140 |
- }, |
|
141 |
- data: { |
|
142 |
- prblmId: vm.prblmId, |
|
143 |
- }, |
|
144 |
- }) |
|
145 |
- .then(function (res) { |
|
146 |
- console.log("problem - response : ", res.data); |
|
147 |
- vm.dataList = res.data.problem; |
|
148 |
- vm.problemDetail = res.data.problemDetail; |
|
149 |
- }) |
|
150 |
- .catch(function (error) { |
|
151 |
- console.log("problem - error : ", error); |
|
152 |
- }); |
|
153 |
- }, |
|
138 |
+ }) |
|
139 |
+ .then(function (res) { |
|
140 |
+ console.log("problem - response : ", res.data); |
|
141 |
+ vm.dataList = res.data.problem; |
|
142 |
+ vm.problemDetail = res.data.problemDetail; |
|
143 |
+ }) |
|
144 |
+ .catch(function (error) { |
|
145 |
+ console.log("problem - error : ", error); |
|
146 |
+ }); |
|
147 |
+ }, |
|
154 | 148 |
|
155 |
- submitAnswer() { |
|
156 |
- console.log(this.answer); |
|
157 |
- }, |
|
149 |
+ submitAnswer() { |
|
150 |
+ console.log(this.answer); |
|
151 |
+ }, |
|
158 | 152 |
|
159 |
- // 문제 풀이 전송 |
|
160 |
- handleSubmitAnswer() { |
|
161 |
- const vm = this; |
|
162 |
- // const accessTime = new Date(); |
|
163 |
- // const formattedTime = |
|
164 |
- // this.formatToTimestampWithoutTimeZone(accessTime); |
|
165 |
- axios({ |
|
166 |
- url: "problemLog/insertProblemLog.json", |
|
167 |
- method: "post", |
|
168 |
- headers: { |
|
169 |
- "Content-Type": "application/json; charset=UTF-8", |
|
170 |
- }, |
|
171 |
- data: { |
|
172 |
- prblmAns: vm.answer, |
|
173 |
- prblmLogAnsCnt: 0, |
|
174 |
- stdId: "2", |
|
175 |
- // prblmStrtTm: formattedTime, |
|
176 |
- prblmId: vm.prblmId, |
|
177 |
- }, |
|
178 |
- }) |
|
179 |
- .then(function (res) { |
|
180 |
- console.log("answer submit - response : ", res.data); |
|
181 |
- }) |
|
182 |
- .catch(function (error) { |
|
183 |
- console.log("answer submit - error : ", error); |
|
184 |
- }); |
|
153 |
+ // 문제 풀이 전송 |
|
154 |
+ handleSubmitAnswer() { |
|
155 |
+ const vm = this; |
|
156 |
+ // const accessTime = new Date(); |
|
157 |
+ // const formattedTime = |
|
158 |
+ // this.formatToTimestampWithoutTimeZone(accessTime); |
|
159 |
+ axios({ |
|
160 |
+ url: "problemLog/insertProblemLog.json", |
|
161 |
+ method: "post", |
|
162 |
+ headers: { |
|
163 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
185 | 164 |
}, |
165 |
+ data: { |
|
166 |
+ prblmAns: vm.answer, |
|
167 |
+ prblmLogAnsCnt: 0, |
|
168 |
+ stdId: "2", |
|
169 |
+ // prblmStrtTm: formattedTime, |
|
170 |
+ prblmId: vm.prblmId, |
|
171 |
+ }, |
|
172 |
+ }) |
|
173 |
+ .then(function (res) { |
|
174 |
+ console.log("answer submit - response : ", res.data); |
|
175 |
+ }) |
|
176 |
+ .catch(function (error) { |
|
177 |
+ console.log("answer submit - error : ", error); |
|
178 |
+ }); |
|
186 | 179 |
}, |
187 |
- watch: {}, |
|
188 |
- computed: {}, |
|
189 |
- components: {}, |
|
190 |
- mounted() { |
|
191 |
- this.problemSearch(); |
|
192 |
- }, |
|
180 |
+ }, |
|
181 |
+ watch: {}, |
|
182 |
+ computed: {}, |
|
183 |
+ components: {}, |
|
184 |
+ mounted() { |
|
185 |
+ this.problemSearch(); |
|
186 |
+ }, |
|
193 | 187 |
}; |
194 | 188 |
</script> |
195 | 189 |
<style scoped> |
196 | 190 |
input.yellow-bd { |
197 |
- width: 30%; |
|
191 |
+ width: 30%; |
|
198 | 192 |
} |
199 | 193 |
|
200 | 194 |
.dropGroup button { |
201 |
- position: relative; |
|
195 |
+ position: relative; |
|
202 | 196 |
} |
203 | 197 |
|
204 | 198 |
.dropGroup button p { |
205 |
- font-size: 48px; |
|
199 |
+ font-size: 48px; |
|
206 | 200 |
} |
207 | 201 |
|
208 | 202 |
.dragGroup { |
209 |
- background-color: #f2f4f8; |
|
210 |
- padding: 30px 50px; |
|
211 |
- width: max-content; |
|
212 |
- border-radius: 20px; |
|
203 |
+ background-color: #f2f4f8; |
|
204 |
+ padding: 30px 50px; |
|
205 |
+ width: max-content; |
|
206 |
+ border-radius: 20px; |
|
213 | 207 |
} |
214 | 208 |
|
215 | 209 |
.dragGroup button p { |
216 |
- font-size: 48px; |
|
210 |
+ font-size: 48px; |
|
211 |
+} |
|
212 |
+ |
|
213 |
+.submit-button { |
|
214 |
+ position: absolute; |
|
215 |
+ background-color: #ffba08; |
|
216 |
+ padding: 10px 30px; |
|
217 |
+ border-radius: 10px; |
|
218 |
+ font-size: 28px; |
|
219 |
+ font-family: "ONEMobilePOPOTF"; |
|
220 |
+ right: 5rem; |
|
221 |
+ bottom: 3rem; |
|
217 | 222 |
} |
218 | 223 |
</style> |
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?