| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <title>主体课文</title>
- <meta charset="utf-8" />
- <script src="Scripts/jquery.js"></script>
- <link href="Common/mtm_passage.css" rel="stylesheet" type="text/css" />
- <link href="Common/tasklib_book.css" rel="stylesheet" type="text/css" />
- <script src="Common/mtm_temp.js"></script>
- <script src="Common/tasklib_book.js"></script>
- </head>
- <body>
- <div class="scroll-view">
- <button id="load-text">加载听说课文</button>
- <button id="showhide-answer" data-status="1">隐藏习题答案</button>
- <button id="handle-answer" data-status="1">处理作答区域</button>
- <button id="submit-answer">提交习题答案</button>
- <button id="backup-answer">回显习题答案</button>
- <button id="update-answer">修改习题答案</button>
- <button id="backup-review">回填评阅数据</button>
- <button id="scroll-review">定位滚动数据</button>
- <button id="test-ui">测试UI效果</button>
- <button id="wordStyleID">单词</button>
- <button id="phraseStyleID">短语</button>
- <button id="sentenceStyleID">句型</button>
- <button id="ShowID">全显示</button>
- <button id="HiddenID">隐藏</button>
- </div>
- <!--<input type="text" style="border:0px; border-bottom:solid #fbfbfb 1px; border-radius: 3px;padding-left:5px; color:#6ab7ff;" value="测试的" />-->
- <!--<div class="btn-play"><img src="play.png" /><span>作答音频(20s)</span></div>-->
- <!--<div class="btn-play"><img src="play.png" /><span>作答音频(20s)</span></div>
- <p class="test-p">1、</p>
- <p class="test-p1">2、</p>-->
- <!--<u style="">ss</u>-->
- <!--<button class="answertext btn-bgimg">点击作答</button>-->
- <div id="data"></div>
- <script type="text/javascript">
- var answerjson = "";//作答信息
- var reviewjson = "";//评阅信息
- //加载数据
- window.onload = function () {
- //加载听说课文
- 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++) {
- // hightcodejson.push(JSON.parse($.ajax({ url: "HightCode/data202116S.json", async: false }).responseText)[i]);
- //}
- //for (var i = 0; i < JSON.parse($.ajax({ url: "HightCode/data202116W.json", async: false }).responseText).length; i++) {
- // hightcodejson.push(JSON.parse($.ajax({ url: "HightCode/data202116W.json", async: false }).responseText)[i]);
- //}
- }
- //加载听说课文
- $("#load-text").on("click", function () {
- var data = $.ajax({ url: "lghp/err.lghp", async: false }).responseText;
- $("#data").html(data);
- bindEventYS();
- Fill(hightcodejson);
- //showHideAnswerEx(true, false);
- //bindCoursewareEvent();
- var ResInfo = {
- 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"
- }
- //调用查看图标
- $.each($(".yaoshi"), function (index, item) {
- $(item).attr("src", ResInfo.yaoshiShowImgUrl);//移动端要根据本地 喇叭 路径替换
- });
- $.each($(".audioImg"), function (index, item) {
- $(item).attr("src", ResInfo.audioPauseImgUrl);//移动端要根据本地 喇叭 路径替换
- });
- $.each($(".oralLanguageImg"), function (index, item) {
- $(item).attr("src", ResInfo.KouYuTagImgUrl);//移动端要根据本地 喇叭 路径替换
- });
- });
- //显示/隐藏习题答案
- $("#showhide-answer").on("click", function () {
- if ($(this).data("status") == "0") {
- this.innerText = "隐藏习题答案";
- $(this).data("status", "1");
- //showHideAnswer(true);
- showHideAnswerEx(true, true);
- //$(".underlineContent").show();
- }
- else {
- this.innerText = "显示习题答案";
- $(this).data("status", "0");
- //showHideAnswer(false);
- showHideAnswerEx(true, false);
- //$(".underlineContent").hide();
- }
- });
- //处理作答区域
- $("#handle-answer").on("click", function () {
- handleAnswerRange();
- });
- //提交习题答案
- $("#submit-answer").on("click", function () {
- getAllAnswer();
- });
- //回显习题答案
- $("#backup-answer").on("click", function () {
- 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);
- });
- //修改习题答案
- $("#update-answer").on("click", function () {
- //backupAllAnswer(answerjson, false);
- answerJson = "{\"AudioLength\":0,\"AudioUrl\":\"\",\"Id\":\"1\",\"Text\":\"learning learning learning learning learning learning nineteen ninety nine learning learning learning learning learning learning nineteen ninety nine learning learning learning learning learning learning nineteen ninety nine learning learning learning learning learning learning nineteen ninety nine learning learning learning learning learning learning nineteen ninety nine learning learning learning learning learning learning nineteen ninety nine\",\"Type\":1}";
- //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}";
- //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);
- });
- //回填评阅数据
- $("#backup-review").on("click", function () {
- backupAllReview(reviewjson);
- });
- //定位滚动数据
- $("#scroll-review").on("click", function () {
- scrollAnswer(randomNum(0,answerData.length-1));
- //scrollAnswer(91);
- });
- //测试UI效果
- $("#test-ui").on("click", function () {
- var clonediv = $(".btn-play").prop("outerHTML");
- $(".test-p").html($(".test-p").html() + clonediv);
- });
- var wordStyleFlag = true;
- var phraseStyleFlag = true;
- var sentenceStyleFlag = true;
- $("#wordStyleID").on("click", function () {
- wordStyleFlag = !wordStyleFlag;
- hightcodejson = null;
- hightcodejson = [];
- if (phraseStyleFlag) {
- for (var i = 0; i < JSON.parse($.ajax({ url: "HightCode/data202116P.json", async: false }).responseText).length; i++) {
- hightcodejson.push(JSON.parse($.ajax({ url: "HightCode/data202116P.json", async: false }).responseText)[i]);
- }
- }
- if (wordStyleFlag) {
- for (var i = 0; i < JSON.parse($.ajax({ url: "HightCode/data202116W.json", async: false }).responseText).length; i++) {
- hightcodejson.push(JSON.parse($.ajax({ url: "HightCode/data202116W.json", async: false }).responseText)[i]);
- }
- }
- if (sentenceStyleFlag) {
- for (var i = 0; i < JSON.parse($.ajax({ url: "HightCode/data202116S.json", async: false }).responseText).length; i++) {
- hightcodejson.push(JSON.parse($.ajax({ url: "HightCode/data202116S.json", async: false }).responseText)[i]);
- }
- }
- console.log(hightcodejson);
- Fill(hightcodejson);
- showGLWorld(wordStyleFlag, phraseStyleFlag, sentenceStyleFlag);
- });
- $("#phraseStyleID").on("click", function () {
- phraseStyleFlag = !phraseStyleFlag;
- hightcodejson = null;
- hightcodejson = [];
- if (phraseStyleFlag) {
- for (var i = 0; i < JSON.parse($.ajax({ url: "HightCode/data202116P.json", async: false }).responseText).length; i++) {
- hightcodejson.push(JSON.parse($.ajax({ url: "HightCode/data202116P.json", async: false }).responseText)[i]);
- }
- }
- if (wordStyleFlag) {
- for (var i = 0; i < JSON.parse($.ajax({ url: "HightCode/data202116W.json", async: false }).responseText).length; i++) {
- hightcodejson.push(JSON.parse($.ajax({ url: "HightCode/data202116W.json", async: false }).responseText)[i]);
- }
- }
- if (sentenceStyleFlag) {
- for (var i = 0; i < JSON.parse($.ajax({ url: "HightCode/data202116S.json", async: false }).responseText).length; i++) {
- hightcodejson.push(JSON.parse($.ajax({ url: "HightCode/data202116S.json", async: false }).responseText)[i]);
- }
- }
- console.log(hightcodejson);
- Fill(hightcodejson);
- showGLWorld(wordStyleFlag, phraseStyleFlag, sentenceStyleFlag);
- });
- $("#sentenceStyleID").on("click", function () {
- sentenceStyleFlag = !sentenceStyleFlag;
- hightcodejson = null;
- hightcodejson = [];
- if (phraseStyleFlag) {
- for (var i = 0; i < JSON.parse($.ajax({ url: "HightCode/data202116P.json", async: false }).responseText).length; i++) {
- hightcodejson.push(JSON.parse($.ajax({ url: "HightCode/data202116P.json", async: false }).responseText)[i]);
- }
- }
- if (wordStyleFlag) {
- for (var i = 0; i < JSON.parse($.ajax({ url: "HightCode/data202116W.json", async: false }).responseText).length; i++) {
- hightcodejson.push(JSON.parse($.ajax({ url: "HightCode/data202116W.json", async: false }).responseText)[i]);
- }
- }
- if (sentenceStyleFlag) {
- for (var i = 0; i < JSON.parse($.ajax({ url: "HightCode/data202116S.json", async: false }).responseText).length; i++) {
- hightcodejson.push(JSON.parse($.ajax({ url: "HightCode/data202116S.json", async: false }).responseText)[i]);
- }
- }
- console.log(hightcodejson);
- Fill(hightcodejson);
- showGLWorld(wordStyleFlag, phraseStyleFlag, sentenceStyleFlag);
- });
- $("#ShowID").on("click", function () {
- showGLWorld(true, true, true);
- });
- $("#HiddenID").on("click", function () {
- showGLWorld(false, false, false);
- });
- //生成从minNum到maxNum的随机数
- function randomNum(minNum, maxNum) {
- switch (arguments.length) {
- case 1:
- return parseInt(Math.random() * minNum + 1, 10);
- break;
- case 2:
- return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
- break;
- default:
- return 0;
- break;
- }
- }
- </script>
- </body>
- </html>
|