lsc 1 year ago
parent
commit
db8871a92e

+ 1 - 1
dist/index.html

@@ -18,7 +18,7 @@
       border-radius: 10px;
       -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
       background-color: rgba(0, 0, 0, 0.1);
-    }</style><link href=./static/css/app.0e2d0bbaac4c1b1c634f59a059efe4e4.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.2ea62301d5bc18e5b15b.js></script><script type=text/javascript src=./static/js/app.40ff9b669b46f4ea2bfd.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.6792f26264d97d52125496dce54d482e.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.2ea62301d5bc18e5b15b.js></script><script type=text/javascript src=./static/js/app.3f4500c792acdc686742.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.0e2d0bbaac4c1b1c634f59a059efe4e4.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.6792f26264d97d52125496dce54d482e.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.6792f26264d97d52125496dce54d482e.css.map


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


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.3f4500c792acdc686742.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map


+ 34 - 5
src/components/EnglishVoice2/component/right.vue

@@ -34,6 +34,10 @@
       <testRole v-if="cjson.type == 'createRole'" :checkJson="answerArray"></testRole>
     </div>
     <div class="o_bottom" v-loading="isloading">
+      <div class="star_box" v-if="LuAudioUrl && star > 0">
+        <div class="star" v-for="index2 in 5" :key="'star' + index2" :class="{ starA: star >= (index2) }">
+        </div>
+      </div>
       <div class="audio" v-if="!LuAudioUrl">
         <img v-if="!isRecord" src="../../../assets/icon/englishVoice/start_aduio.png" alt="" @click="startRecorder">
         <img v-else src="../../../assets/icon/englishVoice/stop_audio.png" alt="" @click="startRecorder">
@@ -118,7 +122,8 @@ export default {
       calcTimer: null,
       totalSeconds: 0,
       answerArray: [],
-      id:this.guid()
+      id: this.guid(),
+      star: 0
     }
   },
   computed: {
@@ -197,7 +202,7 @@ export default {
           }
           this.$emit('setWork', this.answerArray, this.checkType)
         }
-
+        this.star = this.work[newVal] ? (this.work[newVal].score ? JSON.parse(JSON.stringify(this.work[newVal].score)) : 0) : 0
         this.oheight = 'auto'
         this.oWidth = '500px'
         const images = this.$refs['obox'].querySelectorAll('img');
@@ -325,7 +330,7 @@ export default {
       console.log(audioFile);
       let iiframe = this.$refs['iiframe']
 
-       
+
 
       // this.isloading = true
       //   this.beforeUpload1(audioFile, 3);
@@ -618,6 +623,8 @@ export default {
       }
       this.$emit('setWork', this.answerArray, this.checkType)
     }
+    this.star = this.work[this.checkType] ? (this.work[this.checkType].score ? JSON.parse(JSON.stringify(this.work[this.checkType].score)) : 0) : 0
+
     if (this.cjson.type != "createRole") {
       this.calculateParentHeight()
     }
