瀏覽代碼

Merge branch 'develop3.0-tmd' of http://106.12.23.251:10080/TEAMMODEL/TEAMModelOS into develop3.0-tmd

CrazyIter_Bin 4 年之前
父節點
當前提交
6d03588295

+ 88 - 17
TEAMModelOS/ClientApp/src/assets/student-web/component_styles/lesson-testpop.css

@@ -9,15 +9,66 @@
   top: 0px;
   top: 0px;
   left: 0px;
   left: 0px;
 }
 }
+.que-box {
+    margin-top:10px;
+    width:100%;
+    max-height:300px;
+    overflow-y:scroll;
+    display: flex;
+    flex-wrap:wrap;
+}
+.ans-box {
+    border: 1px solid rgba(117, 117, 117, 0.726);
+    /*border-collapse: collapse;*/
+    /*font-weight: 500;*/
+    margin-left: 5px;
+    margin-bottom: 10px;
+    cursor: pointer;
+    width: 60px;
+    font-size: 14px;
+    border-radius: 5px;
+    text-align: center;
+    padding-top: 3px;
+    /*padding: 2px 5px;*/
+    height: 30px;
+}
+.has-ans {
+    border: 1px solid rgba(117, 117, 117, 0.726);
+    /*border-collapse: collapse;*/
+    /*font-weight: 500;*/
+    margin-left: 5px;
+    margin-bottom: 10px;
+    cursor: pointer;
+    width: 60px;
+    font-size: 14px;
+    border-radius: 5px;
+    text-align: center;
+    padding-top: 3px;
+    /*padding: 2px 5px;*/
+    height: 30px;
+    background-color: #d4ede1;
+}
+.ans-box :hover {
+    color: #24b880;
+    font-size: 16px;
+    padding: 2px 5px;
+    /*background-color: #ececec;*/
+}
+.has-ans :hover {
+    color: #24b880;
+    font-size: 16px;
+    padding: 2px 5px;
+    /*background-color: #ececec;*/
+}
 .lesson-test-pop .testTitle {
 .lesson-test-pop .testTitle {
-  background-color: #ffffff;
-  color: #24b880;
-  font-size: 20px;
-  padding: 5px 15px;
-  position: relative;
-  width: 100%;
-  height: 38px;
-  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
+    background-color: #ffffff;
+    color: #24b880;
+    font-size: 20px;
+    padding: 5px 15px;
+    position: relative;
+    width: 100%;
+    height: 38px;
+    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
 }
 }
 .complete-content{
 .complete-content{
     width:35%;
     width:35%;
@@ -27,15 +78,21 @@
 .compose-box {
 .compose-box {
     background-color: #24b880;
     background-color: #24b880;
     color: white;
     color: white;
-    width: 65%;
+    width: 75%;
     border-radius: 6px;
     border-radius: 6px;
 }
 }
 .compose-item {
 .compose-item {
     display: flex;
     display: flex;
     margin-left: 10px;
     margin-left: 10px;
-    max-height: 300px;
+    max-height: 400px;
     overflow-y: scroll;
     overflow-y: scroll;
 }
 }
+.compose-content {
+    margin-top:30px;
+    width: 75%;
+    height: 200px;
+    z-index: 0;
+}
 .lesson-test-pop .warmMessage {
 .lesson-test-pop .warmMessage {
     z-index: 999;
     z-index: 999;
 }
 }
@@ -188,7 +245,7 @@
 .lesson-test-pop .questioDes {
 .lesson-test-pop .questioDes {
     font-weight: 900;
     font-weight: 900;
     font-size: 14px;
     font-size: 14px;
-    min-height:550px;
+    min-height:450px;
 }
 }
 
 
 .lesson-test-pop .questionDesImg {
 .lesson-test-pop .questionDesImg {
@@ -282,11 +339,24 @@
   border: none;
   border: none;
 }
 }
 .lesson-test-pop .checkAnswer {
 .lesson-test-pop .checkAnswer {
-  margin-top: 30px;
-  min-height:600px;
+    margin-top: 30px;
+    max-height: 400px;
+    overflow-y: scroll;
+}
+.lesson-test-pop .checkAnswers {
+    margin-top: 30px;
+    max-height: 400px;
+    width: 85%;
+    overflow-y: scroll;
+}
+.checkAnswers .select-box {
+    width: 100%;
+    display: flex;
+    flex-wrap: wrap;
 }
 }
 .lesson-test-pop .questionNo {
 .lesson-test-pop .questionNo {
-  margin-left: 25px;
+  /*margin-left: 5px;*/
+
   font-weight: 900;
   font-weight: 900;
 }
 }
 .lesson-test-pop input[type="text"] {
 .lesson-test-pop input[type="text"] {
@@ -298,9 +368,10 @@
   border-bottom: 2px solid #24b880;
   border-bottom: 2px solid #24b880;
 }
 }
 .lesson-test-pop .testBtn {
 .lesson-test-pop .testBtn {
-  display: block;
-  margin: 10px auto;
-  width: 90%;
+    display: block;
+    /* margin: 10px auto; */
+    width: 40%;
+    margin-left: 30px;
 }
 }
 .lesson-test-pop .testBtn:hover {
 .lesson-test-pop .testBtn:hover {
   cursor: pointer;
   cursor: pointer;

+ 98 - 143
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTestPop.vue

@@ -51,7 +51,7 @@
             <span class="testTitleText">评量:{{ $store.getters.getItemTitle.name }}</span>
             <span class="testTitleText">评量:{{ $store.getters.getItemTitle.name }}</span>
             <div class="myProgressBar">
             <div class="myProgressBar">
                 <span class="myTestProgresstitle">完成度</span>
                 <span class="myTestProgresstitle">完成度</span>
-                <Progress style="margin-top:15px" :percent="Math.ceil(((examInfo.length - undo)/examLength)*100)" />
+                <Progress style="margin-top:15px" :percent="completeRate" />
             </div>
             </div>
             <button v-if="closeTest" class="submitBtn" @click="openWarmMessage(2)" :class="{ hintClick: hintHandon() }">交卷</button>
             <button v-if="closeTest" class="submitBtn" @click="openWarmMessage(2)" :class="{ hintClick: hintHandon() }">交卷</button>
             <button v-if="!closeTest" class="submitBtn" :class="{ hintClick: hintHandon() }">已完成</button>
             <button v-if="!closeTest" class="submitBtn" :class="{ hintClick: hintHandon() }">已完成</button>
@@ -61,7 +61,7 @@
                    :xs="24"
                    :xs="24"
                    :sm="24"
                    :sm="24"
                    :md="12"
                    :md="12"
-                   :lg="getQue(queNo).type != 'single'&& getQue(queNo).type != 'judge'&& getQue(queNo).type != 'multiple'? 24 : 17">
+                   :lg="20">
                 <div class="questionContent">
                 <div class="questionContent">
                     <span class="hintwrap">
                     <span class="hintwrap">
                         <Tooltip :content="'提示'" theme="light" placement="left">
                         <Tooltip :content="'提示'" theme="light" placement="left">
@@ -95,7 +95,6 @@
                                         <div v-html="getQue(queNo).parentInfo.question"></div>
                                         <div v-html="getQue(queNo).parentInfo.question"></div>
                                     </div>
                                     </div>
                                 </div>
                                 </div>
-
                                 <div style="display:flex;margin-top:20px;">
                                 <div style="display:flex;margin-top:20px;">
                                     <span style="width:40px">{{ getQue(queNo).paperIndex}}:</span>
                                     <span style="width:40px">{{ getQue(queNo).paperIndex}}:</span>
                                     <!--题目渲染-->
                                     <!--题目渲染-->
@@ -108,109 +107,81 @@
                             <Compose ref="compose" :itemInfo="getQue(queNo)" :textData="checkers[queNo]" :index="queNo" @dataGet="getComposeAns"></Compose>
                             <Compose ref="compose" :itemInfo="getQue(queNo)" :textData="checkers[queNo]" :index="queNo" @dataGet="getComposeAns"></Compose>
                         </div>
                         </div>
                         <!--填空题-->
                         <!--填空题-->
-                        <!--<div  v-if="getQue(queNo).type == 'complete'">
-                            
+                        <!--<div v-if="getQue(queNo).type == 'complete'">
                             <div class="complete-content">
                             <div class="complete-content">
-                                <Complete ref="complete":num="getQue(queNo).answer" :textData="checkers[queNo]" :index="queNo" @dataChange="getComposeAns"></Complete>
+                                <Complete ref="complete" :num="getQue(queNo).answer" :textData="checkers[queNo]" :index="queNo" @dataChange="getComposeAns"></Complete>
                             </div>
                             </div>
                         </div>-->
                         </div>-->
                     </div>
                     </div>
-                    <!--答案卡-->
-                    <div class="md-ansSheetGroup">
-                        <h4>{{ $t("studentWeb.exam.testpop.myAnswerSheet") }}</h4>
-                        <table class="ansSheet" >
-                            <tr>
-                                <th class="rightAnstitle">{{ $t("studentWeb.exam.testpop.qNo") }}</th>
-                                <th v-for="(item,index) in examInfo"
-                                    :key="index"
-                                    class="ansSheetQno"
-                                    @click="gototheQues(index +1)">
-                                    {{ item.parent == undefined ? index +1 : item.paperIndex }}
-                                </th>
-                            </tr>
-                            <tr>
-                                <td class="anstext">{{ $t("studentWeb.exam.testpop.myAns") }}</td>
-                                <td v-for="(item, index) in checkers" :key="index">
-                                    <div v-show="item == ''">
-                                        <br />
-                                    </div>
-                                    <div class="anstext" v-show="item.length >= 0 && getQue(index).type != 'subjective' && getQue(index).type != 'complete'  && getQue(index).type != 'judge' ">
-                                        <span v-for="(sub, indexs) in item" :key="indexs">
-                                            {{ sub }}
-                                            <span v-show="indexs + 1 != item.length">,</span>
-                                        </span>
-                                    </div>         
-                                    <div class="anstext" v-show="item.length >= 1">
-                                        <span v-show="getQue(index).type == 'subjective' || getQue(index).type == 'complete'">已作答</span>
-                                        <span v-show="getQue(index).type == 'judge'">{{checkers[index][0] == 'B' ? '对' : '错'}}</span>
-                                    </div>
-                                </td>
-                            </tr>
-                        </table>
-                    </div>
-                    <!--切換頁-->
-                    <div class="pageCtl2" v-if="getQue(queNo).type != 'single'&& getQue(queNo).type != 'judge'&& getQue(queNo).type != 'multiple'">
-                        <button @click="preQ()" v-if="queNo != 0">
-                            <Icon type="ios-arrow-back" />上一题
-                        </button>
-                        <button @click="nextQ()"
-                                v-if="queNo != (examInfo.length-1)"
-                                :class="{ hintClick: queNo != (examInfo.length-1) && checkers[queNo] != '', }">
-                                下一题
-                            <Icon type="ios-arrow-forward" />
-                        </button>
+                    <div class="checkAnswers" v-if="getQue(queNo).type == 'single'|| getQue(queNo).type == 'judge'|| getQue(queNo).type == 'multiple'">
+                        <div class="questionNo">第{{ queNo + 1 }}题 我的答案是:</div>
+                        <!--判断题选项-->
+                        <div v-if="getQue(queNo).type == 'judge'" align="center">
+                            <label class="testBtn yesNoBtn">
+                                <input type="radio" value="B" v-model="checkers[queNo][0]" />
+                                <div class="testbg">
+                                    <Icon type="ios-radio-button-off" />
+                                </div>
+                            </label>
+                            <label class="testBtn yesNoBtn">
+                                <input type="radio" value="A" v-model="checkers[queNo][0]" />
+                                <div class="testbg">
+                                    <Icon type="md-close" />
+                                </div>
+                            </label>
+                        </div>
+                        <!--选择题选项-->
+                        <div class="select-box" v-if=" getQue(queNo).type != 'judge' ">
+                            <label class="testBtn"
+                                   v-for="(item, index) in getQue(queNo).option"
+                                   :key="index">
+                                <input type="checkbox"
+                                       :value="getQue(queNo).option[index].code"
+                                       v-model="checkers[queNo]"
+                                       @click="getAns(queNo,index)" />
+                                <div class="testbg">
+                                    <Row :gutter="10">
+                                        <i-col :xs="16" :sm="16" :md="16" :lg="16">
+                                            <p class="testtext">
+                                                <div style="display:flex">
+                                                    <span>{{ getQue(queNo).option[index].code }}.</span>
+                                                    <div v-html="item.value"></div>
+                                                </div>
+                                            </p>
+                                        </i-col>
+                                    </Row>
+                                    <div style="clear:both"></div>
+                                </div>
+                            </label>
+                        </div>
                     </div>
                     </div>
                 </div>
                 </div>
             </i-col>
             </i-col>
             <!--渲染選擇題 判斷題-->
             <!--渲染選擇題 判斷題-->
             <i-col class="ansArea"
             <i-col class="ansArea"
-                   :xs="24"
-                   :sm="24"
-                   :md="12"
-                   :lg="7"
-                   v-if="getQue(queNo).type == 'single'|| getQue(queNo).type == 'judge'|| getQue(queNo).type == 'multiple'">
+                   :xs="12"
+                   :sm="12"
+                   :md="6"
+                   :lg="4"
+                   >
                 <div class="checkAnswer">
                 <div class="checkAnswer">
-                    <div class="questionNo">第{{ queNo + 1 }}题 我的答案是:</div>
-                    <!--判断题选项-->
-                    <div v-if="getQue(queNo).type == 'judge'" align="center">
-                        <label class="testBtn yesNoBtn">
-                            <input type="radio" value="B" v-model="checkers[queNo][0]" />
-                            <div class="testbg">
-                                <Icon type="ios-radio-button-off" />
-                            </div>
-                        </label>
-                        <label class="testBtn yesNoBtn">
-                            <input type="radio" value="A" v-model="checkers[queNo][0]" />
-                            <div class="testbg">
-                                <Icon type="md-close" />
-                            </div>
-                        </label>
-                    </div>
-                    <!--选择题选项-->
-                    <div v-if=" getQue(queNo).type != 'judge' " >
-                        <label class="testBtn"
-                               v-for="(item, index) in getQue(queNo).option"
-                               :key="index">
-                            <input type="checkbox"
-                                   :value="getQue(queNo).option[index].code"
-                                   v-model="checkers[queNo]" 
-                                    @click="getAns(queNo,index)"
-                                   />
-                            <div class="testbg">
-                                <Row :gutter="10">
-                                    <i-col :xs="16" :sm="16" :md="16" :lg="16">
-                                        <p class="testtext" >
-                                            <div style="display:flex">
-                                                <span>{{ getQue(queNo).option[index].code }}.</span>
-                                                <div v-html="item.value"></div>
-                                            </div>
-                                        </p>
-                                    </i-col>
-                                </Row>
-
-                                <div style="clear:both"></div>
-                            </div>
-                        </label>
+                    <span style="margin-top:10px;font-weight:800">我的答题卡</span>
+                    <br />
+                    <!--<span style="margin-top:10px;font-weight:800">状态:</span>
+                    <div style="display:inline-flex">
+                        <div class="has-ans">
+                            <span style="padding:5px 5px;cursor:pointer">已作答</span>
+                        </div>
+                        <div class="ans-box">
+                            <span style="padding:5px 5px;cursor:pointer">未作答</span>
+                        </div>
+                    </div>-->
+                    <br />
+                    <span style="margin-top:10px;font-weight:800">题号:</span>
+                    <div class="que-box">
+                        <div v-for="(item,index) in examInfo" :class="checkers[index].length > 0 ? 'has-ans':'ans-box'" @click="gototheQues(index +1)">
+                            <span style="padding:5px 5px;cursor:pointer"> {{ item.parent == undefined ? index +1 : item.paperIndex }}</span>
+                        </div>
                     </div>
                     </div>
                 </div>
                 </div>
                 <!--切換頁-->
                 <!--切換頁-->
@@ -437,17 +408,31 @@
             closetest: function () {
             closetest: function () {
                 this.WarmMessageisOpen = false
                 this.WarmMessageisOpen = false
                 if (this.checkers.length) {
                 if (this.checkers.length) {
-                    let len = 0
-                    for (let i = 0; i < this.checkers.length;i++) {
-                        if (this.checkers[i].length !== 0) {
-                            len++
-                        }
-                    }
-                    this.summit()
-                    if (len == this.examInfo.length) {
-                    } else {
-                        this.$Message.warning('请完成作答再提交!')
+                    this.isLoading = true;
+                    let req = {
+                        id: this.$store.getters.getItemTitle.id,
+                        answer: this.checkers,
+                        studentId: this.$store.state.userInfo.sub,
+                        classId: this.$store.state.user.studentProfile.classinfo.id,
+                        subjectId: this.$store.getters.getPaperInfo.subjectId,
+                        multipleRule: this.$store.getters.getExamInfo.multipleRule,
+                        paperId: this.$store.getters.getPaperInfo.id,
+                        school: this.$store.getters.getItemTitle.school
                     }
                     }
+                    this.$api.studentWeb.SaveStuExamPaper(req).then(res => {
+                        if (res) {
+                            this.$Message.success('作答信息提交成功!')
+                            setTimeout(() => {
+                                this.$store.commit("ToggleLessonTestPopWithSubject", "")
+                                this.isLoading = false
+                            }, 2000)
+                        }
+                    }, err => {
+                        this.$Message.warning('作答信息保存失败!')
+                        setTimeout(() => {
+                            this.isLoading = false
+                        }, 1000)
+                    })
                 } 
                 } 
             },
             },
             quitTest() {
             quitTest() {
@@ -455,34 +440,7 @@
                 setTimeout(() => {
                 setTimeout(() => {
                     this.$store.commit("ToggleLessonTestPopWithSubject", "")
                     this.$store.commit("ToggleLessonTestPopWithSubject", "")
                     this.isLoading = false
                     this.isLoading = false
-                }, 1000)
-            },
-            summit() {
-                this.isLoading = true;
-                let req = {
-                    id: this.$store.getters.getItemTitle.id,
-                    answer: this.checkers,
-                    studentId: this.$store.state.userInfo.sub,
-                    classId: this.$store.state.user.studentProfile.classinfo.id,
-                    subjectId: this.$store.getters.getPaperInfo.subjectId,
-                    multipleRule:  this.$store.getters.getExamInfo.multipleRule,
-                    paperId: this.$store.getters.getPaperInfo.id,
-                    school: this.$store.getters.getItemTitle.school
-                }
-                this.$api.studentWeb.SaveStuExamPaper(req).then(res => {
-                    if (res) {
-                        this.$Message.success('作答信息提交成功!')
-                        setTimeout(() => {
-                            this.$store.commit("ToggleLessonTestPopWithSubject", "")
-                            this.isLoading = false
-                        }, 2000)
-                    }
-                }, err => {
-                    this.$Message.warning('作答信息保存失败!')
-                    setTimeout(() => {
-                        this.isLoading = false
-                    }, 1000)
-                })
+                }, 500)
             },
             },
         },
         },
 
 
@@ -507,11 +465,13 @@
             },
             },
         },
         },
         computed: {
         computed: {
-            examLength() {
+            completeRate() {
                 if (this.examInfo.length) {
                 if (this.examInfo.length) {
-                    let i = 0
-                    i = this.examInfo.length
-                    return i
+                    let data = 0
+                    data = Math.ceil(((this.examInfo.length - this.undo) / this.examInfo.length) * 100)
+                    return data
+                } else {
+                    return 0
                 }
                 }
 
 
             }
             }
@@ -521,9 +481,4 @@
 
 
 <style scoped>
 <style scoped>
     @import "~@/assets/student-web/component_styles/lesson-testpop.css";
     @import "~@/assets/student-web/component_styles/lesson-testpop.css";
-    .compose-content{
-        width:65%;
-        height:200px;
-        z-index:0;
-    }
 </style>
 </style>

+ 2 - 7
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/composePaper.vue

@@ -34,9 +34,6 @@
                 examInfo: [],
                 examInfo: [],
                 editor: null
                 editor: null
             }
             }
