Fix: revise php filename
This commit is contained in:
@@ -129,7 +129,7 @@ DBService.prototype.requestWritingInfo = function(writingID, onSucceededListener
|
||||
// typing exam
|
||||
DBService.prototype.addPrevHourTypingExamRecord = function(writingID, record, onSucceededListener, onFailedListener) {
|
||||
var xhr = this.makeXhr(
|
||||
"php/writing/update_result_record.php",
|
||||
"php/record/update_writing_record.php",
|
||||
(function() { // onreadystatechange
|
||||
if(xhr.readyState == 4 && xhr.status == 200) {
|
||||
var replyJSON = JSON.parse(xhr.responseText);
|
||||
@@ -152,7 +152,7 @@ DBService.prototype.addPrevHourTypingExamRecord = function(writingID, record, on
|
||||
|
||||
DBService.prototype.updateTypingExamRecord = function(writingID, record, onSucceededListener, onFailedListener) {
|
||||
var xhr = this.makeXhr(
|
||||
"php/writing/update_result_record.php",
|
||||
"php/record/update_writing_record.php",
|
||||
(function() { // onreadystatechange
|
||||
if(xhr.readyState == 4 && xhr.status == 200) {
|
||||
var replyJSON = JSON.parse(xhr.responseText);
|
||||
@@ -174,7 +174,7 @@ DBService.prototype.updateTypingExamRecord = function(writingID, record, onSucce
|
||||
|
||||
DBService.prototype.getTypingExamHighestRecord = function(writingID, onSucceededListener, onFailedListener) {
|
||||
var xhr = this.makeXhr(
|
||||
"php/writing/get_highest_record.php",
|
||||
"php/record/get_writing_highest_record.php",
|
||||
(function() { // onreadystatechange
|
||||
if(xhr.readyState == 4 && xhr.status == 200) {
|
||||
var replyJSON = JSON.parse(xhr.responseText);
|
||||
@@ -191,4 +191,92 @@ DBService.prototype.getTypingExamHighestRecord = function(writingID, onSucceeded
|
||||
+ "&playerID=" + this.playerID
|
||||
+ "&writingID=" + writingID
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
DBService.prototype.requestWritingPlayerHistory = function(writingID, date, onSucceededListener, onFailedListener) {
|
||||
var historyRecordManager = new HistoryRecordManager();
|
||||
|
||||
if(isDebugMode()) {
|
||||
this.loadTempPlayerHistory(historyRecordManager);
|
||||
|
||||
if(onSucceededListener !== null)
|
||||
onSucceededListener(historyRecordManager);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
var xhr = this.makeXhr(
|
||||
"php/record/history_record.php",
|
||||
(function() { // onreadystatechange
|
||||
if(xhr.readyState == 4 && xhr.status == 200) {
|
||||
var replyJSON = JSON.parse(xhr.responseText);
|
||||
|
||||
if(replyJSON != null)
|
||||
onSucceededListener(this.parseJSONtoHistoryRecord(replyJSON));
|
||||
else
|
||||
onFailedListener(replyJSON);
|
||||
}
|
||||
}).bind(this)
|
||||
);
|
||||
xhr.send(
|
||||
"maestroID=" + this.maestroID
|
||||
+ "&playerID=" + this.playerID
|
||||
+ "&writingID=" + writingID
|
||||
+ "&date=" + date
|
||||
);
|
||||
*/
|
||||
}
|
||||
|
||||
DBService.prototype.parseJSONtoHistoryRecord = function(json) {
|
||||
var historyRecordManager = new HistoryRecordManager();
|
||||
|
||||
if(typeof json === "undefined")
|
||||
return historyRecordManager;
|
||||
|
||||
if(typeof json.history === "undefined")
|
||||
return historyRecordManager;
|
||||
|
||||
var count = json.history.length;
|
||||
for(var i = 0; i < count; i++) {
|
||||
var record = new HistoryRecord(
|
||||
json.history[i]["Date"],
|
||||
json.history[i]["AppName"],
|
||||
json.history[i]["HighScore"]
|
||||
);
|
||||
historyRecordManager.push(record);
|
||||
}
|
||||
|
||||
return historyRecordManager;
|
||||
}
|
||||
|
||||
|
||||
DBService.prototype.loadTempPlayerHistory = function(historyRecordManager) {
|
||||
// historyRecordManager.push(new HistoryRecord("05/14", "space_invaders", 14460));
|
||||
historyRecordManager.push(new HistoryRecord("2019-05-13 00:00:00", "space_invaders", 14460));
|
||||
historyRecordManager.push(new HistoryRecord("2019-05-12 00:00:00", "space_invaders", 12860));
|
||||
historyRecordManager.push(new HistoryRecord("2019-05-11 00:00:00", "typing_english_basic", 15460));
|
||||
historyRecordManager.push(new HistoryRecord("2019-05-10 00:00:00", "typing_korean_basic", 13040));
|
||||
historyRecordManager.push(new HistoryRecord("2019-05-09 00:00:00", "space_invaders", 15460));
|
||||
historyRecordManager.push(new HistoryRecord("2019-05-08 00:00:00", "typing_english_basic", 14607));
|
||||
historyRecordManager.push(new HistoryRecord("2019-05-07 00:00:00", "typing_korean_basic", 13058));
|
||||
}
|
||||
|
||||
DBService.prototype.loadTempRanking = function(rankingRecordManager) {
|
||||
rankingRecordManager.push(new RankingRecord(1, 7, "강경모", 4400));
|
||||
rankingRecordManager.push(new RankingRecord(2, 2, "강성태", 3400));
|
||||
rankingRecordManager.push(new RankingRecord(3, 3, "김기덕", 2400));
|
||||
rankingRecordManager.push(new RankingRecord(4, 4, "김남희", 1400));
|
||||
rankingRecordManager.push(new RankingRecord(5, 5, "고봉순", 900));
|
||||
rankingRecordManager.push(new RankingRecord(6, 6, "파르마", 800));
|
||||
rankingRecordManager.push(new RankingRecord(7, 1, "박지상", 700));
|
||||
rankingRecordManager.push(new RankingRecord(8, 8, "신현주", 600));
|
||||
rankingRecordManager.push(new RankingRecord(9, 9, "꼬봉이", 500));
|
||||
rankingRecordManager.push(new RankingRecord(10, 10, "거북이", 400));
|
||||
rankingRecordManager.push(new RankingRecord(11, 11, "다람쥐", 300));
|
||||
rankingRecordManager.push(new RankingRecord(12, 12, "사시미", 200));
|
||||
rankingRecordManager.push(new RankingRecord(13, 13, "태권도", 100));
|
||||
rankingRecordManager.push(new RankingRecord(14, 14, "합기도", 40));
|
||||
rankingRecordManager.push(new RankingRecord(15, 15, "우습지", 10));
|
||||
rankingRecordManager.push(new RankingRecord(16, 16, "하하하", 4));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user