Commit 8503a3dc authored by liujiangnan's avatar liujiangnan

feat:加一个答题时间

parent fda90d56
...@@ -584,7 +584,9 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -584,7 +584,9 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
} }
localStartTime = new Date().getTime();
gameStart() { gameStart() {
this.localStartTime = new Date().getTime();
console.log(' in gameStart '); console.log(' in gameStart ');
if (this.isTeacher) { if (this.isTeacher) {
this.sendBtn.visible = false; this.sendBtn.visible = false;
...@@ -1823,7 +1825,6 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1823,7 +1825,6 @@ export class PlayComponent implements OnInit, OnDestroy {
this.checkShowSubTemplateOne(); this.checkShowSubTemplateOne();
this.isUpdateStop = true; this.isUpdateStop = true;
// this.serverSendAnswer();
} }
checkShowSubTemplateOne() { checkShowSubTemplateOne() {
...@@ -2127,7 +2128,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -2127,7 +2128,8 @@ export class PlayComponent implements OnInit, OnDestroy {
return; return;
} }
c.sendAnswer({resultData: this.userResultData, resultPic: this.userResultPic}); const duration = new Date().getTime() - this.localStartTime;
c.sendAnswer({resultData: this.userResultData, resultPic: this.userResultPic, duration});
} }
...@@ -2593,10 +2595,9 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -2593,10 +2595,9 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
this.serverResultObj[key] = data; this.serverResultObj[key] = data;
this.serverResultObj.duration = new Date().getTime() - this.localStartTime;
c.sendAnswer(this.serverResultObj); c.sendAnswer(this.serverResultObj);
console.log(' sendAnswer : ', this.serverResultObj);
console.log(' sendAnswer : ' + JSON.stringify( this.serverResultObj ));
} }
......
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