-        },
-        created() {
-
         },
         },
         methods: {
         methods: {
             getInfo() {
             getInfo() {
@@ -51,9 +48,7 @@
                 this.editorContent = ""
                 this.editorContent = ""
                 this.editor = new E("#textArea");
                 this.editor = new E("#textArea");
                 this.editor.config.onchange = (html) => {
                 this.editor.config.onchange = (html) => {
-                    console.log(html)
                     this.editorContent = html;
                     this.editorContent = html;
-
                 };
                 };
                 this.editor.config.showFullScreen = false
                 this.editor.config.showFullScreen = false
                 this.editor.config.menus = [
                 this.editor.config.menus = [
@@ -70,12 +65,12 @@
                 //    //console.log(link); // 插入的链接
                 //    //console.log(link); // 插入的链接
                 //    return true; // 返回 true 表示校验成功
                 //    return true; // 返回 true 表示校验成功
                 //};
                 //};
+                this.editor.config.placeholder = '请输入作答结果'
                 this.editor.config.height = 200
                 this.editor.config.height = 200
                 this.editor.config.showLinkImg = false;
                 this.editor.config.showLinkImg = false;
-                // 下面两个配置,使用其中一个即可显示“上传图片”的tab。但是两者不要同时使用!!!
                 this.editor.config.uploadImgShowBase64 = true; // 使用 base64 保存图片不建议使用这种,我只是图个方便
                 this.editor.config.uploadImgShowBase64 = true; // 使用 base64 保存图片不建议使用这种,我只是图个方便
                 // editor.customConfig.uploadImgServer = '/upload'  // 上传图片到服务器
                 // editor.customConfig.uploadImgServer = '/upload'  // 上传图片到服务器
-				this.$editorTools.addCanvas(this,this.editor)
+                this.$editorTools.addCanvas(this, this.editor)
                 this.editor.create();
                 this.editor.create();
                 this.editor.txt.clear()
                 this.editor.txt.clear()
                 if (this.examInfo.length > 0) {
                 if (this.examInfo.length > 0) {