1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7797],{23152:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/quiz/[quiz_token]",function(){return r(28072)}])},79103:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var s=r(74848),a=r(96540),n=r(46942),l=r.n(n),i=r(86715),o=r(91106),d=r.n(o),c=r(55811);let u=()=>{let[e,t]=(0,a.useState)(!1),[r,n]=(0,a.useState)(!1),[o,u]=(0,a.useState)(),[x,m]=(0,a.useState)(),h=(0,i.useRouter)();return(0,a.useEffect)(()=>{t(!1);let e=JSON.parse(localStorage.getItem("myuser"))||JSON.parse(sessionStorage.getItem("myuser"));e||console.log("no user"),e&&e.token&&(n(!0),u(e.name),m(e.image_url))},[h.query]),(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("prenav",{className:"sticky max-w-screen overflow-hidden top-0 z-20",children:(0,s.jsx)("nav",{className:"relative bg-gray-100 shadow dark:border-gray-800 border-b-2 dark:bg-[#080c11]",children:(0,s.jsx)("div",{className:"container px-6 py-4 mx-auto",children:(0,s.jsxs)("div",{className:"lg:flex lg:items-center lg:justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)(d(),{legacyBehavior:!0,href:"/",children:(0,s.jsxs)("a",{className:"hidden dark:flex text-lg font-semibold font-futura3 leading-none flex gap-2 my-auto items-center dark:text-gray-200",children:[(0,s.jsx)("img",{className:"w-auto rounded-full h-10 sm:h-10",src:"/6.png",alt:""}),"EnglishExpress"]})}),(0,s.jsx)(d(),{legacyBehavior:!0,href:"/",children:(0,s.jsxs)("a",{className:"dark:hidden flex text-lg font-semibold font-futura3 leading-none flex gap-2 my-auto items-center dark:text-gray-200",children:[(0,s.jsx)("img",{className:"w-auto rounded-full h-10 sm:h-10",src:"/5.png",alt:""}),"EnglishExpress"]})}),(0,s.jsxs)("div",{className:"flex lg:hidden",children:[(0,s.jsx)("div",{className:"mx-2",children:(0,s.jsx)(c.A,{})}),(0,s.jsx)("button",{onClick:()=>{t(!e)},type:"button",className:"text-gray-500 dark:text-gray-200 hover:text-gray-600 dark:hover:text-gray-400 focus:outline-none focus:text-gray-600 dark:focus:text-gray-400","aria-label":"toggle menu",children:(0,s.jsx)("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:e?(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}):(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 8h16M4 16h16"})})})]})]}),(0,s.jsxs)("div",{className:l()("absolute inset-x-0 z-20 w-full px-6 py-4 mt-4 transition-all duration-300 ease-in-out bg-gray-100 dark:bg-[#080c11] lg:mt-0 lg:p-0 lg:top-0 lg:relative lg:bg-transparent lg:w-auto lg:opacity-100 lg:translate-x-0 lg:flex lg:items-center",{"opacity-0 -translate-x-full":!e,"translate-x-0 opacity-100":e}),children:[(0,s.jsxs)("div",{class:"flex flex-col -mx-6 lg:flex-row lg:items-center lg:mx-8",children:[(0,s.jsx)(d(),{legacyBehavior:!0,href:"/",children:(0,s.jsx)("a",{class:"px-3 py-2 mx-3 mt-2 text-gray-700 transition-colors duration-300 transform rounded-md lg:mt-0 font-futura3 dark:text-gray-200 hover:bg-gray-300 dark:hover:bg-gray-700",children:"Home"})}),(0,s.jsx)(d(),{legacyBehavior:!0,href:"/practice",children:(0,s.jsx)("a",{class:"px-3 py-2 mx-3 mt-2 text-gray-700 transition-colors duration-300 transform rounded-md lg:mt-0 font-futura3 dark:text-gray-200 hover:bg-gray-300 dark:hover:bg-gray-700",children:"Practice"})})]}),(0,s.jsx)("div",{className:"hidden md:flex",children:(0,s.jsx)(c.A,{})}),(0,s.jsxs)("div",{class:"flex items-center mt-4 lg:mt-0",children:[r&&(0,s.jsx)(d(),{legacyBehavior:!0,href:"/myaccount",children:(0,s.jsxs)("button",{class:"flex items-center focus:outline-none","aria-label":"toggle profile dropdown",children:[(0,s.jsx)("div",{class:"w-8 h-8 overflow-hidden border-1 bg-blue-600 rounded-full",children:(0,s.jsx)("button",{className:"text-white my-auto py-auto mt-1",children:o.charAt(0)})}),(0,s.jsx)("h3",{class:"mx-2 text-gray-700 dark:text-gray-200 lg:hidden",children:o})]})}),!r&&(0,s.jsx)(d(),{legacyBehavior:!0,href:"/login",children:(0,s.jsxs)("a",{class:"rounded-full relative inline-flex group items-center justify-center px-6 py-2 m-1 cursor-pointer border-b-4 border-l-2 active:border-blue-600 active:shadow-none shadow-lg bg-gradient-to-tr from-blue-600 to-blue-500 border-blue-700 text-white",children:[(0,s.jsx)("span",{class:"absolute w-0 h-0 transition-all duration-300 ease-out bg-white rounded-full group-hover:w-20 group-hover:h-10 opacity-10"}),(0,s.jsx)("span",{class:"relative font-futura2",children:"Login"})]})}),!r&&(0,s.jsx)(d(),{legacyBehavior:!0,href:"/signup",children:(0,s.jsxs)("a",{class:"rounded-full relative inline-flex group items-center justify-center px-6 py-2 m-1 cursor-pointer border-b-4 border-l-2 active:border-blue-600 active:shadow-none shadow-lg bg-gradient-to-tr from-blue-600 to-blue-500 border-blue-700 text-white",children:[(0,s.jsx)("span",{class:"absolute w-0 h-0 transition-all duration-300 ease-out bg-white rounded-full group-hover:w-24 group-hover:h-10 opacity-10"}),(0,s.jsx)("span",{class:"relative font-futura2",children:"Signup"})]})})]})]})]})})})})})}},28072:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c});
1var s=r(74848),a=r(86715),n=r(96540),l=r(79103),i=r(43967),o=r(23093);r(74338);var d=r(10813);let c=()=>{let e=(0,a.useRouter)(),{quiz_token:t}=e.query,[r,c]=(0,n.useState)(null),[u,x]=(0,n.useState)(),[m,h]=(0,n.useState)(null),[g,f]=(0,n.useState)(null),[p,b]=(0,n.useState)(1),[y,j]=(0,n.useState)(!1),[v,k]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let r=JSON.parse(localStorage.getItem("myuser"))||JSON.parse(sessionStorage.getItem("myuser"));r||e.push("/"),r&&r.token&&(c(r),t&&w(r.token,t))},[t]);let w=async(e,t)=>{j(!0);let r=await fetch("".concat("https://backend.englishexpress.ai","/get_my_quiz/"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e,quiz_token:t})}),s=await r.json();s.success?s.hasquiz?f(s.quiz):h(s.mcq_data):x(s.error),j(!1)},N=(e,t)=>{h({...m,questions:m.questions.map((r,s)=>s===e?{...r,userAnswer:t}:r)})},S=async()=>{if(k(!0),m.questions.every(e=>void 0!==e.userAnswer&&null!==e.userAnswer&&""!==e.userAnswer)){let e={mcqs:m,quiz_token:t};console.log(e);let r=await fetch("".concat("https://backend.englishexpress.ai","/submit_quiz/"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});f((await r.json()).result)}else o.oR.error("Please attend all questions!",{position:"top-center",autoClose:2e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0});k(!1)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.A,{}),(0,s.jsx)(o.N9,{position:"bottom-right",autoClose:2e3,hideProgressBar:!1,newestOnTop:!1,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!0,draggable:!0,pauseOnHover:!0}),(0,s.jsxs)("div",{className:"bg-[#fff] dark:bg-[#161616]",children:[y&&(0,s.jsxs)("div",{className:"h-screen w-screen flex flex-col items-center justify-center ",children:[(0,s.jsx)(d.IN,{visible:!0,height:"96",width:"96",color:"grey",strokeWidth:"5",animationDuration:"0.75",ariaLabel:"rotating-lines-loading",wrapperStyle:{},wrapperClass:""}),(0,s.jsx)("h2",{className:"text-md mt-12 text-black dark:text-white",children:"Loading ..."})]}),u&&(0,s.jsx)("div",{className:"h-screen w-screen flex flex-col items-center justify-center ",children:(0,s.jsx)("h2",{className:"text-md mt-12 text-black dark:text-white",children:u})}),g&&(0,s.jsxs)("div",{className:"max-w-5xl mx-auto px-4 py-12",children:[(0,s.jsx)("h2",{className:"text-4xl font-extrabold text-center mb-6 text-white bg-gradient-to-r from-purple-500 to-indigo-600 p-1 rounded-lg",children:"Quiz Results"}),(0,s.jsx)("div",{className:"space-y-6",children:g.map((e,t)=>(0,s.jsxs)("div",{className:"relative p-6 border dark:border-neutral-700 border-neutral-300 rounded-lg shadow-lg transform transition-transform duration-300 ".concat((e.isCorrect,"bg-neutral-200 dark:bg-neutral-800")," hover:scale-105"),children:[(0,s.jsx)("div",{className:"absolute top-[-15px] left-[-15px] w-10 h-10 bg-gradient-to-r from-purple-600 to-indigo-600 text-white flex items-center justify-center rounded-full text-lg font-bold",children:t+1}),(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsx)("h3",{className:"text-xl font-semibold",children:e.isCorrect?(0,s.jsx)("span",{className:"text-green-500",children:"Well Done!"}):(0,s.jsx)("span",{className:"text-red-500",children:"Try Again!"})}),(0,s.jsx)("span",{className:"text-lg font-bold ".concat(e.isCorrect?"text-green-500":"text-red-500"),children:e.isCorrect?"âï¸":"â"})]}),(0,s.jsx)("p",{className:"text-lg mb-3 text-gray-900 dark:text-gray-100 font-semibold font-nunito",children:e.question}),(0,s.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,s.jsxs)("p",{className:"text-lg font-nunito font-medium text-gray-900 dark:text-gray-100",children:[(0,s.jsx)("span",{className:"font-bold text-sm",children:"Your Answer:"})," ",e.userAnswer]}),(0,s.jsxs)("p",{className:"text-lg font-nunito font-medium text-gray-900 dark:text-gray-100",children:[(0,s.jsx)("span",{className:"font-bold text-sm",children:"Correct Answer:"})," ",e.correctAnswer]}),(0,s.jsx)("div",{className:"bg-gradient-to-r dark:via-pink-900 dark:from-purple-900 dark:to-transparent via-pink-200 from-purple-200 to-transparent roun
1ded-lg p-3",children:(0,s.jsxs)("p",{className:"text-sm font-medium text-black dark:text-white font-medium",children:[(0,s.jsx)("span",{className:"font-bold",children:"Feedback:"})," ",e.feedback]})})]}),(0,s.jsx)("div",{className:"mt-4 flex justify-center",children:e.isCorrect?(0,s.jsx)("span",{className:"text-4xl text-green-500 animate-bounce",children:"\uD83C\uDF89"}):(0,s.jsx)("span",{className:"text-4xl text-red-500 animate-pulse",children:"\uD83D\uDC94"})})]},t))})]})]}),m&&!g&&(0,s.jsx)("section",{class:"py-12 bg-[#fff] dark:bg-[#161616] min-h-screen overflow-hidden",children:(0,s.jsxs)("div",{class:"container mx-auto px-4",children:[(0,s.jsxs)("div",{class:"max-w-lg mx-auto text-center mb-6",children:[(0,s.jsx)(i.zBt,{class:"mx-auto text-7xl mb-4"}),(0,s.jsx)("h2",{class:"mb-4 font-rem4 text-3xl text-gray-800 dark:text-gray-100",children:"Session Quiz"})]}),(0,s.jsxs)("div",{className:"space-y-5 p-4 max-w-4xl mx-auto",children:[(0,s.jsx)("div",{children:(0,s.jsxs)("h3",{className:"block text-lg font-medium mb-1 font-rem2 text-gray-800 dark:text-gray-200",children:["Question ",p," of 10"]})}),(0,s.jsx)("div",{children:(0,s.jsxs)("div",{className:"mb-6 space-y-3",children:[(0,s.jsx)("p",{className:"block text-xl mb-4 font-semibold font-nunito text-gray-800 dark:text-gray-200",children:m.questions[p-1].question}),m.questions[p-1].options.map((e,t)=>(0,s.jsx)("div",{className:"space-y-2 w-full bg-[#f4f4f4] dark:bg-[#1f1f1f] px-2 mx-px-4 rounded-xl py-2",children:(0,s.jsxs)("label",{className:"flex items-center space-x-3 cursor-pointer",children:[(0,s.jsx)("input",{type:"radio",name:"question-".concat(p-1),value:e,checked:m.questions[p-1].userAnswer===e,onChange:()=>N(p-1,e),className:"h-6 w-6 border-2 border-gray-400 checked:bg-green-500 "}),(0,s.jsx)("span",{className:"block text-lg mb-1 font-medium font-nunito text-gray-800 dark:text-gray-200",children:e})]})},t))]})}),(0,s.jsxs)("div",{className:"flex items-center justify-center max-w-sm w-full gap-2",children:[(0,s.jsx)("button",{onClick:()=>{b(p-1)},disabled:1==p,className:"w-full px-4 py-2 font-medium text-black dark:text-white border border-[#ececec] dark:border[#171717] dark:bg-[#171717] bg[#ececec] rounded-md shadow-sm hover:bg-white dark:hover:bg-black transition-all duration-300 disabled:text-gray-300 disabled:dark:text-gray-600 ",children:"Previous"}),(0,s.jsx)("button",{onClick:()=>{b(p+1)},disabled:10==p,className:"w-full px-4 py-2 font-medium text-black dark:text-white border border-[#ececec] dark:border[#171717] dark:bg-[#171717] bg[#ececec] rounded-md shadow-sm hover:bg-white dark:hover:bg-black transition-all duration-300 disabled:text-gray-300 disabled:dark:text-gray-600 ",children:"Next"})]}),v&&(0,s.jsx)(d.IN,{visible:!0,height:"96",width:"96",color:"grey",strokeWidth:"5",animationDuration:"0.75",ariaLabel:"rotating-lines-loading",wrapperStyle:{},wrapperClass:""}),!v&&(0,s.jsx)("div",{className:"flex items-center justify-center max-w-xs mt-4 mx-auto gap-2",children:(0,s.jsx)("button",{type:"button",onClick:S,className:"w-full px-4 py-2 font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md shadow-sm transition-all duration-300 ",children:"Submit"})})]})]})})]})}},46942:(e,t)=>{var r;!function(){"use strict";var s={}.hasOwnProperty;function a(){for(var e="",t=0;t<arguments.length;t++){var r=arguments[t];r&&(e=n(e,function(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return a.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var r in e)s.call(e,r)&&e[r]&&(t=n(t,r));return t}(r)))}return e}function n(e,t){return t?e?e+" "+t:e+t:e}e.exports?(a.default=a,e.exports=a):void 0!==(r=(function(){return a}).apply(t,[]))&&(e.exports=r)}()}},e=>{var t=t=>e(e.s=t);e.O(0,[9151,6957,1106,3093,3540,636,6593,8792],()=>t(23152)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.