PrimeFactor = {}; //namespace
var Utils = {};
Utils.Path = " ";
Utils.mobileDeviceFlag = false;
//global variable 
var resId = 0, questionId = 0, startTime = 0, totalMarks = 10, level = 4, scoredMarks = 0, label = "null", scoreFlag = "false", leftSideFlag = true, screen = 1, temp = 0, hideShowDiv = 1, blinkFlag = false, removed = 0, highLength = 2, finalAnsNo = 0, finalFlag = false, finalAnsCounter = 0, selectedNumID, divToClear, editFlag = false, valueOne = 0, oneAnsFlag = false;

$(document).ready(function () {
    $(".se-pre-con").fadeOut("slow");
    if ((navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) && !(window.location.href.includes('http')))
        Utils.mobileDeviceFlag = true;
    /* if (Utils.mobileDeviceFlag)
        Utils.Path = Android.getMediaPath("Prime Factorization"); */
    setTimeout(function () { PrimeFactor.Initilize(); }, 200);
});
PrimeFactor.Initilize = function () {
    $("#playGame").css("bottom","9vh");
    document.body.style.backgroundImage = "url('images/skin/Cover.png')";
    PrimeFactor.setImage();
    document.title = PrimeFactor.hardcodedData.title;
    $("#nextStep").addClass("pulse");
    $("#homeDiv").css('visibility', 'hidden');
    $("#widget").hide();
    $("#gamePage").hide();
    $("#endPage").hide();
    $("#screenTwo").hide();
   $("#nextImg").css("visibility", "hidden");
    $("#soundImg").css('visibility', 'hidden');
    PrimeFactor.variableInitilization();
    PrimeFactor.createAcknowledgementDivs();
}
PrimeFactor.setImage = function () { //set All images
    document.getElementById("homeImg").src = Utils.Path + "images/skin/Home.png";
    document.getElementById("logoImg").src = Utils.Path + "images/skin/logo.png";
    document.getElementById("nextStep").src = Utils.Path + "images/skin/Play.png";
    document.getElementById("soundImg").src = Utils.Path + "images/skin/Sound.png";
    document.getElementById("nextImg").src = Utils.Path + "images/skin/Next.png";
    document.getElementById("playAgain").src = Utils.Path + "images/skin/replay.png";
    document.getElementById("creditImg").src = Utils.Path + "images/skin/Credits.png";
    document.getElementById("gameOver").innerHTML = PrimeFactor.hardcodedData.gameOver;
    document.getElementById("ropeDiv").style.backgroundImage = Utils.Path+"url('images/skin/01.png')";
    $("#textDiv").text(PrimeFactor.hardcodedData.ansText);
    document.getElementById("quesSentence").style.backgroundImage = Utils.Path + "url('images/skin/title.png')";
    $("#quesSentence").text(PrimeFactor.hardcodedData.quesText);
    document.getElementById("stepDivId").style.backgroundImage = Utils.Path + "url('images/skin/06.png')";
    document.getElementById("keyPad").style.backgroundImage = Utils.Path + "url('images/skin/07.png')";
    $("#Yes").text(PrimeFactor.hardcodedData.btnText);
    
}
PrimeFactor.variableInitilization = function () { //variable initilize
    PrimeFactor.compositeNoArray = []; //composite No.
    PrimeFactor.primeNoArray = [] //prime no
    PrimeFactor.quesArray = []; //quesArray
    PrimeFactor.quesLength = 4; //total num ques
    PrimeFactor.selectedNum = 0; //number to factorization
    PrimeFactor.quesCount = 0; //ques to show;
    PrimeFactor.blinkNo = 0;
    PrimeFactor.showDiv = 0;
    PrimeFactor.blinkId;
    PrimeFactor.primeFactorOfNo = []; //prime factors of selected numbers
    PrimeFactor.finalAnsArr = [];
    PrimeFactor.nextQuestimer;
    PrimeFactor.showModal;
    PrimeFactor.rightAnsTimer;
    PrimeFactor.checkAnsTimer;
    PrimeFactor.imageId ;
    PrimeFactor.clickedNumber; 
    PrimeFactor.parentDiv ;
  /*   primeFactor.count = 0; */
}
PrimeFactor.startGame = function () {
    document.body.style.backgroundImage = "url('images/skin/BG.jpg')";
    $("#homeDiv").css('visibility', 'visible');
    $("#widget").show();
    $("#gamePage").show();
    $("#playGame").hide();
    $("screenTwo").hide();
    $(".finalWidget").css("visibility", "hidden");
    numberKey();
    PrimeFactor.createStep(); //calculation step
    PrimeFactor.calculateTheValue(); //calculate ques
    PrimeFactor.createDiv(); //set the ques
}

