Browse Source

练习的音频没有播放次数限制

Michael Wang 6 years ago
parent
commit
2ae8afd28b
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/features/OnlineExam/Examing/QuestionBody.vue

+ 6 - 1
src/features/OnlineExam/Examing/QuestionBody.vue

@@ -86,7 +86,12 @@ export default {
         // /question-audio.*?url="[^"]*"/.exec(this.questionBody)
         // /question-audio.*?url="[^"]*"/.exec(this.questionBody)
 
 
         question.audio = [];
         question.audio = [];
-        let re = /name="([^"]*)".*?question-audio.*?url="([^"]*)"/g;
+        let re;
+        if (/<a.*?question-audio.*?\/a>/.test(this.questionBody)) {
+          re = /name="([^"]*)".*?question-audio.*?url="([^"]*)"/g;
+        } else {
+          re = /name="([^"]*)".*?url="([^"]*)"/g;
+        }
         let array1;
         let array1;
         while ((array1 = re.exec(this.questionBody)) !== null) {
         while ((array1 = re.exec(this.questionBody)) !== null) {
           // console.log(`Found ${array1[0]}. Next starts at ${re.lastIndex}.`);
           // console.log(`Found ${array1[0]}. Next starts at ${re.lastIndex}.`);