jichoi / lms_front star
PsHooN7979 2024-08-23
240823 박세훈 사용자 문제 풀이 저장
@041d875e9866ec3c9523439ddab64428168c04dd
client/views/pages/AppStore.js
--- client/views/pages/AppStore.js
+++ client/views/pages/AppStore.js
@@ -3,37 +3,42 @@
 // Local storage에 상태를 저장하는 함수
 function saveStateToLocalStorage(state) {
     localStorage.setItem('vuexState', JSON.stringify(state));
-  }
+}
 
 // Local storage에서 상태를 불러오는 함수
 function loadStateFromLocalStorage() {
     const savedState = localStorage.getItem('vuexState');
     if (savedState) {
-      return JSON.parse(savedState);
+        return JSON.parse(savedState);
     }
     return {
-      token: null,
-      userId: null,
-      authcd: null,
-      stdId: null,
-      schdlId: null,
-      bookId: null,
-      unitId: null,
-      unitNm: null,
-      LearningId: null,
-      currentLearningIds: [],
-      prblmTypeId: null,
-      currentLabel: null,
-      currentProblemIndex: 0,
-      textId: null,
-      wdBookIdList: [],
-      currentWdBkIndex: 0,
+        token: null,
+        userId: null,
+        authcd: null,
+        stdId: null,
+        schdlId: null,
+        bookId: null,
+        unitId: null,
+        unitNm: null,
+        LearningId: null,
+
+        // 문제
+        currentLearningIds: [],
+        prblmTypeId: null,
+        currentLabel: null,
+        currentProblemIndex: 0,
+        allProblems: [],
+
+        // 단어장
+        textId: null,
+        wdBookIdList: [],
+        currentWdBkIndex: 0,
     };
-  }
-  
+}
+
 
 export default createStore({
-    state: loadStateFromLocalStorage(), 
+    state: loadStateFromLocalStorage(),
     getters: {
         getUserInfo(state) {
             return {
@@ -60,12 +65,19 @@
         getTextId(state) {
             return state.textId;
         },
+
+        // 문제
         currentLearningId(state) {
             return state.currentLearningIds[state.currentProblemIndex];
         },
         currentLabel: (state) => state.currentLabel,
         currentProblemIndex: (state) => state.currentProblemIndex,
         prblmTypeId: (state) => state.prblmTypeId,
+        getAllProblems(state) {
+            return state.allProblems;
+        },
+
+        // 단어장
         getWdBookIdList(state) {
             return state.wdBookIdList;
         },
@@ -123,6 +135,8 @@
             state.textId = textId;
             saveStateToLocalStorage(state);
         },
+
+        // 문제
         setLearningData(state, payload) {
             state.currentLearningIds = payload.learning_id; // Array of IDs
             state.currentLabel = payload.label;
@@ -142,6 +156,21 @@
                 saveStateToLocalStorage(state);
             }
         },
+        saveOrUpdateProblem(state, problemData) {
+            const existingProblemIndex = state.allProblems.findIndex(
+                problem => problem.prblmNumber === problemData.prblmNumber
+            );
+
+            if (existingProblemIndex !== -1) {
+                // 문제 데이터 업데이트
+                state.allProblems[existingProblemIndex] = problemData;
+            } else {
+                // 새로운 문제 추가
+                state.allProblems.push(problemData);
+            }
+        },
+
+        // 단어장
         setWdBookIdList(state, wdBookIdList) {
             state.wdBookIdList = wdBookIdList;
             saveStateToLocalStorage(state);
@@ -193,12 +222,19 @@
         updateTextId({ commit }, textId) {
             commit("setTextId", textId);
         },
+
+        // 문제
         goToNextProblem({ commit }) {
             commit("incrementProblemIndex");
         },
         goToPreviousProblem({ commit }) {
             commit("decrementProblemIndex");
         },
+        saveProblemData({ commit }, problemData) {
+            commit('saveOrUpdateProblem', problemData);
+        },
+
+        // 단어장
         updateWdBookIdList({ commit }, wdBookIdList) {
             commit('setWdBookIdList', wdBookIdList);
         },
client/views/pages/main/Chapter/Chapter2_5.vue
--- client/views/pages/main/Chapter/Chapter2_5.vue
+++ client/views/pages/main/Chapter/Chapter2_5.vue
@@ -208,6 +208,12 @@
       }
     },
     nextProblem() {
+      const problemData = {
+        prblmImfo: this.currentLearningId,
+        prblmNumber: this.currentProblemIndex,
+        prblmAns: this.selectedButton
+      }
+      this.$store.dispatch('saveProblemData', problemData);
       if (this.currentProblemIndex < this.$store.state.currentLearningIds.length - 1) {
         this.$store.dispatch('goToNextProblem');
         this.handleProblemDetail(this.currentLearningId);
client/views/pages/main/Chapter/Chapter3.vue
--- client/views/pages/main/Chapter/Chapter3.vue
+++ client/views/pages/main/Chapter/Chapter3.vue
@@ -43,16 +43,17 @@
                         </div>
                     </div>
                     <div class="pickGroup">
-                        <article class="flex justify-center mb50" style="gap: 60px">
-                            <div class="flex" @click="handleClick(1)">
+                        <article class="flex justify-center mb50" style="gap: 60px"
+                            v-for="(item, index) in problemDetail" :key="index">
+                            <div class="flex" @click="handleClick(item.prblmDtlExpln)">
                                 <button>
                                     <img src="../../../../resources/img/img136_71s.png" alt="" />
-                                    <p :class="{ active: selectedButton === 1 }">1</p>
+                                    <p :class="{ active: selectedButton === item.prblmDtlExpln }">{{ index + 1 }}</p>
                                 </button>
-                                <p>guitar</p>
+                                <p>{{ item.prblmDtlExpln }}</p>
                             </div>
                         </article>
-                        <article class="flex justify-center mb50" style="gap: 60px">
+                        <!-- <article class="flex justify-center mb50" style="gap: 60px">
                             <div class="flex" @click="handleClick(2)">
                                 <button>
                                     <img src="../../../../resources/img/img136_71s.png" alt="" />
@@ -69,7 +70,7 @@
                                 </button>
                                 <p>piano</p>
                             </div>
-                        </article>
+                        </article> -->
                     </div>
                 </div>
                 <button class="submit-button" @click="handleSubmit()">제출하기</button>
@@ -92,6 +93,7 @@
             prblm_id: [],
             unit_id: null,
             dataList: [],
+            problemDetail: [],
         };
     },
     methods: {
@@ -115,8 +117,11 @@
                 }
             }, 1000);
         },
