1import{q as O,A as _,B as F,r as s,b as f,o as r,w as i,a,i as M,c as n,F as g,e as b,n as N,t as u,L as P,d as o,f as l,g as Q}from"./app-DFMywQeH.js";import{A as j}from"./AppLayout-N7yHjTE-.js";import{r as V,a as W}from"./BaseAlert-pB5-zJzh.js";import{R as X}from"./RedAlert-BJFHrf-F.js";import{S as E}from"./Skeleton-D5A-Ri-0.js";import{B as H}from"./Box-mr29KB-L.js";import{l as k}from"./index.m-DI45-rQC.js";import{_ as J}from"./Label-BGOgEGRd.js";import{S as K}from"./StickyTwoColumns-Dtm-MBPw.js";import{L as U}from"./LinkText-DiM8h1kk.js";import{M as Y}from"./MetricCard-9m7AwJev.js";import{S as L}from"./Section-CGoTZmfc.js";import{P as Z}from"./PrimaryButton-LXO9DGr1.js";import{_ as w}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./createLucideIcon-CbiM620t.js";import"./IconLogo-BWjhaVHj.js";import"./PremiumPlus-CIx7OfJd.js";import"./notedly-icon-DbWu2gcf.js";import"./SecondaryButton-BoTdGstA.js";import"./BaseButton-DVDEtT5S.js";import"./description-CuYjwT4H.js";import"./DialogModal-Bv7pGcKt.js";import"./ArrowRightIcon-DNTWyt5V.js";import"./utils-rPh-9sn7.js";import"./NewBadge-CNeUWcWa.js";const x=async e=>await O.get(k("api.quiz-attempt.show",e)).then(m=>m.data),ee=_({name:"AttemptRating",components:{Section:L},props:{quizAttempt:{type:Object}},setup(){return{satisfactions:[{label:"ð«",level:0},{label:"ð",level:2},{label:"ð¤©",level:4}]}},data(){return{satisfactionLevel:this.quizAttempt.satisfaction_level,form:F({satisfactionLevel:0})}},methods:{setSatisfactionLevel(){this.form.patch(k("quiz-attempt.update",this.quizAttempt.uuid),{preserveScroll:!0}),this.satisfactionLevel=this.form.satisfactionLevel}}}),te={class:"flex flex-row text-3xl items-center"},se=["disabled","onClick"];function oe(e,t,m,z,A,C){const c=s("Section");return r(),f(c,{title:"How was this Auto Grade?"},{default:i(()=>[a("div",te,[a("form",{onSubmit:t[0]||(t[0]=M((...d)=>e.setSatisfactionLevel&&e.setSatisfactionLevel(...d),["prevent"]))},[(r(!0),n(g,null,b(e.satisfactions,d=>(r(),n("button",{disabled:!e.quizAttempt.is_generated,class:N(["px-4 rounded-md",!e.quizAttempt.is_generated&&"cursor-not-allowed",e.satisfactionLevel!=null&&(e.satisfactionLevel===d.level?"saturate-100 clickable":"saturate-0")]),onClick:h=>e.form.satisfactionLevel=d.level,type:"submit"},u(d.label),11,se))),256))],32)])]),_:1})}const re=w(ee,[["render",oe]]),ae=_({name:"Show",components:{AttemptRating:re,PrimaryButton:Z,Section:L,MetricCard:Y,LinkText:U,Link:P,StickyTwoColumns:K,Label:J,Box:H,Skeleton:E,RedAlert:X,AppLayout:j,XCircleIcon:W,CheckCircleIcon:V},props:{quiz:{type:Object},attempt:{type:Object}},data(){return{attemptLive:this.attempt}},mounted(){Echo.channel(`attempts.${this.attempt.uuid}`).listen("QuizAttemptGraded",async e=>{this.attemptLive=await x(e.uuid)})},computed:{metadata(){return JSON.parse(this.attemptLive.metadata)},correctAnswers(){return this.answers.filter(e=>!!e)},answers(){return Object.values(this.metadata).map(e=>e.correct)}},methods:{letterGrade(e){if(e>=0&&e<=1){const t=[{min:.93,letter:"A",symbol:"+"},{min:.9,letter:"A"},{min:.87,letter:"A",symbol:"-"},{min:.83,letter:"B",symbol:"+"},{min:.8,letter:"B"},{min:.77,letter:"B",symbol:"-"},{min:.73,letter:"C",symbol:"+"},{min:.7,letter:"C"},{min:.67,letter:"C",symbol:"-"},{min:.63,letter:"D",symbol:"+"},{min:.6,letter:"D ð¢"},{min:.57,letter:"D",symbol:"- ð¢"},{min:0,letter:"F ð¤¢"}];for(const m of t)if(e>=m.min)return`${m.letter}${m.symbol||""}`}else return"Invalid input"}}}),ie={class:"text-secondary group px-3 py-4 bg-theme-secondary border border-color rounded-lg mb-8"},ne={key:0},le={key:1},me={key:2,class:"space-y-8"},de={class:"flex space-x-2 border border-color rounded-size p-4 md:p-6"},pe={key:0,class:"heading-sm mt-1 text-green-500 dark:text-green-400"},ue={key:1,class:"heading-sm mt-1 text-red-500 dark:text-red-400"},ce={class:"space-y-4"},fe={class:"heading-sm"},he={class:"text-secondary"},ye={key:0,class:"text-red-500 dark:text-red-400"},ve={class:"text-sm font-medium"},_e={class:"space-y-6"};function ge(e,t,m,z,A,C){const c=s("LinkText"),d=s("RedAlert"),h=s("Skeleton"),S=s("Box"),q=s("CheckCircleIcon"),$=s("XCircleIcon"),B=s("Label"),y=s("Section"),v=s("MetricCard"),R=s("AttemptRating"),I=s("PrimaryButton"),D=s("Link"),T=s("StickyTwoColumns"),G=s("AppLayout");return r(),f(G,{title:"Quiz Attempt"},{default:i(()=>[o(T,null,{secondary:i(()=>[a("div",_e,[o(y,{title:"We'd Love Feedback!"},{default:i(()=>t[7]||(t[7]=[a("p",{class:"text-secondary"}," We've released the Quizzes feature in beta, meaning we want to hear your feedback on it! If you like or dislike any of the generated quizzes or auto-grades, please let us know by rating below. ",-1)])),_:1}),o(y,{title:"Details"},{default:i(()=>[o(v,{isDanger:!1,title:e.attemptLive.is_generated?e.letterGrade(e.correctAnswers.length/e.answers.length):"",description:"Grade on exam",class:"lg:col-span-2"},null,8,["title"]),o(v,{isDanger:!1,title:e.attemptLive.is_generated?`${e.correctAnswers.length} / ${e.answers.length}`:"",description:"correct responses",class:"lg:col-span-2"},null,8,["title"])]),_:1}),o(R,{"quiz-attempt":e.attemptLive},null,8,["quiz-attempt"]),a("div",null,[o(D,{disabled:!e.attemptLive.is_generated||e.attemptLive.did_error,href:e.route("quiz.show",{quiz:e.quiz.uuid,taking:!0}),class:"w-full"},{default:i(()=>[o(I,{class:"w-full",disabled:!e.attemptLive.is_generated||e.attemptLive.did_error},{default:i(()=>t[8]||(t[8]=[l(" Retake Quiz ")])),_:1},8,["disabled"])]),_:1},8,["disabled","href"])])])]),default:i(()=>[a("div",ie,[!e.attemptLive.is_generated&&!e.attemptLive.did_error?(r(),n("span",ne,t[0]||(t[0]=[a("span",{class:"mr-2"},"â°",-1),l(" Grading â this may take 30 seconds... ")]))):(r(),n("span",le,[t[3]||(t[3]=a("span",{class:"mr-2"},"ð§",-1)),t[4]||(t[4]=l(" Return to the ")),o(c,{href:e.route("quiz.show",e.quiz.uuid)},{default:i(()=>t[1]||(t[1]=[l(" quiz attempts page ")])),_:1},8,["href"]),t[5]||(t[5]=l(" or to the ")),o(c,{href:e.route("summary.show",e.quiz.summary_uuid)},{default:i(()=>t[2]||(t[2]=[l(" original summary ")])),_:1},8,["href"]),t[6]||(t[6]=l(" that started it all. "))]))]),e.attemptLive.did_error?(r(),f(d,{key:0,title:"Oh no!",message:"We ran into an error while grading your quiz. Please retake the quiz."})):e.attemptLive.is_generated?(r(),n("div",me,[(r(!0),n(g,null,b(e.quiz.questions,p=>(r(),n("div",null,[a("div",de,[e.metadata[p.uuid].correct===!0?(r(),n("div",pe,[o(q,{class:"w-5 h-5"})])):(r(),n("div",ue,[o($,{class:"w-5 h-5"})])),a("div",ce,[a("div",fe,u(p.question),1),o(B,{class:"sr-only"},{default:i(()=>[l(u(p.question),1)]),_:2},1024),a("div",he,u(e.metadata[p.uuid].answer),1),e.metadata[p.uuid].correct!==!0?(r(),n("div",ye,[a("span",ve,u(e.metadata[p.uuid].comment),1)])):Q("",!0)])])]))),256))])):(r(),f(S,{key:1},{default:i(()=>[o(h)]),_:1}))]),_:1})]),_:1})}const Xe=w(ae,[["render",ge]]);export{Xe 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.