PrimeFactor.playInstruction = function () { //instruction
    document.getElementById("playSound").src = Utils.Path + "sounds/selectNoInstruction_GJ.mp3";
    document.getElementById("playSound").play();
}

PrimeFactor.createStep = function () { //create step for calculation
    for (var i = 0; i < 8; i++) {
        var parentDiv = document.createElement("div");
        parentDiv.setAttribute("id", "parentId" + i);
        parentDiv.setAttribute("class", "noPadding stepHeight styleClass col-sm-8 col-xs-8 col-md-8 col-lg-8 col-sm-offset-2 col-xs-offset-2 col-lg-offset-2 col-md-offset-2");
        document.getElementById("parentStepId").appendChild(parentDiv);
        if (i != 7)
            $(parentDiv).addClass("borderBottom");
        for (j = 0; j < 2; j++) {
            var div = document.createElement("div");
            div.setAttribute("id", "stepno" + i + j);
            if (j == 0) {
                div.setAttribute("class", "noPadding resetAllClass stepHeight styleClass borderRight nullClass col-sm-3 col-lg-3 col-md-3 col-xs-3 ");
                div.setAttribute("onclick", "PrimeFactor.toEdit(this.id)");
            }
            else {
                if (i != 0) {
                    div.setAttribute("onclick", "PrimeFactor.toEdit(this.id)");
                    div.setAttribute("class", "noPadding stepHeight styleClass nullClass resetAllClass col-sm-5 col-lg-5 col-md-5 col-xs-5");
                }
                else
                    div.setAttribute("class", "noPadding stepHeight styleClass nullClass col-sm-5 col-lg-5 col-md-5 col-xs-5");
            }
            parentDiv.appendChild(div);

        }


    }
}

PrimeFactor.calculateTheValue = function () { //calculation of value(primeNumber)
    var min = 11, max = 50, i = 0, j = 0;
    for (i = min; i <= max; i++) {
        isPrime = 0;
        for (j = 2; j <= i / 2; j++) {
            if (i % j == 0) {
                isPrime = 1;
                break;
            }
        }
        if (isPrime == 1)
            PrimeFactor.compositeNoArray.push(i);
        else
            PrimeFactor.primeNoArray.push(i);
    }
}
PrimeFactor.createDiv =  function(){
    var  blockDiv , count = 0 , imgDiv;
    populate(PrimeFactor.compositeNoArray, PrimeFactor.quesArray, PrimeFactor.quesLength); //finding ques from array
    for(var j=0;j<4;j++){
        rowDiv = document.createElement("div");
        rowDiv.setAttribute("id","rowDiv"+j);
        rowDiv.setAttribute("data",j);
        rowDiv.setAttribute("class","noPadding bgClass heightClass col-sm-3 col-xs-3 col-md-3 col-lg-3");
        rowDiv.style.backgroundImage = Utils.Path + 'url('+"images/skin/"+ PrimeFactor.bgImgArray[j]+')';
        document.getElementById("gridDivId").appendChild(rowDiv);

           blockDiv = document.createElement("div");
            blockDiv.setAttribute("id", "blockDivId" + j );
            blockDiv.setAttribute("Class", "noPadding blockClass opacityClass col-sm-12 col-xs-12 col-lg-12 col-md-12");
            blockDiv.setAttribute("onclick", "PrimeFactor.selectNumber(this.id)");
            $(blockDiv).text(PrimeFactor.compositeNoArray[PrimeFactor.quesArray[j]]);
            document.getElementById("rowDiv"+j).appendChild(blockDiv);
        }
}
PrimeFactor.selectNumber = function (clicked_Num) { //select ques
    d = new Date();  //date object
    startTime = d.getDate() + "-" + (d.getMonth() + 1) + "-" + d.getFullYear() + " " + d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds();  //to get the current date
	 selectedNumID = clicked_Num;
    $(".opacityClass").css({ "opacity": "1", "pointer-events": "auto","color":"#393492"});
    $("#" + clicked_Num).css({"opacity":"0.5","color":"black","pointer-events":"none"});
   
     PrimeFactor.parentDiv =  $("#" + clicked_Num).parent().attr("id");
 // console.log(PrimeFactor.primeFactorOfNo);
    label = PrimeFactor.selectedNum = $("#" + clicked_Num).text();
  //  console.log(PrimeFactor.selectedNum);
    PrimeFactor.primeFactorOfNo = primeFactor(PrimeFactor.selectedNum, PrimeFactor.primeFactorOfNo);
    temp = PrimeFactor.selectedNum;
    $("#numDiv").text(PrimeFactor.selectedNum);
    $("#nextImg").css("pointer-events", "auto");
   
    PrimeFactor.nextQues();
}