-        handleClick(number) {
-            this.selectedButton = number;
+        handleClick(answer) {
+            console.log(answer)
+            this.$store.dispatch('updatePrblmAns', answer);
+            this.selectedButton = answer;
+
         },
         // 제출하기 버튼
         handleSubmit() {
@@ -145,6 +150,12 @@
                 });
         },
         nextProblem() {
+            const problemData = {
+                prblmImfo: this.currentLearningId,
+                prblmNumber: this.currentProblemIndex,
+                prblmAns: this.selectedButton
+            }
+            this.$store.dispatch('saveProblemData', problemData);
             if (this.currentProblemIndex < this.$store.state.currentLearningIds.length - 1) {
                 this.$store.dispatch('goToNextProblem');
                 this.handleProblemDetail(this.currentLearningId);
@@ -227,6 +238,12 @@
         },
         isPreviousButtonDisabled() {
             return this.currentProblemIndex === 0;
+        },
+        getAllProblems() {
+            return this.$store.getters.getAllProblems;
+        },
+        getStdId() {
+            return this.$store.getters.getStdId;
         }
     },
     created() {
client/views/pages/main/Chapter/Chapter3_1.vue
--- client/views/pages/main/Chapter/Chapter3_1.vue
+++ client/views/pages/main/Chapter/Chapter3_1.vue
@@ -66,6 +66,7 @@
       buttonImg: "client/resources/img/img136_71s.png",
       selectedbuttonImg: "client/resources/img/img137_71s.png",
       dataList: [],
+      problemDetail: [],
     };
   },
   methods: {
@@ -94,8 +95,6 @@
     },
 
 
