Browse Source

题目修改

HZH 5 years ago
parent
commit
95234b8d27

+ 3 - 3
src/api/exam.js

@@ -21,11 +21,11 @@ export function addPaper(paper) {
 }
 
 //修改试卷
-export function updatePaper(user) {
+export function updateQuestion(question) {
     return axios({
         method: 'post',
-        url: '/user/updatePassword',
-        data: user
+        url: '/question/updateQuestionForPaper',
+        data: question
     }).then(res => res.data)
 }
 

+ 33 - 14
src/components/controlMainPage/docList/QuestionList.vue

@@ -28,11 +28,29 @@
   }
 }
 .change-area{
+  width: calc(100% - 60px);
+  &>div{
+    display: inline-block;
+    vertical-align: top;
+    padding: 15px;
+    textarea{
+      width: 100%;
+      min-height: 50px;
+      margin: 10px;
+      font-size: 16px;
+      &:first-child{
+        min-height: 200px;
+      } 
+    }
+  }
   .material-part{
     width: 400px;
   }
   .question-part{
-    width: 800px;
+    width: 100%;
+    &.halfScreen{
+      width: calc(100% - 400px);
+    }
   }
 }
 /deep/.el-drawer__header{
@@ -67,14 +85,15 @@
     </el-collapse>
   </div>
   <div class="change-area">
-    <!-- <div class="material-part">
+    <div class="material-part" v-if="paper.sections[currentSection - 1].hasMaterial">
 
     </div>
-    <div class="question-part">
-      <textarea></textarea>
-      <textarea></textarea> -->
+    <div class="question-part" :class="{'halfScreen':paper.sections[currentSection - 1].hasMaterial}">
+      <textarea v-model="paper.questions[currentQuestion].content"></textarea>
+      <textarea v-for="answer in paper.questions[currentQuestion].options" :key="answer.id" v-model="answer.content"></textarea>
       <el-button @click="drawer = true" type="primary">查看</el-button>
-    <!-- </div> -->
+      <el-button @click="updateQuestion" type="warning">保存</el-button>
+    </div>
   </div>
   <el-drawer
     :visible.sync="drawer"
@@ -136,7 +155,7 @@
 </template>
 
 <script>
-import { getPaperById } from "@/api/exam";
+import { getPaperById , updateQuestion } from "@/api/exam";
 import { OPTION_LIST } from '@/services/constant';
 
 export default {
@@ -191,13 +210,13 @@ export default {
         },100);
       }
     },
-    // updateUser(){
-    //   updateUser(this.changeUser).then((result) => {
-    //     alert(result.message);
-    //     this.visibleChange = false
-    //     this.searchDoc();
-    //   })
-    // },
+    updateQuestion(){
+      updateQuestion(this.paper.questions[this.currentQuestion]).then((result) => {
+        alert(result.message);
+        this.getQuestion(this.$route.params.pid);
+        this.changePage(this.currentQuestion);
+      })
+    },
   },
 }
 </script>

File diff suppressed because it is too large
+ 0 - 0
static/css/group-controlApp.d4d1dd28.css


+ 1 - 1
static/index.html

@@ -31,4 +31,4 @@
           if(window.confirm("您的浏览器版本过低,推荐使用IE10及以上浏览器或者chrome浏览器,点击确定下载chrome安装浏览器。若是360等浏览器,开启兼容模式")){
               window.open("/download/44.0.2403.89_chrome_installer.exe", "_blank");
           }
-      }</script><link href=/css/group-app.000700aa.css rel=prefetch><link href=/css/group-controlApp.9756e9d7.css rel=prefetch><link href=/css/group-controlApp~group-doTest.d515d56b.css rel=prefetch><link href=/css/group-doTest.c440bfd3.css rel=prefetch><link href=/css/group-mainPage.5a4551a7.css rel=prefetch><link href=/js/group-app.24429b9c.js rel=prefetch><link href=/js/group-controlApp.aa5a8a7b.js rel=prefetch><link href=/js/group-controlApp~group-doTest.d74ed862.js rel=prefetch><link href=/js/group-doTest.9e882abb.js rel=prefetch><link href=/js/group-mainPage.5fd1c98c.js rel=prefetch><link href=/css/app.e9f156cc.css rel=preload as=style><link href=/css/chunk-vendors.723a90c8.css rel=preload as=style><link href=/js/app.508c66ec.js rel=preload as=script><link href=/js/chunk-vendors.2493bbd2.js rel=preload as=script><link href=/css/chunk-vendors.723a90c8.css rel=stylesheet><link href=/css/app.e9f156cc.css rel=stylesheet></head><body><noscript><strong>We're sorry but my-project doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.2493bbd2.js></script><script src=/js/app.508c66ec.js></script></body></html>
+      }</script><link href=/css/group-app.000700aa.css rel=prefetch><link href=/css/group-controlApp.d4d1dd28.css rel=prefetch><link href=/css/group-controlApp~group-doTest.d515d56b.css rel=prefetch><link href=/css/group-doTest.c440bfd3.css rel=prefetch><link href=/css/group-mainPage.5a4551a7.css rel=prefetch><link href=/js/group-app.24429b9c.js rel=prefetch><link href=/js/group-controlApp.93111e71.js rel=prefetch><link href=/js/group-controlApp~group-doTest.6d171e17.js rel=prefetch><link href=/js/group-doTest.68ec04d7.js rel=prefetch><link href=/js/group-mainPage.7099f19c.js rel=prefetch><link href=/css/app.e9f156cc.css rel=preload as=style><link href=/css/chunk-vendors.723a90c8.css rel=preload as=style><link href=/js/app.d6fb1354.js rel=preload as=script><link href=/js/chunk-vendors.2493bbd2.js rel=preload as=script><link href=/css/chunk-vendors.723a90c8.css rel=stylesheet><link href=/css/app.e9f156cc.css rel=stylesheet></head><body><noscript><strong>We're sorry but my-project doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.2493bbd2.js></script><script src=/js/app.d6fb1354.js></script></body></html>

File diff suppressed because it is too large
+ 0 - 0
static/js/app.d6fb1354.js


File diff suppressed because it is too large
+ 0 - 0
static/js/group-controlApp.93111e71.js


File diff suppressed because it is too large
+ 0 - 0
static/js/group-controlApp.aa5a8a7b.js


File diff suppressed because it is too large
+ 0 - 0
static/js/group-controlApp~group-doTest.6d171e17.js


File diff suppressed because it is too large
+ 0 - 0
static/js/group-controlApp~group-doTest.d74ed862.js


+ 0 - 0
static/js/group-doTest.9e882abb.js → static/js/group-doTest.68ec04d7.js


File diff suppressed because it is too large
+ 0 - 0
static/js/group-mainPage.5fd1c98c.js


File diff suppressed because it is too large
+ 0 - 0
static/js/group-mainPage.7099f19c.js


Some files were not shown because too many files changed in this diff