jichoi / lms_front star
PsHooN7979 2024-08-14
240814 박세훈 오답 문제 상세 조회 기능 추가
@d1305ad00f4907f93cf5c6600bc190d3444883b9
client/views/pages/main/Chapter/Chapter3_7.vue
--- client/views/pages/main/Chapter/Chapter3_7.vue
+++ client/views/pages/main/Chapter/Chapter3_7.vue
@@ -1,165 +1,198 @@
 <template>
-  <div id="Chapter1_1" class="content-wrap">
-    <div style="margin: 30px 0px 50px">
-        <router-link to="/MyPlan.page">
-          <div class="logo mb25"><img src="../../../../resources/img/logo2.png" alt=""></div>
-        </router-link>
-    </div>
-    <div class="title-box mb25 flex align-center mt40">
-      <span class="title mr40">1. Hello WORLD</span>
-      <span class="subtitle">my name is dd</span>
-    </div>
-    <div class="flex justify-between align-center">
-      <div class="pre-btn" @click="goToPage('Chapter3_6')"><img src="../../../../resources/img/left.png" alt=""></div>
-      <div class="content title-box">
-        <p class="title mt25 title-bg">step3.</p>
-        <div class="flex align-center mb30">
-               <p class="subtitle2 mr20">듣고 알맞은 것을 고르세요.</p>
-               <button><img src="../../../../resources/img/btn10_s.png" alt="">
-               </button>
-            </div>
-
-        <div class="text-ct">
-          <div class="time-hint">
-          <button class="hint-btn">HINT</button>
-            <div class="time-bg mt20">
-                <div>
-                  <div class="time">
-                    <p class="second">{{ timer }}</p>
-                    <p class="text">sec</p>
-                  </div>
+    <div id="Chapter1_1" class="content-wrap">
+        <div style="margin: 30px 0px 50px">
+            <router-link to="/MyPlan.page">
+                <div class="logo mb25">
+                    <img src="../../../../resources/img/logo2.png" alt="" />
                 </div>
-              </div>
-         </div>
-          
-          <div class="pickGroup flex align-center justify-between mt80" style="gap: 100px;">
-            <p>1. 문제</p>
-            <div class="flex justify-center" style="gap: 60px;">
-              <article >
-                <div class="flex align-center">
-                  <button><img src="../../../../resources/img/img136_71s.png" alt="">
-                    <p>1</p>
-                  </button>
-                  <img src="../../../../resources/img/img111_56s.png" alt="">
-                </div>
-              </article>
-              <article >
-                <div class="flex align-center">
-                  <button><img src="../../../../resources/img/img136_71s.png" alt="">
-                    <p>2</p>
-                  </button>
-                  <img src="../../../../resources/img/img112_56s.png" alt="">
-                </div>
-              </article>
-            </div>
-          </div>
-          <div class="pickGroup mt40 flex align-center justify-between" style="gap: 100px;">
-            <p>2. 문제 ㅇㅇㅇ</p>
-            <div class="flex justify-center" style="gap: 60px;">
-              <article >
-                <div class="flex align-center">
-                  <button><img src="../../../../resources/img/img136_71s.png" alt="">
-                    <p>1</p>
-                  </button>
-                  <img src="../../../../resources/img/img111_56s.png" alt="">
-                </div>
-              </article>
-              <article >
-                <div class="flex align-center">
-                  <button><img src="../../../../resources/img/img136_71s.png" alt="">
-                    <p>2</p>
-                  </button>
-                  <img src="../../../../resources/img/img112_56s.png" alt="">
-                </div>
-              </article>
-            </div>
-          </div>
+            </router-link>
         </div>
