1"use strict";(self.webpackChunkassesify=self.webpackChunkassesify||[]).push([[6676],{36964:(e,s,t)=>{t.d(s,{A:()=>c});var a=t(9950),r=t(90983),l=t(10300),n=t(75300),i=t(14696),d=t(61495),o=t(44414);const c=e=>{let{breadcrumbs:s=[],title:t,subtitle:c,icon:x,stats:m=[],noBanner:h=!1,actions:p,features:g=[],noShadow:b=!1}=e;const u="student"===(0,l.d4)((e=>e.userslice.role)),y=s.length>0||u;return(0,o.jsxs)(o.Fragment,{children:[y&&(0,o.jsxs)("div",{className:`app-topbar relative sticky top-0 z-40 w-full bg-white/80 backdrop-blur-md ${b?"border-b border-gray-100":"border-b border-gray-200 shadow-sm"} mb-2`,children:[(0,o.jsx)(d.Ay,{}),(0,o.jsxs)("div",{className:"w-full flex items-center justify-between gap-3 px-4 sm:px-6 py-2.5",children:[(0,o.jsxs)("nav",{className:"flex items-center flex-wrap gap-1 text-sm text-gray-600 min-w-0",children:[(0,o.jsx)(i.r,{}),s.map(((e,t)=>(0,o.jsxs)(a.Fragment,{children:[(0,o.jsx)("span",{className:"cursor-pointer hover:text-gray-900 transition-colors truncate\n "+(t===s.length-1?"text-gray-900 font-semibold":"text-gray-500"),onClick:e.onClick,children:e.label}),t<s.length-1&&(0,o.jsx)(r.A,{className:"w-4 h-4 text-gray-400 shrink-0"})]},t)))]}),(0,o.jsx)(n.A,{className:"shrink-0"})]})]}),!h&&(0,o.jsx)("div",{className:`relative mb-2 text-gray-900 bg-white ${b?"":"shadow-sm"} rounded-xl overflow-hidden`,children:(0,o.jsx)("div",{className:"relative z-10 px-8 py-6 rounded-xl shadow-sm",children:(0,o.jsx)("div",{className:"relative z-10",children:(0,o.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,o.jsxs)("div",{className:"flex items-center gap-4",children:[x&&(0,o.jsx)("div",{className:"p-3 bg-brand-primary/30 rounded-xl",children:(0,o.jsx)(x,{className:"w-8 h-8 text-brand-primary"})}),(0,o.jsxs)("div",{children:[(0,o.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:t}),c&&(0,o.jsx)("p",{className:"text-gray-600 text-sm",children:c})]})]}),m.length>0&&(0,o.jsx)("div",{className:"hidden lg:flex items-center gap-6 ",children:m.map(((e,s)=>(0,o.jsx)("button",{className:"flex items-center gap-4 bg-white/10 px-2 py-2 rounded-xl backdrop-blur-sm hover:bg-white/20 transition-all duration-300",onClick:e.onClick,children:(0,o.jsxs)("div",{whileHover:{y:-2},className:`flex items-center gap-4 p-4 bg-${e.color}-50 rounded-xl border border-${e.color}-300 transition-all duration-300 shadow-sm hover:shadow-md`,children:[(0,o.jsx)("div",{className:`p-3 rounded-lg bg-${e.color}-100`,children:a.cloneElement(e.icon,{className:`w-6 h-6 text-${e.color}-600`})}),(0,o.jsxs)("div",{className:"flex flex-col",children:[(0,o.jsx)("span",{className:"text-lg font-bold text-gray-900",children:e.value}),(0,o.jsx)("span",{className:"text-sm text-gray-600",children:e.label})]})]})},s)))})]})})})})]})}},16676:(e,s,t)=>{t.r(s),t.d(s,{default:()=>g});t(9950);var a=t(78130),r=t(56149),l=t(7838),n=t(67637),i=t(73202),d=t(35887),o=t(1336),c=t(45272),x=t(34911),m=(t(20649),t(36964)),h=t(23429),p=t(44414);const g=()=>{var e;const{data:s,isLoading:t}=(0,i.q)(void 0,{suspense:!0}),g=e=>{const s=new Date;new Date(e.expiresat)>s?(0,d.Ay)("\ud83d\ude09 Answers will be released soon!"):(async e=>{try{const s=await o.A.get(`/assessment/downloadAnswers/${e}`,{responseType:"blob",withCredentials:!0}),t=s.headers["content-type"];if(t&&t.includes("application/json")){const e=await s.data.text(),t=JSON.parse(e);return(0,d.Ay)(t.message)}const a=new Blob([s.data],{type:"application/pdf"}),r=window.URL.createObjectURL(a),l=document.createElement("a");l.href=r,l.download="assessment.pdf",document.body.appendChild(l),l.click(),l.remove(),window.URL.revokeObjectURL(r)}catch(a){var s;console.error("Error downloading PDF:",a);let e=null;const l=null===a||void 0===a||null===(s=a.response)||void 0===s?void 0:s.data;if(l instanceof Blob)try{var t;e=null===(t=JSON.parse(await l.text()))||void 0===t?void 0:t.message}catch(r){}else"object"===typeof l&&null!==l&&void 0!==l&&l.message&&(e=l.message);d.Ay.error(e||"Failed to download PDF")}})(null===e||void 0===e?void 0:e.id)};return(0,p.jsx)(h.A,{BreadCrumbNav:(0,p.jsx)(m.A,{breadcrumbs:[{label:"Assessments",onClick:()=>{}},{label:"Results"}],title:"Assessment Reports",subtitle:"Track your progress and performance",icon:a.A,stats:[{icon:(0,p.jsx)(r.A,{className:"w-5 h-5 text-yellow-300"}),label:"Total Assessments",value:(null===s||void 0===s||null===(e=s.uniqueAssessments)||void 0===e?void 0:e.length)||0,color:"yellow"}]}),children:(0,p.jsx)("div",{className:"bg-white rounded-xl shadow-lg overflow-hidden border border-gray-100",children:(0,p.jsx)("div",{className:"overflow-x-auto",children:t?(0,p.jsxs)(c.A,{className:"border-collapse",children:[(0,p.jsx)("thead",{children:(0,p.jsxs)("tr",{className:"bg-gray-50",children:[(0,p.jsx)("th",{className:"text-left p-4 text-gray-900 font-semibold tracking-wider up
1percase text-sm",children:"Sno"}),(0,p.jsx)("th",{className:"text-left p-4 text-gray-900 font-semibold tracking-wider uppercase text-sm",children:"Assessment"}),(0,p.jsx)("th",{className:"text-left p-4 text-gray-900 font-semibold tracking-wider uppercase text-sm",children:"Attempted On"}),(0,p.jsx)("th",{className:"text-left p-4 text-gray-900 font-semibold tracking-wider uppercase text-sm",children:"No of Attempts"}),(0,p.jsx)("th",{className:"text-right p-4 text-gray-900 font-semibold tracking-wider uppercase text-sm",children:"Actions"})]})}),(0,p.jsx)("tbody",{children:Array.from({length:5}).map(((e,s)=>(0,p.jsxs)("tr",{className:"border-b border-gray-100 hover:bg-gray-50 transition-colors duration-200",children:[(0,p.jsx)("td",{className:"p-4 text-gray-500 text-md",children:(0,p.jsx)(x.A,{width:20})}),(0,p.jsx)("td",{className:"p-4 text-gray-500 text-md",children:(0,p.jsx)(x.A,{width:"80%"})}),(0,p.jsx)("td",{className:"p-4 text-gray-500 text-md",children:(0,p.jsx)(x.A,{width:"60%"})}),(0,p.jsx)("td",{className:"p-4 text-gray-500 text-md",children:(0,p.jsx)(x.A,{width:50})}),(0,p.jsx)("td",{className:"p-4",children:(0,p.jsxs)("div",{className:"flex justify-end space-x-3",children:[(0,p.jsx)(x.A,{width:100,height:32}),(0,p.jsx)(x.A,{width:100,height:32})]})})]},s)))})]}):(0,p.jsx)(c.A,{data:(null===s||void 0===s?void 0:s.uniqueAssessments)||[],columns:[{key:"name",header:"Assessment",align:"left",render:e=>(0,p.jsx)("div",{className:"font-small text-sm text-gray-500 hover:text-gray-700 transition-colors duration-200",children:e.name})},{key:"attempteddate",header:"Attempted On",align:"left",render:e=>(0,p.jsx)("div",{className:"font-small text-sm text-gray-500 hover:text-gray-700 transition-colors duration-200",children:new Date(null===e||void 0===e?void 0:e.attempteddate).toLocaleString("en-IN",{timeZone:"Asia/Kolkata"})})},{key:"noofattempts",header:"Attempts",align:"left",render:e=>(0,p.jsxs)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-brand-primary/20 text-brand-primary-800",children:[null===e||void 0===e?void 0:e.noofattempts," attempts"]})},{key:"actions",header:"Actions",align:"left",width:"w-64",render:e=>{const s=new Date,t=new Date(e.expiresAt)>s;return(0,p.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,p.jsxs)("button",{onClick:()=>{return s=e.id,void window.open(`/reports/assessment/${s}`,"_blank");var s},className:"inline-flex items-center px-3 py-1.5 text-sm text-yellow-700 bg-yellow-50 hover:bg-yellow-100 rounded-full transition-colors",children:[(0,p.jsx)(l.A,{className:"w-4 h-4 mr-1.5"}),"Report"]}),(0,p.jsxs)("button",{onClick:()=>g(e),disabled:t,className:"inline-flex items-center px-3 py-1.5 text-sm rounded-full transition-colors "+(t?"text-gray-400 bg-gray-100 cursor-not-allowed":"text-green-700 bg-green-50 hover:bg-green-100"),children:[(0,p.jsx)(n.A,{className:"w-4 h-4 mr-1.5"}),"Solutions"]})]})}}],searchPlaceholder:"Search assessments by name or any field...",searchableFields:["name","attempteddate"],itemsPerPage:10,showSerialNumber:!0,serialNumberHeader:"No",className:"border-collapse"})})})})}}}]);
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.