PageSourceSearch

https://simbound-demo.netlify.app/assets/Grading-RSQtfvOR.js

js simbound-demo.netlify.app collected 2026-10-03 11:25:53 UTC 28,278 bytes, 1 lines download raw bytes

1import{k as ye,g as me,u as He,v as De,a as Ie,d as Be,x as Me,j as e,M as fe}from"./index-C1k2hFQU.js";import{r as c,aw as xe,ax as Le,ar as Ee,ay as _e,az as le,aA as oe,aB as de,aC as Te,aD as Ae,s as be,aE as Re,aF as qe,aG as Fe,aH as Pe,aI as je,aa as X}from"./vendor-icons-CuibVgs-.js";import{u as Ke}from"./useGetStudentsGrading-DjDt6mOw.js";import{u as Ve}from"./useDownloadXLSX-DyyTPbZK.js";import{useRouteContext as Oe}from"./Layout-DnbsvrAQ.js";const ze=()=>{const s=ye.c(3),[r]=c.useState(!1),[n]=c.useState("");me();const d=Xe;let o;return s[0]!==n||s[1]!==r?(o={loading:r,error:n,renameBenchmark:d},s[0]=n,s[1]=r,s[2]=o):o=s[2],o};async function Xe(s,r){}const Ye=()=>{const s=ye.c(3),[r]=c.useState(!1),[n]=c.useState("");me();const d=Ue;let o;return s[0]!==n||s[1]!==r?(o={loading:r,error:n,deleteBenchmark:d},s[0]=n,s[1]=r,s[2]=o):o=s[2],o};async function Ue(s){}const Je=s=>!s||!Array.isArray(s)?[]:s.filter(r=>r.deleted==0).map(r=>{const{id:n,benchmark_name:d,benchmark_data:o,added_date:I}=r;let v={};try{v=JSON.parse(o||"{}")}catch{v={}}const{teams:_=[],statistics:f={},config:D={},ai_analysis:P}=v,{criteria:B=[]}=D,K=B.map(x=>({name:x.name,weight:x.weight,min_value:x.minValue,max_value:x.maxValue})),S=_.map(x=>{const g={};return B.forEach((w,M)=>{x.values&&x.values[M]!=null&&(g[w.name]=x.values[M])}),{team_id:x.team_id,student_id:x.name,course_id:x.course_id,final_grade:x.final_grade,status:x.status,criteria_values:g,students:x.students||[],breakdown:[]}}),G=[...new Set(S.map(x=>x.course_id).filter(Boolean))].length>1;return{id:n,name:d,created_at:I,config:{maxGrade:D.maxGrade,minGrade:D.minGrade,passGrade:D.passGrade,highHonorsGrade:D.highHonorsGrade},criteria:K,students:S,hasMultipleCourses:G,statistics:{total:f.total_teams||0,failed:f.failed||0,passed:f.passed||0,highHonors:f.high_honors||0},ai_analysis:P}}),rs=()=>{const{t:s}=He(),{accountType:r}=me(),{courseBenchmarks:n,fetchCourseBenchmarks:d,allCourses:o,fetchAllCourses:I}=De(),{addNotification:v,addActiveModal:_,removeActiveModal:f}=Ie(),{getStudentsGrading:D}=Ke(),{downloadXLSX:P}=Ve(),{loading:B,renameBenchmark:K}=ze(),{loading:S,deleteBenchmark:i}=Ye(),{openGradingModal:G}=Oe(),x=Be(),{courseId:g}=Me(),w=r.includes("instructor"),[M,V]=c.useState(null),[O,m]=c.useState(null),[A,y]=c.useState({}),[Y,k]=c.useState(null),[E,U]=c.useState({show:!1,benchmarkId:null,currentName:""}),[t,p]=c.useState(""),[b,h]=c.useState({show:!1,benchmarkId:null,benchmarkName:""}),u=c.useMemo(()=>{var a;return Je((a=n==null?void 0:n.data)==null?void 0:a.reverse())},[n.data]),$=c.useMemo(()=>{let a=0,l=0,N=0,L=0;return u.forEach(j=>{a+=j.statistics.total,l+=j.statistics.failed,N+=j.statistics.passed,L+=j.statistics.highHonors}),{totalBenchmarks:u.length,totalStudents:a,totalFailed:l,totalPassed:N,totalHighHonors:L,passRate:a?((N+L)/a*100).toFixed(1):0}},[u]),T=(a,l)=>{l.stopPropagation();const{name:N,created_at:L,config:j,criteria:ae,students:te,statistics:H,hasMultipleCourses:Ce}=a,C=te.map(R=>{var ge;const q={[s("team_name")]:R.student_id},$e=(ge=R.students)==null?void 0:ge.map(re=>re.user_name).join(", ");return q[s("team_members")]=$e||"-",Ce&&(q[s("course")]=ue(R.course_id)),q[s("final_grade")]=R.final_grade,q[s("status")]=R.status,ae.forEach(re=>{var pe;q[re.name]=((pe=R.criteria_values)==null?void 0:pe[re.name])??"-"}),q});C.push({}),C.push({[s("team_name")]:s("grading_configuration"),[s("final_grade")]:"",[s("status")]:""}),C.push({[s("team_name")]:s("minimum_grade"),[s("final_grade")]:j.minGrade,[s("status")]:""}),C.push({[s("team_name")]:s("maximum_grade"),[s("final_grade")]:j.maxGrade,[s("status")]:""}),C.push({[s("team_name")]:s("pass_grade"),[s("final_grade")]:j.passGrade,[s("status")]:""}),C.push({[s("team_name")]:s("high_honors_grade"),[s("final_grade")]:j.highHonorsGrade,[s("status")]:""}),C.push({}),C.push({[s("team_name")]:s("statistics"),[s("final_grade")]:"",[s("status")]:""}),C.push({[s("team_name")]:s("total_students"),[s("final_grade")]:H.total,[s("status")]:""}),C.push({[s("team_name")]:s("passed"),[s("final_grade")]:H.passed,[s("status")]:""}),C.push({[s("team_name")]:s("high_honors"),[s("final_grade")]:H.highHonors,[s("status")]:""}),C.push({[s("team_name")]:s("failed"),[s("final_grade")]:H.failed,[s("status")]:""});const Se=new Date(L).toISOString().split("T")[0],Ge=`${N.replace(/[^a-zA-Z0-9]/g,"_")}_${Se}`;P(C,Ge)},J=c.useCallback(async(a,l)=>{var ae,te;const N=`${a.id}_${l.team_id}`;if(A[N]){m(l.team_id);return}k(N);const L=JSON.stringify({max_grade:a.config.maxGrade,min_grade:a.config.minGrade,pass_grade:a.config.passGrade,high_honors_grade:a.config.highHonorsGrade,criteria:a.criteria.map(H=>({name:H.name,max_value:H.max_value,min_value:H.min_value,weight:H.weight})),team_id:l.team_id,team_info:{name:l.student_id,course_id:g,values:Object.values(l.criteria_values||{})}}),j=await D("detailed",L,!1,g);k(null),(ae=j==null?void 0:j.response)!=null&&ae.success&&((te=j==null?void 0:j.response)!=null&&te.data)&&(y(H=>({...H,[N]:j.response.data})),m(l.team_id))},[A,g,D]),Z=c.useCallback((a,l)=>{const N=`${a}_${l}`;return A[N]||null},[A]),Q=c.useCallback((a,l)=>Y==`${a}_${l}`,[Y]),W=a=>{V(M==a?null:a),m(null)},ee=a=>new Date(a).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),Ne=a=>{switch(a){case"High Honors":return"bg-lime-green/20 text-emerald-700 border-lime-green";case"Passed":return"bg-primary/10 text-primary-dark border-primary";case"Failed":return"bg-red-50 text-red-700 border-red-200";default:return"bg-gray-100 text-gray-600 border-gray-200"}};c.useEffect(()=>{w||x("/results/decisions")},[w]),c.useEffect(()=>{(!n.fetchTime||n.fetchTime&&n.course_id!=g)&&d(g)},[g,n,d]),c.useEffect(()=>{o!=null&&o.fetchTime||I()},[o==null?void 0:o.fetchTime,I]);const ue=c.useCallback(a=>{var N;if(!a)return"-";const l=(N=o==null?void 0:o.data)==null?void 0:N.find(L=>L.id==a);return(l==null?void 0:l.name)||`Course ${a}`},[o==null?void 0:o.data]),ve=(a,l)=>{l.stopPropagation(),_("rename-benchmark"),document.body.style.overflowY="hidden",U({show:!0,benchmarkId:a.id,currentName:a.name}),p(a.name)},z=()=>{f("rename-benchmark"),document.body.style.overflowY="auto",U({show:!1,benchmarkId:null,currentName:""}),p("")},he=async()=>
1{if(!t.trim()||B)return;if(t.trim()==E.currentName){z();return}const a=await K(E.benchmarkId,t.trim());a!=null&&a.error?v("warning",a.msg||s("error_occurred")):(v("success",s("benchmark_renamed")),d(g),z())},we=(a,l)=>{l.stopPropagation(),_("delete-benchmark"),document.body.style.overflowY="hidden",h({show:!0,benchmarkId:a.id,benchmarkName:a.name})},se=()=>{f("delete-benchmark"),document.body.style.overflowY="auto",h({show:!1,benchmarkId:null,benchmarkName:""})},ke=async()=>{if(S)return;const a=await i(b.benchmarkId);a!=null&&a.error?v("warning",a.msg||s("error_occurred")):(v("success",s("benchmark_deleted")),d(g),se(),M==b.benchmarkId&&V(null))};return e.jsxs("div",{children:[e.jsx("header",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4 mb-2",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-primary to-dark-turquoise flex items-center justify-center shadow-lg",children:e.jsx(xe,{className:"text-2xl text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-primary-dark tracking-tight",children:s("grading_scores")}),e.jsx("p",{className:"text-sm text-gray-500",children:s("view_and_analyze_past_grades")})]})]}),e.jsxs("button",{onClick:G,className:"flex items-center gap-2 px-4 py-2.5 rounded-xl bg-gradient-to-r from-emerald-500 to-emerald-600 hover:from-emerald-600 hover:to-emerald-700 text-white font-medium shadow-md hover:shadow-lg transition-all",children:[e.jsx(Le,{className:"text-xl"}),s("new_grading_scale")]})]})}),e.jsxs("section",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-8",children:[e.jsx(F,{icon:e.jsx(Ee,{}),label:s("grading_scores"),value:$.totalBenchmarks,color:"from-primary to-dark-turquoise"}),e.jsx(F,{icon:e.jsx(_e,{}),label:s("total_graded"),value:$.totalStudents,color:"from-medium-turquoise to-primary-dark"}),e.jsx(F,{icon:e.jsx(le,{}),label:s("high_honors"),value:$.totalHighHonors,color:"from-lime-green to-strong-green"}),e.jsx(F,{icon:e.jsx(oe,{}),label:s("passed"),value:$.totalPassed,color:"from-primary to-primary-dark"}),e.jsx(F,{icon:e.jsx(de,{}),label:s("failed"),value:$.totalFailed,color:"from-red-400 to-red-600"}),e.jsx(F,{icon:e.jsx(Te,{}),label:s("pass_rate"),value:`${$.passRate}%`,color:"from-strong-green to-dark-turquoise"})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx(Ae,{className:"text-xl text-primary"}),e.jsx("h2",{className:"text-lg font-semibold text-primary-dark",children:s("grading_history")}),e.jsxs("span",{className:"px-3 py-1 text-xs font-medium bg-primary/10 text-primary rounded-full",children:[u.length," ",s("records")]})]}),u.map(a=>e.jsx(Ze,{benchmark:a,isExpanded:M==a.id,onToggle:()=>W(a.id),onExport:l=>T(a,l),onRename:l=>ve(a,l),onDelete:l=>we(a,l),formatDate:ee,getStatusColor:Ne,selectedStudent:O,setSelectedStudent:m,fetchDetailedBreakdown:J,getCachedBreakdown:Z,isLoadingDetailed:Q,getCourseNameById:ue,t:s},a.id))]}),e.jsxs(fe,{modal:{show:E.show,close:z},center:{class:"text-slate-700 max-w-md"},block_focus:!0,children:[e.jsxs("header",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold text-primary-dark",children:s("rename_benchmark")}),e.jsx("button",{className:"text-gray-500 hover:text-gray-400 transition-colors text-3xl disabled:opacity-30 disabled:cursor-not-allowed",onClick:z,disabled:B,children:e.jsx(be,{})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:s("benchmark_name")}),e.jsx("input",{type:"text",value:t,onChange:a=>p(a.target.value),onKeyDown:a=>a.key=="Enter"&&he(),className:"w-full px-4 py-2.5 rounded-lg border border-gray-200 custom-input-outline",placeholder:s("enter_benchmark_name")})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2.5",children:[e.jsx("button",{onClick:z,disabled:B,className:"w-full text-center btn-outline rounded-md disabled:opacity-30 disabled:cursor-not-allowed",children:s("cancel")}),e.jsx("button",{onClick:he,disabled:B||!t.trim(),className:"w-full text-center btn-primary rounded-md disabled:opacity-30 disabled:cursor-not-allowed",children:s("save")})]})]}),e.jsxs(fe,{modal:{show:b.show,close:se},center:{class:"text-slate-700 max-w-md"},block_focus:!0,children:[e.jsxs("header",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold text-red-600",children:s("delete_benchmark")}),e.jsx("button",{className:"text-gray-500 hover:text-gray-400 transition-colors text-3xl disabled:opacity-30 disabled:cursor-not-allowed",onClick:se,disabled:S,children:e.jsx(be,{})})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-600",children:s("delete_benchmark_warning")}),e.jsx("p",{className:"mt-3 p-3 bg-gray-100 rounded-lg font-medium text-primary-dark",children:b.benchmarkName})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2.5",children:[e.jsx("button",{onClick:se,disabled:S,className:"w-full text-center btn-outline rounded-md disabled:opacity-30 disabled:cursor-not-allowed",children:s("cancel")}),e.jsx("button",{onClick:ke,disabled:S,className:"w-full text-center bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded-md font-medium transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:s("delete_")})]})]})]})},F=({icon:s,label:r,value:n,color:d})=>e.jsxs("div",{className:"relative overflow-hidden rounded-xl bg-white border border-gray-100 p-4 shadow-sm hover:shadow-md transition-shadow group",children:[e.jsx("div",{className:`absolute -top-4 -right-4 w-16 h-16 rounded-full bg-gradient-to-br ${d} opacity-10 group-hover:opacity-20 transition-opacity`}),e.jsx("div",{className:`w-10 h-10 rounded-lg bg-gradient-to-br ${d} flex items-center justify-center text-white text-lg mb-3 shadow-sm`,children:s}),e.jsx("p",{className:"text-2xl font-bold text-primary-dark",children:n}),e.jsx("p",{className:"text-xs text-gray-500 font-medium uppercase tracking-wide",children:r})]}),Ze=({benchmark:s,isExpanded:r,onToggle:n,onExport:d,onRename:o,onDelete:I,formatDate:v,getStatusColor:_,selectedStudent:f,setSelectedStudent:D,fetchDetailedBreakdown:P,getCachedBreakdown:B,isLoadingDetailed:K,getCourseNameById:S,t:i})=>{const{config:G,criteria:x,students:g,statistics:w,ai_analysis:M,hasMultipleCourses:V}=s,O=c.useRef(null),[m,A]=c.useState(null),[y,Y]=c.useState(null),k=t=>{let p="asc";t==m&&y=="asc"&&(p="dsc"),Y(p),A(t)},E=f?B(s.id,f):null;c.useEffect(()=>{f&&E&&O.current&&setTimeout(()=>{var t;(t=O.current)==null||t.scrollIntoView({behavior:"smooth",block:"center"})},100)},[f,E]);const U=c.useMemo(()=>
1{if(!(g!=null&&g.length))return[];const t=[...g];return m?t.sort((p,b)=>{var $,T,J,Z,Q,W;let h,u;if(m=="student_name")h=(($=p.student_id)==null?void 0:$.toLowerCase())||"",u=((T=b.student_id)==null?void 0:T.toLowerCase())||"";else if(m=="course")h=((J=S(p.course_id))==null?void 0:J.toLowerCase())||"",u=((Z=S(b.course_id))==null?void 0:Z.toLowerCase())||"";else if(m=="final_grade")h=p.final_grade||0,u=b.final_grade||0;else if(m=="status"){const ee={"High Honors":3,Passed:2,Failed:1};h=ee[p.status]||0,u=ee[b.status]||0}else h=((Q=p.criteria_values)==null?void 0:Q[m])||0,u=((W=b.criteria_values)==null?void 0:W[m])||0;return typeof h=="string"&&typeof u=="string"?y=="asc"?h.localeCompare(u):u.localeCompare(h):y=="asc"?h-u:u-h}):t},[g,m,y,S]);return e.jsxs("div",{className:`rounded-2xl border-2 transition-all duration-300 overflow-hidden ${r?"border-primary bg-white shadow-lg":"border-gray-100 bg-white hover:border-primary/30 hover:shadow-md"}`,children:[e.jsxs("button",{onClick:n,className:"w-full p-5 flex items-center justify-between max-[500px]:flex-wrap gap-y-1.5 text-left focus:outline-none focus:ring-2 focus:ring-primary/20 focus:ring-inset",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:`w-12 h-12 rounded-xl hidden lg:flex items-center justify-center transition-colors ${r?"bg-gradient-to-br from-primary to-dark-turquoise text-white":"bg-primary/10 text-primary"}`,children:e.jsx(xe,{className:"text-xl"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-primary-dark text-base lg:text-lg",children:s.name}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[e.jsx(Re,{className:"text-base"}),v(s.created_at)]})]})]}),e.jsxs("div",{className:"flex items-center gap-4 md:gap-6",children:[e.jsxs("div",{className:"hidden md:flex items-center gap-0 lg:gap-4",children:[e.jsx(ce,{label:i("students"),value:w.total}),e.jsx(ce,{label:i("passed"),value:w.passed+w.highHonors,color:"text-strong-green"}),e.jsx(ce,{label:i("failed"),value:w.failed,color:"text-red-500"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{onClick:o,className:"flex items-center justify-center w-9 h-9 rounded-lg bg-primary/10 hover:bg-primary/20 text-primary transition-colors cursor-pointer",title:i("rename"),children:e.jsx(qe,{className:"text-lg"})}),e.jsx("div",{onClick:I,className:"flex items-center justify-center w-9 h-9 rounded-lg bg-red-50 hover:bg-red-100 text-red-600 transition-colors cursor-pointer",title:i("delete_"),children:e.jsx(Fe,{className:"text-lg"})}),e.jsxs("div",{onClick:d,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-orange-500 hover:bg-orange-600 text-white text-sm font-medium transition-colors cursor-pointer",title:i("_export"),children:[e.jsx(Pe,{className:"text-lg"}),e.jsx("span",{className:"hidden sm:inline",children:i("_export")})]})]}),e.jsx(je,{className:`hidden lg:block text-2xl text-gray-400 transition-transform duration-300 ${r?"rotate-180 text-primary":""}`})]})]}),r&&e.jsxs("div",{className:"border-t border-gray-100 animate-in slide-in-from-top-2 duration-300",children:[e.jsxs("div",{className:"p-5 bg-gradient-to-r from-primary/5 to-transparent",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-1 h-5 bg-primary rounded-full"}),e.jsx("h4",{className:"font-semibold text-primary-dark",children:i("grading_configuration")})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[e.jsx(ne,{label:i("maximum_grade"),value:G.maxGrade}),e.jsx(ne,{label:i("minimum_grade"),value:G.minGrade}),e.jsx(ne,{label:i("pass_grade"),value:G.passGrade}),e.jsx(ne,{label:i("high_honors_grade"),value:G.highHonorsGrade})]})]}),M?e.jsxs("section",{className:"bg-slate-50 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-1 h-5 bg-primary rounded-full"}),e.jsx("h4",{className:"font-semibold text-primary-dark",children:i("ai_analysis")})]}),e.jsx("p",{className:"text-sm text-slate-600 leading-relaxed",children:M})]}):null,e.jsxs("div",{className:"p-5 border-t border-gray-50",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-1 h-5 bg-lime-green rounded-full"}),e.jsx("h4",{className:"font-semibold text-primary-dark",children:i("grading_criteria")})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:x.map((t,p)=>e.jsxs("div",{className:"inline-flex flex-col sm:flex-row sm:items-center gap-1 sm:gap-2 px-3 py-2 rounded-xl bg-gradient-to-br from-primary/10 to-lime-green/10 border border-primary/20 hover:border-primary/40 transition-colors",children:[e.jsx("span",{className:"font-semibold text-primary-dark text-sm",children:t.name}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsxs("span",{className:"px-2 py-0.5 bg-primary text-white rounded-full font-medium",children:[t.weight,"%"]}),e.jsxs("span",{className:"text-gray-500 whitespace-nowrap",children:[t.min_value.toLocaleStr
1ing()," -"," ",t.max_value.toLocaleString()]})]})]},p))})]}),e.jsxs("div",{className:"p-5 border-t border-gray-50",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-1 h-5 bg-strong-green rounded-full"}),e.jsx("h4",{className:"font-semibold text-primary-dark",children:i("student_results")})]}),e.jsx("div",{className:"overflow-x-auto rounded-xl border border-gray-100",children:e.jsxs("table",{className:"w-full min-w-[600px]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-gradient-to-r from-primary-dark to-dark-turquoise text-white",children:[e.jsx("th",{className:"text-left py-3 px-4 font-semibold text-sm cursor-pointer hover:bg-white/10 focus:bg-white/20 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-lime-green transition-colors",onClick:()=>k("student_name"),onKeyDown:t=>(t.key=="Enter"||t.key==" ")&&k("student_name"),tabIndex:0,role:"columnheader","aria-sort":m=="student_name"?y=="asc"?"ascending":"descending":"none",children:e.jsxs("div",{className:"flex items-center gap-0.5",children:[i("student"),m=="student_name"&&e.jsx(X,{className:"text-xl text-lime-green data-[direction=dsc]:rotate-180","data-direction":y})]})}),V&&e.jsx("th",{className:"text-left py-3 px-4 font-semibold text-sm cursor-pointer hover:bg-white/10 focus:bg-white/20 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-lime-green transition-colors",onClick:()=>k("course"),onKeyDown:t=>(t.key=="Enter"||t.key==" ")&&k("course"),tabIndex:0,role:"columnheader","aria-sort":m=="course"?y=="asc"?"ascending":"descending":"none",children:e.jsxs("div",{className:"flex items-center gap-0.5",children:[i("course"),m=="course"&&e.jsx(X,{className:"text-xl text-lime-green data-[direction=dsc]:rotate-180","data-direction":y})]})}),e.jsx("th",{className:"text-center py-3 px-4 font-semibold text-sm cursor-pointer hover:bg-white/10 focus:bg-white/20 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-lime-green transition-colors",onClick:()=>k("final_grade"),onKeyDown:t=>(t.key=="Enter"||t.key==" ")&&k("final_grade"),tabIndex:0,role:"columnheader","aria-sort":m=="final_grade"?y=="asc"?"ascending":"descending":"none",children:e.jsxs("div",{className:"flex items-center gap-0.5 justify-center",children:[i("final_grade"),m=="final_grade"&&e.jsx(X,{className:"text-xl text-lime-green data-[direction=dsc]:rotate-180","data-direction":y})]})}),e.jsx("th",{className:"text-center py-3 px-4 font-semibold text-sm cursor-pointer hover:bg-white/10 focus:bg-white/20 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-lime-green transition-colors",onClick:()=>k("status"),onKeyDown:t=>(t.key=="Enter"||t.key==" ")&&k("status"),tabIndex:0,role:"columnheader","aria-sort":m=="status"?y=="asc"?"ascending":"descending":"none",children:e.jsxs("div",{className:"flex items-center gap-0.5 justify-center",children:[i("status"),m=="status"&&e.jsx(X,{className:"text-xl text-lime-green data-[direction=dsc]:rotate-180","data-direction":y})]})}),x.map((t,p)=>e.jsx("th",{className:"text-center py-3 px-4 font-semibold text-sm whitespace-nowrap cursor-pointer hover:bg-white/10 focus:bg-white/20 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-lime-green transition-colors",onClick:()=>k(t.name),onKeyDown:b=>(b.key=="Enter"||b.key==" ")&&k(t.name),tabIndex:0,role:"columnheader","aria-sort":m==t.name?y=="asc"?"ascending":"descending":"none",children:e.jsxs("div",{className:"flex items-center gap-0.5 justify-center",children:[t.name,m==t.name&&e.jsx(X,{className:"text-xl text-lime-green data-[direction=dsc]:rotate-180","data-direction":y})]})},p))]})}),e.jsx("tbody",{children:U.map((t,p)=>{const b=K(s.id,t.team_id),h=f==t.team_id;return e.jsxs("tr",{className:`border-b border-gray-50 transition-colors ${h?"bg-primary/10":"hover:bg-gray-50"}`,children:[e.jsx("td",{className:"py-3 px-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>{h?D(null):P(s,t)},disabled:b,className:`w-7 h-7 rounded-lg text-xs font-medium transition-colors flex items-center justify-center shrink-0 ${h?"bg-primary text-white":"bg-gray-100 text-gray-600 hover:bg-primary/20 hover:text-primary"} ${b?"opacity-50 cursor-wait":""}`,title:i(h?"hide":"view_details"),children:b?e.jsx("span",{className:"w-4 h-4 border-2 border-gray-400 border-t-transparent roun
1ded-full animate-spin"}):e.jsx(je,{className:`transition-transform ${h?"rotate-180":""}`})}),e.jsx("span",{className:"font-medium text-gray-700",children:t.student_id})]})}),V&&e.jsx("td",{className:"py-3 px-4 text-gray-600 max-w-48 min-w-32",children:S(t.course_id)}),e.jsx("td",{className:"py-3 px-4 text-center",children:e.jsx("span",{className:"font-bold text-primary-dark text-lg",children:t.final_grade})}),e.jsx("td",{className:"py-3 px-4 text-center",children:e.jsxs("span",{className:`inline-flex items-center justify-center w-8 h-8 sm:w-auto sm:h-auto sm:px-2 sm:py-1 rounded-full text-xs font-semibold border ${_(t.status)}`,children:[t.status=="High Honors"&&e.jsx(le,{className:"text-xl sm:text-lg sm:mr-1"}),t.status=="Passed"&&e.jsx(oe,{className:"text-xl sm:text-lg sm:mr-1"}),t.status=="Failed"&&e.jsx(de,{className:"text-xl sm:text-lg sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:t.status})]})}),x.map((u,$)=>{var T;return e.jsx("td",{className:"py-3 px-4 text-center",children:e.jsx("span",{className:"text-sm text-gray-600",children:((T=t.criteria_values)==null?void 0:T[u.name])!=null?typeof t.criteria_values[u.name]=="number"?t.criteria_values[u.name].toLocaleString():t.criteria_values[u.name]:"-"})},$)})]},p)})})]})}),f&&e.jsx("div",{ref:O,children:e.jsx(Qe,{student:g.find(t=>t.team_id==f),breakdown:E,config:G,t:i})})]}),e.jsxs("div",{className:"p-5 border-t border-gray-50 bg-gradient-to-r from-gray-50 to-transparent",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-1 h-5 bg-medium-turquoise rounded-full"}),e.jsx("h4",{className:"font-semibold text-primary-dark",children:i("class_statistics")})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[e.jsx(ie,{label:i("total_students"),value:w.total,icon:e.jsx(_e,{}),color:"bg-gradient-to-br from-primary to-primary-dark"}),e.jsx(ie,{label:`${i("failed")} (< ${G.passGrade})`,value:w.failed,icon:e.jsx(de,{}),color:"bg-gradient-to-br from-red-400 to-red-600"}),e.jsx(ie,{label:`${i("passed")} (>= ${G.passGrade})`,value:w.passed,icon:e.jsx(oe,{}),color:"bg-gradient-to-br from-primary to-dark-turquoise"}),e.jsx(ie,{label:`${i("high_honors")} (>= ${G.highHonorsGrade})`,value:w.highHonors,icon:e.jsx(le,{}),color:"bg-gradient-to-br from-green-500 to-green-800"})]})]})]})]})},ce=({label:s,value:r,color:n="text-primary-dark"})=>e.jsxs("div",{className:"text-center px-3",children:[e.jsx("p",{className:`text-lg font-bold ${n}`,children:r}),e.jsx("p",{className:"text-xs text-gray-400 uppercase tracking-wide",children:s})]}),ne=({label:s,value:r})=>e.jsxs("div",{className:"p-3 rounded-lg bg-white border border-gray-100 shadow-sm",children:[e.jsx("p",{className:"text-xs text-gray-500 uppercase tracking-wide mb-1",children:s}),e.jsx("p",{className:"text-xl font-bold text-primary",children:r})]}),ie=({label:s,value:r,icon:n,color:d})=>e.jsxs("div",{className:"relative overflow-hidden rounded-xl p-4 text-white shadow-md",children:[e.jsx("div",{className:`absolute inset-0 ${d}`}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"text-3xl mb-2 opacity-80",children:n}),e.jsx("p",{className:"text-3xl font-bold",children:r}),e.jsx("p",{className:"text-xs font-medium mt-1",children:s})]})]}),Qe=({student:s,breakdown:r,config:n,t:d})=>{var I,v;if(!((I=r==null?void 0:r.breakdown)!=null&&I.length))return null;const o=r.breakdown;return e.jsxs("div",{className:"mt-4 p-5 rounded-xl bg-gradient-to-br from-primary-dark to-dark-turquoise text-white animate-in fade-in duration-300",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-white/20 flex items-center justify-center",children:e.jsx(xe,{className:"text-xl"})}),e.jsxs("div",{children:[e.jsx("h5",{className:"font-semibold",children:d("detailed_breakdown")}),e.jsx("p",{className:"opacity-90",children:r.team_name||(s==null?void 0:s.student_id)})]})]}),e.jsx("div",{className:"overflow-x-auto rounded-lg",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-white/10",children:[e.jsx("th",{className:"text-left py-2 px-3 text-sm font-semibold",children:d("criterion")}),e.jsx("th",{className:"text-center py-2 px-3 text-sm font-semibold",children:d("raw_value")}),e.jsx("th",{className:"text-center py-2 px-3 text-sm font-semibold",children:d("scaled_grade")}),e.jsx("th",{className:"text-center py-2 px-3 text-sm font-semibold",children:d("weight")}),e.jsx("th",{className:"text-center py-2 px-3 text-sm font-semibold",children:d("weighted_contribution")})]})}),e.jsx("tbody",{children:o.map((_,f)=>e.jsxs("tr",{className:"border-t border-white/10",children:[e.jsx("td",{className:"py-2 px-3 font-medium",children:_.criterion}),e.jsx("td",{className:"py-2 px-3 text-center opacity-80",children:typeof _.raw_value=="number"?_.raw_value.toLocaleStr
1ing():_.raw_value}),e.jsx("td",{className:"py-2 px-3 text-center",children:_.scaled_grade}),e.jsx("td",{className:"py-2 px-3 text-center opacity-80",children:_.weight}),e.jsx("td",{className:"py-2 px-3 text-center font-semibold",children:_.weighted_contribution})]},f))})]})}),e.jsxs("div",{className:`mt-4 p-4 rounded-lg text-white text-center ${r.status=="High Honors"?"bg-emerald-600":r.status=="Passed"?"bg-primary":r.status=="Failed"?"bg-red-700":"bg-primary"}`,children:[e.jsx("p",{className:"mb-1",children:d("final_grade")}),e.jsxs("p",{className:"text-2xl font-bold",children:[r.final_grade," /"," ",((v=r.config)==null?void 0:v.maxGrade)||(n==null?void 0:n.maxGrade)||10]}),r.status&&e.jsxs("p",{className:"mt-1 flex items-center justify-center gap-1",children:[r.status=="High Honors"&&e.jsx(le,{}),r.status=="Passed"&&e.jsx(oe,{}),r.status=="Failed"&&e.jsx(de,{}),r.status]})]})]})};export{rs 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.