PageSourceSearch

https://ieon.com.br/assets/AlunoAvaliacao-DqDzyjB_.js

js ieon.com.br collected 2026-10-06 04:42:12 UTC 23,169 bytes, 1 lines download raw bytes

1import{l as Ye,n as Je,aw as Ze,o as ea,O as Re,r as c,ax as Ne,j as e,t as C,b as E,v as A,z as ee,w as R,Q as F,x as M,_ as T,c as o,R as ve,A as Ce,S as I,M as V,Y as ae,L as aa,E as ye,ae as te,s as k,a4 as u}from"./index-Coi58JqR.js";import{u as sa,R as ta,a as ra}from"./useCourseEvaluation-B7QKSTeq.js";import{a as ia,u as oa,b as na}from"./useCertificateGeneration-D-FFIEOd.js";import{P as la}from"./progress-CZBZ3dPt.js";import{T as Se}from"./textarea-2ePFuKqA.js";import{c as ca}from"./confetti.module-ONDKWxYZ.js";import{f as da,g as ma}from"./useCourseReviews-sx8QQf00.js";import{S as _e}from"./SendCertificateEmailDialog-DuPWUAuE.js";import{D as Ee}from"./download-DY2vzCg4.js";import{B as se}from"./book-open-cd04T4tA.js";import{S as ua}from"./shield-alert-SjR1wv7V.js";import{C as xa}from"./circle-alert-DX0aE5iS.js";import{C as Ae}from"./circle-x-DJ1Bo91T.js";import{R as pa}from"./rotate-ccw-CjkHQw_T.js";import"./index-C69U7ulk.js";import"./index-DHkygX1h.js";import"./circle-Ctd5Q1M4.js";import"./generateCertificatePdf-DsDODyxx.js";function fa(t){const{user:n}=Re();return te({queryKey:["enrollment-for-course",n==null?void 0:n.id,t],enabled:!!(n!=null&&n.id)&&!!t,queryFn:async()=>{const{data:N,error:i}=await k.from("enrollments").select("*").eq("student_id",n.id).eq("course_id",t).maybeSingle();if(i)throw i;return N}})}function ha(t,n){return te({queryKey:["existing-approval",n,t],enabled:!!n&&!!t,queryFn:async()=>{const{data:N,error:i}=await k.from("student_activity_log").select("metadata").eq("student_id",n).eq("course_id",t).eq("activity_type","evaluation_completed").order("created_at",{ascending:!1}).limit(1).maybeSingle();return i?null:N==null?void 0:N.metadata}})}function ga(t,n){return te({queryKey:["existing-certificate",n,t],enabled:!!n&&!!t,queryFn:async()=>{const{data:N,error:i}=await k.from("certificates").select("*").eq("student_id",n).eq("course_id",t).maybeSingle();return i?null:N}})}function Ma(){var we;const{id:t}=Ye(),n=Je(),N=Ze(),{data:i,isLoading:re}=ea(t),{data:h,isLoading:ke}=sa(t),{user:l}=Re(),{data:r,isLoading:Oe}=fa(t),{data:d,isLoading:De}=ha(t,l==null?void 0:l.id),{data:qe}=ga(t,l==null?void 0:l.id),[Pe,Fe]=c.useState(null),b=Pe||qe,{mutate:Me,isPending:z}=ia(),{mutate:Ie,isPending:G}=oa(),{mutateAsync:Le,isPending:O}=na(),[ie,B]=c.useState(!1),[Te,Ve]=c.useState(""),[oe,ze]=c.useState(""),{data:w}=da(t),{mutate:ne,isPending:$}=ma(),[D,le]=c.useState(0),[ce,Q]=c.useState(0),[H,de]=c.useState(""),{mutate:Ge}=Ne({mutationFn:async a=>{if(!l)throw new Error("User not authenticated");const{error:s}=await k.from("student_activity_log").insert({student_id:l.id,course_id:t,activity_type:"evaluation_completed",description:a.passed?"Aprovado na Avaliação Final":"Reprovado na Avaliação Final",metadata:{score:a.score,passed:a.passed,answers:a.answers,total_questions:S.length}});if(s)throw s;a.passed&&(r!=null&&r.id)&&await k.from("enrollments").update({completed_at:new Date().toISOString(),status:"completed",progress:100}).eq("id",r.id)},onError:a=>{console.error("Error saving evaluation:",a),u.error("Erro ao salvar resultado da avaliação.")}}),{mutate:Be}=Ne({mutationFn:async()=>{if(!(r!=null&&r.id))throw new Error("Enrollment not found");const{error:a}=await k.from("enrollments").update({early_completion_accepted:!0}).eq("id",r.id);if(a)throw a},onSuccess:()=>{u.success("Dispensa de carga horária aceita. Avaliação liberada!"),xe(!1)},onError:a=>{console.error("Error accepting early completion:",a),u.error("Erro ao registrar dispensa.")}}),[v,U]=c.useState(0),[y,X]=c.useState({}),[W,Y]=c.useState(!1),[K,me]=c.useState(0),[q,ue]=c.useState(!1),[x,_]=c.useState(!1),[$e,xe]=c.useState(!1),[pe,Qe]=c.useState(!1),J=c.useMemo(()=>{if(!i||!r)return{blocked:!1,daysRemaining:0,daysMinimum:0,daysElapsed:0};const a=i.total_hours||0,s=Math.ceil(a/10),m=r.first_access_at?new Date(r.first_access_at):null,f=r.last_lesson_completed_at?new Date(r.last_lesson_completed_at):new Date;if(!m)return{blocked:!1,daysRemaining:0,daysMinimum:s,daysElapsed:0};const g=f.getTime()-m.getTime(),j=Math.max(1,Math.ceil(g/(1e3*60*60*24))),P=j<s&&!r.early_completion_accepted,We=Math.max(0,s-j);return{blocked:P,daysRemaining:We,daysMinimum:s,daysElapsed:j}},[i,r]);c.useEffect(()=>{J.blocked&&xe(!0)},[J.blocked]);const S=c.useMemo(()=>h!=null&&h.questions?h.questions:[],[h]),p=S[v],L=S.length,fe=a=>{W&&!x||x||p&&X(s=>({...s,[p.id]:a}))},he=()=>{v<L-1?U(a=>a+1):Ue()},He=()=>{v>0&&U(a=>a-1)},Ue=()=>{if(S.length===0)return;if(S.some(P=>y[P.id]===void 0)){u.error("Por favor, responda todas as questões antes de finalizar.");return}let s=0;
1S.forEach(P=>{y[P.id]===P.correct_option_index&&s++});const m=s/S.length*10;let f=(h==null?void 0:h.passing_grade)||70,g=f<=10?f:f/10;const j=m>=g;me(m),ue(j),Y(!0),_(!1),j?(ca({particleCount:200,spread:100,origin:{y:.6},colors:["#22c55e","#FFD700","#FFA500"]}),u.success("Parabéns! Você foi aprovado na avaliação.")):u.error("Infelizmente você não atingiu a nota mínima. Tente novamente."),Ge({score:m,passed:j,answers:y})},Ke=()=>{X({}),Y(!1),me(0),ue(!1),_(!1),U(0),window.scrollTo(0,0)},Xe=()=>{_(!0),U(0),window.scrollTo(0,0)},ge=()=>{if(!(r!=null&&r.id)||!t){u.error("Matrícula não encontrada.");return}Me({courseId:t,enrollmentId:r.id,courseName:(i==null?void 0:i.title)||"Curso",totalHours:(i==null?void 0:i.total_hours)||0,startDate:r.first_access_at||r.enrolled_at||new Date().toISOString(),endDate:r.completed_at||new Date().toISOString(),score:(d==null?void 0:d.score)||K||0,earlyCompletion:r.early_completion_accepted||!1},{onSuccess:a=>{a!=null&&a.certificate_number&&(Fe(a),u.success(`Certificado ${a.certificate_number} gerado com sucesso!`),N.invalidateQueries({queryKey:["existing-certificate",l==null?void 0:l.id,t]}),Z(a))}})},Z=a=>{l!=null&&l.id&&k.from("students").select("full_name, cpf").eq("id",l.id).single().then(({data:s})=>{if(!s){u.error("Dados do aluno não encontrados");return}Ie({certificateNumber:a.certificate_number,studentName:s.full_name,cpf:s.cpf,courseName:(i==null?void 0:i.title)||"Curso",totalHours:(i==null?void 0:i.total_hours)||0,startDate:a.start_date||(r==null?void 0:r.first_access_at)||"",endDate:a.end_date||(r==null?void 0:r.completed_at)||new Date().toISOString(),earlyCompletion:a.early_completion||!1,courseId:t||"",bookNumber:a.book_number||1,pageNumber:a.page_number||1,score:a.score||(d==null?void 0:d.score)||K||0,frequency:a.frequency||100})})},je=a=>{if(!(a!=null&&a.id)){u.error("Certificado não encontrado.");return}Ve(a.id),ze((l==null?void 0:l.email)||""),B(!0)},be=async a=>{var s,m;try{const f=a.trim();if(!f){u.error("Informe um e-mail válido.");return}const g=await Le({certificateId:Te,recipientEmail:f});if((s=g==null?void 0:g.dispatch)!=null&&s.sent){u.success("E-mail enviado com sucesso."),B(!1);return}const j=((m=g==null?void 0:g.dispatch)==null?void 0:m.reason)||"motivo não informado";typeof j=="string"&&j.startsWith("already_")?u.info("Este certificado já foi enviado recentemente. Aguarde para reenviar."):u.warning(`E-mail não enviado (${j}).`)}catch(f){console.error("Erro ao enviar certificado por e-mail:",f),u.error("Erro ao enviar certificado por e-mail.")}};if(re||ke||Oe||De)return e.jsx("div",{className:"flex h-screen items-center justify-center",children:e.jsx(C,{className:"h-8 w-8 animate-spin text-primary"})});if(d!=null&&d.passed&&!W&&!x){const a=!!(b!=null&&b.certificate_number);return e.jsxs("div",{className:"container max-w-2xl mx-auto py-12 px-4 animate-in fade-in zoom-in duration-500",children:[e.jsxs(E,{className:"border-green-500 bg-green-50/50",children:[e.jsxs(A,{className:"text-center pb-2",children:[e.jsx("div",{className:"mx-auto mb-4",children:e.jsx(ee,{className:"h-16 w-16 text-green-500"})}),e.jsx(R,{className:"text-3xl font-bold",children:"Você já foi aprovado!"}),e.jsxs(F,{className:"text-lg mt-2",children:["Sua nota: ",e.jsx("span",{className:"font-bold text-foreground text-2xl",children:(d.score||0).toFixed(1)})," / 10"]})]}),e.jsx(M,{className:"text-center space-y-4",children:e.jsx("p",{className:"font-medium text-green-700",children:a?"Seu certificado já foi emitido. Você pode baixá-lo abaixo.":"Parabéns! Gere seu certificado agora mesmo."})}),e.jsxs(T,{className:"flex flex-col sm:flex-row flex-wrap gap-3 justify-center pt-6",children:[a?e.jsxs(e.Fragment,{children:[e.jsxs(o,{onClick:()=>Z(b),disabled:G,className:"bg-green-600 hover:bg-green-700 w-full sm:w-auto gap-2",children:[G?e.jsx(C,{className:"w-4 h-4 animate-spin"}):e.jsx(Ee,{className:"w-4 h-4"}),"Baixar Certificado"]}),e.jsxs(o,{variant:"outline",onClick:()=>je(b),disabled:O,className:"w-full sm:w-auto gap-2",children:[O?e.jsx(C,{className:"w-4 h-4 animate-spin"}):e.jsx(ve,{className:"w-4 h-4"}),"Receber Certificado por e-mail"]})]}):e.jsxs(o,{onClick:ge,disabled:z,className:"bg-green-600 hover:bg-green-700 w-full sm:w-auto gap-2",children:[z?e.jsx(C,{className:"w-4 h-4 animate-spin"}):e.jsx(Ce,{className:"w-4 h-4"}),"Gerar Certificado"]}
1),(d==null?void 0:d.answers)&&e.jsxs(o,{variant:"outline",onClick:()=>{X(d.answers||{}),_(!0),window.scrollTo(0,0)},className:"w-full sm:w-auto gap-2",children:[e.jsx(se,{className:"w-4 h-4"}),"Ver Gabarito"]}),e.jsx(o,{variant:"ghost",className:"w-full sm:w-auto",onClick:()=>n(`/aluno/curso/${t}/aula`),children:"Voltar ao Curso"})]})]}),((d==null?void 0:d.passed)||K>=0)&&e.jsx("div",{className:"mt-8",children:e.jsxs(E,{children:[e.jsxs(A,{children:[e.jsx(R,{children:"Avalie este Curso"}),e.jsx(F,{children:"Compartilhe sua experiência para ajudar outros alunos."})]}),e.jsx(M,{children:w?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center gap-1",children:[1,2,3,4,5].map(s=>e.jsx(I,{className:V("w-6 h-6",s<=w.rating?"fill-yellow-400 text-yellow-400":"fill-muted text-muted")},s))}),e.jsxs("p",{className:"text-muted-foreground italic",children:['"',w.comment,'"']}),e.jsxs("p",{className:"text-sm font-medium text-primary",children:["Status: ",w.status==="pending"?"Aguardando Aprovação":w.status==="approved"?"Aprovado e Visível":"Rejeitado"]})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center gap-2 mb-2",children:[1,2,3,4,5].map(s=>e.jsx("button",{type:"button",onClick:()=>le(s),onMouseEnter:()=>Q(s),onMouseLeave:()=>Q(0),className:"focus:outline-none transition-transform hover:scale-110",children:e.jsx(I,{className:V("w-8 h-8 transition-colors",s<=(ce||D)?"fill-yellow-400 text-yellow-400 drop-shadow-sm":"fill-muted text-muted")})},s))}),e.jsx(Se,{placeholder:"O que você achou do curso? (Opcional)",value:H,onChange:s=>de(s.target.value),className:"resize-none",rows:3}),e.jsxs(o,{onClick:()=>t&&ne({courseId:t,rating:D,comment:H}),disabled:D===0||$,className:"w-full sm:w-auto",children:[$?e.jsx(C,{className:"w-4 h-4 animate-spin mr-2"}):e.jsx(I,{className:"w-4 h-4 mr-2"}),"Enviar Avaliação"]})]})})]})}),e.jsx(_e,{open:ie,onOpenChange:B,initialEmail:oe,onConfirm:be,isSending:O})]})}return $e?e.jsx("div",{className:"container max-w-3xl mx-auto py-12 px-4 animate-in fade-in duration-500",children:e.jsxs(E,{className:"border-amber-500/50 bg-amber-50/30",children:[e.jsxs(A,{className:"text-center pb-4",children:[e.jsx("div",{className:"mx-auto mb-4 p-3 bg-amber-100 rounded-full w-fit",children:e.jsx(ua,{className:"h-10 w-10 text-amber-600"})}),e.jsx(R,{className:"text-2xl font-bold text-amber-900",children:"AVISO IMPORTANTE"}),e.jsx(F,{className:"text-base text-amber-800 font-medium mt-2",children:"TEXTO DO AVISO, DECLARAÇÃO E SOLICITAÇÃO"})]}),e.jsxs(M,{className:"space-y-6 text-sm leading-relaxed text-gray-800",children:[e.jsxs("div",{className:"bg-white/80 rounded-lg p-6 border border-amber-200 space-y-4",children:[e.jsx("p",{className:"text-justify",children:"AVISO IMPORTANTE – Você poderá fazer a opção pela declaração de conhecimento prévio sobre a matéria do curso, nos termos do art. 41 da Lei n° 9.394/1996 (Lei de Diretrizes e Bases da Educação Nacional), SOLICITANDO A DISPENSA DO CUMPRIMENTO EFETIVO DA CARGA HORÁRIA DO CURSO, mediante avaliação, reconhecimento e certificação para a conclusão do curso, eximindo o Instituto de Educação Online de toda e qualquer responsabilidade sobre a veracidade da declaração, uma vez que o certificado será regulamente emitido após o cumprimento dos requisitos do art. 41 da Lei n° 9.394/1996. Assim você assumirá toda e qualquer responsabilidade sobre a veracidade da declaração e sobre o momento de conclusão do curso. Para tanto, basta clicar na declaração e solicitação abaixo, ou optar pelo cumprimento efetivo da carga horária do curso."}),e.jsx("p",{className:"text-justify italic border-l-4 border-amber-400 pl-4",children:"Art. 41. O conhecimento adquirido na educação profissional e tecnológica, inclusive no trabalho, poderá ser objeto de avaliação, reconhecimento e certificação para prosseguimento ou conclusão de estudos."})]}),e.jsx("div",{className:"bg-white/80 rounded-lg p-6 border border-amber-200",children:e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer group",children:[e.jsx("input",{type:"checkbox",checked:pe,onChange:a=>Qe(a.target.checked),className:"mt-1 h-5 w-5 rounded border-amber-300 text-amber-600 focus:ring-amber-500 shrink-0"}),e.jsx("span",{className:"text-sm leading-relaxed group-hover:text-amber-900 transition-colors",children:"Declaro que já tenho conhecimento prévio sobre a matéria do curs
1o, adquirido na minha educação profissional e tecnológica, inclusive no trabalho, e SOLICITO A DISPENSA DO CUMPRIMENTO EFETIVO DA CARGA HORÁRIA DO CURSO, mediante avaliação, reconhecimento e certificação para a conclusão do curso, nos termos do art. 41 da Lei n° 9.394/1996 (Lei de Diretrizes e Bases da Educação Nacional), assumindo, assim, toda e qualquer responsabilidade sobre a veracidade da presente declaração e sobre o momento de conclusão do curso, eximindo, assim, o Instituto de Educação Online de toda e qualquer responsabilidade sobre a veracidade da minha declaração e sobre o momento de conclusão do curso."})]})}),e.jsx("div",{className:"bg-blue-50 rounded-lg p-4 border border-blue-200",children:e.jsxs("p",{className:"text-sm text-blue-800",children:["Caso prefira, você pode optar por concluir a carga horária estudando o curso por mais ",e.jsxs("strong",{children:[J.daysRemaining," dia(s)"]}),"."]})})]}),e.jsxs(T,{className:"flex flex-col sm:flex-row sm:flex-wrap gap-3 justify-center pt-6",children:[e.jsxs(o,{variant:"outline",onClick:()=>n(`/aluno/curso/${t}/aula`),className:"w-full sm:w-auto",children:[e.jsx(ae,{className:"w-4 h-4 mr-2"}),"Voltar ao Curso"]}),e.jsx(o,{disabled:!pe,onClick:()=>Be(),className:"w-full sm:w-auto bg-amber-600 hover:bg-amber-700",children:"Aceitar e Prosseguir para Avaliação"})]})]})}):!h||!h.is_active||S.length===0?e.jsx("div",{className:"container max-w-2xl mx-auto py-12 px-4 text-center",children:e.jsxs(E,{className:"border-dashed",children:[e.jsxs(A,{children:[e.jsxs(R,{className:"flex flex-col items-center gap-4",children:[e.jsx(xa,{className:"h-12 w-12 text-muted-foreground"}),"Avaliação Indisponível"]}),e.jsx(F,{children:"Este curso ainda não possui uma avaliação configurada."})]}),e.jsx(T,{className:"justify-center",children:e.jsx(o,{onClick:()=>n(`/aluno/curso/${t}/aula`),children:"Voltar para o Curso"})})]})}):W&&!x?e.jsxs("div",{className:"container max-w-2xl mx-auto py-12 px-4 animate-in fade-in zoom-in duration-500",children:[e.jsxs(E,{className:q?"border-green-500 bg-green-50/50":"border-destructive bg-destructive/5",children:[e.jsxs(A,{className:"text-center pb-2",children:[e.jsx("div",{className:"mx-auto mb-4",children:q?e.jsx(ee,{className:"h-16 w-16 text-green-500"}):e.jsx(Ae,{className:"h-16 w-16 text-destructive"})}),e.jsx(R,{className:"text-3xl font-bold",children:q?"Aprovado!":"Reprovado"}),e.jsxs(F,{className:"text-lg mt-2",children:["Sua nota: ",e.jsx("span",{className:"font-bold text-foreground text-2xl",children:K.toFixed(1)})," / 10"]})]}),e.jsxs(M,{className:"text-center space-y-4",children:[e.jsxs("p",{className:"text-muted-foreground",children:["Nota mínima para aprovação: ",e.jsxs("strong",{children:[(h.passing_grade<=10?h.passing_grade:h.passing_grade/10).toFixed(1)," / 10"]})]}),q?e.jsx("p",{className:"font-medium text-green-700",children:"Parabéns! Você concluiu o curso e já pode emitir seu certificado."}):e.jsx("p",{className:"font-medium text-destructive",children:"Você precisa estudar um pouco mais antes de tentar novamente."})]}),e.jsxs(T,{className:"flex flex-col sm:flex-row flex-wrap gap-3 justify-center pt-6",children:[e.jsxs(o,{variant:"outline",onClick:Xe,className:"w-full sm:w-auto",children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),"Ver Gabarito"]}),q?b!=null&&b.certificate_number?e.jsxs(e.Fragment,{children:[e.jsxs(o,{onClick:()=>Z(b),disabled:G,className:"bg-green-600 hover:bg-green-700 w-full sm:w-auto gap-2",children:[G?e.jsx(C,{className:"w-4 h-4 animate-spin"}):e.jsx(Ee,{className:"w-4 h-4"}),"Baixar Certificado"]}),e.jsxs(o,{variant:"outline",onClick:()=>je(b),disabled:O,className:"w-full sm:w-auto gap-2",children:[O?e.jsx(C,{className:"w-4 h-4 animate-spin"}):e.jsx(ve,{className:"w-4 h-4"}),"Receber Certificado por e-mail"]})]}):e.jsxs(o,{onClick:ge,disabled:z,className:"bg-green-600 hover:bg-green-700 w-full sm:w-auto gap-2",children:[z?e.jsx(C,{className:"w-4 h-4 animate-spin"}):e.jsx(Ce,{className:"w-4 h-4"}),"Gerar Certificado"]}):e.jsxs(o,{onClick:Ke,className:"w-full sm:w-auto",children:[e.jsx(pa,{className:"w-4 h-4 mr-2"}),"Tentar Novamente"]}),e.jsx(o,{variant:"ghost",className:"w-full sm:w-auto",onClick:()=>n(`/aluno/curso/${t}/aula`),children:"Voltar ao Curso"})]})]}),q&&e.jsx("div",{className:"mt-8",children:e.jsxs(E,{children:[e.jsxs(A,{children:[e.jsx(R,{children:"Avalie este Curso"}),e.jsx(F,{children:"Compartilhe sua experiência para ajudar outros alunos."})]}),e.jsx(M,{children:w?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center gap-1",children:[1,2,3,4,5].map(a=>e.jsx(I,{className:V("w-6 h-6",a<=w.rating?"fill-yellow-400 text-yellow-400":"fill-muted text-muted")},a))}),e.jsxs("p",{className:"text-muted-foreground italic",children:['"',w.comment,'"']}),e.jsxs("p",{className:"text-sm font-medium text-primary",children:["Status: ",w.status==="pending"?"Aguardando Aprovação":w.status==="approved"?"Aprovado e Visível":"Rejeitado"]})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center gap-2 mb-2",children:[1,2,3,4,5].map(a=>e.jsx("button",{type:"button",onClick:()=>le(a),onMouseEnter:()=>Q(a),onMouseLeave:()=>Q(0),className:"focus:outline-none transition-transform hover:scale-110",children:e.jsx(I,{className:V("w-8 h-8 transition-colors",a<=(ce||D)?"fill-yellow-400 text-yellow-400 drop-shadow-sm":"fill-muted text-muted")})},a))}),e.jsx(Se,{placeholder:"O que você achou do curso? (Opcional)",value:H,onChange:a=>de(a.target.value),className:"resize-none",rows:3}),e.jsxs(o,{onClick:()=>t&&ne({courseId:t,rating:D,comment:H}),disabled:D===0||$,className:"w-full sm:w-auto",children:[$?e.jsx(C,{className:"w-4 h-4 animate-spin mr-2"}):e.jsx(I,{className:"w-4 h-4 mr-2"}),"Enviar Avaliação"]})]})})]})}),e.jsx(_e,{open:ie,onOpenChange:B,initialEmail:oe,onConfirm:be,isSending:O})]}):e.jsxs("div",{className:"min-h-screen bg-background pb-12 transition-colors duration-500",children:[e.jsx("header",{className:"border-b bg-card sticky top-0 z-10 shadow-sm",children:e.jsxs("div",{className:"container max-w-4xl mx-auto py-4 px-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(o,{variant:"ghost",size:"icon",onClick:()=>{x?_(!1):confirm("Sair da avaliação? Seu progresso será perdido.")&&n(`/aluno/curso/${t}/aula`)},children:e.jsx(ae,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"font-bold text-lg leading-tight",children:x?"Revisão da Avaliação":"Avaliação Final"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:i==null?void 0:i.title})]})]}),e.jsxs("div",{className:"text-sm font-medium bg-muted px-3 py-1 rounded-full",children:[v+1," de ",L]})]}),e.jsx(la,{value:(v+1)/L*100,className:"h-2"})]})}),e.jsxs("main",{className:"container max-w-3xl mx-auto py-8 px-4 space-y-8",children:[x&&e.jsxs("div",{className:"bg-blue-50 border border-blue-200 text-blue-800 rounded-lg p-4 text-sm flex gap-3 items-center justify-between",children:[e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(se,{className:"h-5 w-5 shrink-0"}),e.jsx("p",{className:"font-medium",children:"Modo de Revisão: Veja as respostas corretas."})]}),e.jsx(o,{size:"sm",variant:"outline",onClick:()=>{_(!1)},children:"Voltar ao Resultado"})]}),p&&e.jsxs(E,{className:"overflow-hidden animate-in slide-in-from-right-4 duration-300",children:[e.jsx(A,{className:"bg-muted/30 pb-4",children:e.jsxs(R,{className:"text-lg font-semibold leading-relaxed flex gap-3",children:[e.jsx("span",{className:"bg-primary/10 text-primary w-8 h-8 rounded-full flex items-center justify-center text-sm shrink-0 mt-0.5 font-bold",children:v+1}),p.question_text]})}),e.jsx(M,{className:"pt-6",children:e.jsx(ta,{onValueChange:a=>
1fe(parseInt(a)),value:(we=y[p.id])==null?void 0:we.toString(),className:"space-y-3",children:p.options.map((a,s)=>{let m="flex items-start space-x-3 p-4 rounded-lg border transition-all ";if(x){const f=y[p.id]===s,g=p.correct_option_index===s;g?m+="bg-green-50 border-green-500 ring-1 ring-green-500":f&&!g?m+="bg-red-50 border-red-500 opacity-80":m+="opacity-50 border-transparent"}else{const f=y[p.id]===s;m+=f?"bg-primary/5 border-primary ring-1 ring-primary":"hover:bg-muted/50 border-transparent hover:border-border cursor-pointer"}return e.jsxs("div",{className:m,onClick:()=>!x&&fe(s),children:[e.jsx(ra,{value:s.toString(),id:`opt-${s}`,className:"mt-1",disabled:x}),e.jsxs(aa,{htmlFor:`opt-${s}`,className:V("text-base font-normal leading-relaxed flex-1",!x&&"cursor-pointer"),children:[a,x&&p.correct_option_index===s&&e.jsxs("span",{className:"ml-2 text-xs font-bold text-green-600 flex items-center gap-1 inline-flex",children:[e.jsx(ee,{className:"w-3 h-3"})," Correta"]}),x&&y[p.id]===s&&p.correct_option_index!==s&&e.jsxs("span",{className:"ml-2 text-xs font-bold text-red-600 flex items-center gap-1 inline-flex",children:[e.jsx(Ae,{className:"w-3 h-3"})," Sua Resposta"]})]})]},s)})})}),e.jsxs(T,{className:"flex justify-between bg-muted/10 p-6",children:[e.jsxs(o,{variant:"outline",onClick:He,disabled:v===0,className:"w-32",children:[e.jsx(ae,{className:"w-4 h-4 mr-2"}),"Anterior"]}),x?e.jsx("div",{className:"flex gap-2",children:v<L-1?e.jsxs(o,{onClick:he,className:"w-32",children:["Próxima",e.jsx(ye,{className:"w-4 h-4 ml-2"})]}):e.jsx(o,{onClick:()=>{Y(!0),_(!1)},className:"w-32",children:"Finalizar"})}):e.jsx(o,{onClick:he,disabled:y[p.id]===void 0,className:"w-32 font-bold",children:v<L-1?e.jsxs(e.Fragment,{children:["Próxima",e.jsx(ye,{className:"w-4 h-4 ml-2"})]}):"Finalizar"})]})]},p.id)]})]})}export{Ma as default};

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.