@@ -642,7 +649,7 @@ export default {
 }
 
 .o_content {
-  height: calc(100% - 185px);
+  height: calc(100% - 210px);
   display: flex;
   align-items: center;
   justify-content: center;
@@ -651,7 +658,7 @@ export default {
 }
 
 .o_bottom {
-  height: 185px;
+  height: 210px;
   display: flex;
   flex-direction: column;
   align-items: center;
@@ -935,4 +942,26 @@ export default {
   cursor: pointer;
   border-radius: 4px
 }
+
+.star_box {
+  display: flex;
+  align-items: center;
+  margin-bottom: 10px
+}
+
+.star_box>.star {
+  width: 25px;
+  height: 25px;
+  display: block;
+  background-image: url('../../../assets/icon/englishVoice/star-no.png');
+  background-size: 100% 100%;
+}
+
+.star_box>.star+.star {
+  margin-left: 5px;
+}
+
+.star_box>.starA {
+  background-image: url('../../../assets/icon/englishVoice/star.png');
+}
 </style>

+ 89 - 31
src/components/checkEnglishVoice/component/right.vue

@@ -2,6 +2,9 @@
   <div class="o_box">
     <div class="o_top"></div>
     <div class="o_content">
+      <div class="type_box">
+        {{ getType(cjson) }}
+      </div>
       <div class="word_box">
         <div class="word_box2" v-if="cjson.type == 'word' || cjson.type == 'QA'">
           <div class="word_content" v-html="cjson.content"></div>
@@ -28,6 +31,10 @@
         <span v-if="!isRecord">点击话筒开始录音</span>
         <span v-else>点击话筒结束录音</span>
       </div> -->
+      <div class="star_box" v-if="LuAudioUrl && star > 0">
+        <div class="star" v-for="index2 in 5" :key="'star' + index2" :class="{ starA: star >= (index2) }">
+        </div>
+      </div>
       <div v-if="LuAudioUrl" class="audio_b">
         <mini-audio :audio-source="LuAudioUrl" class="audio_class"></mini-audio>
       </div>
@@ -100,9 +107,27 @@ export default {
       isRecord: false,
       isPlayerRecord: false,
       isloading: false,
-      answerArray: []
+      answerArray: [],
+      star: 0
     };
   },
+  computed: {
+    getType() {
+      return function (json) {
+        if (json.type == 'word') {
+          return '单词/词组'
+        } else if (json.type == 'QA') {
+          return '问答题目'
+        } else if (json.type == 'sentence') {
+          return '句子/短文'
+        } else if (json.type == 'theme') {
+          return '主题陈述'
+        } else if (json.type == 'createRole') {
+          return '角色对话'
+        }
+      };
+    },
+  },
   watch: {
     checkType: {
       handler: function (newVal, oldVal) {
@@ -148,6 +173,7 @@ export default {
             )
           }
         }
+        this.star = this.work[this.checkType] ? (this.work[this.checkType].score ? JSON.parse(JSON.stringify(this.work[this.checkType].score)) : 0) : 0
       },
       deep: true
     }
