Ver código fonte

合并修改问题分支

lujianhong 4 anos atrás
pai
commit
eb89c1c329

+ 497 - 0
EBook.Web/AnsText/err.json

@@ -0,0 +1,497 @@
+[
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "0",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "0"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "1",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "1"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "2",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "2"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "3",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "3"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "4",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "3"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "5",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "3"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "6",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "3"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "7",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "7"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "8",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "8"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "9",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "9"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "10",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "10"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "11",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "11"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "12",
+    "Score": 0.0,
+    "Text": "√",
+    "Type": 1,
+    "pId": "12"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "13",
+    "Score": 0.0,
+    "Text": "√",
+    "Type": 1,
+    "pId": "12"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "14",
+    "Score": 0.0,
+    "Text": "√",
+    "Type": 1,
+    "pId": "12"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "15",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "15"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "16",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "16"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "17",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "17"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "18",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "18"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "19",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "19"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "20",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "20"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "21",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "21"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "22",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "22"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "23",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "23"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "24",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "24"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "25",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "25"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "26",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "26"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "27",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "27"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "28",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "28"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "29",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "29"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "30",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "30"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "31",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "31"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "32",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "32"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "33",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "33"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "34",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "34"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "35",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "35"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "36",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "36"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "37",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "37"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "38",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "38"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "39",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "39"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "40",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "40"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "41",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "41"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "42",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "42"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "43",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "43"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "44",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "44"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "45",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "45"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "46",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "46"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "47",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "47"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "48",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "48"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "49",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "49"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "50",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "50"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "51",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "51"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "52",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "52"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "53",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "53"
+  },
+  {
+    "AudioLength": 0,
+    "AudioUrl": "",
+    "Id": "54",
+    "Score": 0.0,
+    "Text": "",
+    "Type": 1,
+    "pId": "54"
+  }
+]

+ 25 - 6
EBook.Web/Common/tasklib_book.js

@@ -69,11 +69,23 @@ var GetPadVal = function (THandel) {
 };
 // 获取最大字符长度的字符串(起决定宽度的字符串/将字符去除HTML标签)(使用)
 var removeHtmlFunc = function (HtmlStr) {
+    var ReArr = {
+        TextStr: "",
+        WidthVal: 0,
+        ImgFlag: false,
+    };
     // 清除非长度标签
     var pattStr = new RegExp(/<(img){1}.*?>/ig);
     var matchesArr = HtmlStr.match(pattStr);
     if (matchesArr != null && (matchesArr != undefined && matchesArr.length > 0)) {
         for (var i = 0; i < matchesArr.length; i++) {
+            var pattWStr = new RegExp(/width\s?:\s?[0-9]+px;/ig);
+            var matchesWArr = matchesArr[i].match(pattWStr);
+            var TempWidthVal=parseFloat(matchesWArr[0].replace(/\s/g, "").replace("width:", "").replace("px", ""));
+            ReArr.WidthVal = TempWidthVal > ReArr.WidthVal ? TempWidthVal : ReArr.WidthVal;
+            if (ReArr.WidthVal != 0) {
+                ReArr.ImgFlag = true;
+            }
             HtmlStr = HtmlStr.replace(matchesArr[i], "");
         }
     }
@@ -119,7 +131,8 @@ var removeHtmlFunc = function (HtmlStr) {
             }
         }
     }