-      </div>
-      <div class="next-btn" @click="goToPage('Chapter3_8')"><img src="../../../../resources/img/right.png" alt=""></div>
+        <div class="title-box mb25 flex align-center mt40">
+            <span class="title mr40">1. Hello WORLD</span>
+            <span class="subtitle">my name is dd</span>
+        </div>
+        <div class="flex justify-between align-center">
+            <div class="pre-btn" @click="goToPage('Chapter3_6')">
+                <img src="../../../../resources/img/left.png" alt="" />
+            </div>
+            <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>
+                    <button>
+                        <img
+                            src="../../../../resources/img/btn10_s.png"
+                            alt=""
+                        />
+                    </button>
+                </div>
+
+                <div class="text-ct">
+                    <div class="time-hint">
+                        <button class="hint-btn">HINT</button>
+                        <div class="time-bg mt20">
+                            <div>
+                                <div class="time">
+                                    <p class="second">{{ timer }}</p>
+                                    <p class="text">sec</p>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+
+                    <div
+                        class="pickGroup flex align-center justify-between mt80"
+                        style="gap: 100px"
+                        v-for="(item, index) in problemDetail"
+                        :key="item.id"
+                    >
+                        <p>{{ index + 1 }}. {{ item.prblmDtlExpln }}</p>
+                        <div class="flex justify-center" style="gap: 60px">
+                            <article>
+                                <div class="flex align-center">
+                                    <button>
+                                        <img
+                                            src="../../../../resources/img/img136_71s.png"
+                                            alt=""
+                                        />
+                                        <p>1</p>
+                                    </button>
+                                    <img
+                                        src="../../../../resources/img/img111_56s.png"
+                                        alt=""
+                                    />
+                                </div>
+                            </article>
+                            <article>
+                                <div class="flex align-center">
+                                    <button>
+                                        <img
+                                            src="../../../../resources/img/img136_71s.png"
+                                            alt=""
+                                        />
+                                        <p>2</p>
+                                    </button>
+                                    <img
+                                        src="../../../../resources/img/img112_56s.png"
+                                        alt=""
+                                    />
+                                </div>
+                            </article>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="next-btn" @click="goToPage('Chapter3_8')">
+                <img src="../../../../resources/img/right.png" alt="" />
+            </div>
+        </div>
     </div>
-  </div>
 </template>
 
 <script>
+import axios from "axios";
+
 export default {
-  data() {
-    return {
-      timer: '00'
-    }
-  },
-  methods: {
-    goToPage(page) {
-      this.$router.push({ name: page });
+    data() {
+        return {
+            timer: "00",
+            prblmId: "",
+            problemDetail: [],
+            dataList: [],
+            prblmExpln: null,
+        };
     },
-    startTimer() {
-      if (this.intervalId) {
-        clearInterval(this.intervalId);
-      }
-      this.timer = 5;
-      this.intervalId = setInterval(() => {
-        if (this.timer > 0) {
-          this.timer--;
-        } else {
-          clearInterval(this.intervalId);
-        }
-      }, 1000);
-    }
-  },
-  watch: {
-
-  },
-  computed: {
-
-  },
-  components: {
-  },
-  mounted() {
-
-  }
-}
+    methods: {
+        goToPage(page) {
+            this.$router.push({ name: page });
+        },
+        startTimer() {
+            if (this.intervalId) {
+                clearInterval(this.intervalId);
+            }
+            this.timer = 5;
+            this.intervalId = setInterval(() => {
+                if (this.timer > 0) {
+                    this.timer--;
+                } else {
+                    clearInterval(this.intervalId);
+                }
+            }, 1000);
+        },
+        problemSearch() {
+            const vm = this;
+            vm.prblmId = JSON.parse(sessionStorage.getItem("prblmId"));
+            axios({
+                url: "problem/problemInfo.json",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json; charset=UTF-8",
+                },
+                data: {
+                    prblmId: vm.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);
+                });
+        },
+    },
+    watch: {},
+    computed: {},
+    components: {},
+    mounted() {
+        // this.problemSearch();
+    },
+};
 </script>
 <style scoped>
 .inputbox {
-  font-size: 38px;
-  font-family: 'Pretendard-ExtraBold';
+    font-size: 38px;
+    font-family: "Pretendard-ExtraBold";
 }
 
 .imgGroup button {
-  position: relative;
+    position: relative;
 }
 
 .imgGroup button p,
 .textbox p {
-  position: absolute;
-  top: 50%;
-  left: 50%;
-  transform: translate(-50%, -50%);
-  width: fit-content;
-  height: fit-content;
-  background: #ffffffb8;
-  border-radius: 5px;
-  padding: 10px;
-  font-size: 48px;
-  font-family: 'ONEMobilePOP';
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+    width: fit-content;
+    height: fit-content;
+    background: #ffffffb8;
+    border-radius: 5px;
+    padding: 10px;
+    font-size: 48px;
+    font-family: "ONEMobilePOP";
 }
