Commit 15a5a5e8 authored by limingzhe's avatar limingzhe

feat: 上报成绩

parent 22ea8686
......@@ -244,6 +244,7 @@ export class PlayComponent implements OnInit, OnDestroy {
sentenceArr = [];
submitCount = 0;
safeDefaultUrl;
resultAnswerArr;
initData() {
......@@ -281,6 +282,8 @@ export class PlayComponent implements OnInit, OnDestroy {
this.safeDefaultUrl = this.sanitizer.bypassSecurityTrustResourceUrl('');
this.resultAnswerArr = [];
}
......@@ -530,8 +533,6 @@ export class PlayComponent implements OnInit, OnDestroy {
this.initView();
}
......@@ -1383,10 +1384,12 @@ export class PlayComponent implements OnInit, OnDestroy {
moreBtnClick() {
this.setPageData('progress', '2', false);
this.setPageData('submitCount', this.submitCount);
// this.setPageData('progress', '2', false);
// this.setPageData('submitCount', this.submitCount);
this.checkShowSubTemplateOne();
this.isUpdateStop = true;
// this.serverSendAnswer();
}
checkShowSubTemplateOne() {
......@@ -1474,8 +1477,15 @@ export class PlayComponent implements OnInit, OnDestroy {
this.changeBtnOff();
this.btnArr = [];
delayCall(0.3, ()=> {
this.initResultView();
this.setPageData('progress', '2', false);
this.setPageData('submitCount', this.submitCount);
this.serverSendAnswer();
})
}
......@@ -1490,6 +1500,27 @@ export class PlayComponent implements OnInit, OnDestroy {
// 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 {
if (msgData.action === "temp_send_result") {
this.setPageData('progress', '3');
const progress = this.getPageData('progress');
if (progress == '2') {
this.setPageData('progress', '3');
} else {
this.setPageData('progress', '4');
}
console.log('in temp_send_result __ msgData: ', msgData);
}
......@@ -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