-
-
     getProblem() {
       const vm = this;
       const prblmId = this.currentLearningId.prblm_id;
@@ -119,6 +118,12 @@
         });
     },
     nextProblem() {
+      const problemData = {
+        prblmImfo: this.currentLearningId,
+        prblmNumber: this.currentProblemIndex,
+        prblmAns: this.selectedButton
+      }
+      this.$store.dispatch('saveProblemData', problemData);
       if (this.currentProblemIndex < this.$store.state.currentLearningIds.length - 1) {
         this.$store.dispatch('goToNextProblem');
         this.handleProblemDetail(this.currentLearningId);
client/views/pages/main/Chapter/Chapter3_10.vue
--- client/views/pages/main/Chapter/Chapter3_10.vue
+++ client/views/pages/main/Chapter/Chapter3_10.vue
@@ -14,7 +14,7 @@
       <div class="content title-box">
         <p class="title mt25 title-bg">step3.</p>
         <div class="flex align-center mb30">
-          <p class="subtitle2 mr20">듣고 알맞은 것을 고르세요.</p>
+          <p class="subtitle2 mr20">{{ currentProblemIndex + 1 }}. {{ dataList.prblmExpln }}</p>
           <button @click="playAudio">
             <img src="../../../../resources/img/btn10_s.png" alt="" />
             <audio id="audio-player" src="client/resources/audio/bank.wav" preload="auto"></audio>
@@ -57,6 +57,8 @@
     return {
       timer: "00",
       answer: null,
+      dataList: [],
+      problemDetail: [],
     };
   },
   methods: {
@@ -108,6 +110,12 @@
         });
     },
     nextProblem() {
+      const problemData = {
+        prblmImfo: this.currentLearningId,
+        prblmNumber: this.currentProblemIndex,
+        prblmAns: this.selectedButton
+      }
+      this.$store.dispatch('saveProblemData', problemData);
       if (this.currentProblemIndex < this.$store.state.currentLearningIds.length - 1) {
         this.$store.dispatch('goToNextProblem');
         this.handleProblemDetail(this.currentLearningId);
client/views/pages/main/Chapter/Chapter3_11.vue
--- client/views/pages/main/Chapter/Chapter3_11.vue
+++ client/views/pages/main/Chapter/Chapter3_11.vue
@@ -15,7 +15,7 @@
       <div class="content title-box">
         <p class="title mt25 title-bg">step3.</p>
         <div class="flex align-center mb30">
-          <p class="subtitle2 mr20">그림을 보고 빈칸을 채우세요.</p>
+          <p class="subtitle2 mr20">{{ currentProblemIndex + 1 }}. {{ dataList.prblmExpln }}</p>
           <!-- <button><img src="../../../../resources/img/btn10_s.png" alt="">
                </button> -->
         </div>
@@ -59,6 +59,8 @@
       answer1: null,
       answer2: null,
       text: "e",
+      dataList: [],
+      problemDetail: [],
     };
   },
   methods: {
@@ -107,6 +109,12 @@
         });
     },
     nextProblem() {
+      const problemData = {
+        prblmImfo: this.currentLearningId,
+        prblmNumber: this.currentProblemIndex,
+        prblmAns: this.selectedButton
+      }
+      this.$store.dispatch('saveProblemData', problemData);
       if (this.currentProblemIndex < this.$store.state.currentLearningIds.length - 1) {
         this.$store.dispatch('goToNextProblem');
         this.handleProblemDetail(this.currentLearningId);
client/views/pages/main/Chapter/Chapter3_12.vue
--- client/views/pages/main/Chapter/Chapter3_12.vue
+++ client/views/pages/main/Chapter/Chapter3_12.vue
@@ -15,7 +15,7 @@
       <div class="content title-box">
         <p class="title mt25 title-bg">step3</p>
         <div class="flex align-center mb30">
-          <p class="subtitle2 mr20">단어를 바르게 배열해 문장을 완성하세요</p>
+          <p class="subtitle2 mr20">{{ currentProblemIndex + 1 }}. {{ dataList.prblmExpln }}</p>
           <!-- <button><img src="../../../../resources/img/btn10_s.png" alt="">
                </button> -->
         </div>
@@ -76,6 +76,8 @@
       userAnswer: [], // 초기화 시 빈 배열로 설정
       draggedChar: null, // 드래그한 문자를 임시로 저장
       draggedCharIndex: null, // 드래그한 문자의 인덱스 저장
+      dataList: [],
+      problemDetail: [],
     };
   },
   methods: {
@@ -141,6 +143,12 @@
         });
     },
     nextProblem() {
+      const problemData = {
+        prblmImfo: this.currentLearningId,
+        prblmNumber: this.currentProblemIndex,
+        prblmAns: this.selectedButton
+      }
+      this.$store.dispatch('saveProblemData', problemData);
       if (this.currentProblemIndex < this.$store.state.currentLearningIds.length - 1) {
         this.$store.dispatch('goToNextProblem');
         this.handleProblemDetail(this.currentLearningId);
client/views/pages/main/Chapter/Chapter3_13.vue
--- client/views/pages/main/Chapter/Chapter3_13.vue
+++ client/views/pages/main/Chapter/Chapter3_13.vue
@@ -15,7 +15,7 @@
       <div class="content title-box">
         <p class="title mt25 title-bg">step3</p>
         <div class="flex align-center mb30">
-          <p class="subtitle2 mr20">그림과 일치하는 올바른 단어를 연결하세요.</p>
+          <p class="subtitle2 mr20">{{ currentProblemIndex + 1 }}. {{ dataList.prblmExpln }}</p>
           <!-- <button><img src="../../../../resources/img/btn10_s.png" alt="">
                </button> -->
         </div>
@@ -90,6 +90,8 @@
       pairs: [], // 매칭된 쌍을 저장
       svgWidth: "100%", // SVG의 너비
       svgHeight: "100%", // SVG의 높이
+      dataList: [],
+      problemDetail: [],
     };
   },
   methods: {
@@ -177,6 +179,12 @@
         });
     },
     nextProblem() {
+      const problemData = {
+        prblmImfo: this.currentLearningId,
+        prblmNumber: this.currentProblemIndex,
+        prblmAns: this.selectedButton
+      }
+      this.$store.dispatch('saveProblemData', problemData);
       if (this.currentProblemIndex < this.$store.state.currentLearningIds.length - 1) {
         this.$store.dispatch('goToNextProblem');
         this.handleProblemDetail(this.currentLearningId);
client/views/pages/main/Chapter/Chapter3_14.vue
--- client/views/pages/main/Chapter/Chapter3_14.vue
+++ client/views/pages/main/Chapter/Chapter3_14.vue
@@ -15,7 +15,7 @@
       <div class="content title-box">
         <p class="title mt25 title-bg">step3</p>
         <div class="flex align-center mb30">
-          <p class="subtitle2 mr20">그림에 알맞는 낱말을 쓰세요.</p>
+          <p class="subtitle2 mr20">{{ currentProblemIndex + 1 }}. {{ dataList.prblmExpln }}</p>
           <!-- <button><img src="../../../../resources/img/btn10_s.png" alt="">
                </button> -->
         </div>
@@ -55,6 +55,8 @@
     return {
       timer: "00",
       answer: null,
+      dataList: [],
+      problemDetail: [],
     };
   },
   methods: {
@@ -100,6 +102,12 @@
         });
     },
     nextProblem() {
+      const problemData = {
+        prblmImfo: this.currentLearningId,
+        prblmNumber: this.currentProblemIndex,
+        prblmAns: this.selectedButton
+      }
+      this.$store.dispatch('saveProblemData', problemData);
       if (this.currentProblemIndex < this.$store.state.currentLearningIds.length - 1) {
         this.$store.dispatch('goToNextProblem');
         this.handleProblemDetail(this.currentLearningId);
client/views/pages/main/Chapter/Chapter3_15.vue
--- client/views/pages/main/Chapter/Chapter3_15.vue
+++ client/views/pages/main/Chapter/Chapter3_15.vue
@@ -15,7 +15,7 @@
       <div class="content title-box">
         <p class="title mt25 title-bg">step3</p>
         <div class="flex align-center mb30">
-          <p class="subtitle2 mr20">듣고 올바른 대답을 말해보세요!</p>
+          <p class="subtitle2 mr20">{{ currentProblemIndex + 1 }}. {{ dataList.prblmExpln }}</p>
           <button><img src="../../../../resources/img/btn10_s.png" alt="" /></button>
         </div>
 
@@ -51,6 +51,8 @@
   data() {
     return {
       timer: "00",
+      dataList: [],
+      problemDetail: [],
     };
   },
   methods: {
@@ -93,6 +95,12 @@
         });
     },
     nextProblem() {
+      const problemData = {
+        prblmImfo: this.currentLearningId,
+        prblmNumber: this.currentProblemIndex,
+        prblmAns: this.selectedButton
+      }
+      this.$store.dispatch('saveProblemData', problemData);
       if (this.currentProblemIndex < this.$store.state.currentLearningIds.length - 1) {
         this.$store.dispatch('goToNextProblem');
         this.handleProblemDetail(this.currentLearningId);
client/views/pages/main/Chapter/Chapter3_16.vue
--- client/views/pages/main/Chapter/Chapter3_16.vue
+++ client/views/pages/main/Chapter/Chapter3_16.vue
@@ -10,7 +10,7 @@
       <span class="subtitle">my name is dd</span>
     </div>
     <div class="flex justify-between align-center">
-      <div class="pre-btn" @click="previousProblem()"><img src="../../../../resources/img/left.png" alt=""></div>
+      <div class="pre-btn" @click="goToPage('Chapter4')"><img src="../../../../resources/img/left.png" alt=""></div>
       <div class="content title-box">
         <p class="title mt25 title-bg">중간 평가 설문 조사</p>
         <div class="flex align-center mb30">
@@ -97,13 +97,12 @@
 
         </div>
       </div>
-      <div class="next-btn" @click="nextProblem()"><img src="../../../../resources/img/right.png" alt=""></div>
+      <div class="next-btn" @click="goToPage('Dashboard')"><img src="../../../../resources/img/right.png" alt=""></div>
     </div>
   </div>
 </template>
 
 <script>
-import axios from "axios";
 export default {
   data() {
     return {
@@ -161,126 +160,20 @@
           clearInterval(this.intervalId);
         }
       }, 1000);
-    },
-    getProblem() {
-      const vm = this;
-      const prblmId = this.currentLearningId.prblm_id;
-      axios({
-        url: "problem/problemInfo.json",
-        method: "post",
-        headers: {
-          "Content-Type": "application/json; charset=UTF-8",
-        },
-        data: {
-          prblmId: prblmId,
-        },
-      })
-        .then(function (res) {
-          console.log("problem - response : ", res.data);
-          vm.dataList = res.data.problem;
-          vm.problemDetail = res.data.problemDetail;
-        })
-        .catch(function (error) {
-          console.log("problem - error : ", error);
-        });
-    },
-    nextProblem() {
-      if (this.currentProblemIndex < this.$store.state.currentLearningIds.length - 1) {
-        this.$store.dispatch('goToNextProblem');
-        this.handleProblemDetail(this.currentLearningId);
-        this.goToPage(this.problemType);
-      } else {
-        // 마지막 문제면 이동
-        this.goToPage("Chapter4")
-      }
-    },
-    previousProblem() {
-      if (this.currentProblemIndex > 0) {
-        this.$store.dispatch('goToPreviousProblem');
-        this.handleProblemDetail(this.currentLearningId);
-        this.goToPage(this.problemType);
-      }
-    },
-
-    handleProblemDetail(item) {
-      if (item.prblm_type_id === "prblm_type_001") {
-        this.problemType = "Chapter3";
-      } else if (item.prblm_type_id === "prblm_type_002") {
-        this.problemType = "Chapter3_1";
-      } else if (item.prblm_type_id === "prblm_type_003") {
-        this.problemType = "Chapter3_2";
-      } else if (item.prblm_type_id === "prblm_type_004") {
-        this.problemType = "Chapter3_3";
-      } else if (item.prblm_type_id === "prblm_type_005") {
-        this.problemType = "Chapter3_3_1";
-      } else if (item.prblm_type_id === "prblm_type_006") {
-        this.problemType = "Chapter3_4";
-      } else if (item.prblm_type_id === "prblm_type_007") {
-        this.problemType = "Chapter3_5";
-      } else if (item.prblm_type_id === "prblm_type_008") {
-        this.problemType = "Chapter3_6";
-      } else if (item.prblm_type_id === "prblm_type_009") {
-        this.problemType = "Chapter3_7";
-      } else if (item.prblm_type_id === "prblm_type_010") {
-        this.problemType = "Chapter3_8";
-      } else if (item.prblm_type_id === "prblm_type_011") {
-        this.problemType = "Chapter3_9";
-      } else if (item.prblm_type_id === "prblm_type_012") {
-        this.problemType = "Chapter3_10";
-      } else if (item.prblm_type_id === "prblm_type_013") {
-        this.problemType = "Chapter3_11";
-      } else if (item.prblm_type_id === "prblm_type_014") {
-        this.problemType = "Chapter3_12";
-      } else if (item.prblm_type_id === "prblm_type_015") {
-        this.problemType = "Chapter3_13";
-      } else if (item.prblm_type_id === "prblm_type_016") {
-        this.problemType = "Chapter3_14";
-      } else if (item.prblm_type_id === "prblm_type_017") {
-        this.problemType = "Chapter3_15";
-      } else if (item.prblm_type_id === "prblm_type_018") {
-        this.problemType = "Chapter2_8";
-      } else if (item.prblm_type_id === "prblm_type_019") {
-        this.problemType = "Chapter2_7";
-      } else if (item.prblm_type_id === "prblm_type_020") {
-        this.problemType = "Chapter2_5";
-      } else if (item.prblm_type_id === "prblm_type_021") {
-        this.problemType = "Chapter2_6";
-      } else if (item.prblm_type_id === "prblm_type_022") {
-        this.problemType = "Chapter2_10";
-      } else if (item.prblm_type_id === "prblm_type_023") {
-        this.problemType = "Chapter2_11";
-      } else if (item.prblm_type_id === "prblm_type_024") {
-        this.problemType = "Chapter2_13";
-      }
-    },
-  },
-  watch: {},
-  computed: {
-    currentLearningId() {
-      return this.$store.getters.currentLearningId;
-    },
-    currentLabel() {
-      return this.$store.getters.currentLabel;
-    },
-    currentProblemIndex() {
-      return this.$store.getters.currentProblemIndex;
-    },
-    isPreviousButtonDisabled() {
-      return this.currentProblemIndex === 0;
     }
   },
