Test.html 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  5. <title>主体课文</title>
  6. <meta charset="utf-8" />
  7. <script src="Scripts/jquery.js"></script>
  8. <link href="Common/mtm_passage.css" rel="stylesheet" type="text/css" />
  9. <link href="Common/tasklib_book.css" rel="stylesheet" type="text/css" />
  10. <script src="Common/mtm_temp.js"></script>
  11. <script src="Common/tasklib_book.js"></script>
  12. </head>
  13. <body>
  14. <div class="scroll-view">
  15. <button id="load-text">加载听说课文</button>
  16. <button id="showhide-answer" data-status="1">隐藏习题答案</button>
  17. <button id="handle-answer" data-status="1">处理作答区域</button>
  18. <button id="submit-answer">提交习题答案</button>
  19. <button id="backup-answer">回显习题答案</button>
  20. <button id="update-answer">修改习题答案</button>
  21. <button id="backup-review">回填评阅数据</button>
  22. <button id="scroll-review">定位滚动数据</button>
  23. <button id="test-ui">测试UI效果</button>
  24. </div>
  25. <!--<input type="text" style="border:0px; border-bottom:solid #fbfbfb 1px; border-radius: 3px;padding-left:5px; color:#6ab7ff;" value="测试的" />-->
  26. <!--<div class="btn-play"><img src="play.png" /><span>作答音频(20s)</span></div>-->
  27. <!--<div class="btn-play"><img src="play.png" /><span>作答音频(20s)</span></div>
  28. <p class="test-p">1、</p>
  29. <p class="test-p1">2、</p>-->
  30. <!--<u style="">ss</u>-->
  31. <!--<button class="answertext btn-bgimg">点击作答</button>-->
  32. <div id="data"></div>
  33. <script type="text/javascript">
  34. var answerjson = "";//作答信息
  35. var reviewjson = "";//评阅信息
  36. //加载数据
  37. window.onload = function () {
  38. //加载听说课文
  39. answerjson = $.ajax({ url: "AnsText/220342.json", async: false }).responseText;
  40. reviewjson = $.ajax({ url: "AnsText/220342.json", async: false }).responseText;
  41. hightcodejson = $.ajax({ url: "HightCode/BGGL.json", async: false }).responseText;
  42. }
  43. //加载听说课文
  44. $("#load-text").on("click", function () {
  45. var data = $.ajax({ url: "lghp/22034.lghp", async: false }).responseText;
  46. $("#data").html(data);
  47. //Fill(JSON.parse(hightcodejson));
  48. bindEventYS();
  49. Fill(JSON.parse(hightcodejson));
  50. //bindCoursewareEvent();
  51. var ResInfo = {
  52. answerPointImgUrl: "Images/update-answer.png",
  53. yaoshiShowImgUrl: "Images/yaoshi-show.png",
  54. yaoshiHideImgUrl: "Images/yaoshi-hide.png",
  55. KouYuTagImgUrl: "Images/KY.png",
  56. recordPlayImgUrl: "Images/play.png",
  57. recordPauseImgUrl: "Images/pause.png",
  58. audioPlayImgUrl: "Images/dynaiselaba.gif",
  59. audioPauseImgUrl: "Images/dynaiselaba.png"
  60. }
  61. //调用查看图标
  62. $.each($(".yaoshi"), function (index, item) {
  63. $(item).attr("src", ResInfo.yaoshiShowImgUrl);//移动端要根据本地 喇叭 路径替换
  64. });
  65. $.each($(".audioImg"), function (index, item) {
  66. $(item).attr("src", ResInfo.audioPauseImgUrl);//移动端要根据本地 喇叭 路径替换
  67. });
  68. $.each($(".oralLanguageImg"), function (index, item) {
  69. $(item).attr("src", ResInfo.KouYuTagImgUrl);//移动端要根据本地 喇叭 路径替换
  70. });
  71. });
  72. //显示/隐藏习题答案
  73. $("#showhide-answer").on("click", function () {
  74. if ($(this).data("status") == "0") {
  75. this.innerText = "隐藏习题答案";
  76. $(this).data("status", "1");
  77. //showHideAnswer(true);
  78. showHideAnswerEx(true, true);
  79. //$(".underlineContent").show();
  80. }
  81. else {
  82. this.innerText = "显示习题答案";
  83. $(this).data("status", "0");
  84. //showHideAnswer(false);
  85. showHideAnswerEx(true, false);
  86. //$(".underlineContent").hide();
  87. }
  88. });
  89. //处理作答区域
  90. $("#handle-answer").on("click", function () {
  91. handleAnswerRange();
  92. });
  93. //提交习题答案
  94. $("#submit-answer").on("click", function () {
  95. getAllAnswer();
  96. });
  97. //回显习题答案
  98. $("#backup-answer").on("click", function () {
  99. backupAllAnswer(answerjson, 2);
  100. //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}";
  101. //reviewAnswer(answerJson);
  102. });
  103. //修改习题答案
  104. $("#update-answer").on("click", function () {
  105. //backupAllAnswer(answerjson, false);
  106. //var answerJson = "{\"AudioLength\":0,\"AudioUrl\":\"\",\"Id\":\"1\",\"Text\":\"sdasd\",\"Type\":1}";
  107. //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}";
  108. //测试数据
  109. //answerJson = "{\"AudioLength\":0,\"Id\":\"0\",\"Text\":\"i am how i know\",\"Type\":1}";
  110. 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}";
  111. //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}";
  112. reviewAnswer(answerJson);
  113. });
  114. //回填评阅数据
  115. $("#backup-review").on("click", function () {
  116. backupAllReview(reviewjson);
  117. });
  118. //定位滚动数据
  119. $("#scroll-review").on("click", function () {
  120. scrollAnswer(randomNum(0,answerData.length-1));
  121. //scrollAnswer(91);
  122. });
  123. //测试UI效果
  124. $("#test-ui").on("click", function () {
  125. var clonediv = $(".btn-play").prop("outerHTML");
  126. $(".test-p").html($(".test-p").html() + clonediv);
  127. });
  128. //生成从minNum到maxNum的随机数
  129. function randomNum(minNum, maxNum) {
  130. switch (arguments.length) {
  131. case 1:
  132. return parseInt(Math.random() * minNum + 1, 10);
  133. break;
  134. case 2:
  135. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  136. break;
  137. default:
  138. return 0;
  139. break;
  140. }
  141. }
  142. </script>
  143. </body>
  144. </html>