2 lines
1.8 KiB
JavaScript
2 lines
1.8 KiB
JavaScript
import{u as o,j as e,b6 as d,n as x}from"./vendor-BKmmeuxg.js";import{C as l}from"./card-D9_SJYq6.js";import{B as i}from"./badge-AQfLLMpR.js";import"./utils-DxSsnXxD.js";import"./index-WW_1X1qx.js";const f=()=>{const{props:n}=o(),{questions:a}=n,c=s=>{const r={multiple_choice:"bg-blue-600",multiple_select:"bg-purple-600",matching:"bg-green-600",fill_blank:"bg-yellow-600",ordering:"bg-orange-600",short_answer:"bg-red-600",listening:"bg-pink-600"};return e.jsx(i,{className:r[s]||"bg-gray-600",variant:"default",children:s.replace("_"," ").replace(/\b\w/g,t=>t.toUpperCase())})};return e.jsx("div",{className:"space-y-4",children:a&&a.length>0?a.map((s,r)=>e.jsx(l,{className:"p-4",children:e.jsx("div",{className:"flex items-start justify-between gap-4",children:e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx(d,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs("span",{className:"text-sm font-semibold",children:["Question ",r+1]}),c(s.question_type),e.jsxs(i,{variant:"outline",children:[s.marks," marks"]})]}),e.jsx("p",{className:"text-base font-medium",children:s.title}),s.description&&e.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:s.description}),s.question_options&&s.question_options.length>0&&e.jsxs("div",{className:"mt-3 space-y-1",children:[e.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Options:"}),e.jsx("ul",{className:"text-muted-foreground ml-4 list-disc space-y-1 text-sm",children:s.question_options.map((t,m)=>e.jsxs("li",{children:[t.option_text||t.text||"Option",t.is_correct&&e.jsx(x,{className:"text-green-600 ml-1 inline h-3 w-3"})]},t.id||m))})]})]})})},s.id)):e.jsx(l,{className:"p-6 text-center",children:e.jsx("p",{className:"text-muted-foreground",children:"No questions available for this exam yet."})})})};export{f as default};
|