Files
sm-bm-plugin/public/assets/quizzes-BiTjzhYv.js
Jakub Zych 85cae45cb9 build: frontend with Microsoft 365 sign-in
The student app's login page offers Microsoft 365 when the provider is
configured, /auth/oauth/callback redeems the one-time code, a consent
screen finishes a first sign-in, the profile attaches Microsoft through
a link ticket, and the service worker leaves /oauth alone. The build
also carries the summer presentation theme already committed in the
frontend sources.
2026-10-21 00:23:38 +02:00

2 lines
1.7 KiB
JavaScript

import{e as p}from"./format-bcE-cYHJ.js";import{d as z,n as o,c as a,F as c,B as h,b as d,p as u,t as n,e as _,z as q,f as l,N as r}from"./index-DmTksCHf.js";const y={class:"rows"},$={class:"row-main"},k={class:"title"},w=["aria-label"],f={key:1,class:"badge"},b={class:"muted small"},S=z({__name:"AttemptList",props:{attempts:{},showQuiz:{type:Boolean}},setup(e){const s=m=>`${Math.round(m.score_points)}/${Math.round(m.max_points)}`;return(m,g)=>(o(),a("ul",y,[(o(!0),a(c,null,h(e.attempts,t=>(o(),a("li",{key:t.id},[d("div",$,[d("span",k,[e.showQuiz?(o(),a(c,{key:0},[u(n(t.quiz_title),1)],64)):(o(),a(c,{key:1},[u(n(_(p)(t.started_at)),1)],64))]),t.completed_at?(o(),a("span",{key:0,class:q(["badge",t.passed?"online":""]),"aria-label":`Wynik ${s(t)}`},n(s(t)),11,w)):(o(),a("span",f,"niezakończona"))]),d("div",b,[e.showQuiz?(o(),a(c,{key:0},[u(n(_(p)(t.started_at))+" · ",1)],64)):l("",!0),t.category?(o(),a(c,{key:1},[u(n(t.category)+" · ",1)],64)):l("",!0),u(" odpowiedzi: "+n(t.answered_count),1),t.completed_at&&t.score_percent!==null?(o(),a(c,{key:2},[u(" · "+n(String(t.score_percent).replace(".",","))+"% puli",1)],64)):l("",!0)])]))),128))]))}}),i="/_quizzes/api/v1",T={list:e=>r.request(`${i}/quizzes`,{query:{context:e}}),quiz:(e,s)=>r.request(`${i}/quizzes/${encodeURIComponent(e)}`,{query:{category:s}}),start:(e,s)=>r.request(`${i}/quizzes/${encodeURIComponent(e)}/attempts`,{method:"POST",body:s?{category:s}:{}}),answer:(e,s)=>r.request(`${i}/attempts/${e}/answers`,{method:"POST",body:s}),finish:e=>r.request(`${i}/attempts/${e}/finish`,{method:"POST"}),attempt:e=>r.request(`${i}/attempts/${e}`),attempts:(e,s)=>r.raw(`${i}/attempts`,{query:{quiz:e,page:s}})};export{S as _,T as q};