-.pickGroup{padding: 0px 80px;}
+.pickGroup {
+    padding: 0px 80px;
+}
 .pickGroup p {
-  font-size: 34px;
-  font-weight: bold;
+    font-size: 34px;
+    font-weight: bold;
 }
 
 .pickGroup button {
-  position: relative;
-  margin-right: 30px;
+    position: relative;
+    margin-right: 30px;
 }
 
 .pickGroup button p {
-  font-size: 34px;
-  color: #c6c6c6;
-  position: absolute;
-  top: 50%;
-  left: 50%;
-  transform: translate(-50%, -50%);
+    font-size: 34px;
+    color: #c6c6c6;
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
 }
-</style>
(No newline at end of file)
+</style>
client/views/pages/main/Chapter/Chapter3_9.vue
--- client/views/pages/main/Chapter/Chapter3_9.vue
+++ client/views/pages/main/Chapter/Chapter3_9.vue
@@ -1,136 +1,172 @@
 <template>
-  <div id="Chapter1_1" class="content-wrap">
-    <div style="margin: 30px 0px 50px">
-        <router-link to="/MyPlan.page">
-          <div class="logo mb25"><img src="../../../../resources/img/logo2.png" alt=""></div>
-        </router-link>
-    </div>
-    <div class="title-box mb25 flex align-center mt40">
-      <span class="title mr40">1. Hello WORLD</span>
-      <span class="subtitle">my name is dd</span>
-    </div>
-    <div class="flex justify-between align-center">
-      <div class="pre-btn" @click="goToPage('Chapter3_8')"><img src="../../../../resources/img/left.png" alt=""></div>
-      <div class="content title-box">
-        <p class="title mt25 title-bg">step3.</p>
-        <div class="flex align-center mb30">
-               <p class="subtitle2 mr20">그림을 보고 단어를 입력하세요.</p>
-               <!-- <button><img src="../../../../resources/img/btn10_s.png" alt="">
-               </button> -->
-            </div>
-
-        <div class="mt50 text-ct">
-          <div class="time-hint">
-          <button class="hint-btn">HINT</button>
-            <div class="time-bg mt20">
-                <div>
-                  <div class="time">
-                    <p class="second">{{ timer }}</p>
-                    <p class="text">sec</p>
-                  </div>
+    <div id="Chapter1_1" class="content-wrap">
+        <div style="margin: 30px 0px 50px">
+            <router-link to="/MyPlan.page">
+                <div class="logo mb25">
+                    <img src="../../../../resources/img/logo2.png" alt="" />
                 </div>
-              </div>
-         </div>
-          <div class="imgGroup  mt50">
-            <img src="../../../../resources/img/img115_58s.png" alt="">
-            <div class=" mt50">
-              <input class="yellow-bd" type="text" name="" id="" placeholder="답을 입력하세요.">
-
-            </div>
-          </div>
-
+            </router-link>
         </div>