@@ -340,38 +366,39 @@ export default {
     } else if (typeof this.work[this.checkType] == 'object' && this.cjson.type != 'createRole') {
       this.LuAudioUrl = this.work[this.checkType].audio ? JSON.parse(JSON.stringify(this.work[this.checkType].audio)) : ''
     } else if (typeof this.work[newVal] == 'object' && this.cjson.type == 'createRole') {
-          var a = Array.isArray(this.work[newVal])
-          if (a) {
-            this.answerArray = JSON.parse(JSON.stringify(this.work[newVal]))
-          } else {
-            this.answerArray = []
-            this.answerArray.push(
-              {
-                isY: false,
-                content: this.cjson.content3,
-                name: this.cjson.content,
-                img: this.cjson.img
-              }
-            )
+      var a = Array.isArray(this.work[newVal])
+      if (a) {
+        this.answerArray = JSON.parse(JSON.stringify(this.work[newVal]))
+      } else {
+        this.answerArray = []
+        this.answerArray.push(
+          {
+            isY: false,
+            content: this.cjson.content3,
+            name: this.cjson.content,
+            img: this.cjson.img
           }
-          this.$emit('setWork', this.answerArray, this.checkType)
-        }
-        if (!this.work[newVal] && this.cjson.type == 'createRole') {
-          var a = Array.isArray(this.work[newVal])
-          if (a) {
-            this.answerArray = JSON.parse(JSON.stringify(this.work[newVal]))
-          } else {
-            this.answerArray = []
-            this.answerArray.push(
-              {
-                isY: false,
-                content: this.cjson.content3,
-                name: this.cjson.content,
-                img: this.cjson.img
-              }
-            )
+        )
+      }
+      this.$emit('setWork', this.answerArray, this.checkType)
+    }
+    if (!this.work[newVal] && this.cjson.type == 'createRole') {
+      var a = Array.isArray(this.work[newVal])
+      if (a) {
+        this.answerArray = JSON.parse(JSON.stringify(this.work[newVal]))
+      } else {
+        this.answerArray = []
+        this.answerArray.push(
+          {
+            isY: false,
+            content: this.cjson.content3,
+            name: this.cjson.content,
+            img: this.cjson.img
           }
-        }
+        )
+      }
+    }
+    this.star = this.work[this.checkType] ? (this.work[this.checkType].score ? JSON.parse(JSON.stringify(this.work[this.checkType].score)) : 0) : 0
     // this.LuAudioUrl = this.work[this.checkType]
     //   ? JSON.parse(JSON.stringify(this.work[this.checkType]))
     //   : "";
@@ -398,6 +425,7 @@ export default {
   align-items: center;
   justify-content: center;
   overflow: hidden;
+  position: relative;
 }
 
 .o_bottom {
@@ -629,4 +657,34 @@ export default {
 .audio_b>>>.vueAudioBetter .iconfont:active {
   position: unset;
 }
+
+.star_box {
+  display: flex;
+  align-items: center;
+  margin-bottom: 10px
+}
+
+.star_box>.star {
+  width: 25px;
+  height: 25px;
+  display: block;
+  background-image: url('../../../assets/icon/englishVoice/star-no.png');
+  background-size: 100% 100%;
+}
+
+.star_box>.star+.star {
+  margin-left: 5px;
+}
+
+.star_box>.starA {
+  background-image: url('../../../assets/icon/englishVoice/star.png');
+}
+
+.type_box {
+  width: calc(100% - 20px);
+    text-align: right;
+    color: #a5a5a5;
+    position: absolute;
+    top: 0;
+}
 </style>

+ 61 - 18
src/components/checkEnglishVoice/data/index.vue

@@ -7,25 +7,25 @@
         <div class="data_progress">
           <div class="depth">
               <div>
-                <el-progress :width="80" type="circle" :percentage="95" :stroke-width="15" :format="format" color="#40b640"></el-progress>
+                <el-progress :width="80" type="circle" :percentage="score.Pronunciation" :stroke-width="15" :format="format" color="#40b640"></el-progress>
               </div>
               <span>Pronunciation score</span>
           </div>
           <div class="depth">
               <div>
-                <el-progress :width="80" type="circle" :percentage="95" :stroke-width="15" :format="format" color="#bc66c3"></el-progress>
+                <el-progress :width="80" type="circle" :percentage="score.Accuracy" :stroke-width="15" :format="format" color="#bc66c3"></el-progress>
               </div>
               <span>Accuracy score</span>
           </div>
           <div class="depth">
               <div>
-                <el-progress :width="80" type="circle" :percentage="95" :stroke-width="15" :format="format" color="#e871bc"></el-progress>
+                <el-progress :width="80" type="circle" :percentage="score.Fluency" :stroke-width="15" :format="format" color="#e871bc"></el-progress>
               </div>
               <span>Fluency score</span>
           </div>
           <div class="depth">
               <div>
-                <el-progress :width="80" type="circle" :percentage="95" :stroke-width="15" :format="format" color="#697bda"></el-progress>
+                <el-progress :width="80" type="circle" :percentage="score.Completeness" :stroke-width="15" :format="format" color="#697bda"></el-progress>
               </div>
               <span>Completeness score</span>
           </div>
@@ -34,8 +34,8 @@
       <div class="whiteBox" v-if="wordArray.length">
         <div class="word_box" v-for="(item, index) in wordArray" :key="index">
           <div class="word"><span>{{ index + 1 }}.</span><span>{{ item.content }}</span></div>
-          <div class="star_box">
-            <div class="star" v-for="index2 in 5" :key="'star' + index2" :class="{ starA: 3 >= (index2) }">
+          <div class="star_box" v-if="item.work && item.work.score">
+            <div class="star" v-for="index2 in 5" :key="'star' + index2" :class="{ starA: item.work.score >= (index2) }">
             </div>
           </div>
         </div>
@@ -46,13 +46,13 @@
             <div class="title">{{ index+1 }}.原文:</div>
             <div class="content">{{ item.content }}</div>
           </div>
-          <div class="star_box" style="margin: 10px 0;">
-            <div class="star" v-for="index2 in 5" :key="'star' + index2" :class="{ starA: 3 >= (index2) }">
+          <div class="star_box" style="margin: 10px 0;" v-if="item.work && item.work.score">
+            <div class="star" v-for="index2 in 5" :key="'star' + index2" :class="{ starA: item.work.score >= (index2) }">
             </div>
           </div>
           <div class="setence">
             <div class="title">录音译文:</div>
-            <div class="content">{{ item.content }}</div>
+            <span>{{ (item.work && item.work.text) ? item.work.text : '无' }}</span>
           </div>
         </div>
       </div>
@@ -62,13 +62,13 @@
             <div class="title">{{ index+1 }}.问题:</div>
             <div class="content">{{ item.content }}</div>
           </div>
-          <div class="star_box" style="margin: 10px 0;">
+          <!-- <div class="star_box" style="margin: 10px 0;">
             <div class="star" v-for="index2 in 5" :key="'star' + index2" :class="{ starA: 3 >= (index2) }">
             </div>
-          </div>
+          </div> -->
           <div class="setence">
             <div class="title">录音回答译文:</div>
-            <div class="content">{{ item.content }}</div>
+            <span>{{ (item.work && item.work.text) ? item.work.text : '无' }}</span>
           </div>
         </div>
       </div>
@@ -81,29 +81,41 @@
               <span>{{ item.content2 }}</span>
             </div>
           </div>
-          <div class="star_box" style="margin: 10px 0;">
+          <!-- <div class="star_box" style="margin: 10px 0;">
             <div class="star" v-for="index2 in 5" :key="'star' + index2" :class="{ starA: 3 >= (index2) }">
             </div>
-          </div>
+          </div> -->
           <div class="setence">
             <div class="title">录音回答译文:</div>
             <div class="content2">
-              <span>{{ item.content }}</span>
-              <span>{{ item.content2 }}</span>
+              <!-- <span>{{ item.content }}</span> -->
+              <span>{{ (item.work && item.work.text) ? item.work.text : '无' }}</span>
             </div>
           </div>
         </div>
       </div>
       <div class="whiteBox" v-if="createRoleArray.length">
+        <div class="setenceBox" v-for="(item, index) in createRoleArray" :key="index">
+          <div class="setence">
+            <div class="title">{{ index+1 }}.对话:</div>
+            <div class="content2" v-if="item.work && item.work.length">
+              <testRole :checkJson="item.work"></testRole>
+            </div>
+            <div class="content2" v-else>
+              暂未对话
+            </div>
+          </div>
+        </div>
       </div>
     </div>
   </el-dialog>
 </template>
   
 <script>
-
+import testRole from "../component/testRole.vue";
 export default {
   components: {
+    testRole
   },
   props: {
     dataDialog: {
@@ -132,7 +144,13 @@ export default {
       sentenceArray: [],
       QAArray: [],
       themeArray: [],
-      createRoleArray: []
+      createRoleArray: [],
+      score:{
+        Pronunciation: 0,
+        Accuracy: 0,
+        Fluency: 0,
+        Completeness: 0,
+      }
     };
   },
   methods: {
@@ -150,6 +168,13 @@ export default {
       this.close2();
     },
     setVoiceJson(val) {
+      let score = {
+        Pronunciation: 0,
+        Accuracy: 0,
+        Fluency: 0,
+        Completeness: 0,
+      }
+      let scoreCont = 0
       let a = JSON.parse(JSON.stringify(val));
       this.title = a.title;
       this.detail = a.detail;
@@ -159,6 +184,24 @@ export default {
       let works = JSON.parse(
         JSON.parse(JSON.stringify(this.commentDetail.works))
       );
+      for(var i = 0; i < works.length; i++){
+        if (i > (this.checkJson.length - 1)) {
+          break
+        }
+        if(works[i].star){
+          scoreCont++
+          score.Pronunciation += works[i].star.PronScore
+          score.Accuracy += works[i].star.AccuracyScore
+          score.Fluency += works[i].star.FluencyScore
+          score.Completeness += works[i].star.CompletenessScore
+        }
+      }
+      this.score = {
+        Pronunciation: parseInt((score.Pronunciation / scoreCont).toFixed(0)),
+        Accuracy: parseInt((score.Accuracy / scoreCont).toFixed(0)),
+        Fluency: parseInt((score.Fluency / scoreCont).toFixed(0)),
+        Completeness: parseInt((score.Completeness / scoreCont).toFixed(0)),
+      }
       for (var i = 0; i < this.checkJson.length; i++) {
         this.checkJson[i].work = ''
         if (i > (works.length - 1)) {

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