Commit 15a5a5e8 authored by limingzhe's avatar limingzhe

feat: 上报成绩

parent 22ea8686
...@@ -244,6 +244,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -244,6 +244,7 @@ export class PlayComponent implements OnInit, OnDestroy {
sentenceArr = []; sentenceArr = [];
submitCount = 0; submitCount = 0;
safeDefaultUrl; safeDefaultUrl;
resultAnswerArr;
initData() { initData() {
...@@ -281,6 +282,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -281,6 +282,8 @@ export class PlayComponent implements OnInit, OnDestroy {
this.safeDefaultUrl = this.sanitizer.bypassSecurityTrustResourceUrl(''); this.safeDefaultUrl = this.sanitizer.bypassSecurityTrustResourceUrl('');
this.resultAnswerArr = [];
} }
...@@ -531,8 +534,6 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -531,8 +534,6 @@ export class PlayComponent implements OnInit, OnDestroy {
this.initView(); this.initView();
} }
initCtx() { initCtx() {
...@@ -1383,10 +1384,12 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1383,10 +1384,12 @@ export class PlayComponent implements OnInit, OnDestroy {
moreBtnClick() { moreBtnClick() {
this.setPageData('progress', '2', false); // this.setPageData('progress', '2', false);
this.setPageData('submitCount', this.submitCount); // this.setPageData('submitCount', this.submitCount);
this.checkShowSubTemplateOne(); this.checkShowSubTemplateOne();
this.isUpdateStop = true; this.isUpdateStop = true;
// this.serverSendAnswer();
} }
checkShowSubTemplateOne() { checkShowSubTemplateOne() {
...@@ -1474,8 +1477,15 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1474,8 +1477,15 @@ export class PlayComponent implements OnInit, OnDestroy {
this.changeBtnOff(); this.changeBtnOff();
this.btnArr = []; this.btnArr = [];
delayCall(0.3, ()=> { delayCall(0.3, ()=> {
this.initResultView(); this.initResultView();
this.setPageData('progress', '2', false);
this.setPageData('submitCount', this.submitCount);
this.serverSendAnswer();
}) })
} }
...@@ -1490,6 +1500,27 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1490,6 +1500,27 @@ export class PlayComponent implements OnInit, OnDestroy {
// tweenChange(shadow, {y: shadowBaseY, alpha: 1}, time) // tweenChange(shadow, {y: shadowBaseY, alpha: 1}, time)
}) })
this.addResultAnswer();
}
addResultAnswer() {
console.log('this.data.contentObj.sentenceArr: ', this.data.contentObj.sentenceArr)
console.log('this.sentenceEmptyArr: ', this.sentenceEmptyArr);
const sentenceArr = this.data.contentObj.sentenceArr;
const resultAnswer = [];
for (let i=0; i<sentenceArr.length; i++) {
const label = this.sentenceEmptyArr[i].label;
const tmpData = {};
tmpData['question'] = sentenceArr[i];
tmpData['userAnswer'] = label.text;
resultAnswer.push(tmpData);
}
this.resultAnswerArr.push(resultAnswer);
} }
...@@ -1832,7 +1863,12 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1832,7 +1863,12 @@ export class PlayComponent implements OnInit, OnDestroy {
if (msgData.action === "temp_send_result") { if (msgData.action === "temp_send_result") {
const progress = this.getPageData('progress');
if (progress == '2') {
this.setPageData('progress', '3'); this.setPageData('progress', '3');
} else {
this.setPageData('progress', '4');
}
console.log('in temp_send_result __ msgData: ', msgData); console.log('in temp_send_result __ msgData: ', msgData);
} }
...@@ -1860,6 +1896,16 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1860,6 +1896,16 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
serverSendAnswer() {
const c = window['courseware'];
if (!c) {
return;
}
c.sendAnswer(this.resultAnswerArr);
console.log(' sendAnswer : ', this.resultAnswerArr);
}
......
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