-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
1 lines (1 loc) · 4.76 KB
/
script.js
1
const _0x593295=_0x4fff;(function(_0x5297ed,_0x524339){const _0x7d4672=_0x4fff,_0x5406b4=_0x5297ed();while(!![]){try{const _0x449410=parseInt(_0x7d4672(0x10c))/0x1+parseInt(_0x7d4672(0xfc))/0x2*(parseInt(_0x7d4672(0xff))/0x3)+-parseInt(_0x7d4672(0xeb))/0x4+-parseInt(_0x7d4672(0xf7))/0x5+parseInt(_0x7d4672(0xea))/0x6+parseInt(_0x7d4672(0xf4))/0x7+-parseInt(_0x7d4672(0xef))/0x8;if(_0x449410===_0x524339)break;else _0x5406b4['push'](_0x5406b4['shift']());}catch(_0x2ab089){_0x5406b4['push'](_0x5406b4['shift']());}}}(_0x2013,0xa60cd));const questions=[{'question':_0x593295(0xe0),'answers':[{'text':'Shark','correct':![]},{'text':_0x593295(0xf3),'correct':!![]},{'text':'Elephant','correct':![]},{'text':_0x593295(0x109),'correct':![]}]},{'question':_0x593295(0xdd),'answers':[{'text':_0x593295(0xfb),'correct':!![]},{'text':_0x593295(0xf5),'correct':![]},{'text':_0x593295(0xf0),'correct':![]},{'text':_0x593295(0xf2),'correct':![]}]},{'question':'Which\x20is\x20the\x20largest\x20desert\x20in\x20the\x20world?','answers':[{'text':_0x593295(0xde),'correct':![]},{'text':_0x593295(0x107),'correct':![]},{'text':_0x593295(0xe4),'correct':![]},{'text':_0x593295(0x101),'correct':!![]}]},{'question':_0x593295(0xdf),'answers':[{'text':'Asia','correct':![]},{'text':_0x593295(0xfa),'correct':!![]},{'text':_0x593295(0xe7),'correct':![]},{'text':'Africa','correct':![]}]}],questionElement=document['getElementById'](_0x593295(0xf6)),answerButtons=document[_0x593295(0x106)](_0x593295(0xec)),nextButton=document[_0x593295(0x106)]('next-btn');let currentQuestionIndex=0x0,score=0x0;function startQuiz(){const _0x559850=_0x593295;currentQuestionIndex=0x0,score=0x0,nextButton[_0x559850(0xe3)]='Next',showQuestion();}function showQuestion(){const _0x432a46=_0x593295;resetState();let _0x1a7c06=questions[currentQuestionIndex],_0x11f976=currentQuestionIndex+0x1;questionElement[_0x432a46(0xe3)]=_0x11f976+'.\x20'+_0x1a7c06[_0x432a46(0xf6)],_0x1a7c06[_0x432a46(0xfd)][_0x432a46(0x104)](_0x1b6e38=>{const _0x2a8931=_0x432a46,_0x59ac0c=document[_0x2a8931(0x105)](_0x2a8931(0xe5));_0x59ac0c[_0x2a8931(0xe3)]=_0x1b6e38[_0x2a8931(0x10a)],_0x59ac0c[_0x2a8931(0x102)][_0x2a8931(0x10f)](_0x2a8931(0xed)),answerButtons[_0x2a8931(0x10e)](_0x59ac0c),_0x1b6e38[_0x2a8931(0x10d)]&&(_0x59ac0c[_0x2a8931(0xe2)]['correct']=_0x1b6e38[_0x2a8931(0x10d)]),_0x59ac0c[_0x2a8931(0xfe)](_0x2a8931(0xf1),selectAnswer);});}function _0x4fff(_0x412f08,_0x57e837){const _0x20132c=_0x2013();return _0x4fff=function(_0x4fffe3,_0x34f715){_0x4fffe3=_0x4fffe3-0xdc;let _0x616424=_0x20132c[_0x4fffe3];return _0x616424;},_0x4fff(_0x412f08,_0x57e837);}function resetState(){const _0x44578d=_0x593295;nextButton['style']['display']='none';while(answerButtons['firstChild']){answerButtons['removeChild'](answerButtons[_0x44578d(0xee)]);}}function selectAnswer(_0x34a781){const _0xe3e610=_0x593295,_0x10ae20=_0x34a781[_0xe3e610(0xdc)],_0x23f934=_0x10ae20[_0xe3e610(0xe2)][_0xe3e610(0x10d)]===_0xe3e610(0xf8);_0x23f934?(_0x10ae20[_0xe3e610(0x102)][_0xe3e610(0x10f)](_0xe3e610(0x10d)),score++):_0x10ae20[_0xe3e610(0x102)]['add'](_0xe3e610(0xe9)),Array[_0xe3e610(0x100)](answerButtons['children'])[_0xe3e610(0x104)](_0x113f5e=>{const _0x48e795=_0xe3e610;_0x113f5e['dataset'][_0x48e795(0x10d)]===_0x48e795(0xf8)&&_0x113f5e[_0x48e795(0x102)][_0x48e795(0x10f)](_0x48e795(0x10d)),_0x113f5e['disabled']=!![];}),nextButton[_0xe3e610(0x10b)][_0xe3e610(0x103)]=_0xe3e610(0xe6);}function showScore(){const _0x374378=_0x593295;resetState(),questionElement[_0x374378(0xe3)]=_0x374378(0xe8)+score+_0x374378(0xf9)+questions['length']+'!',nextButton[_0x374378(0xe3)]=_0x374378(0x108),nextButton[_0x374378(0x10b)][_0x374378(0x103)]='block';}function handleNextButton(){const _0x153129=_0x593295;currentQuestionIndex++,currentQuestionIndex<questions[_0x153129(0xe1)]?showQuestion():showScore();}nextButton[_0x593295(0xfe)](_0x593295(0xf1),()=>{const _0xed10c1=_0x593295;currentQuestionIndex<questions[_0xed10c1(0xe1)]?handleNextButton():startQuiz();}),startQuiz();function _0x2013(){const _0x53fa55=['Which\x20is\x20the\x20largest\x20animal\x20in\x20the\x20world?','length','dataset','innerHTML','Sahara','button','block','Arctic','You\x20scored\x20','incorrect','5103318JECLJV','95000UeppYk','answer-buttons','btn','firstChild','15515912bfgMvN','Nepal','click','Shri\x20Lanka','Blue\x20whale','3988985DhZjgj','Bhutan','question','1005625IGBULc','true','\x20out\x20of\x20','Australia','Vatican\x20City','2WvxRyX','answers','addEventListener','323991rNyOIL','from','Antartica','classList','display','forEach','createElement','getElementById','Gobi','Play\x20Again','Giraffe','text','style','1316100rCDWnA','correct','appendChild','add','target','Which\x20is\x20the\x20smallest\x20country\x20in\x20the\x20world?','Kalahari','Which\x20is\x20the\x20smallest\x20continent\x20in\x20the\x20world?'];_0x2013=function(){return _0x53fa55;};return _0x2013();}