Test.html 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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/duogouxuan.json", async: false }).responseText;
  40. reviewjson = $.ajax({ url: "AnsText/anstext.txt", async: false }).responseText;
  41. hightcodejson = $.ajax({ url: "HightCode/210511.json", async: false }).responseText;
  42. }
  43. //加载听说课文
  44. $("#load-text").on("click", function () {
  45. var data = $.ajax({ url: "lghp/duogouxuan.lghp", async: false }).responseText;
  46. $("#data").html(data);
  47. Fill(JSON.parse(hightcodejson));
  48. bindEventYS();
  49. //bindCoursewareEvent();
  50. var ResInfo = {
  51. answerPointImgUrl: "Images/update-answer.png",
  52. yaoshiShowImgUrl: "Images/yaoshi-show.png",
  53. yaoshiHideImgUrl: "Images/yaoshi-hide.png",
  54. KouYuTagImgUrl: "Images/KY.png",
  55. recordPlayImgUrl: "Images/play.png",
  56. recordPauseImgUrl: "Images/pause.png",
  57. audioPlayImgUrl: "Images/dynaiselaba.gif",
  58. audioPauseImgUrl: "Images/dynaiselaba.png"
  59. }
  60. //调用查看图标
  61. $.each($(".yaoshi"), function (index, item) {
  62. $(item).attr("src", ResInfo.yaoshiShowImgUrl);//移动端要根据本地 喇叭 路径替换
  63. });
  64. $.each($(".audioImg"), function (index, item) {
  65. $(item).attr("src", ResInfo.audioPauseImgUrl);//移动端要根据本地 喇叭 路径替换
  66. });
  67. $.each($(".oralLanguageImg"), function (index, item) {
  68. $(item).attr("src", ResInfo.KouYuTagImgUrl);//移动端要根据本地 喇叭 路径替换
  69. });
  70. });
  71. //显示/隐藏习题答案
  72. $("#showhide-answer").on("click", function () {
  73. if ($(this).data("status") == "0") {
  74. this.innerText = "隐藏习题答案";
  75. $(this).data("status", "1");
  76. //showHideAnswer(true);
  77. showHideAnswerEx(true, true);
  78. //$(".underlineContent").show();
  79. }
  80. else {
  81. this.innerText = "显示习题答案";
  82. $(this).data("status", "0");
  83. //showHideAnswer(false);
  84. showHideAnswerEx(true, false);
  85. //$(".underlineContent").hide();
  86. }
  87. });
  88. //处理作答区域
  89. $("#handle-answer").on("click", function () {
  90. handleAnswerRange();
  91. });
  92. //提交习题答案
  93. $("#submit-answer").on("click", function () {
  94. getAllAnswer();
  95. });
  96. //回显习题答案
  97. $("#backup-answer").on("click", function () {
  98. backupAllAnswer(answerjson, 0);
  99. //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}";
  100. //reviewAnswer(answerJson);
  101. });
  102. //修改习题答案
  103. $("#update-answer").on("click", function () {
  104. //backupAllAnswer(answerjson, false);
  105. //var answerJson = "{\"AudioLength\":0,\"AudioUrl\":\"\",\"Id\":\"1\",\"Text\":\"sdasd\",\"Type\":1}";
  106. //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}";
  107. //测试数据
  108. //answerJson = "{\"AudioLength\":0,\"Id\":\"0\",\"Text\":\"i am how i know\",\"Type\":1}";
  109. 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}";
  110. //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}";
  111. reviewAnswer(answerJson);
  112. });
  113. //回填评阅数据
  114. $("#backup-review").on("click", function () {
  115. backupAllReview(reviewjson);
  116. });
  117. //定位滚动数据
  118. $("#scroll-review").on("click", function () {
  119. //scrollAnswer(randomNum(0,answerData.length-1));
  120. scrollAnswer(91);
  121. });
  122. //测试UI效果
  123. $("#test-ui").on("click", function () {
  124. var clonediv = $(".btn-play").prop("outerHTML");
  125. $(".test-p").html($(".test-p").html() + clonediv);
  126. });
  127. //生成从minNum到maxNum的随机数
  128. function randomNum(minNum, maxNum) {
  129. switch (arguments.length) {
  130. case 1:
  131. return parseInt(Math.random() * minNum + 1, 10);
  132. break;
  133. case 2:
  134. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  135. break;
  136. default:
  137. return 0;
  138. break;
  139. }
  140. }
  141. </script>
  142. </body>
  143. </html>