displayNumber = function (clicked_Button) { //keypad button clicked
    clearTimeout(PrimeFactor.colorgreenTimer, PrimeFactor.colorredTimer)
    clearTimeout( PrimeFactor.checkAnsTimer);
    document.getElementById("playSound").pause();
    clearTimeout(PrimeFactor.nextQuestimer);
    scoreFlag = true;
    var text = document.getElementById(clicked_Button).getAttribute("data");
  //  console.log(text);
    if (finalFlag) { //checkfinal ANS
        clearTimeout(PrimeFactor.rightAnsTimer);
        PrimeFactor.blinkId = $(".blink_me").attr("id");
        if($("#" + PrimeFactor.blinkId).text().length < 2)
           $("#" + PrimeFactor.blinkId).append(text);
        PrimeFactor.checkFinalAns();
    }
    else { // check step ans 
        clearTimeout(PrimeFactor.colorgreenTimer, PrimeFactor.colorredTimer)
        clearTimeout( PrimeFactor.checkAnsTimer);
        PrimeFactor.blinkId = PrimeFactor.blinkDivList[PrimeFactor.blinkNo];
       // console.log(PrimeFactor.blinkId);
        $("#" + PrimeFactor.blinkId).append(text);
        if (leftSideFlag) {
            clearTimeout(PrimeFactor.colorgreenTimer, PrimeFactor.colorredTimer)
            var blinkText = $("#" + PrimeFactor.blinkId).text();
            if (PrimeFactor.primeNoArray.indexOf(PrimeFactor.selectedNum) == -1) {
                PrimeFactor.checkAnsTimer = setTimeout(function () {
                    if (PrimeFactor.primeFactorOfNo.indexOf(parseInt(blinkText)) != -1) {
                        PrimeFactor.checkFactorAns();
                    }

                    else if (temp % $("#" + PrimeFactor.blinkId).text() == 0) {
                        if (oneAnsFlag) {
                            oneAnsFlag = false;
                            PrimeFactor.rightAns();
                        }
                        else {
                            clearTimeout(PrimeFactor.showModal);
                            document.getElementById("playSound").pause();
                            $("#questionMsg").text(PrimeFactor.hardcodedData.modalText1);
                               $("#responseBoxDiv").show();
                           
                        }
                    }

                    else {
                        clearTimeout(PrimeFactor.showModal);
                        document.getElementById("playSound").pause();
                        $("#questionMsg").text(PrimeFactor.hardcodedData.modalText2);
                            $("#responseBoxDiv").show();
                            PrimeFactor.wrongAns();
                       }
                }, 1200);

                if ($("#" + PrimeFactor.blinkId).text().length == 2)
                  $("#keyPad").css("pointer-events", "none");
            }
        }
        else {  //check right sideAns 
            clearTimeout(PrimeFactor.showModal);
            clearTimeout(PrimeFactor.colorgreenTimer, PrimeFactor.colorredTimer)
            PrimeFactor.checkRightsideAns();
        }
    }
}

PrimeFactor.checkFactorAns = function () { //check left side ans
    clearTimeout(PrimeFactor.checkAnsTimer); 
    clearTimeout(PrimeFactor.nextQuestimer);
    clearTimeout(PrimeFactor.colorgreenTimer, PrimeFactor.colorredTimer)
   
    temp = temp / $("#" + PrimeFactor.blinkId).text();
    var indexNo = PrimeFactor.primeFactorOfNo.indexOf(parseInt($("#" + PrimeFactor.blinkId).text()));
    removed = PrimeFactor.primeFactorOfNo.splice(indexNo, 1);
    PrimeFactor.finalAnsArr.push($("#" + PrimeFactor.blinkId).text());
  //  console.log(PrimeFactor.primeFactorOfNo.indexOf(parseInt($("#" + PrimeFactor.blinkId).text())));
    leftSideFlag = false;
    if (temp >= 1) {
        $("#parentId" + hideShowDiv).show();
        hideShowDiv++;
    }
    PrimeFactor.rightAns();
}