-      </div>
-      <div class="next-btn" @click="goToPage('Chapter3_10')"><img src="../../../../resources/img/right.png" alt="">
-      </div>
+        <div class="title-box mb25 flex align-center mt40">
+            <span class="title mr40">1. Hello WORLD</span>
+            <span class="subtitle">my name is dd</span>
+        </div>
+        <div class="flex justify-between align-center">
+            <div class="pre-btn" @click="goToPage('Chapter3_8')">
+                <img src="../../../../resources/img/left.png" alt="" />
+            </div>
+            <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>
+                    <!-- <button><img src="../../../../resources/img/btn10_s.png" alt="">
+               </button> -->
+                </div>
+
+                <div class="mt50 text-ct">
+                    <div class="time-hint">
+                        <button class="hint-btn">HINT</button>
+                        <div class="time-bg mt20">
+                            <div>
+                                <div class="time">
+                                    <p class="second">{{ timer }}</p>
+                                    <p class="text">sec</p>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="imgGroup mt50">
+                        <img
+                            src="../../../../resources/img/img115_58s.png"
+                            alt=""
+                        />
+                        <div class="mt50">
+                            <input
+                                class="yellow-bd"
+                                type="text"
+                                name=""
+                                id=""
+                                placeholder="답을 입력하세요."
+                            />
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="next-btn" @click="goToPage('Chapter3_10')">
+                <img src="../../../../resources/img/right.png" alt="" />
+            </div>
+        </div>
     </div>
-  </div>
 </template>
 
 <script>
+import axios from "axios";
 export default {
-  data() {
-    return {
-      timer: '00',
-      showButton1: false,
-      showButton2: false,
-      showButton3: false,
-      showButton4: false,
-    }
-  },
-  methods: {
-    goToPage(page) {
-      this.$router.push({ name: page });
-    },
-    handleDrag(dragNumber) {
-      // Drag 버튼 숨기기
-      // 여기서는 상태 관리를 통해 버튼을 제어합니다.
-      if (dragNumber === 1) {
-        this.showButton1 = false;
-      } else if (dragNumber === 2) {
-        this.showButton2 = false;
-      } else if (dragNumber === 3) {
-        this.showButton3 = false;
-      }
-    },
-    showButton(dropNumber) {
-      // Drop 영역의 이미지 클릭 이벤트 핸들러 설정
-      // 여기서는 상태 관리를 통해 버튼을 보이게 합니다.
-      if (dropNumber === 1) {
-        this.showButton1 = true;
-      } else if (dropNumber === 2) {
-        this.showButton2 = true;
-      } else if (dropNumber === 3) {
-        this.showButton3 = true;
-      } else if (dropNumber === 4) {
-        this.showButton4 = true;
-      }
-    },
-    startTimer() {
-      if (this.intervalId) {
-        clearInterval(this.intervalId);
-      }
-      this.timer = 5;
-      this.intervalId = setInterval(() => {
-        if (this.timer > 0) {
-          this.timer--;
-        } else {
-          clearInterval(this.intervalId);
-        }
-      }, 1000);
-    }
-  },
-  watch: {
+    data() {
+        return {
+            timer: "00",
+            showButton1: false,
+            showButton2: false,
+            showButton3: false,
+            showButton4: false,
 
-  },
-  computed: {
-
-  },
-  components: {
-  },
-  mounted() {
-
-  }
-}
+            problemDetail: [],
+            dataList: [],
+            prblmExpln: null,
+        };
+    },
+    methods: {
+        goToPage(page) {
+            this.$router.push({ name: page });
+        },
+        handleDrag(dragNumber) {
+            // Drag 버튼 숨기기
+            // 여기서는 상태 관리를 통해 버튼을 제어합니다.
+            if (dragNumber === 1) {
+                this.showButton1 = false;
+            } else if (dragNumber === 2) {
+                this.showButton2 = false;
+            } else if (dragNumber === 3) {
+                this.showButton3 = false;
+            }
+        },
+        showButton(dropNumber) {
+            // Drop 영역의 이미지 클릭 이벤트 핸들러 설정
+            // 여기서는 상태 관리를 통해 버튼을 보이게 합니다.
+            if (dropNumber === 1) {
+                this.showButton1 = true;
+            } else if (dropNumber === 2) {
+                this.showButton2 = true;
+            } else if (dropNumber === 3) {
+                this.showButton3 = true;
+            } else if (dropNumber === 4) {
+                this.showButton4 = true;
+            }
+        },
+        startTimer() {
+            if (this.intervalId) {
+                clearInterval(this.intervalId);
+            }
+            this.timer = 5;
+            this.intervalId = setInterval(() => {
+                if (this.timer > 0) {
+                    this.timer--;
+                } else {
+                    clearInterval(this.intervalId);
+                }
+            }, 1000);
+        },
+        problemSearch() {
+            const vm = this;
+            vm.prblmId = JSON.parse(sessionStorage.getItem("prblmId"));
+            axios({
+                url: "problem/problemInfo.json",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json; charset=UTF-8",
+                },
+                data: {
+                    prblmId: "100",
+                },
+            })
+                .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);
+                });
+        },
+    },
+    watch: {},
+    computed: {},
+    components: {},
+    mounted() {
+        // this.problemSearch();
+    },
+};
 </script>
 <style scoped>
