Add: typing exam start

This commit is contained in:
2019-07-18 16:23:07 +09:00
parent 1f6d91f301
commit f79040fed4
4 changed files with 71 additions and 37 deletions
+55 -26
View File
@@ -7,6 +7,10 @@ var Start = {
create: function() {
this.dbConnectManager = new DBConnectManager();
this.dbService = new DBService();
this.dbService.setMaestroID(sessionStorageManager.getMaestroID());
this.dbService.setPlayerID(sessionStorageManager.getPlayerID());
this.game.stage.backgroundColor = '#4d4d4d';
this.howToPlay = new HowToPlay();
this.chart = new Chart();
@@ -98,37 +102,62 @@ var Start = {
loadChart: function() {
var today = new Date();
var date = DateUtil.getYYYYMMDD(today);
this.dbConnectManager.requestPlayerHistory(
date,
(function(historyRecordManager) {
if(historyRecordManager.count == 0) {
console.log("start - history record : no data");
return;
}
var underValue = historyRecordManager.underValueForGraph();
var upperValue = historyRecordManager.upperValueForGraph();
if(isTypingExamApp()) {
this.dbService.requestTypingExamPlayerHistory(
sessionStorageManager.getWritingID(),
date,
var minValue = underValue - (upperValue - underValue) / 10;
var maxValue = upperValue;// + (upperValue - underValue) / 10;
(function(historyRecordManager) {
this.onReceiveHistoryRecordManager(historyRecordManager);
}).bind(this),
var countRecord = historyRecordManager.count;
for(var i = 0; i < Chart.CHART_COUNT; i++) {
// if(i > 6)
// break;
(function(jsonData) {
console.log(jsonData);
}).bind(this)
);
} else {
this.dbConnectManager.requestPlayerHistory(
date,
var historyRecord = historyRecordManager.getAt(i);
this.chart.drawRecordGraph(
i,
historyRecord === undefined ? "-" : historyRecord.date,
historyRecord === undefined ? "" : historyRecord.bestRecord,
minValue, maxValue
);
}
(function(historyRecordManager) {
this.onReceiveHistoryRecordManager(historyRecordManager);
}).bind(this),
this.chart.printChartBaseLine();
}).bind(this)
);
(function(jsonData) {
console.log(jsonData);
}).bind(this)
);
}
},
onReceiveHistoryRecordManager: function(historyRecordManager) {
if(historyRecordManager.count == 0) {
console.log("start - history record : no data");
return;
}
var underValue = historyRecordManager.underValueForGraph();
var upperValue = historyRecordManager.upperValueForGraph();
var minValue = underValue - (upperValue - underValue) / 10;
var maxValue = upperValue;// + (upperValue - underValue) / 10;
var countRecord = historyRecordManager.count;
for(var i = 0; i < Chart.CHART_COUNT; i++) {
// if(i > 6)
// break;
var historyRecord = historyRecordManager.getAt(i);
this.chart.drawRecordGraph(
i,
historyRecord === undefined ? "-" : historyRecord.date,
historyRecord === undefined ? "" : historyRecord.bestRecord,
minValue, maxValue
);
}
this.chart.printChartBaseLine();
},
calcDate: function(daysBefore) {