PrimeFactor.checkRightsideAns = function () { //check right side Ans
    var Ans = temp;
    Ans = Ans.toString();
    var valLeng = Ans.length;
   // console.log(Ans);
    if (($("#" + PrimeFactor.blinkId).text()).length == valLeng) {
        if (Ans == $("#" + PrimeFactor.blinkId).text()) {
            leftSideFlag = true;
            PrimeFactor.rightAns();
        }
        else {
            PrimeFactor.wrongAns();
        }
    }
}

PrimeFactor.checkFinalAns = function () { //check final Ans
    clearTimeout(PrimeFactor.rightAnsTimer);
    PrimeFactor.rightAnsTimer = setTimeout(function () {
        var finalAnsText = $("#" + PrimeFactor.blinkId).text();
        if (PrimeFactor.finalAnsArr.indexOf(finalAnsText) != -1) {
            var indexNo = PrimeFactor.finalAnsArr.indexOf(finalAnsText);
            removed = PrimeFactor.finalAnsArr.splice(indexNo, 1);
            $("#keyPad").css("pointer-events", "none");
            PrimeFactor.rightAns();
        }
        else {
            PrimeFactor.wrongAns();
        }
    }, 1100);
    /* if ($("#" + PrimeFactor.blinkId).text().length == 2)
        $("#keyPad").css("pointer-events", "none"); */
}

PrimeFactor.rightAns = function () { //right ans
    clearTimeout(PrimeFactor.nextQuestimer);
   // clearTimeout(PrimeFactor.colorgreenTimer);
    $("#" + PrimeFactor.blinkId).css('color', 'green');
    PrimeFactor.colorgreenTimer = setTimeout(function () {
        $("#" + PrimeFactor.blinkId).css('color', '#393492');
        $("#keyPad").css('pointer-events', "auto");
    }, 250);
    $("#" + PrimeFactor.blinkId).removeClass("blink_me");
    if (finalFlag) {
        if (finalAnsNo == finalAnsCounter - 1) {
            document.getElementById("playSound").pause();
            $("#keyPad").css('pointer-events', "none");
           // scoredMarks = 10;
            document.getElementById("playSound").src = Utils.Path + 'sounds/Cheering.mp3';
            document.getElementById("playSound").play();
            PrimeFactor.nextQuestimer = setTimeout(function () {
                $("#"+selectedNumID).hide();
            var count = document.getElementById(PrimeFactor.parentDiv).getAttribute("data");
               document.getElementById( PrimeFactor.parentDiv).style.backgroundImage = Utils.Path + 'url('+"images/skin/"+ PrimeFactor.replaceImgArray[count]+')';
                PrimeFactor.nextQues();
            }, 2300);
        }
        else {
            finalAnsNo += 2;
            $("#finalId" + finalAnsNo).addClass('blink_me');
        }
    }
    else {
        if ($("#" + PrimeFactor.blinkId).text() != 1) {
            PrimeFactor.blinkNo++;
            $("#" + PrimeFactor.blinkDivList[PrimeFactor.blinkNo]).addClass("blink_me");
        }
        else {
            if (valueOne < 2) {
                oneAnsFlag = true;
                valueOne++;
                PrimeFactor.blinkNo++;
                $("#" + PrimeFactor.blinkDivList[PrimeFactor.blinkNo]).addClass("blink_me");
                if (valueOne == 1) {
                    $("#parentId" + hideShowDiv).show();
                    hideShowDiv++;
                }
            }
            else {
                $("#keyPad").css('pointer-events', "none");
                PrimeFactor.finalAnsArr.push("1");
                PrimeFactor.createFinalAnsStep();
            }
        }
    }
}
PrimeFactor.wrongAns = function () { //wrong ans
    clearTimeout(PrimeFactor.colorredTimer);
    $("#keyPad").css('pointer-events', "none");
    $("#" + PrimeFactor.blinkId).css('color', 'red');
    PrimeFactor.colorredTimer = setTimeout(function () {
        $("#" + PrimeFactor.blinkId).css('color', '#393492');
        $("#" + PrimeFactor.blinkId).text("");
        $("#keyPad").css('pointer-events', "auto");
    }, 200);
}
PrimeFactor.createFinalAnsStep = function () { // final ans step
    var arrlength = PrimeFactor.finalAnsArr.length, x = 0;
    finalFlag = true;
    for (var i = 0; i < (arrlength + (arrlength - 1)); i++) {
        var finalDiv = document.createElement("div");
        finalDiv.setAttribute("id", "finalId" + i);
        document.getElementById("finalAnsDiv").appendChild(finalDiv);
        if (i % 2 == 0) {
            $(finalDiv).css("border", "2px solid black");
            finalDiv.setAttribute("class", "noPadding finalTextStyleClass finalAnstext col-sm-1 col-xs-1 col-md-1 col-lg-1");
            $(finalDiv).data("data", PrimeFactor.finalAnsArr[x]);
            x++;
        }
        else {
            finalDiv.setAttribute("class", "noPadding finalTextStyleClass col-sm-1 col-xs-1 col-md-1 col-lg-1");
            $(finalDiv).text("X");
        }
        finalAnsCounter++;
    }
    $("#keyPad").css('pointer-events', "auto");
    $(".finalWidget").css("visibility", "Visible");
    $("#finalId" + finalAnsNo).addClass("blink_me");
}

