PageSourceSearch

https://studykit.app/_nuxt/_id_.BoHJzR48.js

js studykit.app collected 2026-10-05 10:59:53 UTC 17,378 bytes, 10 lines download raw bytes

1function __vite__mapDeps(indexes) {
2  if (!__vite__mapDeps.viteFileDeps) {
3    __vite__mapDeps.viteFileDeps = ["./MediaDisplay.oIEK0tvy.js","./MediaDisplay.vue.BqlDVjMM.js","./entry.DrpYnreb.js","./entry.BSfEFN8L.css","./asyncData.DgbV1HUY.js","./helpers.GDsuqJk0.js"]
4  }
5  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
6}
7import{d as ne,r as x,a as oe,q as re,u as ae,p as $,s as ie,o as le,ad as ce,x as ue,f as r,g as a,h as e,z as Y,S as j,j as t,i as k,F as B,G as I,t as l,A as v,k as M,Q as de,R as pe,C as me,n as _e,E as O,W as fe,v as he,l as ge,_ as ve,Z as be}from"./entry.DrpYnreb.js";import{_ as xe}from"./SafeIcon.vue.r5tZHDcs.js";import{_ as ye}from"./RichTextRenderer.C5i9p1Bd.js";import{_ as ke}from"./TestFeedback.vue.Uu0mXygN.js";import{L as we,a as Ce,b as Te,c as qe,d as Re}from"./TestFillInTheBlank.u7kMXUIo.js";import"./SafeHtml.vue.VFZb6209.js";import"./StyledLink.vue.XQoYm1A5.js";import"./nuxt-link.7CWUUqGI.js";const Ae=ge(()=>ve(()=>import("./MediaDisplay.oIEK0tvy.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url).then(L=>L.default||L)),Pe={class:"grid min-h-screen",style:{"grid-template-columns":"1fr 4fr"}},Se={class:"max-h-screen bg-white border-r overflow-hidden grid",style:{"grid-template-rows":"1fr auto"}},Be={class:"overflow-auto overflow-y-auto scrollbar"},Ie={key:0},Ue={key:1},De=["onClick"],$e={key:0,class:"relative"},Le={class:"bg-kit-50 p-4 max-h-screen overflow-y-auto scrollbar space-y-8"},Ve=["id"],Fe={class:"bg-white p-8 shadow-sm rounded w-full"},Ne={key:1,class:"bg-rose-200 p-2 px-4 rounded my-2",id:"warning"},Ee={class:"flex justify-between mb-2 flex-col md:flex-row"},je={class:"text-gray-400"},ze={class:"space-x-2"},Ge={key:0,class:"text-sm text-blue-500"},Ye={key:1,class:"monospace text-gray-400 text-sm rounded border p-1"},Oe={key:2,class:"monospace animate-pulse text-gray-400 text-sm rounded border p-1"},Me={key:3,class:"monospace text-gray-400 text-sm rounded border p-1"},Je={class:"md:text-2xl text-lg font-medium whitespace-pre-line"},We={ref:"submitContainer",class:"min-h-screen flex items-center justify-center"},He={key:0,class:"bg-white p-8 shadow-sm rounded w-full space-y-4","vue-auto-animate":""},Ke={class:"text-2xl font-medium"},Ze={key:0,class:"grid md:grid-cols-2"},Xe={class:"col-span-2 flex flex-col justify-center items-center"},Qe=e("p",{class:"text-center"},[e("span",{class:"text-2xl"},"You're all done!"),e("br"),M("Double check your answers and click submit when you're ready.")],-1),et={class:"max-h-96 overflow-y-auto scrollbar"},tt={class:"w-full p-2 truncate"},st=["onClick"],nt={key:1,class:"text-center"},ot=["disabled"],rt={key:2,class:"space-y-4"},at={class:"space-y-4 text-center"},it={class:"flex justify-center gap-x-12"},lt={class:"flex flex-col justify-center items-center"},ct={class:"text-4xl font-bold"},ut=e("span",{class:"text-green-500"},"Points",-1),dt={key:0,class:"flex flex-col justify-center items-center"},pt={class:"text-4xl font-bold"},mt=e("span",{class:"text-gray-500"},"Awaitng Grading",-1),_t={class:"bg-kit-50 rounded p-4 max-w-xl mx-auto"},ft={key:1,class:"bg-white p-8 shadow-sm rounded w-full space-y-4","vue-auto-animate":""},ht={class:"grid md:grid-cols-2"},gt={key:0,class:"col-span-2 flex flex-col justify-center items-center"},vt={class:"text-center space-y-2"},bt={class:"text-2xl"},xt=e("br",null,null,-1),yt=e("br",null,null,-1),kt={key:1,class:"flex md:flex-row flex-col gap-2"},wt={key:1,class:"space-y-2"},Ct=e("h2",{class:"text-xl font-medium"},"Pending Questions",-1),Tt=e("p",null," All required questions must be graded before the response can be marked as graded. ",-1),qt={class:"max-h-96 overflow-y-auto scrollbar"},Rt={class:"w-full py-2 truncate"},At=["onClick"],Pt={class:"absolute z-20 bottom-0 w-full left-0 py-4 flex items-center justify-center bg-white"},St={key:1,class:"p-8 shadow-sm rounded w-full space-y-2"},Bt=e("h1",{class:"text-2xl font-medium"},"Responses",-1),It=e("p",{class:"text-gray-400"},"Select a test response to view",-1),Ut={key:0,class:"flex items-center gap-2"},Dt=e("option",{value:"",disabled:"",selcted:""},"Bulk Action",-1),$t=e("option",{value:"release"},"Release",-1),Lt=e("option",{value:"unrelease"},"Unrelease",-1),Vt=e("option",{value:"delete"},"Delete",-1),Ft=[Dt,$t,Lt,Vt],Nt={key:1,class:"table-auto w-full text-left border-separate border-spacing-2"}
7,Et=e("thead",null,[e("tr",null,[e("th",null,"User"),e("th",null,"Submitted"),e("th",null,"Points Earned"),e("th",null,"Status"),e("th",null,"Released"),e("th",null,"Actions")])],-1),jt={class:"divide-y"},zt={class:"text-gray-400"},Gt={key:0,class:"text-gray-400"},Yt={key:1,class:"text-gray-400"},Ot={class:"text-gray-400"},Mt=["onChange"],Jt=be('<option value="" disabled selected>Action</option><option value="grade">Grade</option><option value="release">Release</option><option value="unrelease">Unrelease</option><option value="delete">Delete</option>',5),Wt=[Jt],Ht=["onClick"],Kt={key:2},rs=ne({__name:"[id]",setup(L){const V=x(null),w=oe(),g=me(),C=re().$db(),J=ae(),R=x(w.params.id||"new"),y=x(!1),W={"multiple-choice":we,"free-response":Ce,matching:Te,"true-or-false":qe,"fill-in-the-blank":Re},d=x([]),H=$(()=>{const o=[];return d.value.forEach((s,i)=>{s.component.required&&(m.value[i]===null||m.value[i]==="pending")&&o.push(i)}),o}),F=x([]),m=x([]),p=$(()=>m.value.length===0?{points:0,maxPoints:0,pendingPoints:0}:{points:m.value.reduce((o,s)=>s===null||s==="pending"?o:o+s,0),maxPoints:d.value.reduce((o,s)=>
7s.component.required?o+s.component.points:o,0),pendingPoints:d.value.reduce((o,s,i)=>(m.value[i]===null||m.value[i]==="pending")&&d.value[i].component.required?o+s.component.points:o,0)}),K=$(()=>{if(p.value.pendingPoints>0)return{main:"✍️ Here's a preview of your score! Your score will be updated once all questions are graded.",seeInsightCTA:null};const o=p.value.points/(p.value.maxPoints-p.value.pendingPoints)*100;return o>=100?{main:"🥳 Perfect score! You've demonstrated an exceptional understanding of this material. Fantastic work",seeInsightCTA:"See How You've Improved",grade:"A+"}:o>=90?{main:"👏 Great job! You've shown a strong grasp of this material. Just a few small hiccups. Keep up the good work!",seeInsightCTA:"Tips For Improvement",grade:"A"}:o>=80?{main:"👍 Well done! You have a good understanding, but there's room to grow even stronger.",seeInsightCTA:"Tips For Improvement",grade:"B"}:o>=70?{main:"👌 Good job! You've got a solid foundation, but there's opportunity for improvement. Take a closer look at your insights to see where you can make progress",seeInsightCTA:"Tips For Improvement",grade:"C"}:o>=60?{main:"🌱 You're making strides! Recognize that every step counts. Let's work together to build on this and aim for even greater understanding!",seeInsightCTA:"Tips For Improvement",grade:"D"}:{main:"🌟 Let's pinpoint areas where we can strengthen your understanding and work towards improvement together!",seeInsightCTA:"Tips For Improvement"}}),b=x(0);let U=!1;const A=o=>{const s=document.getElementById("q"+o.toString());U||s&&setTimeout(()=>{s.scrollIntoView({behavior:"smooth"}),U=!0,setTimeout(()=>{U=!1},300)},0)},c=x([]);let z="[]",_=-1;const N=async o=>{const s=c.value[o];_=o,d.value=s.questions,F.value=s.answers,m.value=s.points_earned_breakdown,z=JSON.stringify(c.value[o]),await he(),Q()},Z=async()=>{_!==-1&&_!==c.value.length-1&&(await P(),N(_+1))},P=async(o=!1)=>{if(_===-1)return o?void 0:_e(`/tracks/${w.params.track_id}`);if(y.value){const{isConfirmed:s}=await g.fire({title:"Save Response Feedback?",text:"Would you like to save your feedback?",icon:"question",showCancelButton:!0,confirmButtonText:"Save",cancelButtonText:"Discard",confirmButtonColor:"#3085d6",cancelButtonColor:"#d33"});if(s){const{error:i}=await C.from("test_submissions").update({questions:d.value,answers:F.value,points_earned_breakdown:m.value,pending:c.value[_].pending}).eq("user_id",c.value[_].user_id).eq("test_id",c.value[_].test_id).eq("created_at",c.value[_].created_at);if(i){g.fire({icon:"error",title:"Unable to save response",text:i.message});return}}else c.value[_]=JSON.parse(z)}_=-1,d.value=[],b.value=-1,V.value=null,ee()},S=x(""),G=async o=>{if(await P(!0),o==="delete"){const{isConfirmed:i}=await g.fire({title:"Delete All Responses?",text:"Are you sure you want to delete all responses? This action cannot be undone.",icon:"warning",showCancelButton:!0,confirmButtonText:"Delete",cancelButtonText:"Cancel",confirmButtonColor:"#d33",cancelButtonColor:"#3085d6",focusCancel:!0});if(!i)return;const{error:h}=await C.from("test_submissions").delete().eq("test_id",R.value).eq("track_id",w.params.track_id);if(h){g.fire({icon:"error",title:"Unable to delete responses",text:h.message});return}c.value=[];return}const{error:s}=await C.from("test_submissions").update({released:o==="release"}).eq("track_id",w.params.track_id).eq("test_id",R.value);if(s){g.fire({icon:"error",title:"Unable to release responses",text:s.message});return}c.value.forEach(i=>i.released=o==="release"),g.fire({icon:"success",title:`All Responses ${o==="release"?"Released":"Unreleased"}`,toast:!0,timer:3e3,timerProgressBar:!0,position:"top-right"})},X=async(o,s)=>{if(o==="grade"){N(s);return}if(o==="delete"){const{isConfirmed:h}=await g.fire({title:"Delete Response?",text:"Are you sure you want to delete this response? This action cannot be undone.",icon:"warning",showCancelButton:!0,confirmButtonText:"Delete",cancelButtonText:"Cancel",confirmButtonColor:"#d33",cancelButtonColor:"#3085d6",focusCancel:!0});if(!h)return;const{error:q}=await C.from("test_submissions").delete().eq("test_id",R.value).eq("track_id",w.params.track_id).eq("user_id",c.value[s].user_id
7).eq("created_at",c.value[s].created_at);if(q){g.fire({icon:"error",title:"Unable to delete response",text:q.message});return}c.value.splice(s,1);return}const{error:i}=await C.from("test_submissions").update({released:o==="release"}).eq("track_id",w.params.track_id).eq("test_id",R.value).eq("user_id",c.value[s].user_id).eq("created_at",c.value[s].created_at);if(i){g.fire({icon:"error",title:"Unable to release response",text:i.message});return}c.value[s].released=o==="release",g.fire({icon:"success",title:`Response ${o==="release"?"Released":"Unreleased"}`,toast:!0,timer:3e3,timerProgressBar:!0,position:"top-right"})};ie(p,()=>{_!==-1&&(p.value.pendingPoints===0?c.value[_].pending=!1:c.value[_].pending=!0)});const E=$(()=>c.value.filter(o=>o.pending).length);le(async()=>{var q;const{data:o,error:s}=await C.from("test_submissions").select(`
8            *,
9            user: user_id (username)
10        `).eq("track_id",w.params.track_id).eq("test_id",R.value);if(s){g.fire({icon:"error",title:"Unable to load test",text:s.message});return}c.value=o;const{data:i,error:h}=await C.from("tests").select("user_id").eq("id",R.value).maybeSingle();if(h){g.fire({icon:"error",title:"Unable to load test",text:h.message}),console.error(h);return}(i==null?void 0:i.user_id)===((q=J.value.data)==null?void 0:q.id)&&(y.value=!0)}),ce(async()=>{await P()});let T=null;const Q=async()=>{T=new IntersectionObserver(s=>{s.forEach(i=>{if(i.isIntersecting&&!U){const h=parseInt(i.target.id.split("q")[1]);if(isNaN(h))return;b.value=h}})},{threshold:.5}),document.querySelectorAll("[id]").forEach(s=>{T==null||T.observe(s)})},ee=()=>{T&&(T.disconnect(),T=null)};return(o,s)=>{const i=xe,h=Ae,q=ye,te=ke,se=ue("auto-animate");
10return r(),a("div",Pe,[e("aside",Se,[Y((r(),a("ul",Be,[e("button",{class:j([{"bg-kit-500 text-white":t(b)===-1},"p-4 w-full hover:bg-kit-500 hover:text-white transition-colors cursor-pointer border-b truncate group relative flex gap-2 items-center"]),onClick:s[0]||(s[0]=n=>P())},[k(i,{icon:t(d).length===0?"tabler:x":"tabler:chevron-left",class:"inline-block"},null,8,["icon"]),t(d).length===0?(r(),a("span",Ie,"Exit")):(r(),a("span",Ue,"Back"))],2),(r(!0),a(B,null,I(t(d),(n,u)=>(r(),a("button",{onClick:f=>A(u),class:j([{"bg-kit-500 text-white":t(b)===u,"text-gray-400":n.question.trim().length===0},"p-4 cursor-pointer border-b truncate group relative w-full text-left"])},l(n.question.length>0?n.question:"Unamed Question"),11,De))),256))])),[[se]])]),t(d).length>0?(r(),a("section",$e,[e("main",Le,[(r(!0),a(B,null,I(t(d),(n,u)=>(r(),a("div",{class:"min-h-screen flex items-center justify-center",id:"q"+u},[e("section",Fe,[n.mediaURL?(r(),O(h,{key:0,src:n.mediaURL,class:"w-full mb-4 fadeIn"},null,8,["src"])):v("",!0),t(V)?(r(),a("p",Ne,l(t(V)),1)):v("",!0),e("aside",Ee,[e("p",je,"Question "+l(u+1)+" of "+l(t(d).length),1),e("p",ze,[n.component.required?(r(),a("span",Ge,"Required")):v("",!0),t(m)[u]===null?(r(),a("span",Ye,l(n.component.points)+" point"+l(n.component.points===1?"":"s"),1)):t(m)[u]==="pending"?(r(),a("span",Oe," Pending ")):(r(),a("span",Me,l(t(m)[u].toFixed(2).replace(/[.,]00$/,""))+"/"+l(n.component.points),1))])]),e("h1",Je,l(n.question),1),k(q,{doc:n.description,"force-rich":""},null,8,["doc"]),(r(),O(fe(W[n.component.key]),{live:"","show-answers":!0,defaultAnswer:t(F)[u],"is-teacher-grading":t(y),modelValue:n.component,"onUpdate:modelValue":f=>n.component=f,question:n,points:t(m)[u]},null,8,["defaultAnswer","is-teacher-grading","modelValue","onUpdate:modelValue","question","points"])),k(te,{"is-manual":!0,"is-teacher-grading":t(y),modelValue:n.component,"onUpdate:modelValue":f=>n.component=f,defaultPoints:t(m)[u],"onUpdate:points":f=>t(m)[u]=f},null,8,["is-teacher-grading","modelValue","onUpdate:modelValue","defaultPoints","onUpdate:points"])])],8,Ve))),256)),e("aside",We,[t(d).length>0&&!t(y)?(r(),a("section",He,[e("h1",Ke,l(t(p).maxPoints===0?"Ready To Submit?":"Your Score"),1),t(p).maxPoints===0?(r(),a("div",Ze,[e("section",Xe,[k(i,{icon:"tabler:check",class:"text-4xl font-bold text-green-500"}),Qe]),e("section",null,[e("ul",et,[(r(!0),a(B,null,I(o.progress.requiredQuestionsLeft,n=>(r(),a("li",tt,[e("button",{onClick:u=>A(n),class:"border-b hover:border-kit-500 transition-colors w-full text-left"},l(t(d)[n].question),9,st)]))),256))])])])):v("",!0),t(p).maxPoints===0?(r(),a("aside",nt,[e("button",{disabled:!o.progress.readyToSubmit,onClick:s[1]||(s[1]=(...n)=>o.submitTest&&o.submitTest(...n)),class:"btn btn-kit"},"Submit",8,ot)])):v("",!0),t(p).maxPoints>0?(r(),a("section",rt,[e("div",at,[e("div",it,[e("div",lt,[e("span",ct,l(t(p).points.toFixed(2).replace(/[.,]00$/,""))+"/"+l(t(p).maxPoints),1),ut]),t(p).pendingPoints>0?(r(),a("div",dt,[e("span",pt,l(t(p).pendingPoints),1),mt])):v("",!0)]),e("p",_t,l(t(K).main),1)])])):v("",!0)])):(r(),a("section",ft,[e("div",ht,[t(p).pendingPoints===0?(r(),a("section",gt,[k(i,{icon:"tabler:check",class:"text-4xl font-bold text-green-500"}),e("p",vt,[e("span",bt,l(t(E)===0?"All Responses Graded!":"Ready To Grade Next Response?"),1),xt,M(" Pending Responses Left: "+l(t(E))+" ",1),yt,t(E)>0?(r(),a("button",{key:0,class:"btn btn-kit",onClick:Z}," Next Response ")):(r(),a("aside",kt,[e("button",{class:"btn btn-kit",onClick:s[2]||(s[2]=n=>G("release"))}," Release All Responses "),e("button",{class:"btn btn-gray",onClick:P}," Close Response ")]))])])):(r(),a("section",wt,[Ct,Tt,e("ul",qt,[(r(!0),a(B,null,I(t(H),n=>(r(),a("li",Rt,[e("button",{onClick:u=>A(n),class:"border-b hover:border-kit-500 transition-colors w-full text-left"},l(t(d)[n].question),9,At)]))),256))])]))])]))],512)]),e("aside",Pt,[t(b)>0||t(b)===-1?(r(),a("button",{key:0,class:"mx-2 btn text-white bg-kit-700 !text-xl !py-1.5 !px-3 !border-none",onClick:s[3]||(s[3]=n=>A(Math.sign(t(b))>0?t(b)-1:t(d).length-1))},[k(i,{icon:"tabler:chevron-left"}
10)])):v("",!0),t(b)<t(d).length-1?(r(),a("button",{key:1,class:"mx-2 btn text-white bg-kit-700 !text-xl !py-1.5 !px-3 !border-none",onClick:s[4]||(s[4]=n=>A(t(b)+1))},[k(i,{icon:"tabler:chevron-right"})])):v("",!0),t(b)===t(d).length-1?(r(),a("button",{key:2,class:"mx-2 btn text-white bg-kit-700 !text-xl !py-1.5 !px-3 !border-none",onClick:s[5]||(s[5]=(...n)=>o.scrollToSubmit&&o.scrollToSubmit(...n))},[k(i,{icon:"tabler:chevron-right"})])):v("",!0)])])):(r(),a("main",St,[Bt,It,t(y)?(r(),a("div",Ut,[Y(e("select",{"onUpdate:modelValue":s[6]||(s[6]=n=>pe(S)?S.value=n:null),class:"input !py-2"},Ft,512),[[de,t(S)]]),t(S)?(r(),a("button",{key:0,onClick:s[7]||(s[7]=n=>G(t(S))),class:"btn btn-kit"},"Apply")):v("",!0)])):v("",!0),t(c).length>0?(r(),a("table",Nt,[Et,e("tbody",jt,[(r(!0),a(B,null,I(t(c).sort((n,u)=>n.pending&&!u.pending?-1:!n.pending&&u.pending?1:new Date(u.created_at).getTime()-new Date(n.created_at).getTime()),(n,u)=>(r(),a("tr",null,[e("td",null,l(n.user.username),1),e("td",null,[e("div",zt,l(new Date(n.created_at).toLocaleString()),1)]),e("td",null,[n.pending?(r(),a("div",Gt,"Pending")):(r(),a("div",Yt,l(n.points_earned_breakdown.reduce((f,D)=>(f??0)+(D??0),0).toFixed(2).replace(/[.,]00$/,""))+"/"+l(n.questions.reduce((f,D)=>D.component.required?f+D.component.points:f,0)),1))]),e("td",null,[e("div",{class:j({"text-green-500 font-medium":!n.pending,"text-gray-400 font-medium":n.pending})},l(n.pending?"Pending":"Graded"),3)]),e("td",null,[e("div",Ot,l(n.released?"Yes":"No"),1)]),e("td",null,[t(y)?(r(),a("select",{key:0,onChange:f=>X(f.target.value,u),class:"btn btn-gray w-full"},Wt,40,Mt)):(r(),a("button",{key:1,onClick:f=>N(u),class:"btn btn-gray"},"View",8,Ht))])]))),256))])])):(r(),a("p",Kt,l(t(y)?"No responses yet":"There are no released responses yet. Check back soon!"),1))]))])}}});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.