PageSourceSearch

https://exam.net/build/assets/chunk.DqxfHifhMhpb.js

js exam.net collected 2026-10-01 15:08:36 UTC 16,679 bytes, 4 lines download raw bytes

1var V=(m,e,d)=>new Promise((f,l)=>{var o=g=>{try{a(d.next(g))}catch(I){l(I)}},i=g=>{try{a(d.throw(g))}catch(I){l(I)}},a=g=>g.done?f(g.value):Promise.resolve(g.value).then(o,i);a((d=d.apply(m,e)).next())});import{w as pe,r as $,c as k,k as N,I as A,Q as t,q as p,H as B,s as x,A as w,v,u as b,y as u,z as _,x as C,J as K,K as ee,M as fe,a6 as he,C as _e,n as ge,D as ve}from"./chunk.CaKkpqnfqRp7.js";import{b as z,a as te}from"./chunk.DRC83bQkYTbv.js";import{j as ye,aB as xe,aP as Se,a1 as G,aj as we,w as be,a0 as q,c4 as X,c as ke,m as Ie,o as Be}from"./entry.BuXKX4_t9gqW.js";import{a as De}from"./chunk.DXoLqoRAi1wM.js";import{y as oe,t as n,I as L,a as T,S as Pe,P as $e,D as Ce}from"./chunk.CCfNaIAVhYqF.js";import{S as Ge}from"./chunk.D1UDEjTj3J1q.js";import{s as Ne}from"./chunk.fITB3rBeC9hl.js";import{a as Ee}from"./chunk.BzrbN2Gua0E8.js";import{s as Te}from"./chunk.DL-a_wA3_eAo.js";import{o as ze}from"./chunk.DHobIHYcYShQ.js";import{g as Ae}from"./chunk.BROV0gF-YYS2.js";import"./chunk.DMiigLJ6-phQ.js";import"./chunk.B6KHPqLJkpf7.js";import"./chunk.BW9eYjIvWPrD.js";import"./chunk.DhG69mGtnsbj.js";import"./chunk.DfUHRhp0hiQa.js";import"./chunk.Cb2vamYrWu7b.js";import"./chunk.D0oM7fm6J3rd.js";import"./chunk.vKmSb7iagUEM.js";import"./chunk.C9Cw7x6sFZ90.js";import"./chunk.D9Ig9rEoLPVN.js";const Le=`<svg viewBox="0 0 26 26" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g transform="translate(-2.000000, -2.000000)" fill-rule="nonzero" stroke="currentColor" stroke-width="3"> <circle cx="15" cy="15" r="11.5"></circle> </g> </g> </svg>
2`,He=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 21" fill="none"><g clip-path="url(#clip0_1411_52)"><path d="M17.5 3C18.8807 3 20 4.11929 20 5.5L20 16.9645C20 19.1917 17.3071 20.3071 15.7322 18.7322L4.26776 7.26776C2.69285 5.69285 3.80827 3 6.03553 3L17.5 3Z" fill="currentcolor"/></g><defs><clipPath id="clip0_1411_52"><rect width="20" height="20" fill="white" transform="translate(0 0.5)"/></clipPath></defs></svg>
3`,Me=m=>m.toLowerCase().replace(/\s+/g,""),Y=m=>{var e;return((e=m.name)==null?void 0:e.trim())||m.email||""},Ve="no-name",ae="no-email",E=ye("portfolio",()=>{const m=$([]),e=$([]),d=$([]),f=k(()=>e.value.map(s=>s.id)),l=k(()=>e.value.flatMap(s=>{var c;return(c=s.exams)!=null?c:[]})),o=$(null),i=$(!0),a=$([]),g=$(!1),I=k(()=>{const s=[...d.value].sort(),c=[...f.value].sort();return JSON.stringify(s)!==JSON.stringify(c)}),H=k(()=>{const s=new Map;return e.value.forEach(c=>{c.exams&&c.exams.forEach(r=>{r.students.forEach(h=>{var j,F,J,Q,W;const P=i.value?Me(h.name||Ve):h.email||ae;s.has(P)||s.set(P,{name:h.name,email:h.email||null,dataByExamId:{}});const M=s.get(P);M&&(M.dataByExamId[r.id]||(M.dataByExamId[r.id]=[]),M.dataByExamId[r.id].push({student_id:h.id,points:(F=(j=h.score)==null?void 0:j.points)!=null?F:null,isHandedIn:h.isHandedIn,status:(Q=(J=h.score)==null?void 0:J.status)!=null?Q:"",updated_at:(W=h.updated_at)!=null?W:""}))})})}),s}),R=k(()=>Array.from(H.value.values()).sort((s,c)=>Se(Y(s),Y(c))));pe(()=>e.value,s=>{O(s)});function y(s,c){m.value=s,e.value=c,d.value=c.map(r=>r.id)}let S=!1,D=null;function O(s){return V(this,null,function*(){if(S){D=[...s];return}S=!0;try{for(const c of s)if(c.exams){for(const r of c.exams)if(!(!r.isBuilder||!r.examBuilderId))try{const{studentGrading:h}=yield De({examId:r.id,examBuilderId:r.examBuilderId});U(r,h)}catch(h){console.error(`Failed to auto-grade exam ${r.name} (ID: ${r.id}):`,h)}}}finally{if(S=!1,D){const c=D;D=null,yield O(c)}}})}function U(s,c){s.students.forEach(r=>{const h=c[r.id.toString()];if(h&&h.gradeIdPoints){const P=xe(h.gradeIdPoints);r.score?(r.score.points=P,r.score.status=h.status,r.score.isDirty=!1):r.score={status:h.status,isDirty:!1,points:P}}})}function ne(s){d.value=s}function re(s){d.value=s.value}function ie(){const s=new URL(window.location.href);s.searchParams.delete("group[]"),d.value.forEach(c=>{s.searchParams.append("group[]",c.toString())}),window.location.href=s.toString()}function le(s){o.value=s,me()}function de(){o.value=null,a.value=[]}function ue(){i.value=!i.value}function ce(s){for(const c of e.value)if(c.exams){for(const r of c.exams)if(r.students.find(P=>P.id===s))return{name:r.name,id:r.id}}return null}function me(){return V(this,null,function*(){if(!o.value){a.value=[];return}const s=Object.values(o.value.dataByExamId).flat().map(r=>r.student_id);if(s.length===0){a.value=[];return}const c=new URLSearchParams;
3s.forEach(r=>c.append("student_ids[]",r.toString())),g.value=!0;try{const r=yield fetch(`/api/portfolio/get-comments?${c.toString()}`,{method:"GET",headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}});if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);const h=yield r.json();a.value=h}catch(r){console.error("Failed to fetch student comments:",r),a.value=[]}finally{g.value=!1}})}return{allGroups:m,selectedGroups:e,newSelectedGroupIds:d,initialGroupIds:f,selectedStudent:o,groupByName:i,selectedStudentComments:a,loadingComments:g,hasSelectionChanged:I,groupedStudentDataMap:H,groupedStudentData:R,examData:l,setGroups:y,updateNewSelectedGroupIds:ne,handleGroupSelectionChange:re,updateSelection:ie,selectStudent:le,clearSelectedStudent:de,toggleGroupByName:ue,getExamInfoByStudentId:ce,checkAndTriggerAutoGrading:O,updateStudentScoresFromGrading:U}}),Re={key:1},se=N({__name:"PortfolioTableCell",props:{studentData:{},maxPoints:{},isAnonymized:{type:Boolean}},setup(m){const e=oe,d=E(),f=k(()=>{if(m.studentData.length===0)return{display:n("No exam"),tooltip:d.groupByName?n("No student has entered the exam with this name."):n("No student has entered the exam with this email."),color:"red"};if(m.isAnonymized)return{display:n("Anonymized"),tooltip:n("This exam is anonymized and identities have not been revealed. Please reveal identities to view the results."),color:"yellow"};if(m.studentData.length>1)return{display:n("Multiple entries"),tooltip:n("If multiple entries have occurred by mistake, you can delete the invalid submission from the monitoring/results view of the student submission."),color:"blue"};const{isHandedIn:l,status:o,points:i}=m.studentData[0];if(!l)return{display:n("Not submitted"),tooltip:n("This exam is still ongoing, or the student has failed to fully submit the exam. You can submit it for them from the monitoring view."),color:"yellow"};if(i===null)return{display:n("No score"),tooltip:n("This exam has not been marked or has no set score."),color:"yellow"};switch(o){case"graded":return{display:m.maxPoints?`${i}/${m.maxPoints}`:`${i}`};case"requires_manual_grading":return{display:m.maxPoints?`${i}/${m.maxPoints}*`:`${i}*`,tooltip:n("This student requires manual marking.")};case"not_graded":case"missing":case"error":return{display:n("No score"),tooltip:n("This exam has not been marked or has no set score."),color:"yellow"};default:return{display:"-"}}});return(l,o)=>f.value.color?A((p(),B(Ge,{key:0,text:f.value.display,color:f.value.color},null,8,["text","color"])),[[t(e),f.value.tooltip,void 0,{top:!0}]]):A((p(),x("span",Re,[w(v(f.value.display),1)])),[[t(e),f.value.tooltip,void 0,{top:!0}]])}}),Oe={class:"portfolio-table-header"},qe={class:"portfolio-table-header__title-group"},Ke={key:0,class:"portfolio-table-header__ungrouped-warning"},Ue=N({__name:"PortfolioTableHeader",setup(m){const e=E(),d=[{label:n("Identify via email"),value:!1},{label:n("Identify via name"),value:!0}],f=k(()=>{var a;if(e.groupByName)return 0;const o=e.groupedStudentDataMap.get(ae);if(!o)return 0;const{dataByExamId:i}=o;return(a=Object.values(i).flat().length)!=null?a:0});function l(o){e.groupByName=o.value}return(o,i)=>(p(),x("div",Oe,[b("div",qe,[u(G,{level:1,size:"large"},{default:_(()=>[w(v(t(n)("Group Results")),1)]),_:1}),!t(e).groupByName&&f.value>0?(p(),x("span",Ke,[u(L,{svg:t(we),width:"var(--width-3)",fill:"var(--yellow-500)"},null,8,["svg"]),b("span",null,v(t(n)("We found :num submissions with no email",{num:String(f.value)})),1)])):C("",!0)]),u(Ne,{modelValue:t(e).groupByName,"onUpdate:modelValue":i[0]||(i[0]=a=>t(e).groupByName=a),options:d,optionLabel:"label",optionValue:"value",placeholder:"Select grouping method",class:"portfolio-header__grouping-select",onChange:l},null,8,["modelValue"])]))}}),je=T(Ue,[["__scopeId","data-v-8f44f602"]]),Fe={class:"portfolio-table"},Je={class:"py-4 text-center"},Qe={class:"font-semibold"},We={class:"text-gray-600 text-sm"},Xe={class:"portfolio-table__column-title"},Ye={class:"portfolio-table__score"},Ze=N({__name:"PortfolioTable",setup(m){const e=E(),d=oe;return(f,l)=>(p(),x("div",Fe,[u(je),u(t(te),{value:t(e).groupedStudentData,selectionMode:"single",dataKey:t(e).groupByName?"name":"email",scrollable:"",onRowSelect:l[0]||(l[0]=o=>t(e).selectStudent(o.data))},{empty:_(()=>[b("div",Je,v(t(n)("No students found in this exam group.")),1)]),default:_(()=>[u(t(z),{field:"name",header:t(n)("Student"),frozen:"",style:{"min-width":"200px"}},{body:_(({data:o})=>[b("div",Qe,v(o.name),1),b("div",We,v(o.email),1)]),_:1},8,["header"]),(p(!0),x(K,null,ee(t(e).examData,o=>A((p(),B(t(z),{key:o.id,style:{"max-width":"var(--width-56)"}},{header:_(()=>[A((p(),x("div",Xe,[w(v(o.name),1)])),[[t(d),o.name.length>30?o.name:"",void 0,{top:!0}]])]),body:_(({data:i})=>{var a;return[b("div",Ye,[u(se,{studentData:(a=i.dataByExamId[o.id])!=null?a:[],isBuilder:o.isBuilder,maxPoints:o.maxPoints,isAnonymized:o.isAnonymized},null,8,["studentData","isBuilder","maxPoints","isAnonymized"])])]}),_:2},1024)),[[t(d),o.name]])),128))]),_:1},8,["value","dataKey"])]))}}),et=T(Ze,[["__scopeId","data-v-b1d9aa53"]]),tt={class:"portfolio-student-comments"},ot={key:1,class:"portfolio-student-comments__list"},at={key:0,class:"portfolio-student-comments__comment-container"},st={class:"portfolio-student-comments__comment-date"},nt={class:"portfolio-student-comments__comment-date"},rt=N({__name:"PortfolioStudentComments",setup(m){const e=E(),d=l=>{if(!l)return"";try{return new Date(l).toLocaleDateString(window.K$.locale.sv)}catch(o){return""}},f=l=>{const o=e.getExamInfoByStudentId(l.student_id);return o?l.question_id?n("Question comment from :exam",{exam:`<a target="_blank" href="/admin/exams/${o.id}">${o.name}</a>`}):n("Exam comment from :exam",{exam:`<a target="_blank" href="/admin/exams/${o.id}">${o.name}</a>`}):""};return(l,o)=>{const i=fe("sanitized-html");return p(),x("div",tt,[t(e).loadingComments?(p(),B(be,{key:0})):(p(),x("div",ot,[t(e).selectedStudentComments.length===0?(p(),x("div",at,[b("div",st,[u(q,{size:"medium",tag:"span"},{default:_(()=>[w(v(d(new Date().toDateString())),1)]),_:1}),u(L,{class:"portfolio-student-comments__comment-date-icon",svg:t(X),width:"var(--width-3)",height:"var(--height-3)"},null,8,["svg"])]),u(ke,{class:"portfolio-student-comments__empty",title:t(n)("This student log is empty"),subMessage:t(n)("No exam comments have been added to this student's exam.")},null,8,["title","subMessage"])])):(p(!0),x(K,{key:1},ee(t(e).selectedStudentComments,(a,g)=>(p(),x("div",{key:a.id,class:"portfolio-student-comments__comment-container"},[b("div",nt,[u(q,{size:"medium",tag:"span"},{default:_(()=>[w(v(d(a.created_at)),1)]),_:2},1024),u(L,{class:"portfolio-student-comments__comment-date-icon",svg:g===0?t(X):t(Le),width:"var(--width-3)",height:"var(--height-3)"},null,8,["svg"])]),u(Ee,{comment:a,viewOnly:"",hideDate:"",class:"portfolio-student-comments__comment"},{default:_(()=>[A(u(q,{class:"portfolio-student-comments__comment-exam",size:"large",tag:"span"},null,512),[[i,f(a)]])]),_:2},1032,["comment"])]))),128))]))])}}}),it=T(rt,[["__scopeId","data-v-f9d3d6e1"]]),lt={class:"portfolio-student"},dt={class:"portfolio-student__header"},ut={class:"py-4 text-center"},ct=N({__name:"PortfolioStudent",setup(m){const e=E(),d=k(()=>
3{if(!e.selectedStudent)return[];const l=e.selectedStudent,o=[];return e.examData.forEach(i=>{const a=l.dataByExamId[i.id]||[];o.push({examId:i.id,examName:i.name,isAnonymized:i.isAnonymized,studentData:a,isBuilder:i.isBuilder,maxPoints:i.maxPoints})}),o}),f=l=>{if(!l)return"";try{return new Date(l).toLocaleDateString(window.K$.locale.sv)}catch(o){return""}};return(l,o)=>{var i;return p(),x("div",lt,[b("div",dt,[u(G,{level:1,size:"large"},{default:_(()=>{var a,g;return[w(v((g=(a=t(e).selectedStudent)==null?void 0:a.name)!=null?g:t(n)("Student")),1)]}),_:1}),b("span",null,v((i=t(e).selectedStudent)==null?void 0:i.email),1)]),u(t(te),{value:d.value},{empty:_(()=>[b("div",ut,v(t(n)("No exam data found for this student.")),1)]),default:_(()=>[u(t(z),{field:"examName",header:t(n)("Exam")},null,8,["header"]),u(t(z),{field:"date",header:t(n)("Date")},{body:_(({data:a})=>{var g;return[a.studentData.length===1&&((g=a.studentData[0])!=null&&g.updated_at)?(p(),x(K,{key:0},[w(v(f(a.studentData[0].updated_at)),1)],64)):C("",!0)]}),_:1},8,["header"]),u(t(z),{field:"score",header:t(n)("Results"),style:{"min-width":"120px"}},{body:_(({data:a})=>[u(se,{studentData:a.studentData,isBuilder:a.isBuilder,maxPoints:a.maxPoints,isAnonymized:a.isAnonymized},null,8,["studentData","isBuilder","maxPoints","isAnonymized"])]),_:1},8,["header"])]),_:1},8,["value"]),u(it)])}}}),mt=T(ct,[["__scopeId","data-v-51403d18"]]),pt={class:"portfolio-header"},ft={class:"portfolio-header__breadcrumbs"},ht={class:"portfolio-header__breadcrumbs-groups"},_t={key:0,class:"portfolio-header__select-footer"},Z=15,gt=N({__name:"PortfolioHeader",setup(m){const e=E(),d=he("groupSelect"),f=()=>V(null,null,function*(){var y;e.hasSelectionChanged&&(yield ge(),(y=d.value)==null||y.show())}),l=()=>{var y;e.updateNewSelectedGroupIds(e.initialGroupIds),(y=d.value)==null||y.hide()},o=y=>y.title.length>Z?y.title.slice(0,Z)+"...":y.title,i=k(()=>e.selectedGroups.length===1?e.selectedGroups[0].title:n(":num Groups",{num:String(e.selectedGroups.length)})),a=k(()=>e.selectedGroups.length===1),g=k(()=>{if(a.value){const y=e.allGroups.find(S=>S.id===e.selectedGroups[0].id);if(y&&y.color)return Ae(y.color)}}),I=k(()=>!!e.selectedStudent),H=()=>{window.location.href="/admin/exams"},R=()=>{I.value&&e.clearSelectedStudent()};return(y,S)=>(p(),x("div",pt,[b("div",ft,[u(G,{class:"portfolio-header__breadcrumbs-title",size:"small",level:3,onClick:H},{default:_(()=>[u(L,{svg:t(ze),width:"var(--width-5)"},null,8,["svg"]),w(" "+v(t(n)("Exams")),1)]),_:1}),u(G,{class:"portfolio-header__breadcrumbs-spacer",size:"small",level:3},{default:_(()=>[...S[1]||(S[1]=[w(" >",-1)])]),_:1}),u(G,{class:_e(["portfolio-header__breadcrumbs-title",{isActive:!I.value}]),size:"small",level:3,onClick:R},{default:_(()=>[w(v(t(n)("Students in :group",{group:""}))+" ",1),b("span",ht,[a.value?(p(),B(L,{key:0,svg:t(He),width:"var(--width-3)",color:g.value},null,8,["svg","color"])):C("",!0),w(" "+v(i.value),1)])]),_:1},8,["class"]),I.value?(p(),B(G,{key:0,class:"portfolio-header__breadcrumbs-spacer",size:"small",level:3},{default:_(()=>[...S[2]||(S[2]=[w(" >",-1)])]),_:1})):C("",!0),I.value?(p(),B(G,{key:1,class:"isActive portfolio-header__breadcrumbs-title",size:"small",level:3},{default:_(()=>{var D;return[w(v(((D=t(e).selectedStudent)==null?void 0:D.name)||t(n)("Student Details")),1)]}),_:1})):C("",!0)]),I.value?C("",!0):(p(),B(Te,{key:0,ref_key:"groupSelect",ref:d,modelValue:t(e).newSelectedGroupIds,"onUpdate:modelValue":S[0]||(S[0]=D=>t(e).newSelectedGroupIds=D),options:t(e).allGroups,optionLabel:o,optionValue:"id",placeholder:"Select exam groups",display:"chip",class:"portfolio-header__select",maxSelectedLabels:3,onChange:t(e).handleGroupSelectionChange,onBeforeHide:f},{chipicon:_(()=>[...S[3]||(S[3]=[w(v(""),-1)])]),footer:_(()=>[t(e).hasSelectionChanged?(p(),x("div",_t,[u(Pe,{label:t(n)("Cancel"),class:"student-portfolio__cancel-button",onClick:l},null,8,["label"]),u($e,{label:t(n)("Update selection"),class:"student-portfolio__update-button",onClick:t(e).updateSelection},null,8,["label","onClick"])])):C("",!0)]),_:1},8,["modelValue","options","onChange"]))]))}}),vt=T(gt,[["__scopeId","data-v-06c0190a"]]),yt={key:1,class:"student-portfolio"},xt=N({__name:"StudentPortfolio",props:{allGroups:{},selectedGroups:{}},setup(m){const e=E(),{bookingUrl:d,isRestricted:f}=Ie(),l=f("portfolio");function o(){window.location.href="/admin/exams"}return ve(()=>{l||e.setGroups(m.allGroups,m.selectedGroups)}),(i,a)=>t(l)?(p(),B(Be,{key:0,visible:"",url:t(d),onHide:o},{actions:_(()=>[u(Ce,{primary:{label:t(n)("Back to exam list"),onAction:o}},null,8,["primary"])]),_:1},8,["url"])):(p(),x("div",yt,[u(vt),t(e).selectedStudent?(p(),B(mt,{key:0})):(p(),B(et,{key:1}))]))}}),qt=T(xt,[["__scopeId","data-v-4da56ea8"]]);export{qt as default};
4//# sourceMappingURL=chunk.DqxfHifhMhpb.js.map

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.