PrimeFactor.nextQues = function () { //next question
    clearTimeout(PrimeFactor.nextQuestimer);
    clearTimeout(PrimeFactor.colorgreenTimer, PrimeFactor.colorredTimer)
    clearTimeout(PrimeFactor.checkAnsTimer);
    valueOne = 0;
    oneAnsFlag = false;
    $("#" + selectedNumID).removeClass("opacityClass");
    clearTimeout(PrimeFactor.nextQuestimer);
    document.getElementById("playSound").pause();
    $(".keyPad").css("pointer-events", "auto");
    if (PrimeFactor.quesCount < 4) { //when screen in one call this
        if (screen == 1) {
            $("#nextImg").css("visibility", "visible");
            PrimeFactor.blinkNo = 0;
            hideShowDiv = 1;
            scoreFlag = false;
            leftSideFlag = true;
            document.getElementById("playSound").pause();
            PrimeFactor.playInstruction();
            $(".nullClass").text("");
            screen = 2;
            PrimeFactor.quesCount++;
            $("#nextImg").removeClass("bounce");
            $("#screenOne").hide();
            $("#widget").show();
            //document.getElementById("nextImg").src = Utils.Path + "images/skin/Next.png";
            document.getElementById("ropeDiv1").style.backgroundImage = Utils.Path+"url('images/skin/01.png')";
            $("#screenTwo").show();
            $("#soundImg").css('visibility', 'visible');
            $("#stepno01").text(PrimeFactor.selectedNum);
            $("#parentId1,#parentId2,#parentId3,#parentId4,#parentId5,#parentId6,#parentId7").hide();
            $("#" + PrimeFactor.blinkDivList[PrimeFactor.blinkNo]).addClass("blink_me");
        }
        else {    //when screen in two call this
            if (!scoreFlag)
                scoredMarks = -1;
            else
               {
                   if(finalFlag)
                    scoredMarks = 10;
                   else
                     scoredMarks = 0;
               }
            PrimeFactor.scoreFunction();
            PrimeFactor.primeFactorOfNo = [];
            PrimeFactor.finalAnsArr = [];
            finalAnsNo = 0;
            finalAnsCounter = 0;
            finalFlag = false;
            document.getElementById("finalAnsDiv").innerHTML = "";
            $(".finalWidget").css("visibility", "hidden");
          //  $("#nextImg").css("pointer-events", "none");
            $("#soundImg").css('visibility', 'hidden');
            $("#nextImg").css("visibility", "hidden");
            screen = 1;
            $("#screenTwo").hide();
           // document.getElementById("nextImg").src = Utils.Path + "images/skin/continue.png";

            $("#screenOne").show();
        }
    }
    else {  //after 4 ques
        if (!scoreFlag)
        scoredMarks = -1;
       else
          {
             if(finalFlag)
               scoredMarks = 10;
             else
                scoredMarks = 0;
        }
        PrimeFactor.scoreFunction();
        $("#screenTwo").hide();
        PrimeFactor.gameOver();
    }
}

clearText = function () { //clear wrong text
    divToClear = $(".blink_me").attr("id");
    $("#" + divToClear).text("");
}

PrimeFactor.gameOver = function () { // game over
    document.getElementById("playSound").pause();
    clearTimeout(PrimeFactor.nextQuestimer);
    $("#gamePage").hide();
    $("#endPage").show();
    $("#acknowledgementDiv").hide();
}

