Add: writing_info.php
This commit is contained in:
@@ -272,7 +272,7 @@ var TypingExamination = {
|
||||
|
||||
back: function() {
|
||||
sessionStorageManager.resetPlayingAppData();
|
||||
location.href = '../../web/client/menu_typing_test.html';
|
||||
location.href = '../../web/client/menu_typing_exam.html';
|
||||
},
|
||||
|
||||
startGame: function() {
|
||||
@@ -333,15 +333,33 @@ var TypingExamination = {
|
||||
|
||||
|
||||
loadExaminationContent: function() {
|
||||
var path = "./../../../resources/file/typing_exam/";
|
||||
var dbService = new DBService();
|
||||
dbService.setMaestroID(sessionStorageManager.getMaestroID());
|
||||
dbService.setPlayerID(sessionStorageManager.getPlayerID());
|
||||
|
||||
// get the writing data from session storage
|
||||
// get the writing data from DB
|
||||
dbService.requestWritingInfo(
|
||||
sessionStorageManager.getWritingID(),
|
||||
(function(jsonData) { // onSucceeded
|
||||
this.downloadListSucceeded(jsonData);
|
||||
}).bind(this),
|
||||
(function(jsonData) { // onFailed
|
||||
this.downloadListFailed(jsonData);
|
||||
}).bind(this)
|
||||
);
|
||||
},
|
||||
|
||||
var filename = "korean_heoseng.txt";
|
||||
var writer = "system";
|
||||
downloadListSucceeded: function(jsonData) {
|
||||
console.log(jsonData);
|
||||
var writingInfo = jsonData["writingInfo"];
|
||||
console.log(writingInfo);
|
||||
|
||||
var writer = writingInfo["writer"];
|
||||
var writerID = "";
|
||||
writingInfo["writerID"] == null ? writerID = "" : writerID = writingInfo["writerID"];
|
||||
|
||||
var path = "./../../../resources/file/typing_exam/";
|
||||
var directory = writer + writerID + "/";
|
||||
var filename = writingInfo["filename"];
|
||||
var url = path + directory + filename;
|
||||
|
||||
game.load.onLoadComplete.add(this.completeLoadingWriting, this);
|
||||
@@ -351,6 +369,10 @@ var TypingExamination = {
|
||||
game.load.start();
|
||||
},
|
||||
|
||||
downloadListFailed: function(jsonData) {
|
||||
console.log(jsonData);
|
||||
},
|
||||
|
||||
completeLoadingWriting: function() {
|
||||
game.load.onFileComplete.remove(this.loadExaminationContent, this);
|
||||
game.load.onLoadComplete.remove(this.completeLoadingWriting, this);
|
||||
|
||||
Reference in New Issue
Block a user