-  created() {
-    console.log('Current Learning ID:', this.currentLearningId);
-    console.log('Current Label:', this.currentLabel);
-    console.log('Current Problem Index:', this.currentProblemIndex);
+  watch: {
 
-    // Fetch or process the current problem based on `currentLearningId`
   },
-  components: {},
+  computed: {
+
+  },
+  components: {
+  },
   mounted() {
-    this.getProblem()
-  },
-};
+
+  }
+}
 </script>
 <style scoped>
 .textbox {
client/views/pages/main/Chapter/Chapter3_2.vue
--- client/views/pages/main/Chapter/Chapter3_2.vue
+++ client/views/pages/main/Chapter/Chapter3_2.vue
@@ -16,7 +16,7 @@
       <div class="content title-box">
         <p class="title mt25 title-bg">step3.</p>
         <div class="flex align-center mb30">
-          <p class="subtitle2 mr20">1. see the picture</p>
+          <p class="subtitle2 mr20">{{ currentProblemIndex + 1 }}. {{ dataList.prblmExpln }}</p>
           <!-- <button><img src="../../../../resources/img/btn10_s.png" alt="">
           </button> -->
         </div>
@@ -71,6 +71,8 @@
     return {
       timer: "00",
       selectedButton: null,
+      dataList: [],
+      problemDetail: [],
     };
   },
   methods: {
@@ -123,6 +125,12 @@
         });
     },
     nextProblem() {
+      const problemData = {
+        prblmImfo: this.currentLearningId,
+        prblmNumber: this.currentProblemIndex,
+        prblmAns: this.selectedButton
+      }
+      this.$store.dispatch('saveProblemData', problemData);
       if (this.currentProblemIndex < this.$store.state.currentLearningIds.length - 1) {
         this.$store.dispatch('goToNextProblem');
         this.handleProblemDetail(this.currentLearningId);
client/views/pages/main/Chapter/Chapter3_3.vue
--- client/views/pages/main/Chapter/Chapter3_3.vue
+++ client/views/pages/main/Chapter/Chapter3_3.vue
@@ -29,12 +29,14 @@
               </div>
             </div>
           </div>
-          <div class="pickGroup mt60 flex align-center justify-center" style="gap: 100px; margin-top: 7%">
-            <article v-for="(detail, index) in problemDetail" :key="index" style="gap: 60px">
-              <div class="flex align-center" @click="handleClick(index + 1)">
+          <div class="pickGroup mt60 flex align-center justify-center"
+            style="flex-wrap: wrap; gap: 100px; margin-top: 7%; margin-left: 5%">
+            <article v-for="(detail, index) in problemDetail" :key="index"
+              style="flex: 1 0 calc(50% - 100px); bottom: 159px; left: 242px">
+              <div class="flex align-center" @click="handleClick(item)">
                 <button>
                   <img src="../../../../resources/img/img136_71s.png" alt="" />
-                  <p :class="{ active: selectedButton === index + 1 }">{{ index + 1 }}</p>
+                  <p :class="{ active: selectedButton === item }">{{ index + 1 }}</p>
                 </button>
                 <p>{{ detail.prblmDtlExpln }}</p>
               </div>
@@ -112,6 +114,12 @@
         });
     },
     nextProblem() {
+      const problemData = {
+        prblmImfo: this.currentLearningId,
+        prblmNumber: this.currentProblemIndex,
+        prblmAns: this.selectedButton
+      }
+      this.$store.dispatch('saveProblemData', problemData);
       if (this.currentProblemIndex < this.$store.state.currentLearningIds.length - 1) {
         this.$store.dispatch('goToNextProblem');
         this.handleProblemDetail(this.currentLearningId);
client/views/pages/main/Chapter/Chapter3_3_1.vue
--- client/views/pages/main/Chapter/Chapter3_3_1.vue
+++ client/views/pages/main/Chapter/Chapter3_3_1.vue
@@ -14,7 +14,7 @@
       <div class="content title-box">
         <p class="title mt25 title-bg">step3.</p>
         <div class="flex align-center mb30">
-          <p class="subtitle2 mr20">1. see the picture</p>
+          <p class="subtitle2 mr20">{{ currentProblemIndex + 1 }}. {{ dataList.prblmExpln }}</p>
           <button><img src="../../../../resources/img/btn10_s.png" alt="" /></button>
         </div>
 
@@ -80,6 +80,8 @@
     return {
       timer: "00",
       selectedButton: null,
+      dataList: [],
+      problemDetail: [],
     };
   },
   methods: {
@@ -129,6 +131,12 @@
         });
     },
     nextProblem() {
+      const problemData = {
+        prblmImfo: this.currentLearningId,
+        prblmNumber: this.currentProblemIndex,
+        prblmAns: this.selectedButton
+      }
+      this.$store.dispatch('saveProblemData', problemData);
       if (this.currentProblemIndex < this.$store.state.currentLearningIds.length - 1) {
         this.$store.dispatch('goToNextProblem');
         this.handleProblemDetail(this.currentLearningId);
client/views/pages/main/Chapter/Chapter3_4.vue
--- client/views/pages/main/Chapter/Chapter3_4.vue
+++ client/views/pages/main/Chapter/Chapter3_4.vue
@@ -18,7 +18,7 @@
       <div class="content title-box">
         <p class="title mt25 title-bg">step3.</p>
         <div class="flex align-center mb30">
-          <p class="subtitle2 mr20">{{ dataList.prblmExpln }}</p>
+          <p class="subtitle2 mr20">{{ currentProblemIndex + 1 }}. {{ dataList.prblmExpln }}</p>
           <button>
             <img src="../../../../resources/img/btn10_s.png" alt="Listen" @click="playAudio" />
             <audio id="audio-player" src="client/resources/audio/tt.wav" preload="auto"></audio>
@@ -152,6 +152,12 @@
         });
     },
     nextProblem() {
+      const problemData = {
+        prblmImfo: this.currentLearningId,
+        prblmNumber: this.currentProblemIndex,
+        prblmAns: this.selectedButton
+      }
+      this.$store.dispatch('saveProblemData', problemData);
       if (this.currentProblemIndex < this.$store.state.currentLearningIds.length - 1) {
         this.$store.dispatch('goToNextProblem');
         this.handleProblemDetail(this.currentLearningId);
client/views/pages/main/Chapter/Chapter3_5.vue
--- client/views/pages/main/Chapter/Chapter3_5.vue
+++ client/views/pages/main/Chapter/Chapter3_5.vue
@@ -14,7 +14,7 @@
       <div class="content title-box">
         <p class="title mt25 title-bg">step3.</p>
         <div class="flex align-center mb30">
-          <p class="subtitle2 mr20">1. see the picture</p>
+          <p class="subtitle2 mr20">{{ currentProblemIndex + 1 }}. {{ dataList.prblmExpln }}</p>
           <!-- <button><img src="../../../../resources/img/btn10_s.png" alt="">
           </button> -->
         </div>
@@ -79,6 +79,8 @@
     return {
       timer: "00",
       selectedButton: null,
+      dataList: [],
+      problemDetail: [],
     };
   },
   methods: {
@@ -128,6 +130,12 @@
         });
     },
     nextProblem() {
+      const problemData = {
+        prblmImfo: this.currentLearningId,
+        prblmNumber: this.currentProblemIndex,
+        prblmAns: this.selectedButton
+      }
+      this.$store.dispatch('saveProblemData', problemData);
       if (this.currentProblemIndex < this.$store.state.currentLearningIds.length - 1) {
         this.$store.dispatch('goToNextProblem');
         this.handleProblemDetail(this.currentLearningId);
client/views/pages/main/Chapter/Chapter3_6.vue
--- client/views/pages/main/Chapter/Chapter3_6.vue
+++ client/views/pages/main/Chapter/Chapter3_6.vue
@@ -14,7 +14,7 @@
       <div class="content title-box">
         <p class="title mt25 title-bg">step3.</p>
         <div class="flex align-center mb30">
-          <p class="subtitle2 mr20">듣고 알맞은 것을 고르세요.</p>
+          <p class="subtitle2 mr20">{{ currentProblemIndex + 1 }}. {{ dataList.prblmExpln }}</p>
           <button @click="playAudio"><img src="../../../../resources/img/btn10_s.png" alt="" /> <audio id="audio-player"
               src="client/resources/audio/bank.wav" preload="auto"></audio></button>
         </div>
@@ -30,9 +30,9 @@
           </div>
         </div>
 
-        <div class="imgGroup">
+        <!-- <div class="imgGroup">
           <img src="../../../../resources/img/img114_57s.png" alt="" />
-        </div>
+        </div> -->
 
         <div class="flex justify-center">
           <div class="btnGroup mt50 flex justify-between">
@@ -67,6 +67,8 @@
       selectedIndex: null,
       timer: "00",
       intervalId: null,
+      dataList: [],
+      problemDetail: [],
     };
   },
   beforeDestroy() {
@@ -126,6 +128,12 @@
         });
     },
     nextProblem() {
+      const problemData = {
+        prblmImfo: this.currentLearningId,
+        prblmNumber: this.currentProblemIndex,
+        prblmAns: this.selectedButton
+      }
+      this.$store.dispatch('saveProblemData', problemData);
       if (this.currentProblemIndex < this.$store.state.currentLearningIds.length - 1) {
         this.$store.dispatch('goToNextProblem');
         this.handleProblemDetail(this.currentLearningId);
client/views/pages/main/Chapter/Chapter3_7.vue
--- client/views/pages/main/Chapter/Chapter3_7.vue
+++ client/views/pages/main/Chapter/Chapter3_7.vue
@@ -18,10 +18,7 @@
       <div class="content title-box">
         <p class="title mt25 title-bg">step3.</p>
         <div class="flex align-center mb30">
-          <p class="subtitle2 mr20">O X 퀴즈</p>
-          <button>
-            <img src="../../../../resources/img/btn10_s.png" alt="" />
-          </button>
+          <p class="subtitle2 mr20">{{ currentProblemIndex + 1 }}. {{ dataList.prblmExpln }}</p>
         </div>
 
         <div class="text-ct">
@@ -38,7 +35,10 @@
           </div>
 
           <div class="pickGroup flex align-center justify-between mt80" style="gap: 100px">
-            <p>Q. {{ dataList.prblmExpln }}</p>
+            <!-- <p></p> -->
+            <button>
+              <img src="../../../../resources/img/btn10_s.png" alt="" />
+            </button>
             <div class="flex justify-center" style="gap: 60px">
               <article>
                 <div class="flex align-center">
@@ -136,6 +136,12 @@
         });
     },
     nextProblem() {
+      const problemData = {
+        prblmImfo: this.currentLearningId,
+        prblmNumber: this.currentProblemIndex,
+        prblmAns: this.selectedButton
+      }
+      this.$store.dispatch('saveProblemData', problemData);
       if (this.currentProblemIndex < this.$store.state.currentLearningIds.length - 1) {
         this.$store.dispatch('goToNextProblem');
         this.handleProblemDetail(this.currentLearningId);
client/views/pages/main/Chapter/Chapter3_8.vue
--- client/views/pages/main/Chapter/Chapter3_8.vue
+++ client/views/pages/main/Chapter/Chapter3_8.vue
@@ -14,7 +14,7 @@
       <div class="content title-box">
         <p class="title mt25 title-bg">step3.</p>
         <div class="flex align-center mb30">
-          <p class="subtitle2 mr20">그림을 보고 철자를 바르게 배열하세요.</p>
+          <p class="subtitle2 mr20">{{ currentProblemIndex + 1 }}. {{ dataList.prblmExpln }}</p>
           <!-- <button><img src="../../../../resources/img/btn10_s.png" alt="">
                </button> -->
         </div>
@@ -68,6 +68,8 @@
       ],
       word_shuffle: "docul",
       answer: null,
+      dataList: [],
+      problemDetail: [],
     };
   },
   methods: {
@@ -138,6 +140,12 @@
         });
     },
     nextProblem() {
+      const problemData = {
+        prblmImfo: this.currentLearningId,
+        prblmNumber: this.currentProblemIndex,
+        prblmAns: this.selectedButton
+      }
+      this.$store.dispatch('saveProblemData', problemData);
       if (this.currentProblemIndex < this.$store.state.currentLearningIds.length - 1) {
         this.$store.dispatch('goToNextProblem');
         this.handleProblemDetail(this.currentLearningId);
client/views/pages/main/Chapter/Chapter3_9.vue
--- client/views/pages/main/Chapter/Chapter3_9.vue
+++ client/views/pages/main/Chapter/Chapter3_9.vue
@@ -18,7 +18,7 @@
       <div class="content title-box">
         <p class="title mt25 title-bg">step3.</p>
         <div class="flex align-center mb30">
-          <p class="subtitle2 mr20">{{ dataList.prblmExpln }}</p>
+          <p class="subtitle2 mr20">{{ currentProblemIndex + 1 }}. {{ dataList.prblmExpln }}</p>
           <!-- <button><img src="../../../../resources/img/btn10_s.png" alt="">
                </button> -->
         </div>
@@ -143,6 +143,12 @@
         });
     },
     nextProblem() {
+      const problemData = {
+        prblmImfo: this.currentLearningId,
+        prblmNumber: this.currentProblemIndex,
+        prblmAns: this.selectedButton
+      }
+      this.$store.dispatch('saveProblemData', problemData);
       if (this.currentProblemIndex < this.$store.state.currentLearningIds.length - 1) {
         this.$store.dispatch('goToNextProblem');
         this.handleProblemDetail(this.currentLearningId);
client/views/pages/main/Chapter/Chapter4.vue
--- client/views/pages/main/Chapter/Chapter4.vue
+++ client/views/pages/main/Chapter/Chapter4.vue
@@ -23,23 +23,12 @@
                  </button>
                 </div> -->
 
-                <div
-                    class="text-ct flex justify-center"
-                    style="gap: 150px; margin: 0 auto"
-                >
+                <div class="text-ct flex justify-center" style="gap: 150px; margin: 0 auto">
                     <div class="wrap-bg">
                         <div class="title-box flex mb10 justify-between">
                             <p class="title mb20">최종 점수</p>
-                            <button
-                                type="button"
-                                class="popup-close-btn"
-                                @click="closeBtn"
-                            >
-                                <svg-icon
-                                    type="mdi"
-                                    :path="mdiWindowClose"
-                                    class="close-btn"
-                                ></svg-icon>
+                            <button type="button" class="popup-close-btn" @click="closeBtn">
+                                <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon>
                             </button>
                         </div>
                         <div style="width: 100%" class="flex mt30">
@@ -51,27 +40,12 @@
                     <div class="bg-gray" style="width: 980px">
                         <div class="title-box flex mb10 justify-between">
                             <p class="title mb20">오답 문제 리스트</p>
-                            <button
-                                type="button"
-                                class="popup-close-btn"
-                                @click="closeBtn"
-                            >
-                                <svg-icon
-                                    type="mdi"
-                                    :path="mdiWindowClose"
-                                    class="close-btn"
-                                ></svg-icon>
+                            <button type="button" class="popup-close-btn" @click="closeBtn">
+                                <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon>
                             </button>
                         </div>
-                        <article
-                            class="mb20 flex-column result-box"
-                            style="gap: 20px"
-                        >
-                            <div
-                                class="flex justify-between wrap"
-                                v-for="(item, index) in dataList"
-                                :key="item.id"
-                            >
+                        <article class="mb20 flex-column result-box" style="gap: 20px">
+                            <div class="flex justify-between wrap" v-for="(item, index) in dataList" :key="item.id">
                                 <div class="flex align-center">
                                     <div>
                                         <p class="title1 mr20">
@@ -85,23 +59,15 @@
                                     </div>
                                 </div>
                                 <div>
-                                    <div
-                                        class="flex align-center"
-                                        style="gap: 10px"
-                                    >
-                                        <button
-                                            type="button"
-                                            title="정답 확인"
-                                            class="yellow-btn"
-                                            @click="
-                                                [
-                                                    handleProblemDetail(item),
-                                                    goToProblemPage(
-                                                        problemType
-                                                    ),
-                                                ]
-                                            "
-                                        >
+                                    <div class="flex align-center" style="gap: 10px">
+                                        <button type="button" title="정답 확인" class="yellow-btn" @click="
+                                            [
+                                                handleProblemDetail(item),
+                                                goToProblemPage(
+                                                    problemType
+                                                ),
+                                            ]
+                                            ">
                                             정답 확인
                                         </button>
                                     </div>
@@ -208,20 +174,54 @@
         },
 
         handleProblemDetail(item) {
-            sessionStorage.setItem("prblmId", JSON.stringify(item.prblmId));
-            console.log(item.prblmTypeId);
-            if (item.prblmTypeId === "11") {
-                this.problemType = "Chapter3_9";
-            } else if (item.prblmTypeId === "12") {
-                this.problemType = "Chapter3_4";
-            } else if (item.prblmTypeId === "4") {
-                this.problemType = "Chapter3_3";
-            } else if (item.prblmTypeId === "3") {
-                this.problemType = "Chapter3_7";
-            } else if (item.prblmTypeId === "10") {
+            if (item.prblm_type_id === "prblm_type_001") {
+                this.problemType = "Chapter3";
+            } else if (item.prblm_type_id === "prblm_type_002") {
+                this.problemType = "Chapter3_1";
+            } else if (item.prblm_type_id === "prblm_type_003") {
                 this.problemType = "Chapter3_2";
-            } else if (item.prblmTypeId === "14") {
+            } else if (item.prblm_type_id === "prblm_type_004") {
+                this.problemType = "Chapter3_3";
+            } else if (item.prblm_type_id === "prblm_type_005") {
+                this.problemType = "Chapter3_3_1";
+            } else if (item.prblm_type_id === "prblm_type_006") {
+                this.problemType = "Chapter3_4";
+            } else if (item.prblm_type_id === "prblm_type_007") {
+                this.problemType = "Chapter3_5";
+            } else if (item.prblm_type_id === "prblm_type_008") {
+                this.problemType = "Chapter3_6";
+            } else if (item.prblm_type_id === "prblm_type_009") {
+                this.problemType = "Chapter3_7";
+            } else if (item.prblm_type_id === "prblm_type_010") {
+                this.problemType = "Chapter3_8";
+            } else if (item.prblm_type_id === "prblm_type_011") {
+                this.problemType = "Chapter3_9";
+            } else if (item.prblm_type_id === "prblm_type_012") {
+                this.problemType = "Chapter3_10";
+            } else if (item.prblm_type_id === "prblm_type_013") {
+                this.problemType = "Chapter3_11";
+            } else if (item.prblm_type_id === "prblm_type_014") {
                 this.problemType = "Chapter3_12";
+            } else if (item.prblm_type_id === "prblm_type_015") {
+                this.problemType = "Chapter3_13";
+            } else if (item.prblm_type_id === "prblm_type_016") {
+                this.problemType = "Chapter3_14";
+            } else if (item.prblm_type_id === "prblm_type_017") {
+                this.problemType = "Chapter3_15";
+            } else if (item.prblm_type_id === "prblm_type_018") {
+                this.problemType = "Chapter2_8";
+            } else if (item.prblm_type_id === "prblm_type_019") {
+                this.problemType = "Chapter2_7";
+            } else if (item.prblm_type_id === "prblm_type_020") {
+                this.problemType = "Chapter2_5";
+            } else if (item.prblm_type_id === "prblm_type_021") {
+                this.problemType = "Chapter2_6";
+            } else if (item.prblm_type_id === "prblm_type_022") {
+                this.problemType = "Chapter2_10";
+            } else if (item.prblm_type_id === "prblm_type_023") {
+                this.problemType = "Chapter2_11";
+            } else if (item.prblm_type_id === "prblm_type_024") {
+                this.problemType = "Chapter2_13";
             }
         },
     },
Add a comment
List