Browse Source

修复部分问题

lujianhong 4 years ago
parent
commit
de403e64e5

+ 3 - 3
EBook.Web/AnsText/21255.json

@@ -81,11 +81,11 @@
   },
   {
     "AudioLength": 0,
-    "AudioUrl": "",
+    "AudioUrl": "http://172.16.41.241:10103/http_TBookEditor51/exerciseAnswerAudio/2020-12-04_04-52-34.wav",
     "Id": "10",
     "Score": 0.0,
-    "Text": "",
-    "Type": 1
+    "Text": "learning learning learning learning learning learning nineteen ninety ninelearning learning learning learning learning learning nineteen ninety ninelearning learning learning learning learning learning nineteen ninety ninelearning learning learning learning learning learning nineteen ninety ninelearning learning learning learning learning learning nineteen ninety ninelearning learning learning learning learning learning nineteen ninety ninelearning learning learning learning learning learning nineteen ninety ninelearning learning learning learning learning learning nineteen ninety ninelearning learning learning learning learning learning nineteen ninety ninelearning learning learning learning learning learning nineteen ninety ninelearning learning learning learning learning learning nineteen ninety ninelearning learning learning learning learning learning nineteen ninety nine",
+    "Type": 3
   },
   {
     "AudioLength": 0,

+ 20 - 11
EBook.Web/Common/tasklib_book.css

@@ -1,20 +1,29 @@
 body {text-align:left;}
-.answer-range {background-color:#eaf6ff;border-radius: 5px; display:inline-block;margin-bottom:-5px;margin-top:8px;}
-.answer-range img {float:left;margin-left:3px;margin-top:5px;width:20px;height:20px;}
-
-.answertext { float:left;margin-left:5px; margin-right:8px;color:#6ab7ff;line-height:30px;font-size:16px;}
-.answertext:focus { border: 0 none;outline: none;border-bottom:solid #6ab7ff 1px;}
-.answer-img {margin-left:3px;margin-top:5px;width:20px;height:20px;top:5px;}
-
-.no-answer { color:#989898;text-decoration:none;}
+p{word-break: break-word;word-wrap: break-word;}
+/*作答区域外层*/
+.answer-body {background-color:#eaf6ff;border-radius: 5px;display:inline-block;margin-bottom:-1px;margin-top:8px;}
+.answer-border {border:solid #66b6ff 1px;}
+/*作答音频区域*/
+.answer-audio-range { border-radius: 5px;border:solid #66b6ff 1px;height:25px;background-color:#eaf6ff;display:none;margin-bottom:-6px;}
+.answer-audio-range img {float:left;margin-left:3px;margin-top:3px;width:20px;height:20px;}
+.answer-audio-range span { float:left;margin-left:4px; margin-right:5px;color:#6ab7ff;line-height:25px;font-size:16px;}
+/*答题点区域*/
+.answer-point-range { border-radius: 5px;height:25px;}
+.answer-point-range img {float:left;margin-left:3px;margin-top:5px;width:16px;height:16px;}
+.answer-point-range span { float:left;margin-left:3px; margin-right:7px;color:#6ab7ff;line-height:25px;font-size:16px;}
+/*作答内容*/
+.answer-text { margin-left:5px; margin-right:8px;color:#6ab7ff;line-height:25px;font-size:16px;word-break:break-word;word-wrap:break-word;display:inline-block;text-indent:0;display:none;}
+/*评阅及点击相关样式*/
+.no-answer { color:#989898;}
 .bad-answer { color:red; }
 .good-answer { color:green; }
 .select-answer {background:#ffefe4;}
-.select-answer span {color:#ff6600;}
-.break-word {word-break:break-word;word-wrap:break-word;display:inline-block;text-indent:0;}
-.audio {margin-top:8px;}
+.select-answer .answer-text {color:#ff6600;}
+.select-answer .answer-point-range span {color:#ff6600;}
 
 /*.docxParagraphs {border:solid red 1px;}*/
+.answertext {border:0px; border-bottom:solid #6ab7ff 1px; padding-left:5px; color:#6ab7ff;word-break:keep-all;}
+.btn-bgimg { background:url(../Images/update-answer.png) no-repeat;background-position: left 3px;padding-left:18px;font-size:16px;}
 
 .div-container {
     position: relative;

+ 130 - 123
EBook.Web/Common/tasklib_book.js

@@ -1,6 +1,6 @@
 //播放音频图片地址
-var PicInfo = {
-    answerPointImgUrl: "file:///android_asset/js/update-answer.png", //../Images/update-answer.png
+var PicInfo1 = {
+    answerPointImgUrl: "file:///android_asset/js/update-answer.png",
     yaoshiShowImgUrl: "file:///android_asset/js/yaoshi-show.png",
     yaoshiHideImgUrl: "file:///android_asset/js/yaoshi-hide.png",
     recordPlayImgUrl: "file:///android_asset/js/play.png",
@@ -9,6 +9,18 @@ var PicInfo = {
     audioPauseImgUrl: "file:///android_asset/js/dynaiselaba.png"
 }
 
+//本地调用用的资源
+var PicInfo = {
+    answerPointImgUrl: "../Images/update-answer.png",
+    yaoshiShowImgUrl: "../Images/yaoshi-show.png",
+    yaoshiHideImgUrl: "../Images/yaoshi-hide.png",
+    KouYuTagImgUrl: "../Images/KY.png",
+    recordPlayImgUrl: "../Images/play.png",
+    recordPauseImgUrl: "../Images/pause.png",
+    audioPlayImgUrl: "../Images/dynaiselaba.gif",
+    audioPauseImgUrl: "../Images/dynaiselaba.png"
+}
+
 //显示、隐藏答案
 function showHideAnswer(flag) {
     if (flag) {
@@ -403,7 +415,7 @@ function handleAnswerRange() {
                 break;
             }
         }
-        $(item).prop("outerHTML", "<div class='answer-range' answer-id='" + answerid + "' answer-anstext='" + answerText + "' answer-isky='" + isky + "'><img src='" + PicInfo.answerPointImgUrl + "'/><span class='answertext'>答题点</span></div>");
+        $(item).prop("outerHTML", "<div class='answer-body' answer-id='" + answerid + "' answer-anstext='" + answerText + "' answer-isky='" + isky + "'><div class='answer-audio-range'><img src='" + PicInfo.recordPlayImgUrl + "'/><span class='answer-audio-text'>作答音频</span></div><div class='answer-point-range'><img src='" + PicInfo.answerPointImgUrl + "'/><span class='answer-point-text'>答题点</span></div><buttom class='answer-text'></buttom></div>");
         //删除钥匙节点
         var prev = $("img[answer-id='" + answerid + "']");
         if (prev.length > 0) {
@@ -412,7 +424,7 @@ function handleAnswerRange() {
     });
 
     //添加点击事件
-    $(".answer-range").on("click", function () {
+    $(".answer-body").on("click", function () {
         var curObj = new Object();
         curObj.Id = $(this).attr("answer-id");//答题点ID
         curObj.IsKY = $(this).attr("answer-isky");//是否是口语试题,0-不是口语题,1-是口语题
@@ -421,7 +433,7 @@ function handleAnswerRange() {
         curObj.AnsText = $(this).attr("answer-anstext");//参考答案
         curObj.Comment = $(this).attr("answer-comment");//评语
 
-        $(".answer-range").removeClass("select-answer");
+        $(".answer-body").removeClass("select-answer");
         $(this).addClass("select-answer");
 
         //已作答,弹出作答答案
@@ -451,55 +463,49 @@ function handleAnswerRange() {
 function reviewAnswer(answerJson) {
     if (answerJson != "" && answerJson) {
         var answerObj = JSON.parse(answerJson);
-        var selectElement = $(".answer-range[answer-id='" + answerObj.Id + "']");
-        var audioElement = $(selectElement).children("img").eq(0);
+        var selectElement = $(".answer-body[answer-id='" + answerObj.Id + "']");
+        var audioElement = $(selectElement).children(".answer-audio-range").children("img").eq(0);
         answerObj.IsKY = $(selectElement).attr("answer-isky");//是否是口语试题,0-不是口语题,1-是口语题
 
-        //有内容时,要动态处理单词长度
-        if (answerObj.Text != "") {
-            $(selectElement).addClass("break-word");
-        }
-        else {
-            $(selectElement).removeClass("break-word");
-        }
-
-        //是否是音频作答
+        //是否为音频作答
         if ((answerObj.Type == 3 || answerObj.Type == 4) && answerObj.AudioUrl != "") {
-            $(selectElement).attr("answer-text", answerObj.Text);//填充作答内容
-            answerObj.Text = answerObj.Text == "" ? "作答音频[" + answerObj.AudioLength + "s]" : "作答音频[" + answerObj.AudioLength + "s]" + "(" + answerObj.Text + ")";
-            $(selectElement).children("span").text(answerObj.Text);
-
-            //是否之前存在作答音频
-            $(selectElement).attr("play-status", "0");
-            $(audioElement).attr("src", PicInfo.recordPlayImgUrl);
-            var curDisplay = $(audioElement).css("display");
-            if (curDisplay == "none") {
-                $(audioElement).show();
+            $(selectElement).children(".answer-point-range").hide();
+            $(selectElement).children(".answer-audio-range").css("display", "inline-block");
+            $(selectElement).children(".answer-audio-range").children("span").text("作答音频(" + answerObj.AudioLength + "s)");
+            //填充作答内容
+            $(selectElement).attr("answer-text", answerObj.Text);
+            if (answerObj.Text != "") {
+                answerObj.Text = "(" + answerObj.Text + ")";
+                $(selectElement).children(".answer-text").show();
+                $(selectElement).children(".answer-text").text(answerObj.Text);
             }
 
+            //是否之前存在作答音频
             $(selectElement).attr("answer-url", answerObj.AudioUrl);
+            $(audioElement).attr("src", PicInfo.recordPlayImgUrl);
+            $(selectElement).children(".answer-audio-range").attr("play-status", "0");
             //独立绑定事件
             $(audioElement).on("click", function () {
                 recordAudioClick(this, answerObj.Id, answerObj.AudioUrl);
             });
-            $(selectElement).children("span").on("click", function () {
-                $(".answer-range").removeClass("select-answer");
-                $(item).addClass("select-answer");
+            $(selectElement).children(".answer-audio-range").children("span").on("click", function () {
+                $(".answer-body").removeClass("select-answer");
+                $(selectElement).addClass("select-answer");
                 onClickAnswerPoint(JSON.stringify(answerObj));
             });
         }
         else {
             $(selectElement).attr("answer-text", answerObj.Text);//填充作答内容
-            if (answerObj.Text == "") {
-                answerObj.Text = "答题点";
-                $(audioElement).show();
-                $(audioElement).attr("src", PicInfo.answerPointImgUrl);
+            $(selectElement).children(".answer-audio-range").hide();
+            if (answerObj.Text != "") {
+                $(selectElement).children(".answer-text").show();
+                $(selectElement).children(".answer-point-range").hide();
+                $(selectElement).children(".answer-text").text(answerObj.Text);
             }
             else {
-                //之前作答存在音频,但是现在没有音频传入,要隐藏音频节点
-                $(audioElement).hide();
+                $(selectElement).children(".answer-text").hide();
+                $(selectElement).children(".answer-point-range").show();
             }
-            $(selectElement).children("span").text(answerObj.Text);
         }
     }
 }
@@ -507,17 +513,19 @@ function reviewAnswer(answerJson) {
 //提交,获取所有作答答案及参考答案
 function getAllAnswer() {
     //处理作答
-    $.each($(".answer-range"), function (index, item) {
-        var mytext = $(item).children("span").text();
-        if (mytext == "答题点") {
+    $.each($(".answer-body"), function (index, item) {
+        var mytext = $(item).children(".answer-text").text();
+        var curDisplay = $(item).children(".answer-audio-range").css("display");
+        if (mytext == "" && curDisplay == "none") {
             mytext = "未作答";
-            $(item).children("span").addClass("no-answer");
-            $(item).children("img").hide();
-            $(item).children("span").text(mytext);
+            $(item).children(".answer-point-range").hide();
+            $(item).children(".answer-text").show();
+            $(item).children(".answer-text").text(mytext);
+            $(item).children(".answer-text").addClass("no-answer");
         }
     });
-    $(".answer-range").unbind('click');//取消点击绑定事件
-    $(".answer-range>span").unbind('click');//取消点击绑定事件
+    $(".answer-body").unbind('click');//取消点击绑定事件
+    $(".answer-body").children(".answer-audio-range").children("span").unbind('click');//取消点击绑定事件
 
     return answerData;
 }
@@ -526,87 +534,75 @@ function getAllAnswer() {
 function backupAllAnswer(answerJson, statusType) {
     if (answerJson != "" && answerJson) {
         var answerList = JSON.parse(answerJson);
-        //answerList = JSON.parse(answerList);
-        //获取Dom一个个回填
-        $.each($(".answer-range"), function (index, item) {
+        $.each($(".answer-body"), function (index, item) {
             //提交直接还原作答现场
             var mytext = answerList[index].Text;//我的答案
             answerList[index].IsKY = $(item).attr("answer-isky");//是否是口语试题,0-不是口语题,1-是口语题
-            //有内容时,要动态处理单词长度
-            if (mytext != "") {
-                $(item).addClass("break-word");
-            }
 
             //添加音频控制
-            var audioElement = $(item).children("img").eq(0);
+            var audioElement = $(item).children(".answer-audio-range").children("img").eq(0);
             if ((answerList[index].Type == 3 || answerList[index].Type == 4) && answerList[index].AudioUrl != "") {
-                $(item).attr("answer-text", mytext);//填充作答内容
-                mytext = mytext == "" ? "作答音频[" + answerList[index].AudioLength + "s]" : "作答音频[" + answerList[index].AudioLength + "s]" + "(" + mytext + ")";
-                $(item).children("span").text(mytext);
-
-                $(item).attr("play-status", "0");
-                $(item).attr("answer-url", answerList[index].AudioUrl);
+                $(item).children(".answer-point-range").hide();
+                $(item).children(".answer-audio-range").css("display", "inline-block");
+                $(item).children(".answer-audio-range").children("span").text("作答音频(" + answerList[index].AudioLength + "s)");
+                //填充作答内容
+                $(item).attr("answer-text", mytext);
+                if (mytext != "") {
+                    mytext = "(" + mytext + ")";
+                    $(item).children(".answer-text").show();
+                    $(item).children(".answer-text").text(mytext);
+                }
+                //音频节点
                 $(audioElement).attr("src", PicInfo.recordPlayImgUrl);
+                $(item).attr("answer-url", answerList[index].AudioUrl);
+                $(item).children(".answer-audio-range").attr("play-status", "0");
+
+                //独立绑定事件
+                $(audioElement).on("click", function () {
+                    recordAudioClick(this, answerList[index].Id, answerList[index].AudioUrl);
+                });
             }
 
             //可作答状态,作答还原
             if (statusType == 0) {
                 //已作答过,还原作答,增加作答后的UI节点
                 if ((answerList[index].Type == 3 || answerList[index].Type == 4) && answerList[index].AudioUrl != "") {
-                    //独立绑定事件
-                    $(item).children("img").on("click", function () {
-                        recordAudioClick(this, answerList[index].Id, answerList[index].AudioUrl);
-                    });
-                    $(item).children("span").on("click", function () {
-                        $(".answer-range").removeClass("select-answer");
+                    $(item).children(".answer-audio-range").children("span").on("click", function () {
+                        $(".answer-body").removeClass("select-answer");
                         $(item).addClass("select-answer");
                         onClickAnswerPoint(JSON.stringify(answerList[index]));
                     });
                 }
                 else {
                     $(item).attr("answer-text", mytext);//填充作答内容
-                    if (mytext == "") {
-                        mytext = "答题点";
-                        $(audioElement).attr("src", PicInfo.answerPointImgUrl);
-                    }
-                    else {
-                        //之前作答存在音频,但是现在没有音频传入,要隐藏音频节点
-                        $(audioElement).hide();
+                    if (mytext != "") {
+                        $(item).children(".answer-text").show();
+                        $(item).children(".answer-point-range").hide();
+                        $(item).children(".answer-text").text(mytext);
                     }
-                    $(item).children("span").text(mytext);
                 }
             }
             //已提交,作答还原
             if (statusType == 1) {
                 //取消点击绑定事件
                 $(item).unbind('click');
-                //添加音频控制
-                if ((answerList[index].Type == 3 || answerList[index].Type == 4) && answerList[index].AudioUrl != "") {
-                    //独立绑定事件
-                    $(item).children("img").on("click", function () {
-                        recordAudioClick(this, answerList[index].Id, answerList[index].AudioUrl);
-                    });
-                }
-                else {
-                    $(item).attr("answer-text", mytext);//填充作答内容
-                    if (mytext == "") {
-                        mytext = "未作答";
-                        $(item).children("span").addClass("no-answer");
-                    }
-                    $(audioElement).hide();
-                    $(item).children("span").text(mytext);
+                //填充作答内容
+                $(item).attr("answer-text", mytext);
+                if (mytext == "") {
+                    mytext = "未作答";
+                    $(item).children(".answer-text").addClass("no-answer");
                 }
+                $(item).children(".answer-text").show();
+                $(item).children(".answer-text").text(mytext);
+                $(item).children(".answer-point-range").hide();
             }
             //已评阅,查看评阅详情
             if (statusType == 2) {
                 //添加音频控制
                 if ((answerList[index].Type == 3 || answerList[index].Type == 4) && answerList[index].AudioUrl != "") {
                     //独立绑定事件
-                    $(item).children("img").on("click", function () {
-                        recordAudioClick(this, answerList[index].Id, answerList[index].AudioUrl);
-                    });
-                    $(item).children("span").on("click", function () {
-                        $(".answer-range").removeClass("select-answer");
+                    $(item).children(".answer-audio-range").children("span").on("click", function () {
+                        $(".answer-body").removeClass("select-answer");
                         $(item).addClass("select-answer");
                         onClickAnswerPoint(JSON.stringify(answerList[index]));
                     });
@@ -615,17 +611,19 @@ function backupAllAnswer(answerJson, statusType) {
                     $(item).attr("answer-text", mytext);//填充作答内容
                     if (mytext == "") {
                         mytext = "未作答";
-                        $(item).children("span").addClass("no-answer");
+                        $(item).children(".answer-text").addClass("no-answer");
                     }
-                    $(audioElement).hide();
-                    $(item).children("span").text(mytext);
+                    $(item).children(".answer-text").show();
+                    $(item).children(".answer-text").text(mytext);
+                    $(item).children(".answer-point-range").hide();
                 }
+
                 //评阅样式
                 if (answerList[index].Score == 0 && answerList[index].Text != "") {
-                    $(item).children("span").addClass("bad-answer");
+                    $(item).children(".answer-text").addClass("bad-answer");
                 }
                 if (answerList[index].Score > 0) {
-                    $(item).children("span").addClass("good-answer");
+                    $(item).children(".answer-text").addClass("good-answer");
                 }
             }
         });
@@ -636,7 +634,7 @@ function backupAllAnswer(answerJson, statusType) {
 function reviewStuAnswer(answerJson) {
     if (answerJson != "" && answerJson) {
         var answerObj = JSON.parse(answerJson);
-        var selectElement = $(".answer-range[answer-id='" + answerObj.Id + "']");
+        var selectElement = $(".answer-body[answer-id='" + answerObj.Id + "']");
 
         //$(selectElement).attr("answer-text", answerObj.Text);//用户作答内容
         $(selectElement).attr("answer-score", answerObj.Score);//作答评分
@@ -644,12 +642,12 @@ function reviewStuAnswer(answerJson) {
         $(selectElement).attr("answer-comment", answerObj.Comment);//评语
         //评阅样式
         if (answerObj.Score == 0) {
-            $(selectElement).children("span").removeClass("good-answer");
-            $(selectElement).children("span").addClass("bad-answer");
+            $(selectElement).children(".answer-text").removeClass("good-answer");
+            $(selectElement).children(".answer-text").addClass("bad-answer");
         }
         if (answerObj.Score > 0) {
-            $(selectElement).children("span").removeClass("bad-answer");
-            $(selectElement).children("span").addClass("good-answer");
+            $(selectElement).children(".answer-text").removeClass("bad-answer");
+            $(selectElement).children(".answer-text").addClass("good-answer");
         }
     }
 }
@@ -658,7 +656,7 @@ function reviewStuAnswer(answerJson) {
 function backupAllReview(answerJson) {
     if (answerJson != "" && answerJson) {
         var answerList = JSON.parse(answerJson);
-        $.each($(".answer-range"), function (index, item) {
+        $.each($(".answer-body"), function (index, item) {
             //$(item).attr("answer-id", answerList[index].Id);//答题点ID
             //$(item).attr("answer-text", answerList[index].Text);//用户作答内容
             $(item).attr("answer-score", answerList[index].Score);//作答评分
@@ -667,41 +665,50 @@ function backupAllReview(answerJson) {
 
             //提交直接还原作答现场
             var mytext = answerList[index].Text;//我的答案
-            var audioElement = $(item).children("img").eq(0);
+            var audioElement = $(item).children(".answer-audio-range").children("img").eq(0);
             if ((answerList[index].Type == 3 || answerList[index].Type == 4) && answerList[index].AudioUrl != "") {
-                $(item).attr("answer-text", mytext);//填充作答内容
-                mytext = mytext == "" ? "作答音频[" + answerList[index].AudioLength + "s]" : "作答音频[" + answerList[index].AudioLength + "s]" + "(" + mytext + ")";
-                $(item).children("span").text(mytext);
+                $(item).children(".answer-point-range").hide();
+                $(item).children(".answer-audio-range").css("display", "inline-block");
+                $(item).children(".answer-audio-range").children("span").text("作答音频(" + answerList[index].AudioLength + "s)");
+                //填充作答内容
+                $(item).attr("answer-text", mytext);
+                if (mytext != "") {
+                    mytext = "(" + mytext + ")";
+                    $(item).children(".answer-text").show();
+                    $(item).children(".answer-text").text(mytext);
+                }
 
-                $(item).attr("play-status", "0");
-                $(item).attr("answer-url", answerList[index].AudioUrl);
+                //是否之前存在作答音频
                 $(audioElement).attr("src", PicInfo.recordPlayImgUrl);
+                $(item).attr("answer-url", answerList[index].AudioUrl);
+                $(item).children(".answer-audio-range").attr("play-status", "0");
                 //独立绑定事件
-                $(item).children("img").on("click", function () {
+                $(audioElement).on("click", function () {
                     recordAudioClick(this, answerList[index].Id, answerList[index].AudioUrl);
                 });
-                $(item).children("span").on("click", function () {
-                    $(".answer-range").removeClass("select-answer");
+                $(item).children(".answer-audio-range").children("span").on("click", function () {
+                    $(".answer-body").removeClass("select-answer");
                     $(item).addClass("select-answer");
-                    onClickAnswerPoint(JSON.stringify(answerList[index]));//移动端的修改
+                    onClickAnswerPoint(JSON.stringify(answerList[index]));
                 });
             }
             else {
                 $(item).attr("answer-text", mytext);//填充作答内容
                 if (mytext == "") {
                     mytext = "未作答";
-                    $(item).children("span").addClass("no-answer");
+                    $(item).children(".answer-text").addClass("no-answer");
                 }
-                $(audioElement).hide();
-                $(item).children("span").text(mytext);
+                $(item).children(".answer-text").show();
+                $(item).children(".answer-text").text(mytext);
+                $(item).children(".answer-point-range").hide();
             }
 
             //评阅样式
             if (answerList[index].Score == 0) {
-                $(item).children("span").addClass("bad-answer");
+                $(item).children(".answer-text").addClass("bad-answer");
             }
             if (answerList[index].Score > 0) {
-                $(item).children("span").addClass("good-answer");
+                $(item).children(".answer-text").addClass("good-answer");
             }
         });
     }
@@ -710,7 +717,7 @@ function backupAllReview(answerJson) {
 //处理播放录音,answerid:答题点ID,isPlay:是否播放(0-暂停,1-播放)
 function playRecordAudio(answerid, isPlay) {
     //获取其他正在播放的音频
-    var playing = $(".answer-range[answer-id='" + answerid + "']");
+    var playing = $(".answer-body[answer-id='" + answerid + "']").children(".answer-audio-range");
     if (playing.length > 0) {
         if (isPlay == "1") {
             $(playing).attr("play-status", "1");
@@ -726,8 +733,8 @@ function playRecordAudio(answerid, isPlay) {
 //滚动到相应DIV
 function scrollAnswer(answerid) {
     //console.log(answerid);
-    $(".answer-range").removeClass("select-answer");
-    var ansDom = $(".answer-range[answer-id='" + answerid + "']");
+    $(".answer-body").removeClass("select-answer");
+    var ansDom = $(".answer-body[answer-id='" + answerid + "']");
     $(ansDom).addClass("select-answer");
     var scroll_offset = $(ansDom).offset(); //得到box这个div层的offset,包含两个值,top和left
     var offset_top = scroll_offset.top;
@@ -761,7 +768,7 @@ function audioPlayClick(myobj) {
     }
     else {
         //停止其他作答音频播放
-        var isRecordPlaying = $(".answer-range[play-status='1']");
+        var isRecordPlaying = $(".answer-audio-range[play-status='1']");
         if (isRecordPlaying.length > 0) {
             $(isRecordPlaying).attr("play-status", "0");
             $(isRecordPlaying).find("img").attr("src", PicInfo.recordPlayImgUrl);//移动端要根据本地路径替换
@@ -789,7 +796,7 @@ function recordAudioClick(myobj, id, url) {
     //处理当前按钮的状态
     if ($(myobj).parent().attr("play-status") == "0") {
         //停止其他作答音频播放
-        var isRecordPlaying = $(".answer-range[play-status='1']");
+        var isRecordPlaying = $(".answer-audio-range[play-status='1']");
         if (isRecordPlaying.length > 0) {
             $(isRecordPlaying).attr("play-status", "0");
             $(isRecordPlaying).find("img").attr("src", PicInfo.recordPlayImgUrl);//移动端要根据本地路径替换

+ 20 - 3
EBook.Web/EBook.Web.csproj

@@ -13,13 +13,14 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>EBook.Web</RootNamespace>
     <AssemblyName>EBook.Web</AssemblyName>
-    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <UseIISExpress>true</UseIISExpress>
     <IISExpressSSLPort />
     <IISExpressAnonymousAuthentication />
     <IISExpressWindowsAuthentication />
     <IISExpressUseClassicPipelineMode />
     <UseGlobalApplicationHostFile />
+    <TargetFrameworkProfile />
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
@@ -29,6 +30,7 @@
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
@@ -37,20 +39,27 @@
     <DefineConstants>TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\word\FSCloud\V2.1\svn\code\PC\FSCModule\Website\DLL\Newtonsoft.Json.dll</HintPath>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Data" />
-    <Reference Include="System.Core" />
     <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Web.ApplicationServices" />
+    <Reference Include="System.Web.DynamicData" />
+    <Reference Include="System.Web.Entity" />
     <Reference Include="System.Web.Extensions" />
-    <Reference Include="System.Xml.Linq" />
     <Reference Include="System.Drawing" />
     <Reference Include="System.Web" />
     <Reference Include="System.Xml" />
     <Reference Include="System.Configuration" />
     <Reference Include="System.Web.Services" />
     <Reference Include="System.EnterpriseServices" />
+    <Reference Include="System.Xml.Linq" />
   </ItemGroup>
   <ItemGroup>
     <Content Include="AnsText\20578.txt" />
@@ -109,12 +118,20 @@
     <Content Include="TagWord\TextTraining.js" />
     <Content Include="Temp.html" />
     <Content Include="Test.html" />
+    <Content Include="Test\Test.aspx" />
     <Content Include="TxtStr\01.txt" />
     <Content Include="TxtStr\02.txt" />
     <Content Include="Web.config" />
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Test\Test.aspx.cs">
+      <DependentUpon>Test.aspx</DependentUpon>
+      <SubType>ASPXCodeBehind</SubType>
+    </Compile>
+    <Compile Include="Test\Test.aspx.designer.cs">
+      <DependentUpon>Test.aspx</DependentUpon>
+    </Compile>
   </ItemGroup>
   <ItemGroup>
     <Content Include="Lghp\20322.lghp" />

+ 4 - 3
EBook.Web/Test.html

@@ -47,7 +47,7 @@
         }
         //加载听说课文
         $("#load-text").on("click", function () {
-            var data = $.ajax({ url: "lghp/21773.lghp", async: false }).responseText;
+            var data = $.ajax({ url: "lghp/data13.lghp", async: false }).responseText;
             $("#data").html(data);
 
             //Fill(JSON.parse(hightcodejson));
@@ -55,6 +55,7 @@
             //bindCoursewareEvent();
 
             var ResInfo = {
+                answerPointImgUrl: "Images/update-answer.png",
                 yaoshiShowImgUrl: "Images/yaoshi-show.png",
                 yaoshiHideImgUrl: "Images/yaoshi-hide.png",
                 KouYuTagImgUrl: "Images/KY.png",
@@ -113,8 +114,8 @@
             //var answerJson = "{\"AudioLength\":0,\"AudioUrl\":\"\",\"Id\":\"1\",\"Text\":\"sdasd\",\"Type\":1}";
             //var answerJson = "{\"AudioLength\":5,\"AudioUrl\":\"http://172.16.41.241:10103/Web_AITeachCloudV10/Files/UpLoad/zxstu155/2020/11/25/8a5d785d626748bbaa027895568d1bc3.wav\",\"Comment\":\"\",\"Id\":\"10\",\"PicUrl\":\"\",\"Score\":\"\",\"Text\":\"Good .\",\"Type\":3}";
             //测试数据
-            answerJson = "{\"AudioLength\":0,\"Id\":\"0\",\"Text\":\"i am how i know\",\"Type\":1}";
-            //answerJson = "{\"AudioLength\":3,\"AudioUrl\":\"http://172.16.41.241:10103/http_TBookEditor51/exerciseAnswerAudio/2020-11-06_09-31-19.wav\",\"Id\":\"4\",\"Text\":\"i know how i know \",\"Type\":3}";
+            //answerJson = "{\"AudioLength\":0,\"Id\":\"0\",\"Text\":\"i am how i know\",\"Type\":1}";
+            answerJson = "{\"AudioLength\":3,\"AudioUrl\":\"http://172.16.41.241:10103/http_TBookEditor51/exerciseAnswerAudio/2020-11-06_09-31-19.wav\",\"Id\":\"4\",\"Text\":\"i know how i know \",\"Type\":3}";
             //var answerJson = "{\"AudioLength\":5,\"AudioUrl\":\"http://172.16.41.241:10103/Web_AITeachCloudV10/Files/UpLoad/zxstu155/2020/11/25/8a5d785d626748bbaa027895568d1bc3.wav\",\"Comment\":\"\",\"Id\":\"10\",\"PicUrl\":\"\",\"Score\":\"\",\"Text\":\"Good .\",\"Type\":3}";
             reviewAnswer(answerJson);
         });

+ 18 - 0
EBook.Web/Test/Test.aspx

@@ -0,0 +1,18 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="EBook.Web.Test.Test" %>
+
+<!DOCTYPE html>
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head runat="server">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+    <title></title>
+</head>
+<body>
+    <form id="form1" runat="server">
+    <div>
+        <asp:Button runat="server" ID="BtnTest" Text="测试数组排序" OnClick="BtnTest_Click" />
+        <asp:TextBox runat="server" ID="Data" Text="" Width="1000"></asp:TextBox>
+    </div>
+    </form>
+</body>
+</html>

+ 38 - 0
EBook.Web/Test/Test.aspx.cs

@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using Newtonsoft.Json;
+
+namespace EBook.Web.Test
+{
+    public partial class Test : System.Web.UI.Page
+    {
+        protected void Page_Load(object sender, EventArgs e)
+        {
+
+        }
+
+        protected void BtnTest_Click(object sender, EventArgs e)
+        {
+            List<string> ls = new List<string>();
+            ls.Add("-1");
+            ls.Add("0");
+            ls.Add("01");
+            ls.Add("0%");
+            ls.Add("1");
+            ls.Add("10");
+            ls.Add("05");
+            ls.Add("20");
+            ls.Add("02");
+            ls.Add("50%");
+            ls.Add("100%");
+
+            ls = ls.OrderBy(a => a).ToList();
+
+            Data.Text = JsonConvert.SerializeObject(ls);
+        }
+    }
+}

+ 42 - 0
EBook.Web/Test/Test.aspx.designer.cs

@@ -0,0 +1,42 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+//     此代码由工具生成。
+//
+//     对此文件的更改可能导致不正确的行为,如果
+//     重新生成代码,则所做更改将丢失。
+// </自动生成>
+//------------------------------------------------------------------------------
+
+namespace EBook.Web.Test {
+    
+    
+    public partial class Test {
+        
+        /// <summary>
+        /// form1 控件。
+        /// </summary>
+        /// <remarks>
+        /// 自动生成的字段。
+        /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+        /// </remarks>
+        protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+        
+        /// <summary>
+        /// BtnTest 控件。
+        /// </summary>
+        /// <remarks>
+        /// 自动生成的字段。
+        /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+        /// </remarks>
+        protected global::System.Web.UI.WebControls.Button BtnTest;
+        
+        /// <summary>
+        /// Data 控件。
+        /// </summary>
+        /// <remarks>
+        /// 自动生成的字段。
+        /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+        /// </remarks>
+        protected global::System.Web.UI.WebControls.TextBox Data;
+    }
+}

+ 29 - 95
EBook.Web/Web.config

@@ -1,36 +1,23 @@
-<?xml version="1.0" encoding="utf-8"?>
-
+<?xml version="1.0"?>
 <configuration>
-    <configSections>
-      <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
-        <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
-          <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
-          <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
-            <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
-            <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
-            <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
-            <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
-          </sectionGroup>
-        </sectionGroup>
-      </sectionGroup>
-    </configSections>  
-    <appSettings/>
-    <connectionStrings/>
-    <system.web>
-        <compilation debug="true" >
-          <assemblies>
-            <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
-            <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
-            <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
-            <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
-          </assemblies>
-        </compilation>
+  <appSettings/>
+  <connectionStrings/>
+  <!--
+    有关 web.config 更改的说明,请参见 http://go.microsoft.com/fwlink/?LinkId=235367。
+
+    可在 <httpRuntime> 标记上设置以下特性。
+      <system.Web>
+        <httpRuntime targetFramework="4.5" />
+      </system.Web>
+  -->
+  <system.web>
+    <compilation debug="true" targetFramework="4.5"/>
     <!--
       通过 <authentication> 节,可配置 
       ASP.NET 用于识别进入用户的 
       安全身份验证模式。
     -->
-    <authentication mode="Windows" />
+    <authentication mode="Windows"/>
     <!--
        通过 <customErrors> 节,可以配置
        在执行请求的过程中出现未处理的错误时要执行 
@@ -43,74 +30,21 @@
          <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
     -->
-      <pages>
-        <controls>
-          <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
-          <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
-        </controls>
-      </pages>
-
-      <httpHandlers>
-        <remove verb="*" path="*.asmx"/>
-        <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
-        <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
-        <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
-      </httpHandlers>
-      <httpModules>
-        <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
-      </httpModules>
-    </system.web>
-    <system.codedom>
-      <compilers>
-        <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4"
-                  type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-          <providerOption name="CompilerVersion" value="v3.5"/>
-          <providerOption name="WarnAsError" value="false"/>
-        </compiler>
-      </compilers>
-    </system.codedom>
-    <!-- 
+    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
+  </system.web>
+  <!-- 
         system.webServer 节是在 Internet Information Services 7.0 下运行 ASP.NET AJAX 
         所必需的。对于早期版本的 IIS,不必保留此节。
   -->
-    <system.webServer>
-      <validation validateIntegratedModeConfiguration="false"/>
-      <modules>
-        <remove name="ScriptModule" />
-        <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
-      </modules>
-      <handlers>
-        <remove name="WebServiceHandlerFactory-Integrated"/>
-        <remove name="ScriptHandlerFactory" />
-        <remove name="ScriptHandlerFactoryAppServices" />
-        <remove name="ScriptResource" />
-        <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"
-             type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
-        <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode"
-             type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
-        <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
-      </handlers>
-      <staticContent>
-        <remove fileExtension=".less" />
-        <mimeMap fileExtension=".less" mimeType="text/css" />
-        <remove fileExtension=".mp4" />
-        <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
-        <remove fileExtension=".flv" />
-        <mimeMap fileExtension=".flv" mimeType="video/x-flv" />
-        <mimeMap fileExtension=".lghp" mimeType="text/html" />
-      </staticContent>
-    </system.webServer>
-    <runtime>
-      <assemblyBinding appliesTo="v2.0.50727" xmlns="urn:schemas-microsoft-com:asm.v1">
-        <dependentAssembly>
-          <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
-          <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
-        </dependentAssembly>
-        <dependentAssembly>
-          <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
-          <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
-        </dependentAssembly>
-      </assemblyBinding>
-    </runtime>
-
-</configuration>
+  <system.webServer>
+    <staticContent>
+      <remove fileExtension=".less"/>
+      <mimeMap fileExtension=".less" mimeType="text/css"/>
+      <remove fileExtension=".mp4"/>
+      <mimeMap fileExtension=".mp4" mimeType="video/mp4"/>
+      <remove fileExtension=".flv"/>
+      <mimeMap fileExtension=".flv" mimeType="video/x-flv"/>
+      <mimeMap fileExtension=".lghp" mimeType="text/html"/>
+    </staticContent>
+  </system.webServer>
+</configuration>