jichoi / lms_front star
woals 2024-08-14
240814 권민수 학생 질문 업데이트 기능 추가
@31d67704d1a3d8c2c268bc46cb8977967fc8d633
client/views/layout/Side.vue
--- client/views/layout/Side.vue
+++ client/views/layout/Side.vue
@@ -26,7 +26,7 @@
             <p class="title1 mb15">선생님께 질문 있어요~</p>
 
             <div class="memo mb15"><textarea name="" id="" placeholder="궁금한 것을 적어보세요." v-model="studentInfo.studentQuestion"></textarea></div>
-            <div class="flex justify-end"><button>질문하기</button></div>
+            <div class="flex justify-end"><button @click="updateQuestion">질문하기</button></div>
         </div>
         <!-- <div class="btn-wrap flex justify-between">
             <button class="login-btn" @click="handleClick" >
@@ -73,6 +73,22 @@
             });
         },
 
+        // 질문 업데이트 메서드
+        updateQuestion() {
+            axios.post('/studentInfo/updateQuestion.json', {
+                userId: this.userId,
+                studentQuestion: this.studentInfo.studentQuestion
+            })
+            .then(response => {
+                console.log('질문이 성공적으로 업데이트되었습니다.');
+                alert('질문이 성공적으로 업데이트되었습니다.');
+            })
+            .catch(error => {
+                console.error('질문 업데이트 실패:', error);
+                alert('질문 업데이트에 실패했습니다.');
+            });
+        },
+
         handleClick() {
             this.toggleText();
             this.goToPage('PreviewNote');
client/views/pages/main/PreviewNote.vue
--- client/views/pages/main/PreviewNote.vue
+++ client/views/pages/main/PreviewNote.vue
@@ -16,7 +16,7 @@
             <p class="title">오답노트</p>
         </div>
         <div class="wrap" style="border-radius: 0;">
-
+ㄴ
             <div class="table-wrap">
                 <table>
                     <colgroup>
@@ -56,7 +56,7 @@
             currentStdId: "1", // 임시 학생 아이디
             currentUnitId: "1", // 임시 유닛 아이디
             wrongAnswerNotes: [], // 오답 노트 목록 데이터
-            unitData: {},
+            unitData: {}, // 단원 정보 데이터
         }
     },
     methods: {
@@ -67,6 +67,7 @@
             console.log('링크될 문제 ID:', prblmId);
         },
 
+        // 단원 정보를 불러오는 API 호출
         fetchUnitDetail() {
             axios.post('/unit/unitDetail.json', {
                 unitId: this.currentUnitId
Add a comment
List