jichoi / lms_front star
PsHooN7979 2024-08-23
240823 박세훈 Chapter3 문제들 수정 및 오답노트 로드맵 연결
@bada2619594055d4a03930f56969d26476d49435
client/views/pages/main/Chapter/Chapter3.vue
--- client/views/pages/main/Chapter/Chapter3.vue
+++ client/views/pages/main/Chapter/Chapter3.vue
@@ -55,7 +55,8 @@
                         </article>
                     </div>
                 </div>
-                <button class="submit-button" @click="handleSubmit()">제출하기</button>
+                <button class="submit-button" @click="handleSubmit()"
+                    v-if="currentIndex === learningIdsLength - 1">제출하기</button>
             </div>
             <div class="next-btn" @click="nextProblem()">
                 <img src="../../../../resources/img/right.png" alt="" />
@@ -76,6 +77,8 @@
             unit_id: null,
             dataList: [],
             problemDetail: [],
+            currentIndex: null,
+            learningIdsLength: null,
         };
     },
     methods: {
client/views/pages/main/Chapter/Chapter3_1.vue
--- client/views/pages/main/Chapter/Chapter3_1.vue
+++ client/views/pages/main/Chapter/Chapter3_1.vue
@@ -47,7 +47,8 @@
             </div>
           </div>
         </div>
-        <button class="submit-button" @click="handleSubmit()">제출하기</button>
+        <button class="submit-button" @click="handleSubmit()"
+          v-if="currentIndex === learningIdsLength - 1">제출하기</button>
       </div>
       <div class="next-btn" @click="nextProblem()"><img src="../../../../resources/img/right.png" alt="" />
       </div>
@@ -67,6 +68,8 @@
       selectedbuttonImg: "client/resources/img/img137_71s.png",
       dataList: [],
       problemDetail: [],
+      currentIndex: null,
+      learningIdsLength: null,
     };
   },
   methods: {
@@ -213,6 +216,8 @@
     console.log('Current Learning ID:', this.currentLearningId);
     console.log('Current Label:', this.currentLabel);
     console.log('Current Problem Index:', this.currentProblemIndex);
+    this.currentIndex = this.currentProblemIndex;
+    this.learningIdsLength = this.$store.state.currentLearningIds.length;
 
     // Fetch or process the current problem based on `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
@@ -41,7 +41,8 @@
             </div>
           </div>
         </div>
-        <button class="submit-button" @click="handleSubmit()">제출하기</button>
+        <button class="submit-button" @click="handleSubmit()"
+          v-if="currentIndex === learningIdsLength - 1">제출하기</button>
       </div>
       <div class="next-btn" @click="nextProblem()"><img src="../../../../resources/img/right.png" alt="" />
       </div>
@@ -59,6 +60,8 @@
       answer: null,
       dataList: [],
       problemDetail: [],
+      currentIndex: null,
+      learningIdsLength: null,
     };
   },
   methods: {
@@ -205,6 +208,8 @@
     console.log('Current Learning ID:', this.currentLearningId);
     console.log('Current Label:', this.currentLabel);
     console.log('Current Problem Index:', this.currentProblemIndex);
+    this.currentIndex = this.currentProblemIndex;
+    this.learningIdsLength = this.$store.state.currentLearningIds.length;
 
     // Fetch or process the current problem based on `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
@@ -42,7 +42,8 @@
             </div>
           </div>
         </div>
-        <button class="submit-button" @click="handleSubmit()">제출하기</button>
+        <button class="submit-button" @click="handleSubmit()"
+          v-if="currentIndex === learningIdsLength - 1">제출하기</button>
       </div>
       <div class="next-btn" @click="nextProblem()"><img src="../../../../resources/img/right.png" alt="" />
       </div>
@@ -61,6 +62,8 @@
       text: "e",
       dataList: [],
       problemDetail: [],
+      currentIndex: null,
+      learningIdsLength: null,
     };
   },
   methods: {
@@ -204,6 +207,8 @@
     console.log('Current Learning ID:', this.currentLearningId);
     console.log('Current Label:', this.currentLabel);
     console.log('Current Problem Index:', this.currentProblemIndex);
+    this.currentIndex = this.currentProblemIndex;
+    this.learningIdsLength = this.$store.state.currentLearningIds.length;
 
     // Fetch or process the current problem based on `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
@@ -55,7 +55,8 @@
             </div>
           </div>
         </div>
-        <button class="submit-button" @click="handleSubmit()">제출하기</button>
+        <button class="submit-button" @click="handleSubmit()"
+          v-if="currentIndex === learningIdsLength - 1">제출하기</button>
       </div>
       <div class="next-btn" @click="nextProblem()"><img src="../../../../resources/img/right.png" alt="" />
       </div>
@@ -78,6 +79,8 @@
       draggedCharIndex: null, // 드래그한 문자의 인덱스 저장
       dataList: [],
       problemDetail: [],
+      currentIndex: null,
+      learningIdsLength: null,
     };
   },
   methods: {
@@ -238,6 +241,8 @@
     console.log('Current Learning ID:', this.currentLearningId);
     console.log('Current Label:', this.currentLabel);
     console.log('Current Problem Index:', this.currentProblemIndex);
+    this.currentIndex = this.currentProblemIndex;
+    this.learningIdsLength = this.$store.state.currentLearningIds.length;
 
     // Fetch or process the current problem based on `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
@@ -63,7 +63,8 @@
             </div>
           </div>
         </div>
-        <button class="submit-button" @click="handleSubmit()">제출하기</button>
+        <button class="submit-button" @click="handleSubmit()"
+          v-if="currentIndex === learningIdsLength - 1">제출하기</button>
       </div>
       <div class="next-btn" @click="nextProblem()"><img src="../../../../resources/img/right.png" alt="" />
       </div>
@@ -92,6 +93,8 @@
       svgHeight: "100%", // SVG의 높이
       dataList: [],
       problemDetail: [],
+      currentIndex: null,
+      learningIdsLength: null,
     };
   },
   methods: {
@@ -274,6 +277,8 @@
     console.log('Current Learning ID:', this.currentLearningId);
     console.log('Current Label:', this.currentLabel);
     console.log('Current Problem Index:', this.currentProblemIndex);
+    this.currentIndex = this.currentProblemIndex;
+    this.learningIdsLength = this.$store.state.currentLearningIds.length;
 
     // Fetch or process the current problem based on `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
@@ -40,7 +40,8 @@
             </div>
           </div>
         </div>
-        <button class="submit-button" @click="handleSubmit()">제출하기</button>
+        <button class="submit-button" @click="handleSubmit()"
+          v-if="currentIndex === learningIdsLength - 1">제출하기</button>
       </div>
       <div class="next-btn" @click="nextProblem(answer)"><img src="../../../../resources/img/right.png" alt="" />
       </div>
@@ -57,6 +58,8 @@
       answer: null,
       dataList: [],
       problemDetail: [],
+      currentIndex: null,
+      learningIdsLength: null,
     };
   },
   methods: {
@@ -194,6 +197,8 @@
     console.log('Current Learning ID:', this.currentLearningId);
     console.log('Current Label:', this.currentLabel);
     console.log('Current Problem Index:', this.currentProblemIndex);
+    this.currentIndex = this.currentProblemIndex;
+    this.learningIdsLength = this.$store.state.currentLearningIds.length;
 
     // Fetch or process the current problem based on `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
@@ -38,7 +38,8 @@
           </div>
         </div>
 
-        <button class="submit-button" @click="handleSubmit()">제출하기</button>
+        <button class="submit-button" @click="handleSubmit()"
+          v-if="currentIndex === learningIdsLength - 1">제출하기</button>
       </div>
       <div class="next-btn" @click="nextProblem()"><img src="../../../../resources/img/right.png" alt="" /></div>
     </div>
@@ -53,6 +54,8 @@
       timer: "00",
       dataList: [],
       problemDetail: [],
+      currentIndex: null,
+      learningIdsLength: null,
     };
   },
   methods: {
@@ -190,6 +193,8 @@
     console.log('Current Learning ID:', this.currentLearningId);
     console.log('Current Label:', this.currentLabel);
     console.log('Current Problem Index:', this.currentProblemIndex);
+    this.currentIndex = this.currentProblemIndex;
+    this.learningIdsLength = this.$store.state.currentLearningIds.length;
 
     // Fetch or process the current problem based on `currentLearningId`
   },
