1import{m as L,u as D,j as e}from"./vendor-react-CO7PoREX.js";import{A as x,t as s,d as h,C as w,f as y,g as S,h as I,E as Q,i as A,B as t}from"./index-pTXHG3cO.js";import{S as u}from"./skeleton-Bb3vIg_k.js";import{P as T}from"./progress-B_AuVipW.js";import{S as $}from"./separator-tkcRLFCn.js";import{c as q}from"./useExamHistory-BQYSR9PX.js";import{K as H,W as E,y as R,bI as j,F as V,bb as P,M as z,k as M}from"./vendor-icons-CbEPf7Uj.js";import"./vendor-query-BrmcFX9b.js";import"./profiles-CIcyqyE-.js";const ee=()=>{var g,p,b,N;const{attemptId:B}=L(),n=D(),{data:a,isLoading:F}=q(B);if(F)return e.jsx(x,{title:s("Carregando..."),subtitle:s("Buscando revisão do exame"),children:e.jsxs("div",{className:"max-w-3xl mx-auto space-y-6",children:[e.jsx(u,{className:"h-48 w-full"}),e.jsx(u,{className:"h-64 w-full"}),e.jsx(u,{className:"h-64 w-full"})]})});if(!a)return e.jsx(x,{title:s("Revisão não encontrada"),subtitle:"",children:e.jsxs("div",{className:"text-center py-12",children:[e.jsx(H,{className:"h-16 w-16 mx-auto mb-4 text-muted-foreground"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:s("Tentativa não encontrada.")}),e.jsx(h,{onClick:()=>n("/edu/historico"),children:s("Voltar ao Histórico")})]})});const i=a.result==="passed",d=a.result==="pending";return e.jsx(x,{title:s("Revisão do Exame"),subtitle:a.course_title||"Prova",children:e.jsxs("div",{className:"max-w-3xl mx-auto space-y-6",children:[e.jsxs(w,{className:d?"border-amber-500/50":i?"border-green-500/50":"border-red-500/50",children:[e.jsxs(y,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(S,{className:"flex items-center gap-2",children:[d?e.jsx(E,{className:"h-5 w-5 text-amber-500"}):i?e.jsx(R,{className:"h-5 w-5 text-green-500"}):e.jsx(j,{className:"h-5 w-5 text-red-500"}),d?s("Aguardando Correção"):i?s("Aprovado"):s("Reprovado")]}),e.jsx(I,{children:a.submitted_at&&`Realizada em ${new Date(a.submitted_at).toLocaleDateString(Q(),{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"})}`})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("p",{className:"text-3xl font-bold",children:[(a.score_pct||0).toFixed(0),"%"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a.grading_mode==="hybrid"&&d?s("Nota parcial"):s("Nota final")})]})]}),e.jsx(T,{value:a.score_pct||0,className:"mt-4 h-3",indicatorClassName:i?"bg-green-500":d?"bg-amber-500":"bg-red-500"})]}),e.jsx(A,{children:e.jsxs("div",{className:"grid grid-cols-3 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground",children:s("Questões")}),e.jsx("p",{className:"font-medium",children:((g=a.answers)==null?void 0:g.length)||0})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground",children:s("Acertos")}),e.jsx("p",{className:"font-medium text-green-600",children:((p=a.answers)==null?void 0:p.filter(r=>r.is_correct===!0).length)||0})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground",children:s("Erros")}),e.jsx("p",{className:"font-medium text-red-600",children:((b=a.answers)==null?void 0:b.filter(r=>r.is_correct===!1).length)||0})]})]})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[e.jsx(V,{className:"h-5 w-5"}),s("Revisão das Questões")]}),(N=a.answers)==null?void 0:N.map((r,f)=>{var k;const o=r.question_type==="essay",v=r.is_correct===!0,_=r.is_correct===!1,C=r.is_correct===null&&o;return e.jsxs(w,{className:C?"border-amber-200 dark:border-amber-800":v?"border-green-200 dark:border-green-800":_?"border-red-200 dark:border-red-800":"",children:[e.jsxs(y,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(t,{variant:"outline",children:["Questão ",f+1]}),o&&e.jsx(t,{variant:"secondary",children:s("Dissertativa")}),C?e.jsxs(t,{variant:"secondary",className:"bg-amber-500/10 text-amber-700",children:[e.jsx(E,{className:"w-3 h-3 mr-1"}),s("Aguardando")]}):v?e.jsxs(t,{className:"bg-green-500/10 text-green-700 border-green-200",children:[e.jsx(P,{className:"w-3 h-3 mr-1"}),s("Correta")]}):_?e.jsxs(t,{variant:"destructive",children:[e.jsx(j,{className:"w-3 h-3 mr-1"}),s("Incorreta")]}):null]}),e.jsxs("span",{className:"text-sm font-mono text-muted-foreground",children:[(r.awarded_points||0).toFixed(1)," pts"]})]}),e.jsx(S,{className:"text-base leading-relaxed mt-2",children:r.stem||"Questão"})]}),e.jsxs(A,{className:"space-y-3",children:[o?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:s("Sua resposta:")}),e.jsx("div",{className:"bg-muted p-3 rounded-lg text-sm whitespace-pre-wrap",children:r.free_text_answer||e.jsx("span",{className:"italic text-muted-foreground",children:s("Sem resposta")})})]}),r.grader_comment&&e.jsxs("div",{children:[e.jsxs("p",{className:"text-xs text-muted-foreground mb-1 flex items-center gap-1",children:[e.jsx(z,{className:"h-3 w-3"}),s("Comentário do professor:")]}),e.jsx("div",{className:"bg-blue-50 dark:bg-blue-950/30 p-3 rounded-lg text-sm border border-blue-200 dark:border-blue-800",children:r.grader_comment})]})]}):e.jsx("div",{className:"space-y-2",children:(k=r.options)==null?void 0:k.map(l=>{const m=r.selected_option_id===l.option_id,c=l.is_correct;return e.jsxs("div",{className:`flex items-center gap-3 p-3 rounded-lg border text-sm ${c?"border-green-300 bg-green-50 dark:bg-green-950/20 dark:border-green-800":m&&!c?"border-red-300 bg-red-50 dark:bg-red-950/20 dark:border-red-800":"border-border"}`,children:[e.jsxs("span",{className:"font-medium w-6",children:[l.o
1ption_label,")"]}),e.jsx("span",{className:"flex-1",children:l.option_text}),c&&e.jsx(P,{className:"h-4 w-4 text-green-600 shrink-0"}),m&&!c&&e.jsx(j,{className:"h-4 w-4 text-red-600 shrink-0"}),m&&e.jsx(t,{variant:"outline",className:"text-xs shrink-0",children:s("Sua resposta")})]},l.option_id)})}),r.explanation&&e.jsxs(e.Fragment,{children:[e.jsx($,{}),e.jsxs("div",{className:"bg-blue-50 dark:bg-blue-950/30 p-3 rounded-lg",children:[e.jsx("p",{className:"text-xs font-medium text-blue-700 dark:text-blue-300 mb-1",children:s("Explicação:")}),e.jsx("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:r.explanation})]})]})]})]},`${r.quiz_id}-${f}`)})]}),e.jsxs("div",{className:"flex justify-between pt-4",children:[e.jsxs(h,{variant:"outline",onClick:()=>n("/edu/historico"),children:[e.jsx(M,{className:"mr-2 h-4 w-4"}),s("Voltar ao Histórico")]}),i&&e.jsxs(h,{onClick:()=>n("/certificados"),children:[e.jsx(R,{className:"mr-2 h-4 w-4"}),s("Ver Certificados")]})]})]})})};export{ee 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.