-input.yellow-bd{width: 30%;}
+input.yellow-bd {
+    width: 30%;
+}
 .dropGroup button {
-  position: relative;
+    position: relative;
 }
 
 .dropGroup button p {
-  font-size: 48px;
+    font-size: 48px;
 }
 
 .dragGroup {
-  background-color: #F2F4F8;
-  padding: 30px 50px;
-  width: max-content;
-  border-radius: 20px;
+    background-color: #f2f4f8;
+    padding: 30px 50px;
+    width: max-content;
+    border-radius: 20px;
 }
 
 .dragGroup button p {
-  font-size: 48px;
+    font-size: 48px;
 }
-</style>
(No newline at end of file)
+</style>
client/views/pages/main/Chapter/Chapter4.vue
--- client/views/pages/main/Chapter/Chapter4.vue
+++ client/views/pages/main/Chapter/Chapter4.vue
@@ -2,7 +2,9 @@
     <div id="Chapter1_1" class="content-wrap">
         <div style="margin: 30px 0px 50px">
             <router-link to="/MyPlan.page">
-                <div class="logo mb25"><img src="../../../../resources/img/logo2.png" alt=""></div>
+                <div class="logo mb25">
+                    <img src="../../../../resources/img/logo2.png" alt="" />
+                </div>
             </router-link>
         </div>
         <div class="title-box mb25 flex align-center mt40">
@@ -10,7 +12,8 @@
             <span class="subtitle">my name is dd</span>
         </div>
         <div class="flex justify-between align-center">
-            <div class="pre-btn" @click="goToPage('Chapter3_15')"><img src="../../../../resources/img/left.png" alt="">
+            <div class="pre-btn" @click="goToPage('Chapter3_15')">
+                <img src="../../../../resources/img/left.png" alt="" />
             </div>
             <div class="content title-box">
                 <p class="title mt25 title-bg">Quiz Result</p>
@@ -20,83 +23,83 @@
                  </button>
                 </div> -->
 
-                <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">
+                <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">
+                        <div style="width: 100%" class="flex mt30">
                             <p class="title5"><em class="yellow">93</em></p>
                             <p class="title4 ml10 mr10">&#47;</p>
                             <p class="title4">100</p>
                         </div>
                     </div>
-                    <div class="bg-gray " style="width: 980px;">
-                        <div class="title-box flex mb10  justify-between">
+                    <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">
+                        <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">1.</p></div>
+                                    <div>
+                                        <p class="title1 mr20">
+                                            {{ index + 1 }}
+                                        </p>
+                                    </div>
                                     <div class="text-lf">
-                                        <p class="title1">2교시</p>
+                                        <p class="title1">
+                                            {{ item.prblmExpln }}
+                                        </p>
                                     </div>
                                 </div>
                                 <div>