client/views/pages/main/Chapter/Chapter3_2.vue
--- client/views/pages/main/Chapter/Chapter3_2.vue
+++ client/views/pages/main/Chapter/Chapter3_2.vue
@@ -57,7 +57,8 @@
             <p>bed</p>
           </div>
         </div>
-        <button class="submit-button" @click="handleSubmit()">제출하기</button>
+        <button class="submit-button" @click="handleSubmit()"
+          v-if="currentIndex === learningIdsLength - 1">제출하기</button>
       </div>
       <div class="next-btn" @click="nextProblem()"><img src="../../../../resources/img/right.png" alt="" /></div>
     </div>
@@ -73,6 +74,8 @@
       selectedButton: null,
       dataList: [],
       problemDetail: [],
+      currentIndex: null,
+      learningIdsLength: null,
     };
   },
   methods: {
@@ -220,6 +223,8 @@
     console.log('Current Learning ID:', this.currentLearningId);
     console.log('Current Label:', this.currentLabel);
     console.log('Current Problem Index:', this.currentProblemIndex);
+    this.currentIndex = this.currentProblemIndex;
+    this.learningIdsLength = this.$store.state.currentLearningIds.length;
 
     // Fetch or process the current problem based on `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
@@ -43,7 +43,8 @@
             </article>
           </div>
         </div>
-        <button class="submit-button" @click="handleSubmit()">제출하기</button>
+        <button class="submit-button" @click="handleSubmit()"
+          v-if="currentIndex === learningIdsLength - 1">제출하기</button>
       </div>
       <div class="next-btn" @click="nextProblem()"><img src="../../../../resources/img/right.png" alt="" />
       </div>
@@ -60,6 +61,8 @@
       timer: "00",
       prblmId: "",
       problemDetail: [],
+      currentIndex: null,
+      learningIdsLength: null,
       dataList: [],
       prblmExpln: null,
       unitData: {}, // 단원 정보 데이터
@@ -209,6 +212,8 @@
     console.log('Current Learning ID:', this.currentLearningId);
     console.log('Current Label:', this.currentLabel);
     console.log('Current Problem Index:', this.currentProblemIndex);
+    this.currentIndex = this.currentProblemIndex;
+    this.learningIdsLength = this.$store.state.currentLearningIds.length;
 
     // Fetch or process the current problem based on `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
@@ -64,7 +64,8 @@
             </article>
           </div>
         </div>
-        <button class="submit-button" @click="handleSubmit()">제출하기</button>
+        <button class="submit-button" @click="handleSubmit()"
+          v-if="currentIndex === learningIdsLength - 1">제출하기</button>
       </div>
       <div class="next-btn" @click="nextProblem()"><img src="../../../../resources/img/right.png" alt="" />
       </div>
@@ -82,6 +83,8 @@
       selectedButton: null,
       dataList: [],
       problemDetail: [],
+      currentIndex: null,
+      learningIdsLength: null,
     };
   },
   methods: {
@@ -226,6 +229,8 @@
     console.log('Current Learning ID:', this.currentLearningId);
     console.log('Current Label:', this.currentLabel);
     console.log('Current Problem Index:', this.currentProblemIndex);
+    this.currentIndex = this.currentProblemIndex;
+    this.learningIdsLength = this.$store.state.currentLearningIds.length;
 
     // Fetch or process the current problem based on `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
@@ -55,7 +55,8 @@
             </article>
           </div>
         </div>
-        <button class="submit-button" @click="handleSubmit()">제출하기</button>
+        <button class="submit-button" @click="handleSubmit()"
+          v-if="currentIndex === learningIdsLength - 1">제출하기</button>
       </div>
       <div class="next-btn" @click="nextProblem()">
         <img src="../../../../resources/img/right.png" alt="" />
@@ -72,6 +73,8 @@
       timer: "00",
       prblmId: "101",
       problemDetail: [],
+      currentIndex: null,
+      learningIdsLength: null,
       dataList: [],
       prblmExpln: null,
       accessTime: null,
@@ -224,6 +227,8 @@
     console.log('Current Learning ID:', this.currentLearningId);
     console.log('Current Label:', this.currentLabel);
     console.log('Current Problem Index:', this.currentProblemIndex);
+    this.currentIndex = this.currentProblemIndex;
+    this.learningIdsLength = this.$store.state.currentLearningIds.length;
 
     // Fetch or process the current problem based on `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
@@ -64,7 +64,8 @@
             <p>bed</p>
           </div>
         </div>
-        <button class="submit-button" @click="handleSubmit()">제출하기</button>
+        <button class="submit-button" @click="handleSubmit()"
+          v-if="currentIndex === learningIdsLength - 1">제출하기</button>
       </div>
       <div class="next-btn" @click="nextProblem()"><img src="../../../../resources/img/right.png" alt="" />
       </div>
@@ -81,6 +82,8 @@
       selectedButton: null,
       dataList: [],
       problemDetail: [],
+      currentIndex: null,
+      learningIdsLength: null,
     };
   },
   methods: {
@@ -225,6 +228,8 @@
     console.log('Current Learning ID:', this.currentLearningId);
     console.log('Current Label:', this.currentLabel);
     console.log('Current Problem Index:', this.currentProblemIndex);
+    this.currentIndex = this.currentProblemIndex;
+    this.learningIdsLength = this.$store.state.currentLearningIds.length;
 
     // Fetch or process the current problem based on `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
@@ -54,7 +54,8 @@
             </article>
           </div>
         </div>
-        <button class="submit-button" @click="handleSubmit()">제출하기</button>
+        <button class="submit-button" @click="handleSubmit()"
+          v-if="currentIndex === learningIdsLength - 1">제출하기</button>
       </div>
       <div class="next-btn" @click="nextProblem()"><img src="../../../../resources/img/right.png" alt="" />
       </div>
@@ -80,6 +81,8 @@
       intervalId: null,
       dataList: [],
       problemDetail: [],
+      currentIndex: null,
+      learningIdsLength: null,
       selectedButton: null,
     };
   },
