Add: add license score
This commit is contained in:
@@ -71,8 +71,6 @@ function InputScore(licenseDataManager, timer, chart) {
|
||||
this.makeSubjectPanel();
|
||||
this.setVisibleCompanyPanel(false);
|
||||
this.setVisibleSubjectPanel(false, "");
|
||||
|
||||
this.loadMaestroPasswordFromServer();
|
||||
}
|
||||
|
||||
InputScore.prototype.initVariables = function() {
|
||||
@@ -290,25 +288,70 @@ InputScore.prototype.makePanelSprite = function(x, y, width, height, color) {
|
||||
return game.add.sprite(x, y, btnTexture);
|
||||
}
|
||||
|
||||
|
||||
|
||||
InputScore.prototype.onClickSendToServerButton = function() {
|
||||
console.log("send data to server");
|
||||
|
||||
console.log(this.subjectFullname);
|
||||
console.log(this.scoreText.value);
|
||||
var subjectData = this.licenseDataManager.getSubjectDataByName(this.subjectFullname);
|
||||
if(subjectData != null)
|
||||
console.log(subjectData.getGrade(this.scoreText.value))
|
||||
console.log(this.passwordText.value);
|
||||
InputScore.prototype.alert = function(message) {
|
||||
console.log("Alert message : " + message);
|
||||
}
|
||||
|
||||
InputScore.prototype.loadMaestroPasswordFromServer = function() {
|
||||
InputScore.prototype.onClickSendToServerButton = function() {
|
||||
if(this.subjectFullname == "") {
|
||||
this.alert("no subject error");
|
||||
return;
|
||||
}
|
||||
|
||||
if(this.scoreText.value == "") {
|
||||
this.alert("no score error");
|
||||
return;
|
||||
}
|
||||
|
||||
if(this.passwordText.value == "") {
|
||||
this.alert("no password error");
|
||||
return;
|
||||
}
|
||||
this.maestroPassword = this.passwordText.value;
|
||||
|
||||
console.log("send data to server");
|
||||
|
||||
this.checkMaestroPasswordFromServer();
|
||||
}
|
||||
|
||||
|
||||
|
||||
InputScore.prototype.addScoreToServer = function(subjectName, score) {
|
||||
this.dbConnectManager.addLicenseScore(
|
||||
sessionStorageManager.getMaestroID(),
|
||||
sessionStorageManager.getPlayerID(),
|
||||
subjectName,
|
||||
score,
|
||||
(function(replyJson) {
|
||||
console.log(replyJson);
|
||||
|
||||
this.chart.loadScoreFromServer();
|
||||
}).bind(this),
|
||||
|
||||
(function(replyJson) {
|
||||
console.log(replyJson);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
InputScore.prototype.checkMaestroPasswordFromServer = function() {
|
||||
this.dbConnectManager.requestLicenseMaestroPassword(
|
||||
sessionStorageManager.getMaestroID(),
|
||||
(function(replyJson) {
|
||||
// console.log(replyJson);
|
||||
this.maestroPassword = replyJson.maestroPassword;
|
||||
console.log(replyJson);
|
||||
|
||||
console.log(this.maestroPassword);
|
||||
console.log(replyJson.maestroPassword);
|
||||
|
||||
if(replyJson.maestroPassword == null || replyJson.maestroPassword == "") {
|
||||
this.alert("set password!!!");
|
||||
return;
|
||||
} else if(this.maestroPassword != replyJson.maestroPassword) {
|
||||
this.alert("wrong password");
|
||||
return;
|
||||
}
|
||||
|
||||
this.addScoreToServer(this.subjectFullname, this.scoreText.value);
|
||||
}).bind(this),
|
||||
|
||||
(function(replyJson) {
|
||||
|
||||
@@ -33,7 +33,7 @@ var licenseDataList = [
|
||||
gradeList: [
|
||||
{ score: 160, grade: "고급" },
|
||||
{ score: 120, grade: "중급" },
|
||||
{ score: 80, grade: "초금" }
|
||||
{ score: 80, grade: "초급" }
|
||||
],
|
||||
subjects: [
|
||||
"프리젠테이션",
|
||||
@@ -49,7 +49,7 @@ var licenseDataList = [
|
||||
gradeList: [
|
||||
{ score: 80, grade: "고급" },
|
||||
{ score: 60, grade: "중급" },
|
||||
{ score: 40, grade: "초금" }
|
||||
{ score: 40, grade: "초급" }
|
||||
],
|
||||
subjects: [
|
||||
"인터넷정보검색",
|
||||
|
||||
Reference in New Issue
Block a user