PrimeFactor.replayGame = function () { //playAgain
    document.getElementById("playSound").pause();
    clearTimeout(PrimeFactor.nextQuestimer);
    PrimeFactor.resetVariable();
    document.getElementById("gridDivId").innerHTML = "";
    document.getElementById("finalAnsDiv").innerHTML = "";
    $(".finalWidget").css("visibility", "hidden");
    $("#endPage").hide();
    $("#widget").hide();
    $("#screenOne").show();
    $("#screenTwo").hide();
    PrimeFactor.createDiv();
    $("#gamePage").show();
}

PrimeFactor.resetVariable = function () { //reset all variable
    PrimeFactor.quesArray = []; //quesArray
    PrimeFactor.selectedNum = 0; //number to factorization
    PrimeFactor.quesCount = 0; //ques to show;
    PrimeFactor.blinkNo = 0;
    PrimeFactor.showDiv = 0;
    PrimeFactor.blinkId;
    PrimeFactor.primeFactorOfNo = []; //prime factors of selected numbers
    PrimeFactor.finalAnsArr = [];
    leftSideFlag = true;
    finalAnsCounter = 0;
    valueOne = 0;
    oneAnsFlag = false;
    screen = 1, temp = 0, hideShowDiv = 1, blinkFlag = false, removed = 0, finalAnsNo = 0, finalFlag = false;
}

PrimeFactor.goHome = function () {
    clearTimeout(PrimeFactor.nextQuestimer);
    clearTimeout(PrimeFactor.colorgreenTimer, PrimeFactor.colorredTimer)
    clearTimeout(PrimeFactor.checkAnsTimer);
    document.getElementById("playSound").pause();
    if(finalFlag)
      scoredMarks = 10;
    else
      scoredMarks = 0;
    PrimeFactor.scoreFunction();
    location.reload();
}

PrimeFactor.disablemodal = function () { //hide modal on click  ok
    $("#responseBoxDiv").hide();
    $("#" + PrimeFactor.blinkId).text("");
}

resetAll = function () { //click on resetbutton
     clearTimeout(PrimeFactor.checkAnsTimer); 
    $(".resetAllClass").text("");
    PrimeFactor.primeFactorOfNo = [];
  //  console.log(PrimeFactor.primeFactorOfNo);
    PrimeFactor.primeFactorOfNo = primeFactor(PrimeFactor.selectedNum, PrimeFactor.primeFactorOfNo);
   // console.log(PrimeFactor.primeFactorOfNo);
    $("#parentId1,#parentId2,#parentId3,#parentId4,#parentId5,#parentId6").hide();
    $(".finalAnstext").text("");
    $(".finalWidget").css("visibility", "hidden");
    finalFlag = false;
    temp = PrimeFactor.selectedNum;
    PrimeFactor.blinkNo = 0;
    hideShowDiv = 1;
    finalAnsNo = 0;
    finalAnsCounter = 0;
    valueOne = 0;
    oneAnsFlag = false;
    PrimeFactor.finalAnsArr = [];
    leftSideFlag = true;
    document.getElementById("finalAnsDiv").innerHTML = "";
    $("#" + PrimeFactor.blinkDivList[PrimeFactor.blinkNo]).addClass("blink_me");

}

PrimeFactor.createAcknowledgementDivs = function () { //create Aknowlegment div
    var i = 0, div;
    for (i = 0; i < Object.keys(PrimeFactor.AcknowledgementPageData).length; i++) {
        div = document.createElement('div');
        div.className = "fontClass firstLetter col-xs-12 col-sm-12 col-md-12 col-lg-12";
        div.innerHTML = Object.keys(PrimeFactor.AcknowledgementPageData)[i] + " : " + Object.values(PrimeFactor.AcknowledgementPageData)[i];
        acknowledgementDiv.appendChild(div);
    }
    div = document.createElement('div');
    div.className = "fontClass firstLetter col-xs-12 col-sm-12 col-md-12 col-lg-12";
    div.style.marginBottom = "2vh";
    acknowledgementDiv.appendChild(div);
}

PrimeFactor.showAcknowledgement = function () { //show Aknowlegment
    $("#acknowledgementDiv").show();
}

PrimeFactor.scoreFunction = function () { //score function
    console.log(resId, questionId, scoredMarks, totalMarks, level, startTime, label);
    if (Utils.mobileDeviceFlag) {
        Android.addScore(resId, questionId, scoredMarks, totalMarks, level, startTime);
    }
}