Leonezhurui 5 лет назад
Родитель
Сommit
c139edebd7

+ 1 - 0
src/assets/correct.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M313.134255 475.396337l121.552403 241.612827c0 0 197.417255-490.988454 508.857427-654.643768-7.575536 116.885104-37.969776 218.207767 15.152095 342.936513-136.700405 31.166837-417.765779 381.946992-508.929058 553.383526C320.714907 795.008632 168.720168 670.279886 62.396607 631.270431L313.134255 475.396337 313.134255 475.396337 313.134255 475.396337zM313.134255 475.396337" fill="#f1939c" /></svg>

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/assets/wrong.svg


+ 8 - 8
src/components/MarkdownText.vue

@@ -38,14 +38,14 @@
 <style lang="scss">
 <style lang="scss">
     .markdown-content {
     .markdown-content {
         word-break: break-all;
         word-break: break-all;
-        white-space: pre-wrap;
-        margin-top: 16px;
-    p {
-        margin-bottom: 0;
-    }
-    img {
-        max-width: 100%;
-    }
+        /*white-space: pre-wrap;*/
+        /*margin-top: 16px;*/
+        p {
+            /*margin-bottom: 0;*/
+        }
+        img {
+            max-width: 100%;
+        }
     }
     }
 
 
 </style>
 </style>

+ 15 - 16
src/components/bok/bokMain/QuestionRepository/index.vue

@@ -29,22 +29,21 @@
                          :questionvo="item" :total-num="totalNum" :cur-num="index+(currentPage-1)*pageSize" />
                          :questionvo="item" :total-num="totalNum" :cur-num="index+(currentPage-1)*pageSize" />
     </div>
     </div>
 
 
-<!--    <el-backtop target=".index-body" :bottom="100">-->
-<!--      <div-->
-<!--              style="{-->
-<!--        height: 100%;-->
-<!--        width: 100%;-->
-<!--        background-color: #f2f5f6;-->
-<!--        box-shadow: 0 0 6px rgba(0,0,0, .12);-->
-<!--        text-align: center;-->
-<!--        line-height: 40px;-->
-<!--        color: #1989fa;-->
-<!--      }"-->
-<!--      >-->
-<!--        UP-->
-<!--      </div>-->
-<!--    </el-backtop>-->
-  <el-backtop></el-backtop>
+    <el-backtop :bottom="50">
+      <div
+              style="{
+        height: 100%;
+        width: 100%;
+        background-color: #f2f5f6;
+        box-shadow: 0 0 6px rgba(0,0,0, .12);
+        text-align: center;
+        line-height: 40px;
+        color: #1989fa;
+      }"
+      >
+        UP
+      </div>
+    </el-backtop>
   </div>
   </div>
 
 
   <el-drawer
   <el-drawer

+ 42 - 28
src/components/card/BriefQuestionCard.vue

@@ -7,7 +7,7 @@
                 </el-col>
                 </el-col>
 
 
                 <el-col :span="5">
                 <el-col :span="5">
-                    <span><strong>KeyPoints: </strong>{{questionvo.keyPoints}}</span>
+                    <span><strong>题目类型: </strong>{{questionvo.type}}</span>
                 </el-col>
                 </el-col>
 
 
                 <el-col :span="6">
                 <el-col :span="6">
@@ -22,8 +22,8 @@
                                     <el-tag  effect="dark" style="margin-right: 2px">{{item}}</el-tag>
                                     <el-tag  effect="dark" style="margin-right: 2px">{{item}}</el-tag>
                                 </el-tooltip>
                                 </el-tooltip>
                             </span>
                             </span>
-                                <span v-else>
-                                <span>no knowledgeId</span>
+                            <span v-else>
+                                <span><strong>KnowledgeId: </strong>null</span>
                             </span>
                             </span>
                         </div>
                         </div>
                 </el-col>
                 </el-col>
@@ -37,7 +37,8 @@
                     <el-button type="primary" icon="el-icon-edit" circle @click="updateQuestion"></el-button>
                     <el-button type="primary" icon="el-icon-edit" circle @click="updateQuestion"></el-button>
                 </el-col>
                 </el-col>
                 <el-col :span="1">
                 <el-col :span="1">
-                    <el-button type="danger" icon="el-icon-delete" circle @click="deleteQuestion"></el-button>
+                    <el-button v-if="isDelete === false" type="danger" icon="el-icon-delete" circle @click="deleteQuestion"></el-button>
+                    <el-button v-else type="success" icon="el-icon-delete" circle @click="recoverQuestion"></el-button>
                 </el-col>
                 </el-col>
             </el-row>
             </el-row>
         </template>
         </template>
@@ -45,27 +46,44 @@
         <div class="bQuestion-card-body">
         <div class="bQuestion-card-body">
             <div class="bQuestion-card-body-stem">
             <div class="bQuestion-card-body-stem">
                 <MarkdownText :raw="'<strong>题目: </strong>'+questionvo.stem"></MarkdownText>
                 <MarkdownText :raw="'<strong>题目: </strong>'+questionvo.stem"></MarkdownText>
-<!--                <div v-html="markdownToHTML('<strong>题目: </strong>'+questionvo.stem)" class="markdown-content"></div>-->
             </div>
             </div>
 
 
             <div class="bQuestion-card-body-options" v-if="isAll">
             <div class="bQuestion-card-body-options" v-if="isAll">