@@ -238,6 +241,8 @@
     console.log('Current Learning ID:', this.currentLearningId);
     console.log('Current Label:', this.currentLabel);
     console.log('Current Problem Index:', this.currentProblemIndex);
+    this.currentIndex = this.currentProblemIndex;
+    this.learningIdsLength = this.$store.state.currentLearningIds.length;
 
     // Fetch or process the current problem based on `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
@@ -61,7 +61,8 @@
             </div>
           </div>
         </div>
-        <button class="submit-button" @click="handleSubmit()">제출하기</button>
+        <button class="submit-button" @click="handleSubmit()"
+          v-if="currentIndex === learningIdsLength - 1">제출하기</button>
       </div>
       <div class="next-btn" @click="nextProblem()">
         <img src="../../../../resources/img/right.png" alt="" />
@@ -79,6 +80,8 @@
       timer: "00",
       prblmId: "PROBLEM_000000000000003",
       problemDetail: [],
+      currentIndex: null,
+      learningIdsLength: null,
       dataList: [],
       prblmExpln: null,
       accessTime: null,
@@ -229,6 +232,8 @@
     console.log('Current Learning ID:', this.currentLearningId);
     console.log('Current Label:', this.currentLabel);
     console.log('Current Problem Index:', this.currentProblemIndex);
