Commit 22aae6c5 authored by liujiaxin's avatar liujiaxin

qqqq

parent 88ae8435
......@@ -31,8 +31,7 @@
"rxjs": "~6.5.4",
"spark-md5": "^3.0.0",
"tslib": "^1.10.0",
"zone.js": "~0.10.2",
"node-sass": "4.0.0"
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.900.3",
......
......@@ -49,7 +49,7 @@ export class PlayComponent implements OnInit, OnDestroy {
@ViewChild('canvas', { static: true }) canvas: ElementRef;
@ViewChild('wrap', { static: true }) wrap: ElementRef;
@ViewChild('iframeContent', {static: true }) iframeContent: ElementRef;
canvasScale = 2;
......@@ -188,7 +188,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}
// 用于存储公共数据 当翻页时清空
// 用于存储公共数据 当翻页时清空
pageData;
initPageData(aspect) {
const pageDataStr = aspect?.page_aspect?.pagedata;
......@@ -231,7 +231,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}
// 用于存储私有数据 当翻页时清空
// 用于存储私有数据 当翻页时清空
storeData;
initStoreData(aspect) {
const storeDataStr = aspect?.user_aspect;
......@@ -280,7 +280,7 @@ export class PlayComponent implements OnInit, OnDestroy {
const data = {"sentenceArr":[{"text":"1.There can be mentally and physically _ for a person to use.","answer":"exhausting"},{"text":"2.To travel through beautiful scenery at a speed of four horsepower is just _ .","answer":"marvellous"},{"text":"3.The Park is known as a place for _ and hiking, as well as events.","answer":"recreation"},{"text":"4.She looked at him in _ distress that he had to look away.","answer":"such"},{"text":"5.He enjoys the finer things in life, like _ with his wife.","answer":"ballroom dancing"},{"text":"6.Rappers always dress in their own _.","answer":"style"},{"text":"7.They suggest _ reasons for the difference in the federal government's attitudes toward the two lawsuits.","answer":"a couple of"},{"text":"8.Mr. Smith bought a new house near _ by the beach.","answer":"waterfront"},{"text":"9.One has to be knowledgeable in low to do international _ .","answer":"trade"},{"text":"10.Planes must _ from one ground beacon (信标) to the next to flight through the Mount Everest.","answer":"zigzag"},{"text":"11.Baltimore in its heyday(鼎盛时期) was a major centre of industrial and _ activity.","answer":"commercial"},{"text":"12.Despite persistent rain showers, the music festival’s _ were packed with fans.","answer":"pavilion"},{"text":"13.If something _ you, it surprises you very much. ","answer":"amazes"}],"templateArr":[{"formUrl":"https://staging-teach.cdn.ireadabc.com/h5template/JM_4-2/v11/index.html?type=form&key=1","template":{"id":740,"uuid":"b4279bef-f779-4ab7-be76-f1af96713a86","name":"JM_4-2","description":"JM04-02拼句子","interaction_type":"","recommend_type":"","cover":"https://staging-teach.cdn.ireadabc.com/d5baf57d-0175-4640-93a5-6baaff117867.png","type":1,"t_type":2,"form_url":"index.html?type=form","play_url":"index.html","developer_id":12,"git":"{\"id\":791,\"ssh\":\"git@vcs.ireadabc.com:template/JM_4-2.git\",\"http\":\"https://vcs.ireadabc.com/template/JM_4-2.git\"}","del":0,"publish":1,"last_version":11,"pub_date":null,"is_public":0,"created_date":"2021-07-26T10:01:26.000Z","updated_date":"2021-08-02T03:24:44.000Z"},"data":{"sentenceArr":[{"answer":"zigzag","text":"1. They staggered (蹒跚)in a _ across the road.","audio_url":"https://staging-teach.cdn.ireadabc.com/2ee1851630ae13b645f41acba1500109.mp3"},{"answer":"pavilion","text":"2. Despite persistent rain showers, the lawn and _ were packed with fans.","audio_url":"https://staging-teach.cdn.ireadabc.com/d051865834696ed4a161660ea9bd5e67.mp3"},{"answer":"amazed","text":"3. We just moved house and are _ with the amount of junk we have.","audio_url":"https://staging-teach.cdn.ireadabc.com/7c0432dc51915132f139dce7a75f1808.mp3"},{"answer":"Trade","text":"4. _between the two countries has increased.","audio_url":"https://staging-teach.cdn.ireadabc.com/30ad4162816dd0fc9747d0f38236fdba.mp3"},{"text":"5. They went for a walk along the_ .","answer":"waterfront","audio_url":"https://staging-teach.cdn.ireadabc.com/4736dddf059affd06cccc2bed72b2608.mp3"},{"text":"6. Yunnan has indeed become more _ over the past decade.","answer":"commercial","audio_url":"https://staging-teach.cdn.ireadabc.com/b68d81e3e216e80a5d14aef66a11b0c7.mp3"},{"text":"7. What’s the _ of haircut do you like?","answer":"style","audio_url":"https://staging-teach.cdn.ireadabc.com/0206e3bfd21c45d89e12612230742b19.mp3"},{"text":"8. Saturday afternoon is for _ and outings.","answer":"recreation","audio_url":"https://staging-teach.cdn.ireadabc.com/3298442f14bf32f3dbdaa32929cfe8f6.mp3"},{"text":"9. It's the most _ piece of music.","answer":"marvellous","audio_url":"https://staging-teach.cdn.ireadabc.com/4b6005977408e74acdcddc9a936cc423.mp3"},{"text":"10. She was too _ and distressed(痛苦的)to talk about the tragedy.","answer":"exhausted","audio_url":"https://staging-teach.cdn.ireadabc.com/96c2a53cfc64ea56e0ae24c24fe1731d.mp3"},{"text":"11. He is _ a fool to cheat on an exam.","answer":"such","audio_url":"https://staging-teach.cdn.ireadabc.com/a5f60ce1e9e13c1905636ac9ba170f0d.mp3"},{"text":"12. I also enjoy dancing like_ .","answer":" ballroom dancing","audio_url":"https://staging-teach.cdn.ireadabc.com/079c1935a169043acc524c8c19449c88.mp3"},{"text":"13. We went to the US _ years ago.","answer":"a couple of","audio_url":"https://staging-teach.cdn.ireadabc.com/1af6c6dae99270fe36eaae56588dae46.mp3"}],"templateArr":[],"title":"Spell the words according to what you heard"}},{"formUrl":"https://staging-teach.cdn.ireadabc.com/h5template/JM04-3/v16/index.html?type=form&key=2","template":{"id":733,"uuid":"3900b0f7-d041-490e-9b42-da8d3855633b","name":"JM04-3","description":"JM04-03拼单词","interaction_type":"","recommend_type":"","cover":"https://staging-teach.cdn.ireadabc.com/0455da10-c452-4cec-9f01-530536b886b3.png","type":1,"t_type":2,"form_url":"index.html?type=form","play_url":"index.html","developer_id":119,"git":"{\"id\":784,\"ssh\":\"git@vcs.ireadabc.com:template/JM04-3.git\",\"http\":\"https://vcs.ireadabc.com/template/JM04-3.git\"}","del":0,"publish":1,"last_version":16,"pub_date":null,"is_public":0,"created_date":"2021-07-20T06:18:52.000Z","updated_date":"2021-08-17T03:18:58.000Z"},"data":{"contentObj":{"version":"1.0","dataKey":"DataKey_JM04_3","title":{"NO":"C","mainText":"connected with the buying and selling of goods and services","mainTextAudio_url":""},"size":{"wh":"17*17"},"dataArray":[{"image_url":"","audio_url":"","text":"used to emphasize the great degree of something","uuid":"9803c50c-3638-4a6a-a4f8-719bdeaacede","direction":"Across"},{"image_url":"","audio_url":"","direction":"Down","text":"","uuid":"64635d65-972a-42d1-95c5-148efc9bd866"},{"image_url":"","audio_url":"","direction":"Down","text":"the particular way in which something is done","uuid":"1e27124a-49f2-44e6-8478-fcbc461e420f"},{"image_url":"","audio_url":"","direction":"Across","text":"emely good; wonderful","uuid":"6c6dce11-9a9d-484d-90b2-39a8ffe827f5"},{"image_url":"","audio_url":"","direction":"Down","text":"very surprised","uuid":"97ffbe71-6304-43e1-9688-a0002b45fadf"},{"image_url":"","audio_url":"","direction":"Down","text":"a part of a town or an area that is next to water","uuid":"8532c243-0036-432e-92d4-5cfdfa67a958"},{"image_url":"","audio_url":"","direction":"Down","text":"a line that has a series of angles in it like a continuous series","uuid":"8f1d8024-ebdc-4094-89ae-8238c5a9b47b"},{"image_url":"","audio_url":"","direction":"Across","text":"making you feel very tired","uuid":"8d4742d0-ee35-4c27-8da1-ff649c477222"},{"image_url":"","audio_url":"","direction":"Down","text":"the activity of buying and selling or of exchanging goods or services between people or countries","uuid":"2bd8882e-b637-4652-8c0e-da232e698223"},{"image_url":"","audio_url":"","direction":"Across","text":"a building next to a sports ground, used by players and people watching the game","uuid":"5ab70f33-0523-46aa-ac52-e0b1b191a4d7"},{"image_url":"","audio_url":"","direction":"Across","text":"(a way of) enjoying yourself when you are not working","uuid":"c2a844a2-fd57-4cc7-bec0-3930e4423c5f"}],"grid":[[{"index":[],"text":""},{"index":[],"text":""},{"index":[0],"text":"s"},{"index":[0],"text":"u"},{"index":[0,1],"text":"c"},{"index":[0],"text":"h"},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""}],[{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[1],"text":"o"},{"index":[],"text":""},{"index":[2],"text":"s"},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""}],[{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[1],"text":"m"},{"index":[],"text":""},{"index":[2],"text":"t"},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""}],[{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[1],"text":"m"},{"index":[],"text":""},{"index":[2],"text":"y"},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""}],[{"index":[3],"text":"m"},{"index":[3,4],"text":"a"},{"index":[3],"text":"r"},{"index":[3],"text":"v"},{"index":[1,3],"text":"e"},{"index":[3],"text":"l"},{"index":[2,3],"text":"l"},{"index":[3],"text":"o"},{"index":[3],"text":"u"},{"index":[3],"text":"s"},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""}],[{"index":[],"text":""},{"index":[4],"text":"m"},{"index":[],"text":""},{"index":[],"text":""},{"index":[1],"text":"r"},{"index":[],"text":""},{"index":[2],"text":"e"},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""}],[{"index":[],"text":""},{"index":[4],"text":"a"},{"index":[],"text":""},{"index":[],"text":""},{"index":[1],"text":"c"},{"index":[],"text":""},{"index":[],"text":""},{"index":[5],"text":"w"},{"index":[],"text":""},{"index":[],"text":""},{"index":[6],"text":"z"},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""}],[{"index":[],"text":""},{"index":[4],"text":"z"},{"index":[],"text":""},{"index":[],"text":""},{"index":[1],"text":"i"},{"index":[],"text":""},{"index":[],"text":""},{"index":[5],"text":"a"},{"index":[],"text":""},{"index":[],"text":""},{"index":[6],"text":"i"},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""}],[{"index":[],"text":""},{"index":[4,7],"text":"e"},{"index":[7],"text":"x"},{"index":[7],"text":"h"},{"index":[1,7],"text":"a"},{"index":[7],"text":"u"},{"index":[7],"text":"s"},{"index":[5,7],"text":"t"},{"index":[7],"text":"i"},{"index":[7],"text":"n"},{"index":[7,6],"text":"g"},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""}],[{"index":[],"text":""},{"index":[4],"text":"d"},{"index":[],"text":""},{"index":[],"text":""},{"index":[1],"text":"l"},{"index":[],"text":""},{"index":[],"text":""},{"index":[5],"text":"e"},{"index":[],"text":""},{"index":[],"text":""},{"index":[6],"text":"z"},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""}],[{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[5],"text":"r"},{"index":[],"text":""},{"index":[],"text":""},{"index":[6],"text":"a"},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""}],[{"index":[],"text":""},{"index":[],"text":""},{"index":[8],"text":"t"},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[5],"text":"f"},{"index":[],"text":""},{"index":[],"text":""},{"index":[6],"text":"g"},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""}],[{"index":[],"text":""},{"index":[],"text":""},{"index":[8],"text":"r"},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[5],"text":"r"},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""}],[{"index":[],"text":""},{"index":[9],"text":"p"},{"index":[9,8],"text":"a"},{"index":[9],"text":"v"},{"index":[9],"text":"i"},{"index":[9],"text":"l"},{"index":[9],"text":"i"},{"index":[5,9],"text":"o"},{"index":[9],"text":"n"},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""}],[{"index":[],"text":""},{"index":[],"text":""},{"index":[8],"text":"d"},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[5],"text":"n"},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""}],[{"index":[],"text":""},{"index":[10],"text":"r"},{"index":[8,10],"text":"e"},{"index":[10],"text":"c"},{"index":[10],"text":"r"},{"index":[10],"text":"e"},{"index":[10],"text":"a"},{"index":[5,10],"text":"t"},{"index":[10],"text":"i"},{"index":[10],"text":"o"},{"index":[10],"text":"n"},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""}],[{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""},{"index":[],"text":""}]]}}}],"title":"Vocabulary box","bg_url":"https://staging-teach.cdn.ireadabc.com/1aaccbaa8f3a32df099f3308feac49e7.png"}
// const data = {"sentenceArr":[{"text":"1. She was not only _ but also very musical.","answer":"starfish"},{"text":"2. A _ is a flat sea creature in the shape of a star with five arms.","answer":"sea horse"},{"text":"3. A _ is a small sea fish with a horse-like head.","answer":"stream"},{"text":"4. There was a small _ at the end of the garden.","answer":"intelligent"}],"templateArr":[{"formUrl":"https://staging-teach.cdn.ireadabc.com/h5template/JM04-3/v14/index.html?type=form&key=1","template":{"id":733,"uuid":"3900b0f7-d041-490e-9b42-da8d3855633b","name":"JM04-3","description":"JM04-03拼单词","interaction_type":"","recommend_type":"","cover":"https://staging-teach.cdn.ireadabc.com/0455da10-c452-4cec-9f01-530536b886b3.png","type":1,"t_type":2,"form_url":"index.html?type=form","play_url":"index.html","developer_id":119,"git":"{\"id\":784,\"ssh\":\"git@vcs.ireadabc.com:template/JM04-3.git\",\"http\":\"https://vcs.ireadabc.com/template/JM04-3.git\"}","del":0,"publish":1,"last_version":14,"pub_date":null,"is_public":0,"created_date":"2021-07-20T06:18:52.000Z","updated_date":"2021-08-11T13:46:52.000Z"}},{"formUrl":"https://staging-teach.cdn.ireadabc.com/h5template/JM04-3/v14/index.html?type=form&key=2","template":{"id":733,"uuid":"3900b0f7-d041-490e-9b42-da8d3855633b","name":"JM04-3","description":"JM04-03拼单词","interaction_type":"","recommend_type":"","cover":"https://staging-teach.cdn.ireadabc.com/0455da10-c452-4cec-9f01-530536b886b3.png","type":1,"t_type":2,"form_url":"index.html?type=form","play_url":"index.html","developer_id":119,"git":"{\"id\":784,\"ssh\":\"git@vcs.ireadabc.com:template/JM04-3.git\",\"http\":\"https://vcs.ireadabc.com/template/JM04-3.git\"}","del":0,"publish":1,"last_version":14,"pub_date":null,"is_public":0,"created_date":"2021-07-20T06:18:52.000Z","updated_date":"2021-08-11T13:46:52.000Z"}}],"title":"Vocabulary box","bg_url":"https://staging-teach.cdn.ireadabc.com/892d0db2075efa3fa7aea6911bf36a83.png"}
this.data = { contentObj: data };
}
......@@ -301,7 +301,7 @@ export class PlayComponent implements OnInit, OnDestroy {
uploadUrl;
userData;
initData() {
this.canvasWidth = this.wrap.nativeElement.clientWidth * this.canvasScale;
this.canvasHeight = this.wrap.nativeElement.clientHeight * this.canvasScale;
......@@ -314,7 +314,7 @@ export class PlayComponent implements OnInit, OnDestroy {
const sy = this.canvasHeight / this.canvasBaseH;
const s = Math.min(sx, sy);
this.mapScale = s;
console.log('this.mapScale: ', this.mapScale);
this.mapScaleMax = Math.max(sx, sy);
......@@ -344,7 +344,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.submitCount = 0;
this.replaceSentenceText();
this.safeDefaultUrl = this.sanitizer.bypassSecurityTrustResourceUrl('');
this.safeDefaultUrl = this.sanitizer.bypassSecurityTrustResourceUrl('');
this.resultAnswerArr = [];
......@@ -446,7 +446,7 @@ export class PlayComponent implements OnInit, OnDestroy {
addOneAudio('click', this.rawAudios.get('click'), 1);
addOneAudio('more', this.rawAudios.get('more'), 0.8);
addOneAudio('submit', this.rawAudios.get('submit'), 0.8);
// addOneAudio('cow_start', this.rawAudios.get('cow_start'), 1);
// addOneAudio('eat', this.rawAudios.get('eat'), 1);
// addOneAudio('grass', this.rawAudios.get('grass'), 1);
......@@ -508,10 +508,10 @@ export class PlayComponent implements OnInit, OnDestroy {
// this.initFontImg();
// 预加载资源
this.loadResources().then(() => {
......@@ -565,7 +565,7 @@ export class PlayComponent implements OnInit, OnDestroy {
return;
}
c.onEvent('sendBtnClick', (data, next) => {
const durTime = new Date().getTime() - data.time
const useTime = ( Math.round( durTime / 1000 * 1000) / 1000) ;
const infoText = '发题 用时: ' + useTime + ''
......@@ -577,7 +577,7 @@ export class PlayComponent implements OnInit, OnDestroy {
});
c.onEvent('uploadAudioBtn1Click', (data, next) => {
this.infoLabel.text = `uploadAudioBtn1Click: data: ${JSON.stringify(data)}`;
//30秒
const audioUrl = 'http://staging-teach.cdn.ireadabc.com/107582309ca6d5de35404bcf56af69bf.mp3'
this.uploadTestAudio('30秒', audioUrl, 30);
......@@ -632,17 +632,17 @@ export class PlayComponent implements OnInit, OnDestroy {
this.showLansiEvaluation();
next();
});
c.onEvent('sendAnswerBtnClick', (data, next) => {
this.infoLabel.text = `sendAnswerBtnClick: data: ${JSON.stringify(data)}`;
//蓝思值
this.showSendAnswer();
next();
});
}
sendServerEvent(key, data) {
......@@ -682,7 +682,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.setStoreData('testData', testData, false);
const sendAnswer = window['courseware'].sendAnswer;
if (!sendAnswer) {
this.infoLabel.text = '=-=-=-=-= 接口异常: sendAnswer';
......@@ -763,7 +763,7 @@ export class PlayComponent implements OnInit, OnDestroy {
There is a very famous poem saying: The sky is blue, the wild is boundless. When the winds blow, the grass is low, and you can see the sheep and cattle.天苍苍野茫茫,风吹草低见牛羊。
Now do you know where I am talking about? Yes, it is Inner Mongolia, the second largest province in China.
My mother took me there in the summer holiday.
Inner Mongolia is very large. It has many cities, such as Ulanhot, Hohhot,Ordos and Baotou. The native Inner Mongolia people live on the grassland and enjoy their lives all the time.
I have been to Xilamuren Grassland. It has many cows and horses. When I was there, I rode horses, hugged the lamb, and played with my new friend Wangqi. How big Inner Mongolia is!
The most brilliant place I’ve visited is Mongolian yurts. It is so plain outside, but once you go inside the yurts, you will find how big it is, and how good the people they are! I love the people there.
......@@ -779,7 +779,7 @@ export class PlayComponent implements OnInit, OnDestroy {
return;
}
const startTime = new Date().getTime();
greadPapersForText({text: this.checkText}, (res) => {
......@@ -797,13 +797,22 @@ export class PlayComponent implements OnInit, OnDestroy {
}
url2Blob (url) {
return new Promise(resolve => {
return new Promise((resolve, reject) => {
console.log(' in url2Blob ..')
console.log(' in url2Blob ..');
console.log('url: ', url);
var xhr = new XMLHttpRequest();
xhr.open('get', url, true);
xhr.responseType = 'arraybuffer';
// const xhr = new XMLHttpRequest();
fetch(url)
// Retrieve its body as ReadableStream
.then(response => {
console.log(' in url2Blob load end..');
console.log(response.arrayBuffer);
resolve(response.arrayBuffer);
});
// xhr.open('get', url, true);
// xhr.responseType = 'arraybuffer';
// xhr.onload = () => {
// console.log(' in url2Blob load end..')
......@@ -814,6 +823,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// }
// };
/*
xhr.onreadystatechange = () => {
if (xhr.readyState !== 4) {
return;
......@@ -824,18 +834,20 @@ export class PlayComponent implements OnInit, OnDestroy {
if ((status >= 200 && status < 300) || status === 304) {
console.log('request success');
console.log(xhr.response);
console.log(xhr.response);
resolve(xhr.response);
} else {
console.log('request error');
console.log('xhr.response: ', xhr.response);
console.log('xhr.response1: ', xhr.response);
console.log('xhr.response2: ', xhr.responseText);
reject(xhr);
}
};
xhr.responseType = 'arraybuffer';
xhr.open('get', url, true);
xhr.send();
*/
});
}
......@@ -869,10 +881,10 @@ export class PlayComponent implements OnInit, OnDestroy {
});
});
}
......@@ -909,8 +921,8 @@ export class PlayComponent implements OnInit, OnDestroy {
this.initLabel();
}
// this.initSentence();
// this.changeBtnOff();
......@@ -950,7 +962,7 @@ export class PlayComponent implements OnInit, OnDestroy {
richText2.width = this.canvasWidth * 0.9;
richText2.textAlign = 'center';
this.topArr.push(richText);
// this.topArr.push(richText2);
......@@ -986,7 +998,7 @@ export class PlayComponent implements OnInit, OnDestroy {
if (progressStore == '4') {
return;
}
// const resultData = this.getStoreData('resultData')
// if (resultData) {
// this.initResultView(resultData);
......@@ -998,18 +1010,18 @@ export class PlayComponent implements OnInit, OnDestroy {
return;
}
}
maskPic;
initMaskPic() {
const bgUrl = this.data.contentObj.bg_url;
const bgUrl = this.data.contentObj.bg_url;
console.log('bgUrl', bgUrl);
const maskPic = this.getMySprite(bgUrl);
const sx = this.canvasWidth / maskPic.width;
const sy = this.canvasHeight / maskPic.height;
......@@ -1061,7 +1073,7 @@ export class PlayComponent implements OnInit, OnDestroy {
const resultLayer = new MySprite()
resultLayer.x = this.canvasWidth / 2;
resultLayer.y = this.canvasHeight / 2;
const bg = new MySprite();
bg.init(this.images.get("result_bg"))
......@@ -1126,10 +1138,10 @@ export class PlayComponent implements OnInit, OnDestroy {
btnLabel.fontColor = '#ffffff';
btn.addChild(btnLabel, 3);
this.topArr.push(resultLayer);
this.resultPanel = panel;
this.resultLayer = resultLayer;
......@@ -1137,7 +1149,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.initResultSentence();
}
......@@ -1170,7 +1182,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// richText.x = -this.panel.width / 2 * 0.9
richText.x = 0.05 * this.panel.width;
richText.y = baseY + 80;
richText.fontSize = 48;
richText.width = this.panel.width * 0.9;
richText.fontColor = '#ffffff'
......@@ -1183,8 +1195,8 @@ export class PlayComponent implements OnInit, OnDestroy {
richText.isShowWordBg = true;
richText.update();
const rectData = richText.getSubTextRect('____________________');
// if (!rectData) {
......@@ -1195,7 +1207,7 @@ export class PlayComponent implements OnInit, OnDestroy {
rect.height += 16;
const colorRect = new ShapeRectNew();
colorRect.setSize(rect.width, rect.height, 10);
colorRect.fillColor = '#007b3e'
const offX = 4;
colorRect.x = rect.x + offX - rect.width;
......@@ -1349,7 +1361,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// lansiEvaluation 蓝思值
// startTest 开始口语评分
// stopTest 结束口语评分
// sendAnswer
// sendAnswer
// const startRecordBtn = this.getBtnWithLabel('开始 录音转文本');
// startRecordBtn.x = this.canvasWidth / 2 //- 300 * this.mapScale;
......@@ -1357,7 +1369,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// startRecordBtn.setScaleXY(this.mapScale * 0.8);
// this.startRecordBtn = startRecordBtn;
// this.topArr.push(startRecordBtn);
// const stopRecordBtn = this.getBtnWithLabel('结束 录音转文本');
// stopRecordBtn.x = this.canvasWidth / 2 //- 300 * this.mapScale;
// stopRecordBtn.y = this.canvasHeight / 2 - 200 * this.mapScale;
......@@ -1406,7 +1418,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.greadPapersForCheckBtn = greadPapersForCheckBtn;
this.topArr.push(greadPapersForCheckBtn);
const lansiEvaluationBtn = this.getBtnWithLabel('蓝思值');
lansiEvaluationBtn.x = this.canvasWidth / 2 + 800 * this.mapScale;
lansiEvaluationBtn.y = this.canvasHeight / 2 - 0 * this.mapScale;
......@@ -1485,7 +1497,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// this.submitBtn.shadowSpr.alpha = 1;
// this.submitBtn.shadowSpr.y = this.submitBtn.shadowSpr.baseY;
this.submitBtn.visible = true;
this.submitBtn.shadowSpr.visible = true;
......@@ -1537,9 +1549,9 @@ export class PlayComponent implements OnInit, OnDestroy {
this.scrollView = sv;
this.sentenceEmptyArr = [];
const arr = this.sentenceArr;
// const arr = this.sentenceArr.concat(this.sentenceArr);
if (!arr) {
......@@ -1584,7 +1596,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// const colorRect = new ShapeRectNew();
// rect.height += 30;
// colorRect.setSize(rect.width, rect.height, 1);
// colorRect.fillColor = '#ff0000'
// const offX = 13;
// colorRect.x = rect.x + offX;
......@@ -1592,7 +1604,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// console.log('rect.height: ', rect.height);
// colorRect.alpha = 0.5;
// richText.addChild(colorRect);
// this.sentenceEmptyArr.push(colorRect);
......@@ -1609,18 +1621,18 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
getFillLabel() {
const label = new Label();
label.fontSize = 56;
label.fontColor = '#ffffff'
label.fontName = 'Aileron-Black';
// label.setScaleXY(this.mapScale);
return label;
}
......@@ -1628,13 +1640,13 @@ export class PlayComponent implements OnInit, OnDestroy {
const richText = new RichText();
richText.disH = 0;
richText.fontSize = 56;
richText.width = 2000 / this.mapScale
richText.fontColor = '#000000'
richText.fontName = 'DroidSansFallback';
richText.setScaleXY(this.mapScale);
return richText;
}
......@@ -1647,7 +1659,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.btnArr[i].isOff = true;
}
}
}
changeBtnOn() {
......@@ -1658,7 +1670,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.btnArr[i].isOff = false;
}
}
}
......@@ -1912,12 +1924,12 @@ export class PlayComponent implements OnInit, OnDestroy {
this.sendServerEvent('sendAnswerBtnClick', {});
}
checkBtnClick(btn, btnFunc) {
if (this.checkClickTarget(btn)) {
btnFunc();
......@@ -1938,13 +1950,13 @@ export class PlayComponent implements OnInit, OnDestroy {
return;
}
this.downFlag = true;
if (this.isTeacher) {
this.checkBtnClick(this.sendBtn, this.sendBtnClick.bind(this));
this.checkBtnClick(this.uploadAudioBtn1, this.uploadAudioBtn1Click.bind(this));
this.checkBtnClick(this.uploadAudioBtn2, this.uploadAudioBtn2Click.bind(this));
......@@ -1959,7 +1971,7 @@ export class PlayComponent implements OnInit, OnDestroy {
return;
}
this.downFlag = false;
......@@ -1974,14 +1986,14 @@ export class PlayComponent implements OnInit, OnDestroy {
event.preventDefault()
}
if (!this.downFlag) {
return;
}
}
......@@ -2012,7 +2024,7 @@ export class PlayComponent implements OnInit, OnDestroy {
const progress = this.getStoreData('progress');
console.log(' progress: ', progress);
if (progress == '2') {
......@@ -2055,7 +2067,7 @@ export class PlayComponent implements OnInit, OnDestroy {
iframecont.contentWindow.postMessage({ action: 'is_show_more', data: JSON.stringify(data) }, '*');
console.log(' post msg is_show_more ')
}, 1000);
}
......@@ -2076,7 +2088,7 @@ export class PlayComponent implements OnInit, OnDestroy {
label['targetLabel'] = emptyRect.label;
label['fillRect'] = emptyRect.label.fillRect;
this.curMoveItem = label;
this.mapMove(null)
return;
}
......@@ -2099,15 +2111,15 @@ export class PlayComponent implements OnInit, OnDestroy {
this.canTouch = true;
this.submitOff();
const isAllRight = this.checkAnswer();
if (isAllRight || this.submitCount >= 2) {
this.changeBtnOff();
this.btnArr = [];
delayCall(0.3, ()=> {
......@@ -2119,7 +2131,7 @@ export class PlayComponent implements OnInit, OnDestroy {
})
}
})
......@@ -2188,7 +2200,7 @@ export class PlayComponent implements OnInit, OnDestroy {
return isAllRight;
}
removeRectText(emptyRect) {
......@@ -2207,7 +2219,7 @@ export class PlayComponent implements OnInit, OnDestroy {
const pos = {x: emptyRect.width / 2, y: emptyRect.height / 2};
this.showRightParticle(emptyRect, pos)
}
}
showRightParticle(emptyRect, point ) {
......@@ -2226,10 +2238,10 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
checkOnTarget() {
for (let i = 0; i < this.sentenceEmptyArr.length; i++) {
if (this.checkClickTargetSv(this.sentenceEmptyArr[i])) {
......@@ -2244,7 +2256,7 @@ export class PlayComponent implements OnInit, OnDestroy {
const btnIndex = this.btnArr.indexOf(this.curMoveItem);
const isBtn = btnIndex != -1;
console.log('isBtn: ', isBtn);
if (isBtn && tmpText != '') {
this.moveItemBack();
......@@ -2258,7 +2270,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.curMoveItem.text = tmpText;
this.moveItemBack();
}
if (isBtn) {
this.removeBtn(this.curMoveItem);
}
......@@ -2269,7 +2281,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}
this.moveItemBack();
}
removeBtn(btn) {
......@@ -2289,7 +2301,7 @@ export class PlayComponent implements OnInit, OnDestroy {
emptyRect.label.setScaleXY(1);
emptyRect.label.textAlign = 'center';
emptyRect.addChild(emptyRect.label);
// this.renderArr.push(emptyRect.label);
}
const label = emptyRect.label
......@@ -2303,13 +2315,13 @@ export class PlayComponent implements OnInit, OnDestroy {
// label.x = emptyRect.parent.x + ( emptyRect.x + emptyRect.width / 2 - label.width / 2 ) * this.mapScale
label.y = emptyRect.height / 2;
label.x = ( emptyRect.width / 2 )
label.x = ( emptyRect.width / 2 )
// const w1 = emptyRect.width / this.mapScale;
// const w2 = label.width;
// label.width = w1// w2 < w1 ? w1: w2;
label['moveOffX'] = -label.width / 2 * label.scaleX;
label['moveOffY'] = 0// -label.height / 2 * label.scaleY;
......@@ -2342,7 +2354,7 @@ export class PlayComponent implements OnInit, OnDestroy {
removeItemFromArr(this.renderArr, this.curMoveItem);
return;
}
this.curMoveItem.x = this.curMoveItem['baseX'];
this.curMoveItem.y = this.curMoveItem['baseY'];
}
......@@ -2381,7 +2393,7 @@ export class PlayComponent implements OnInit, OnDestroy {
console.log('i~~:' , index)
this.templateArr[index].playUrl = this.sanitizer.bypassSecurityTrustResourceUrl(urlData.play_url + `?key=${index+1}`);
this.appRef.tick();
index ++;
if (index < this.templateArr.length) {
const {name, last_version, play_url} = this.templateArr[index].template;
......@@ -2406,19 +2418,19 @@ export class PlayComponent implements OnInit, OnDestroy {
// console.log('urlData~~:' , urlData)
// console.log('i~~:' , index)
// this.templateArr[index].playUrl = this.sanitizer.bypassSecurityTrustResourceUrl(urlData.play_url + `?key=${index+1}`);
// })
// const playUrl = `https://staging-teach.cdn.ireadabc.com/h5template/${name}/v${last_version}/${play_url}?key=${i+1}`
// this.templateArr[i].playUrl = this.sanitizer.bypassSecurityTrustResourceUrl(playUrl);
// this.templateArr[i].playUrl = this.sanitizer.bypassSecurityTrustResourceUrl(playUrl);
// console.log('playUrl: ', playUrl);
// }
// this.showSubTemplate(0);
// setTimeout(() => {
// this.showSubTemplate(1);
// }, 5000);
}
......@@ -2470,17 +2482,17 @@ export class PlayComponent implements OnInit, OnDestroy {
// console.log('iframe: ', iframe);
// iframeArr.push(iframe)
// }
// console.log('iframeArr: ', iframeArr);
// // }, 1);
this.readyObj = {};
window.addEventListener('message', (e) => {
let msgData = e.data;
if (msgData.action === "getData") {
......@@ -2504,16 +2516,16 @@ export class PlayComponent implements OnInit, OnDestroy {
console.log("getData e: ", e);
const data = { msg: 'success', data: JSON.stringify(saveData)};
iframecont.contentWindow.postMessage({ action: 'getData', data: JSON.stringify(data) }, '*');
}
if (msgData.action === "temp_send_result") {
console.log(' in temp_send_result');
......@@ -2542,7 +2554,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.checkShowSubTemplateOne();
}
if (msgData.action == 'course-ready') {
console.log(' in course-ready msgData: ', msgData)
......@@ -2563,12 +2575,12 @@ export class PlayComponent implements OnInit, OnDestroy {
const divArr = this.iframeContent.nativeElement.children;
const iframecont = divArr[index].children[0];
const data = { msg: 'success', data: ''};
iframecont.contentWindow.postMessage({ action: 'airEvents', evt: 'course-in-screen', data: JSON.stringify(data) }, '*');
}
getQueryVariable(url, variable) {
......@@ -2955,7 +2967,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.scrollView.onWheelUp(event.deltaY);
}
}
}
......@@ -3104,14 +3116,14 @@ export class PlayComponent implements OnInit, OnDestroy {
const svBox = this.scrollView.getBoundingBox();
const x = svBox.x + tmpRect.x * this.mapScale;
const y = svBox.y + tmpRect.y * this.mapScale;
const width = tmpRect.width * this.mapScale;
const height = tmpRect.height * this.mapScale;
const rect = {x, y, width, height};
// const contentBox = this.scrollView.content.getBoundingBox();
// rect.x += contentBox.x + svBox.x;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment