Test.html 6.9 KB

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