+    this.currentIndex = this.currentProblemIndex;
+    this.learningIdsLength = this.$store.state.currentLearningIds.length;
 
     // Fetch or process the current problem based on `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
@@ -44,7 +44,8 @@
             <input class="yellow-bd" v-model="answer" style="width: 45%" type="text" placeholder="답을 입력하세요." />
           </div>
         </div>
-        <button class="submit-button" @click="handleSubmit()">제출하기</button>
+        <button class="submit-button" @click="handleSubmit()"
+          v-if="currentIndex === learningIdsLength - 1">제출하기</button>
       </div>
       <div class="next-btn" @click="nextProblem()"><img src="../../../../resources/img/right.png" alt="" />
       </div>
@@ -70,6 +71,8 @@
       answer: null,
       dataList: [],
       problemDetail: [],
+      currentIndex: null,
+      learningIdsLength: null,
     };
   },
   methods: {
@@ -235,6 +238,8 @@
     console.log('Current Learning ID:', this.currentLearningId);
     console.log('Current Label:', this.currentLabel);
     console.log('Current Problem Index:', this.currentProblemIndex);
+    this.currentIndex = this.currentProblemIndex;
+    this.learningIdsLength = this.$store.state.currentLearningIds.length;
 
     // Fetch or process the current problem based on `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
@@ -70,6 +70,8 @@
       showButton4: false,
 
       problemDetail: [],
+      currentIndex: null,
+      learningIdsLength: null,
       dataList: [],
       prblmExpln: null,
       prblmId: "1004",
@@ -238,6 +240,8 @@
     console.log('Current Learning ID:', this.currentLearningId);
     console.log('Current Label:', this.currentLabel);
     console.log('Current Problem Index:', this.currentProblemIndex);
+    this.currentIndex = this.currentProblemIndex;
+    this.learningIdsLength = this.$store.state.currentLearningIds.length;
 
     // Fetch or process the current problem based on `currentLearningId`
   },
