This repository has been archived by the owner on Dec 26, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app_dev.js
executable file
·1 lines (1 loc) · 10 KB
/
app_dev.js
1
var app=angular["\x6D\x6F\x64\x75\x6C\x65"]("\x71\x75\x69\x7A\x41\x70\x70",["\x6E\x67\x52\x65\x73\x6F\x75\x72\x63\x65","\x70\x61\x73\x63\x61\x6C\x70\x72\x65\x63\x68\x74\x2E\x74\x72\x61\x6E\x73\x6C\x61\x74\x65"]);var API_URL="\x2F\x2F\x62\x75\x72\x6E\x65\x72\x2D\x67\x61\x6D\x65\x73\x2E\x68\x65\x72\x6F\x6B\x75\x61\x70\x70\x2E\x63\x6F\x6D\x2F\x61\x70\x69\x2F\x76\x31\x2F";var gameToken="";var userId=0;var sessionToken="";app["\x63\x6F\x6E\x73\x74\x61\x6E\x74"]("\x43\x4F\x4E",{correctAnswers:10});var gameQuestions={id:null,question:null,options:null,answer:null};app["\x63\x6F\x6E\x74\x72\x6F\x6C\x6C\x65\x72"]("\x71\x75\x69\x7A\x49\x6E\x69\x74",function($scope,$http){userId=getUrlParams("\x75\x73\x65\x72\x49\x64");if(userId!==undefined){$scope["\x49\x6E\x69\x74"]=function(){var new_gameRequest={method:"\x50\x4F\x53\x54",url:API_URL+"\x2F\x67\x61\x6D\x65\x73\x2F\x6E\x65\x77\x2F",contentType:"\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x2F\x6A\x73\x6F\x6E",dataType:"\x6A\x73\x6F\x6E",data:"\x7B\x22\x75\x73\x65\x72\x5F\x69\x64\x22\x3A\x20"+userId+"\x7D"};$http(new_gameRequest)["\x74\x68\x65\x6E"](function(data){gameToken=data["\x64\x61\x74\x61"]["\x74\x6F\x6B\x65\x6E"]},function(){console["\x6C\x6F\x67"]("\x45\x72\x72\x6F\x72\x3A\x20\x66\x61\x69\x6C\x65\x64\x20\x74\x6F\x20\x69\x6E\x69\x74\x20\x6E\x65\x77\x20\x67\x61\x6D\x65")});}}else {$(function(){$("\x23\x67\x61\x6D\x65\x2D\x73\x74\x61\x72\x74\x2D\x77\x72\x61\x70\x70\x65\x72")["\x68\x69\x64\x65"]()});alert("\x55\x73\x65\x72\x20\x69\x64\x20\x69\x73\x20\x6D\x69\x73\x73\x69\x6E\x67\x21");};;;});app["\x64\x69\x72\x65\x63\x74\x69\x76\x65"]("\x71\x75\x69\x7A",function(quizFactory,$http,CON){var qnumber;var correctAnswers;return {restrict:"\x41\x45",scope:{},templateUrl:"\x73\x74\x61\x74\x69\x63\x73\x2F\x74\x65\x6D\x70\x6C\x61\x74\x65\x2E\x68\x74\x6D\x6C",link:function(scope,elem,attrs){scope["\x73\x74\x61\x72\x74"]=function(){$("\x23\x69\x6E\x74\x72\x6F")["\x66\x61\x64\x65\x4F\x75\x74"]("\x66\x61\x73\x74");correctAnswers=0;qnumber=1;scope["\x69\x64"]=0;scope["\x71\x75\x69\x7A\x4F\x76\x65\x72"]=false;scope["\x69\x6E\x50\x72\x6F\x67\x72\x65\x73\x73"]=true;scope["\x67\x65\x74\x51\x75\x65\x73\x74\x69\x6F\x6E"]();};scope["\x67\x65\x74\x51\x75\x65\x73\x74\x69\x6F\x6E"]=function(){var get_questionsRequest={method:"\x50\x4F\x53\x54",url:API_URL+"\x2F\x67\x61\x6D\x65\x73\x2F"+gameToken+"\x2F\x6E\x65\x77\x5F\x71\x75\x65\x73\x74\x69\x6F\x6E\x2F",contentType:"\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x2F\x6A\x73\x6F\x6E",dataType:"\x6A\x73\x6F\x6E",data:"\x7B\x7D"};$http(get_questionsRequest)["\x74\x68\x65\x6E"](function(data){console["\x6C\x6F\x67"](data["\x64\x61\x74\x61"]);gameQuestions["\x69\x64"]=data["\x64\x61\x74\x61"]["\x69\x64"];gameQuestions["\x71\x75\x65\x73\x74\x69\x6F\x6E"]=data["\x64\x61\x74\x61"]["\x62\x6F\x64\x79"];gameQuestions["\x6F\x70\x74\x69\x6F\x6E\x73"]=data["\x64\x61\x74\x61"]["\x61\x6E\x73\x77\x65\x72\x73"];gameQuestions["\x61\x6E\x73\x77\x65\x72"]=0;if(gameQuestions){scope["\x71\x6E\x75\x6D\x62\x65\x72"]=qnumber;scope["\x71\x75\x65\x73\x74\x69\x6F\x6E"]=gameQuestions["\x71\x75\x65\x73\x74\x69\x6F\x6E"];scope["\x6F\x70\x74\x69\x6F\x6E\x73"]=gameQuestions["\x6F\x70\x74\x69\x6F\x6E\x73"];scope["\x61\x6E\x73\x77\x65\x72"]=gameQuestions["\x61\x6E\x73\x77\x65\x72"];scope["\x61\x6E\x73\x77\x65\x72\x4D\x6F\x64\x65"]=true;}else {scope["\x71\x75\x69\x7A\x4F\x76\x65\x72"]=true};},function(){console["\x6C\x6F\x67"]("\x45\x72\x72\x6F\x72\x3A\x20\x63\x61\x6E\x27\x74\x20\x67\x65\x74\x20\x71\x75\x65\x73\x74\x69\x6F\x6E\x73\x20\x66\x72\x6F\x6D\x20\x61\x70\x69")});};scope["\x6E\x65\x78\x74\x51\x75\x65\x73\x74\x69\x6F\x6E"]=function(){qnumber++;scope["\x69\x64"]++;scope["\x67\x65\x74\x51\x75\x65\x73\x74\x69\x6F\x6E"]();};scope["\x72\x65\x73\x65\x74"]=function(){scope["\x69\x6E\x50\x72\x6F\x67\x72\x65\x73\x73"]=false;scope["\x73\x63\x6F\x72\x65"]=0;};scope["\x63\x68\x65\x63\x6B\x41\x6E\x73\x77\x65\x72"]=function(){if(!$("\x69\x6E\x70\x75\x74\x5B\x6E\x61\x6D\x65\x3D\x61\x6E\x73\x77\x65\x72\x5D\x3A\x63\x68\x65\x63\x6B\x65\x64")["\x6C\x65\x6E\x67\x74\x68"]){alert("\x43\x68\x6F\x6F\x73\x65\x20\x61\x6E\x20\x61\x6E\x73\x77\x65\x72\x21");return ;};var UserAnswer=$("\x69\x6E\x70\x75\x74\x5B\x6E\x61\x6D\x65\x3D\x61\x6E\x73\x77\x65\x72\x5D\x3A\x63\x68\x65\x63\x6B\x65\x64")["\x76\x61\x6C"]();var post_checkAnswer={method:"\x50\x4F\x53\x54",url:API_URL+"\x2F\x67\x61\x6D\x65\x73\x2F"+gameToken+"\x2F\x61\x6E\x73\x77\x65\x72",contentType:"\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x2F\x6A\x73\x6F\x6E",dataType:"\x6A\x73\x6F\x6E",data:"\x7B\x22\x71\x75\x65\x73\x74\x69\x6F\x6E\x5F\x69\x64\x22\x3A\x20\x22"+gameQuestions["\x69\x64"]+"\x22\x2C\x20\x22\x61\x6E\x73\x77\x65\x72\x5F\x69\x64\x73\x22\x3A\x5B\x22"+UserAnswer+"\x22\x5D\x7D"};$http(post_checkAnswer)["\x74\x68\x65\x6E"](function(data){correctAnswers=data["\x64\x61\x74\x61"]["\x67\x61\x6D\x65"]["\x61\x6E\x73\x77\x65\x72\x65\x64\x5F\x63\x6F\x72\x72\x65\x63\x74\x6C\x79"];console["\x6C\x6F\x67"]("\x43\x6F\x72\x72\x65\x63\x74\x20\x41\x6E\x73\x77\x65\x72\x73\x3A\x20"+correctAnswers);});if(correctAnswers<CON["\x63\x6F\x72\x72\x65\x63\x74\x41\x6E\x73\x77\x65\x72\x73"]){this["\x6E\x65\x78\x74\x51\x75\x65\x73\x74\x69\x6F\x6E"]()}else {$("\x23\x71\x75\x69\x7A\x2D\x69\x73\x2D\x6F\x76\x65\x72")["\x74\x6F\x67\x67\x6C\x65"]()};scope["\x61\x6E\x73\x77\x65\x72\x4D\x6F\x64\x65"]=false;};scope["\x72\x65\x73\x65\x74"]();}};});app["\x66\x61\x63\x74\x6F\x72\x79"]("\x71\x75\x69\x7A\x46\x61\x63\x74\x6F\x72\x79",function($http){return {getQuestion:function(id){var get_questionsRequest={method:"\x50\x4F\x53\x54",url:API_URL+"\x2F\x67\x61\x6D\x65\x73\x2F"+gameToken+"\x2F\x6E\x65\x77\x5F\x71\x75\x65\x73\x74\x69\x6F\x6E\x2F",contentType:"\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x2F\x6A\x73\x6F\x6E",dataType:"\x6A\x73\x6F\x6E",data:"\x7B\x7D"};$http(get_questionsRequest)["\x74\x68\x65\x6E"](function(data){var quesLevel=data["\x64\x61\x74\x61"]["\x6C\x65\x76\x65\x6C"];var quesBody=data["\x64\x61\x74\x61"]["\x62\x6F\x64\x79"];var quesAnswers=data["\x64\x61\x74\x61"]["\x61\x6E\x73\x77\x65\x72\x73"];gameQuestions["\x71\x75\x65\x73\x74\x69\x6F\x6E"]=quesBody;gameQuestions["\x6F\x70\x74\x69\x6F\x6E\x73"]=quesAnswers;gameQuestions["\x61\x6E\x73\x77\x65\x72"]=0;console["\x6C\x6F\x67"]("\x3C\x3C\x20\x67\x65\x74\x51\x75\x65\x73\x74\x69\x6F\x6E\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x3E\x3E");console["\x6C\x6F\x67"]("\x51\x75\x65\x73\x74\x69\x6F\x6E\x3A\x20"+gameQuestions["\x71\x75\x65\x73\x74\x69\x6F\x6E"]);console["\x6C\x6F\x67"]("\x4F\x70\x74\x69\x6F\x6E\x73\x3A\x20"+gameQuestions["\x6F\x70\x74\x69\x6F\x6E\x73"]);},function(){console["\x6C\x6F\x67"]("\x45\x72\x72\x6F\x72\x3A\x20\x63\x61\x6E\x27\x74\x20\x67\x65\x74\x20\x71\x75\x65\x73\x74\x69\x6F\x6E\x73\x20\x66\x72\x6F\x6D\x20\x61\x70\x69")});return gameQuestions;if(id<gameQuestions["\x6C\x65\x6E\x67\x74\x68"]){return gameQuestions[id]}else {return false};}}});var getUrlParams=function getUrlParameter(sParam){var sPageURL=decodeURIComponent(window["\x6C\x6F\x63\x61\x74\x69\x6F\x6E"]["\x73\x65\x61\x72\x63\x68"]["\x73\x75\x62\x73\x74\x72\x69\x6E\x67"](1)),sURLVariables=sPageURL["\x73\x70\x6C\x69\x74"]("\x26"),sParameterName,i;for(i=0;i<sURLVariables["\x6C\x65\x6E\x67\x74\x68"];i++){sParameterName=sURLVariables[i]["\x73\x70\x6C\x69\x74"]("\x3D");if(sParameterName[0]===sParam){return sParameterName[1]===undefined?true:sParameterName[1]};};};app["\x63\x6F\x6E\x66\x69\x67"](function($translateProvider){var dic_EN={TITLE:"\x57\x65\x6C\x63\x6F\x6D\x65\x20\x74\x6F\x20\x74\x68\x65\x20\x4D\x69\x64\x62\x75\x72\x6E\x20\x71\x75\x69\x7A",DESC:"\x49\x6E\x20\x6F\x72\x64\x65\x72\x20\x74\x6F\x20\x62\x65\x20\x65\x6C\x69\x67\x69\x62\x6C\x65\x20\x66\x6F\x72\x20\x61\x20\x74\x69\x63\x6B\x65\x74\x20\x66\x6F\x72\x20\x4D\x69\x64\x62\x75\x72\x6E\x20\x32\x30\x31\x36\x2C\x20\x79\x6F\x75\x20\x6D\x75\x73\x74\x20\x66\x69\x72\x73\x74\x20\x73\x68\x6F\x77\x20\x74\x68\x61\x74\x20\x79\x6F\x75\x20\x63\x61\x72\x65\x20\x61\x62\x6F\x75\x74\x20\x6F\x75\x72\x20\x63\x75\x6C\x74\x75\x72\x65\x2C\x20\x62\x79\x20\x61\x6E\x73\x77\x65\x72\x69\x6E\x67\x20\x31\x30\x20\x71\x75\x65\x73\x74\x69\x6F\x6E\x73\x20\x63\x6F\x72\x72\x65\x63\x74\x6C\x79\x2E",INFO:"\x57\x61\x69\x74\x2C\x20\x77\x68\x61\x74\u2019\x73\x20\x4D\x69\x64\x62\x75\x72\x6E\x3F",BTN_START_GAME:"\x53\x74\x61\x72\x74\x20\x47\x61\x6D\x65"};var dic_HE={TITLE:"\u05D1\u05E8\u05D5\u05DB\u05D9\u05DD\x20\u05D4\u05D1\u05D0\u05D5\u05EA\x20\u05DC\u05E9\u05D0\u05DC\u05D5\u05DF\x20\u05DE\u05D9\u05D3\u05D1\u05E8\u05DF",DESC:"\u05E2\u05DC\x20\u05DE\u05E0\u05EA\x20\u05DC\u05D4\u05D9\u05D5\u05EA\x20\u05D6\u05DB\u05D0\u05D9\u05EA\x20\u05DC\u05DB\u05E8\u05D8\u05D9\u05E1\x20\u05DC\u05DE\u05D9\u05D3\u05D1\u05E8\u05DF\x20\x32\x30\x31\x36\x2C\x20\u05E8\u05D0\u05E9\u05D9\u05EA\x20\u05D0\u05EA\u05D4\x20\u05D7\u05D9\u05D9\u05D1\u05EA\x20\u05DC\u05D4\u05E8\u05D0\u05D5\u05EA\x20\u05E9\u05D0\u05DB\u05E4\u05EA\x20\u05DC\u05DA\x20\u05DE\u05D4\u05EA\u05E8\u05D1\u05D5\u05EA\x20\u05E9\u05DC\u05E0\u05D5\x2C\x20\u05E2\u05DC\x20\u05D9\u05D3\u05D9\x20\u05DE\u05E2\u05E0\u05D4\x20\u05E9\u05DC\x20\x31\x30\x20\u05E9\u05D0\u05DC\u05D5\u05EA\x20\u05D1\u05E6\u05D5\u05E8\u05D4\x20\u05E0\u05DB\u05D5\u05E0\u05D4\x2E",INFO:"\u05E8\u05D2\u05E2\x2C\x20\u05DE\u05D4\x20\u05D6\u05D4\x20\u05DE\u05D9\u05D3\u05D1\u05E8\u05DF\x3F",BTN_START_GAME:"\u05D4\u05EA\u05D7\u05DC\u05D4\x20\u05D1\u05DE\u05E9\u05D7\u05E7"};$translateProvider["\x74\x72\x61\x6E\x73\x6C\x61\x74\x69\x6F\x6E\x73"]("\x65\x6E",dic_EN);$translateProvider["\x74\x72\x61\x6E\x73\x6C\x61\x74\x69\x6F\x6E\x73"]("\x68\x65",dic_HE);$translateProvider["\x70\x72\x65\x66\x65\x72\x72\x65\x64\x4C\x61\x6E\x67\x75\x61\x67\x65"]("\x65\x6E");});app["\x63\x6F\x6E\x74\x72\x6F\x6C\x6C\x65\x72"]("\x4C\x61\x6E\x67\x43\x6F\x6E\x74\x72\x6F\x6C\x6C\x65\x72",function($scope,$translate){$scope["\x63\x68\x61\x6E\x67\x65\x4C\x61\x6E\x67\x75\x61\x67\x65"]=function(key){$translate["\x75\x73\x65"](key);switch(key){case "\x65\x6E":{$("\x62\x6F\x64\x79")["\x72\x65\x6D\x6F\x76\x65\x43\x6C\x61\x73\x73"]("\x6C\x61\x6E\x48\x45");$("\x62\x6F\x64\x79")["\x61\x64\x64\x43\x6C\x61\x73\x73"]("\x6C\x61\x6E\x45\x4E");break ;};case "\x68\x65":{$("\x62\x6F\x64\x79")["\x72\x65\x6D\x6F\x76\x65\x43\x6C\x61\x73\x73"]("\x6C\x61\x6E\x45\x4E");$("\x62\x6F\x64\x79")["\x61\x64\x64\x43\x6C\x61\x73\x73"]("\x6C\x61\x6E\x48\x45");break ;};};}});