var problem,content_help,content_main,character,grp_option,graph,prob_type;var answer=0,selected_answer='',number1=0,number2=0;var count=0,left=0,right=0;var correct='',group,number;var integer=-1,decimal=-1;var $page_problem=$('.page-problem'),$page_help=$('.page-help'),$counters=$('.counter'),$modalSuccess=$('#modalSuccess'),$modalAlert=$('#modalAlert');function getProblem(){questionLoading();if(countPractice==0)startClock();count=0;answer=0;other=0;selected_answer=0;$.ajax({cache:false,url:'/online-practice/year4/decimals/get-problem?_dt='+(new Date()).getTime(),type:'post',data:{skill_id:1031,score:totalScore},success:function(result,status){if(status=='success'){var data=JSON.parse(result);answer=data.answer;prob_type=data.type;showProblem(data);;prependVoiceIcon();M.parseMath(document.body);}else{alert('not get problem');}},error:function(jqXHR,status,error){alert(error);}})}function showProblem(data){countPracticeTime();questionLoaded();$page_help.hide();$page_problem.show();selected_answer='';$('.question').html(data.question);$('.equation').html(data.line);$('.remember').html(data.remember);$('.solve').html(data.solve);$('.correct').html(data.correct);$('.prob .point').hover(function(){$(this).addClass('hover');},function(){$(this).removeClass('hover');}).click(function(){$('.prob .point').removeClass('active');$(this).addClass('active');selected_answer=$(this).attr('value');})}function submit_answer(){resumeClock();showPracticeCount();if(selected_answer==''){$modalAlert.modal('show');return;}$('.wrong .point[value="'+selected_answer+'"]').addClass('active');if(selected_answer==answer){initBorderAnimation(1);showModalSuccess();showScore(true);}else{showScore(false);$page_problem.fadeOut(timePageProblem);$page_help.fadeIn(timePagehelp);}}function getNewProblem(){getProblem();}function showModalSuccess(){$modalSuccess.modal('show');modalHook();$('#success-msg').html(messages[Math.floor(Math.random()*messages.length)]);paused=true;setTimeout(function(){getNewProblem();},timeModalWait);}