-                                    <div class="flex align-center " style="gap: 10px;"><button type="button"
-                                            title="정답 확인" class="yellow-btn">
-                                            정답 확인
-                                        </button>
-                                    </div>
-                                </div>
-                            </div>
-                            <div class="flex justify-between wrap">
-                                <div class="flex align-center">
-                                    <div><p class="title1 mr20">1.</p></div>
-                                    <div class="text-lf">
-                                        <p class="title1">2교시</p>
-                                    </div>
-                                </div>
-                                <div>
-                                    <div class="flex align-center " style="gap: 10px;"><button type="button"
-                                            title="정답 확인" class="yellow-btn">
-                                            정답 확인
-                                        </button>
-                                    </div>
-                                </div>
-                            </div>
-                            <div class="flex justify-between wrap">
-                                <div class="flex align-center">
-                                    <div><p class="title1 mr20">1.</p></div>
-                                    <div class="text-lf">
-                                        <p class="title1">2교시</p>
-                                    </div>
-                                </div>
-                                <div>
-                                    <div class="flex align-center " style="gap: 10px;"><button type="button"
-                                            title="정답 확인" class="yellow-btn">
-                                            정답 확인
-                                        </button>
-                                    </div>
-                                </div>
-                            </div>
-                            <div class="flex justify-between wrap">
-                                <div class="flex align-center">
-                                    <div><p class="title1 mr20">1.</p></div>
-                                    <div class="text-lf">
-                                        <p class="title1">2교시</p>
-                                    </div>
-                                </div>
-                                <div>
-                                    <div class="flex align-center " style="gap: 10px;"><button type="button"
-                                            title="정답 확인" class="yellow-btn">
+                                    <div
+                                        class="flex align-center"
+                                        style="gap: 10px"
+                                    >
+                                        <button
+                                            type="button"
+                                            title="정답 확인"
+                                            class="yellow-btn"
+                                            @click="
+                                                [
+                                                    handleProblemDetail(item),
+                                                    goToPage(problemType),
+                                                ]
+                                            "
+                                        >
                                             정답 확인
                                         </button>
                                     </div>
@@ -104,25 +107,36 @@
                             </div>
                         </article>
                     </div>
-
                 </div>
             </div>
-            <div class="next-btn" @click="goToPage('Chapter3_16')"><img src="../../../../resources/img/right.png" alt="">
+            <div class="next-btn" @click="goToPage('Chapter3_16')">
+                <img src="../../../../resources/img/right.png" alt="" />
             </div>
         </div>
     </div>
 </template>
 
 <script>
+import axios from "axios";
+
 export default {
     data() {
         return {
-            timer: '00',
+            timer: "00",
             showButton1: false,
             showButton2: false,
             showButton3: false,
             showButton4: false,
-        }
+
+            // 단원 평가 아이디, 추후 세션으로 받게 변경
+            evalId: "EVAL_000000000000003",
+
+            dataList: [],
+
+            prblmId: "",
+
+            problemType: null,
+        };
     },
     methods: {
         goToPage(page) {
@@ -164,20 +178,54 @@
                     clearInterval(this.intervalId);
                 }
             }, 1000);
-        }
-    },
-    watch: {
+        },
+        problemList() {
+            const vm = this;
 
-    },
-    computed: {
+            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) {
+            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") {
+                this.problemType = "Chapter3_2";
+            } else if (item.prblmTypeId === "14") {
+                this.problemType = "Chapter3_12";
+            }
+        },
     },
-    components: {
-    },
+    watch: {},
+    computed: {},
+    components: {},
     mounted() {
-
-    }
-}
+        this.problemList();
+    },
+};
 </script>
 <style scoped>
 .textbox {
@@ -201,4 +249,4 @@
 .dragGroup button p {
     font-size: 48px;
 }
-</style>
(No newline at end of file)
+</style>
Add a comment
List