"use strict";exports.id=83754,exports.ids=[67183,83754,89564],exports.modules={5637:(a,b,c)=>{c.d(b,{T$:()=>h,TC:()=>g,ml:()=>f});var d=c(23971),e=c(40433);let f=async a=>{try{let b=(await d.uE.get(e.Sn.QUIZZES.MY_ATTEMPTS,{params:a})).data;if(!b.success||!b.data)throw Error(b.message||"Failed to load quiz attempts");return b.data}catch(a){throw Error((0,d.hS)(a))}},g=async a=>{try{let b=(await d.uE.get(`${e.Sn.QUIZZES.LIST}/${a}/attempts`)).data;if(!b.success||!b.data)throw Error(b.message||"Failed to load quiz attempts");return b.data}catch(a){throw Error((0,d.hS)(a))}},h=async a=>{try{let b=(await d.uE.get(e.Sn.QUIZZES.MY_ATTEMPT_DETAILS(a))).data;if(!b.success||!b.data)throw Error(b.message||"Failed to load quiz attempt details");return b.data}catch(a){throw Error((0,d.hS)(a))}}},83754:(a,b,c)=>{c.r(b),c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(89564),g=c(41090),h=c(20524);c(5637);var i=c(40433);function j(){let[a,b]=(0,e.useState)([]),[c,j]=(0,e.useState)(!0),[k,l]=(0,e.useState)(null),m=(0,e.useMemo)(()=>a,[a]);return(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h1",{className:"text-2xl font-bold text-[var(--foreground)]",children:"Quiz Reports"}),(0,d.jsx)("p",{className:"text-sm text-[var(--muted-foreground)] mt-1",children:"View your quiz history and admin replies (if available)."})]}),(0,d.jsx)(f.j,{href:`${i.bw.DASHBOARD}/my-courses`,children:(0,d.jsx)(h.$,{variant:"outline",size:"sm",children:"Back to My Courses"})})]}),k?(0,d.jsx)(g.Z,{padding:"lg",children:(0,d.jsx)("div",{className:"text-sm text-red-600",children:k})}):c?(0,d.jsx)(g.Z,{padding:"lg",children:(0,d.jsx)("div",{className:"text-sm text-[var(--muted-foreground)]",children:"Loading reports…"})}):0===m.length?(0,d.jsx)(g.Z,{padding:"lg",children:(0,d.jsx)("div",{className:"text-sm text-[var(--muted-foreground)]",children:"No quiz attempts yet. Play any quiz to see your history here."})}):(0,d.jsx)("div",{className:"space-y-4",children:m.map(a=>{let b=a.quiz?.lesson?.course?.title||"Course",c=a.quiz?.lesson?.title||"Lesson",e=a.quiz?.title||"Quiz",j=a.completedAt?new Date(a.completedAt).toLocaleString():"—",k="number"==typeof a.score&&"boolean"==typeof a.isPassed?`Score: ${a.score} • ${a.isPassed?"Passed":"Not passed"}`:null!==a.score&&void 0!==a.score?`Score: ${a.score}`:"";return(0,d.jsxs)(g.Z,{padding:"lg",className:"space-y-3",children:[(0,d.jsx)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2",children:(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("div",{className:"text-xs font-semibold text-[var(--muted-foreground)] uppercase tracking-wider",children:b}),(0,d.jsx)("div",{className:"text-base font-bold text-[var(--foreground)] truncate",children:e}),(0,d.jsxs)("div",{className:"text-xs text-[var(--muted-foreground)]",children:[c," • Submitted: ",j]})]})}),a.adminVisible&&((a.adminNotes||"").trim().length>0||a.adminVideoUrl)?(0,d.jsxs)("div",{className:"border border-[var(--border)] bg-[var(--muted)]/30 p-4 rounded-md",children:[(0,d.jsx)("div",{className:"text-xs font-bold text-[var(--foreground)] uppercase tracking-wider mb-2",children:"Admin reply"}),!!(a.adminNotes||"").trim()&&(0,d.jsx)("div",{className:"text-sm text-[var(--foreground)] whitespace-pre-wrap",children:a.adminNotes}),a.adminVideoUrl&&(0,d.jsx)("div",{className:"mt-3",children:(0,d.jsx)("a",{href:a.adminVideoUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center rounded-md border border-[var(--border)] px-3 py-2 text-sm font-medium text-[var(--foreground)] hover:bg-[var(--muted)]/50",children:"Watch reply video"})})]}):k?(0,d.jsx)("div",{className:"text-sm text-[var(--muted-foreground)]",children:k}):null,a.adminVisible||k?null:(0,d.jsx)("div",{className:"text-sm text-[var(--muted-foreground)]",children:"—"}),(0,d.jsx)("div",{className:"flex justify-end pt-2",children:(0,d.jsx)(f.j,{href:`${i.bw.DASHBOARD}/quiz-reports/${a.id}`,children:(0,d.jsx)(h.$,{variant:"outline",size:"sm",children:"View details"})})})]},a.id)})})]})}},89564:(a,b,c)=>{c.d(b,{j:()=>l});var d=c(48249),e=c(2116),f=c.n(e),g=c(18954),h=c(17060),i=c(89513);function j(a){return(a.split("?")[0]||a).replace(/\/$/,"")||"/"}function k(a){if("string"==typeof a)return a;if(a&&"object"==typeof a){let b=a.pathname?String(a.pathname):"",c=a.search?String(a.search):"",d=a.hash?String(a.hash):"";return`${b}${c}${d}`}return""}function l({href:a,onClick:b,prefetch:c=!1,scroll:e=!0,...l}){let m=(0,h.sK)(),n=k(a),o=j(k(a)),p=m??"",q=o?(0,i.C)(o):null;return(0,d.jsx)(f(),{href:a,prefetch:c,scroll:e,...l,onClick:a=>{b?.(a),!a.defaultPrevented&&o&&(j(p)===j(o)?a.preventDefault():q&&(a.preventDefault(),(0,g.$)(n,{scroll:e})))}})}}};