Commit 8503a3dc authored by liujiangnan's avatar liujiangnan

feat:加一个答题时间

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