-                <div v-for="(item,index) in questionvo.options">
-                    <div v-if="index === questionvo.answer" class="correct-answer">{{index}}: {{item}}</div>
-                    <div v-else>{{index}}: {{item}}</div>
+                <div v-for="(item,index) in questionvo.options" v-if="questionvo.type === 'choice' || questionvo.type === 'multiple_choice'">
+                    <div v-if="questionvo.answer.split(';').indexOf(index) !== -1" class="underline-correct-answer">
+                        <MarkdownText :raw="index+': '+item"></MarkdownText>
+                    </div>
+                    <div v-else>
+                        <MarkdownText :raw="index+': '+item"></MarkdownText>
+                    </div>
+                </div>
+                <div v-for="index in Object.keys(questionvo.blanks).length" v-if="questionvo.type === 'blank'">
+                    <div class="correct-answer">
+                        __{{index}}__: {{questionvo.blanks['__'+index+'__']}}
+                    </div>
+                </div>
+                <div v-if="questionvo.type === 'true_false'">
+                    <div class="correct_answer"> {{questionvo.answer}}</div>
                 </div>
                 </div>
             </div>
             </div>
 
 
             <el-divider v-if="isAll"></el-divider>
             <el-divider v-if="isAll"></el-divider>
 
 
             <el-row v-if="isAll">
             <el-row v-if="isAll">
-                <el-col :span="4">
-                    <span><strong>题目类型: </strong>{{questionvo.type}}</span>
+                <el-col v-if="questionvo.type === 'short_answer'">
+                    <MarkdownText :raw="'<strong>正确答案: </strong>'+questionvo.answer"></MarkdownText>
+                </el-col>
+            </el-row>
+
+            <el-row v-if="isAll">
+                <el-col :span="4" v-if="questionvo.type === 'choice' || questionvo.type === 'multiple_choice' || questionvo.type === 'true_false'">
+                    <span><strong>正确答案: </strong>{{questionvo.answer}}</span>
                 </el-col>
                 </el-col>
                 <el-col :span="4">
                 <el-col :span="4">
                     <span><strong>题目难度: </strong>{{questionvo.weight}}/5</span>
                     <span><strong>题目难度: </strong>{{questionvo.weight}}/5</span>
                 </el-col>
                 </el-col>
-                <el-col :span="4">
-                    <span><strong>正确答案: </strong>{{questionvo.answer}}</span>
+                <el-col :span="16">
+                    <span><strong>KeyPoints: </strong>{{questionvo.keyPoints}}</span>
                 </el-col>
                 </el-col>
             </el-row>
             </el-row>
 
 
@@ -118,10 +136,8 @@
             size="35%"
             size="35%"
     >
     >
         <QuestionUpdater :question="questionvo"/>
         <QuestionUpdater :question="questionvo"/>
-
     </el-drawer>
     </el-drawer>
 
 
-
 </template>
 </template>
 
 
 <script>
 <script>
@@ -161,12 +177,12 @@
             curNum: Number,
             curNum: Number,
         },
         },
         computed: {
         computed: {
-
         },
         },
         data(){
         data(){
             return{
             return{
                 isAll: false,
                 isAll: false,
                 dialog: false,
                 dialog: false,
+                isDelete: false,
             }
             }
         },
         },
         methods: {
         methods: {
@@ -185,6 +201,7 @@
                                 type: 'success',
                                 type: 'success',
                                 message: '删除成功!'
                                 message: '删除成功!'
                             });
                             });
+                            this.isDelete = true;
                     }).catch( error => {
                     }).catch( error => {
                         console.log(error);
                         console.log(error);
                         this.$notify.error({
                         this.$notify.error({
@@ -199,6 +216,7 @@
                     });
                     });
                 });
                 });
 
 
+
             },
             },
             expand(){
             expand(){
                 if(!this.isAll){
                 if(!this.isAll){
@@ -226,6 +244,9 @@
             map1(abbreviation){
             map1(abbreviation){
                 return map(abbreviation);
                 return map(abbreviation);
             },
             },
+            recoverQuestion(){
+                alert("Delete successfully!");
+            },
             toMyDate(instant){
             toMyDate(instant){
                 let date = new Date(instant);
                 let date = new Date(instant);
                 var year = date.getFullYear();
                 var year = date.getFullYear();
@@ -277,25 +298,18 @@
         font-size: 18px;
         font-size: 18px;
     }
     }
 
 
-    .correct-answer{
+    .underline-correct-answer{
         font-family: "Kaiti SC";
         font-family: "Kaiti SC";
         font-size: 22px;
         font-size: 22px;
         color: #f1939c;
         color: #f1939c;
         font-weight: bold;
         font-weight: bold;
         text-decoration: underline;
         text-decoration: underline;
-
     }
     }
 
 
-    .markdown-content {
-        word-break: break-all;
-        white-space: pre-wrap;
-        margin-top: 16px;
-    p {
-        margin-bottom: 0;
-    }
-    img {
-        max-width: 100%;
-    }
+    .correct_answer{
+        font-family: "Kaiti SC";
+        font-size: 21px;
+        color: #f1939c;
+        font-weight: bold;
     }
     }
-
 </style>
 </style>

+ 4 - 0
src/components/card/QuestionCreater.vue

@@ -248,6 +248,9 @@
                             message: '创建成功',
                             message: '创建成功',
                             type: 'success'
                             type: 'success'
                         });
                         });
+                        setTimeout(() => {
+                            this.$emit('closeDialog');
+                        }, 1000);
 
 
                     }).catch(err => {
                     }).catch(err => {
                         console.log(err);
                         console.log(err);
@@ -256,6 +259,7 @@
                             message: '创建失败'
                             message: '创建失败'
                         });
                         });
                 }).finally(() => {
                 }).finally(() => {
+
                     console.log("Question created!");
                     console.log("Question created!");
                 })
                 })
             }
             }

Некоторые файлы не были показаны из-за большого количества измененных файлов