client/views/pages/main/Chapter/Chapter4.vue
--- client/views/pages/main/Chapter/Chapter4.vue
+++ client/views/pages/main/Chapter/Chapter4.vue
@@ -45,7 +45,7 @@
                             </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">
+                            <div class="flex justify-between wrap" v-for="(item, index) in dataList" :key="index">
                                 <div class="flex align-center">
                                     <div>
                                         <p class="title1 mr20">
@@ -54,7 +54,7 @@
                                     </div>
                                     <div class="text-lf">
                                         <p class="title1">
-                                            {{ item.prblmExpln }}
+                                            {{ item.prblmImfo.prblm_expln }}
                                         </p>
                                     </div>
                                 </div>
@@ -62,7 +62,7 @@
                                     <div class="flex align-center" style="gap: 10px">
                                         <button type="button" title="정답 확인" class="yellow-btn" @click="
                                             [
-                                                handleProblemDetail(item),
+                                                handleProblemDetail(item.prblmImfo),
                                                 goToProblemPage(
                                                     problemType
                                                 ),
@@ -111,7 +111,6 @@
             this.$router.push({ name: page });
         },
         goToProblemPage(page) {
-            sessionStorage.setItem("previewNote", "true");
             this.$router.push({ name: page });
         },
         handleDrag(dragNumber) {
@@ -152,25 +151,6 @@
             }, 1000);
         },
         problemList() {
-            const vm = this;
-
-            axios({
-                url: "problem/evaluationProblemList.json",
-                method: "post",
-                headers: {
-                    "Content-Type": "application/json; charset=UTF-8",
-                },
-                data: {
-                    evalId: vm.evalId,
-                },
-            })
-                .then(function (res) {
-                    console.log("problemList - response : ", res.data);
-                    vm.dataList = res.data;
-                })
-                .catch(function (error) {
-                    console.log("problemList - error : ", error);
-                });
         },
 
         handleProblemDetail(item) {
@@ -226,7 +206,16 @@
         },
     },
     watch: {},
-    computed: {},
+    computed: {
+        getAllProblems() {
+            return this.$store.getters.getAllProblems;
+        },
+    },
+    created() {
+        console.log('Problem List :', this.getAllProblems);
+        this.dataList = this.getAllProblems;
+
+    },
     components: {},
     mounted() {
         this.problemList();
Add a comment
List