-    return HtmlStr;
+    ReArr.TextStr = HtmlStr;
+    return ReArr;
 };
 // 获取最大字符长度的字符串(起决定宽度的字符串/将字符去除HTML标签)(替换,不用)
 var dealTdTextFunc = function (HtmlStr) {
@@ -157,12 +170,15 @@ var AdjustTableFunc = function () {
         var RuleFlag = true;
         $.each($(item).find("tr"), function (trIndex, trItem) {
             $.each($(trItem).find("td"), function (tdIndex, tdItem) {
-                var tdtext = removeHtmlFunc($(tdItem).html());
-                $("#pContrainId").text(tdtext);
-                var tdWidthVal = $("#pContrainId").width();  // 获取文字宽度
+                var RemoveHtmlArr = removeHtmlFunc($(tdItem).html());
+                $("#pContrainId").text(RemoveHtmlArr.TextStr);
+                var tdWidthVal = $("#pContrainId").width() + parseFloat(RemoveHtmlArr.WidthVal);  // 获取文字宽度
                 tdWidthVal += GetPadVal(tdItem);
-                if (tdWidthVal > (ScreenWidth / 2)) {
-                    tdWidthVal = (ScreenWidth / 2);
+                if (!RemoveHtmlArr.ImgFlag && (tdWidthVal > ScreenWidth)) {
+                    tdWidthVal = ScreenWidth;
+                }
+                if (tdWidthVal < 135) {
+                    tdWidthVal = 135;
                 }
                 if (ArrMaxLen.length < tdIndex + 1) {
                     if (trIndex != 0) {
@@ -1377,6 +1393,9 @@ function backupAllAnswer(answerJson, statusType) {
             var answerText = $(item).attr("answer-anstext");//参考答案
             $(item).attr("answer-text", mytext);
             $(item).find('input').prop('checked', ischecked);
+            if (ischecked && statusType == 0) {
+                clickCheckBox(answerid);
+            }
             //已提交,已评阅,还原HTML代码,去除checkbox
             if (statusType == 1 || statusType == 2) {
                 mytext = mytext == "" ? "&nbsp;&nbsp;&nbsp;" : mytext;

+ 10 - 0
EBook.Web/EBook.Web.csproj

@@ -70,6 +70,10 @@
     <Content Include="AnsText\answer.txt" />
     <Content Include="AnsText\21985.json" />
     <Content Include="AnsText\GCZD.json" />
+    <Content Include="AnsText\22034.json" />
+    <Content Include="AnsText\220341.json" />
+    <Content Include="AnsText\220342.json" />
+    <Content Include="AnsText\err.json" />
     <None Include="AnsText\TGX.json" />
     <Content Include="Common\mtm_passage.css" />
     <Content Include="Common\mtm_temp.js" />
@@ -112,6 +116,10 @@
     <Content Include="Lghp\22045.lghp" />
     <Content Include="Lghp\22052.lghp" />
     <Content Include="Lghp\22225.lghp" />
+    <Content Include="Lghp\22034.lghp" />
+    <Content Include="Lghp\22216.lghp" />
+    <Content Include="Lghp\data202116.lghp" />
+    <Content Include="Lghp\err.lghp" />
     <None Include="Lghp\gaicuo.lghp" />
     <Content Include="NK\tasklib_book.css" />
     <Content Include="NK\tasklib_book.js" />
@@ -189,6 +197,8 @@
     <Content Include="Lghp\gouxuan.lghp" />
     <Content Include="Lghp\TGX.lghp" />
     <Content Include="Lghp\GCZD.lghp" />
+    <Content Include="Lghp\newduokong.lghp" />
+    <Content Include="Lghp\jieduan.lghp" />
     <None Include="Properties\PublishProfiles\WebEBook.pubxml" />
     <Content Include="TagWord\data\html.json" />
     <None Include="Web.Debug.config">

+ 3 - 3
EBook.Web/Test.html

@@ -46,7 +46,7 @@
         //加载数据
         window.onload = function () {
             //加载听说课文
-            answerjson = $.ajax({ url: "AnsText/gaicuo.json", async: false }).responseText;
+            answerjson = $.ajax({ url: "AnsText/err.json", async: false }).responseText;
             reviewjson = $.ajax({ url: "AnsText/anstext.txt", async: false }).responseText;
             hightcodejson = JSON.parse($.ajax({ url: "HightCode/data202116P.json", async: false }).responseText);
             //for (var i = 0; i < JSON.parse($.ajax({ url: "HightCode/data202116S.json", async: false }).responseText).length; i++) {
@@ -58,7 +58,7 @@
         }
         //加载听说课文
         $("#load-text").on("click", function () {
-            var data = $.ajax({ url: "lghp/BGGL.lghp", async: false }).responseText;
+            var data = $.ajax({ url: "lghp/err.lghp", async: false }).responseText;
             $("#data").html(data);
             bindEventYS();
             Fill(hightcodejson);
@@ -115,7 +115,7 @@
         });
         //回显习题答案
         $("#backup-answer").on("click", function () {
-            backupAllAnswer(answerjson, 2);
+            backupAllAnswer(answerjson, 0);
             //var answerJson = "{\"AudioLength\":3,\"AudioUrl\":\"http://172.16.41.241:10103/http_TBookEditor51/exerciseAnswerAudio/2020-11-06_09-31-19.wav\",\"Id\":\"18\",\"Text\":\"\",\"Type\":3}";
             //reviewAnswer(answerJson);
         });

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
EBook.Web/lghp/err.lghp


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
EBook.Web/lghp/newduokong.lghp


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff