@citolab/qti-components 6.4.0 → 6.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunk4UAPG3LEcjs = require('./chunk-4UAPG3LE.cjs');var _chunkHYQC3D4Zcjs = require('./chunk-HYQC3D4Z.cjs');var _decoratorsjs = require('lit/decorators.js');var q=class extends _chunk4UAPG3LEcjs.a{connectedCallback(){super.connectedCallback();let t=new CustomEvent("register-item-ref",{bubbles:!0,composed:!0,detail:{identifier:this.identifier,href:this.href}});this.dispatchEvent(t)}};_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],q.prototype,"identifier",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],q.prototype,"href",2),q= exports.a =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "qti-assessment-item-ref")],q);var _lit = require('lit');var _context2 = require('@lit/context');var xt=class{},m= exports.c =_context2.createContext.call(void 0, "test");var _preactsignals = require('@lit-labs/preact-signals');var E=class extends _lit.LitElement{constructor(){super();this.itemIndex=0;this._initialValue={itemIndex:0,audienceContext:"candidate",items:[]};this.signalContext=_preactsignals.signal.call(void 0, this._initialValue);this.itemRefEls=new Map;this.restoreContext=t=>{var e;t||(t=this._initialValue),this.signalContext.value.itemIndex=t.itemIndex,(e=t.items)==null||e.forEach(r=>{let i=this.signalContext.value.items.find(c=>c.identifier===r.identifier);i?i.variables=r.variables:this.signalContext.value.items.push(r)})};this.itemConnected=t=>{let e=this.signalContext.value.items.find(r=>(r==null?void 0:r.identifier)===(t==null?void 0:t.identifier));e.variables.length===1?this.copyItemVariables(t.identifier):t.variables=[...e.variables]};this.addEventListener("register-item-ref",this.onItemRefRegistered),this.addEventListener("on-test-request-item",this.onTestRequestItem),this.addEventListener("qti-item-first-updated",t=>this.itemConnected(t.detail)),this.addEventListener("qti-interaction-changed",t=>this.copyItemVariables(t.detail.item)),this.addEventListener("qti-outcome-changed",t=>this.copyItemVariables(t.detail.item)),_preactsignals.effect.call(void 0, ()=>this._context=this.signalContext.value)}set context(t){console.log("set context",t),this.signalContext.value=t}updated(t){var e,r;if(t.has("_context")){let i=(e=t.get("_context"))==null?void 0:e.itemIndex;this.signalContext.value.items.length>0&&this.signalContext.value.itemIndex!==null&&i!==this.signalContext.value.itemIndex&&this._requestItem(this.signalContext.value.items[this.signalContext.value.itemIndex].identifier,(r=this.signalContext.value.items[i])==null?void 0:r.identifier)}t.has("audienceContext")&&(this._context=_chunkHYQC3D4Zcjs.b.call(void 0, _chunkHYQC3D4Zcjs.a.call(void 0, {},this._context),{audienceContext:this.audienceContext}),this.itemRefEls.forEach((i,c)=>i.audienceContext={view:this.audienceContext})),t.has("itemIndex")&&(this.signalContext.value=_chunkHYQC3D4Zcjs.b.call(void 0, _chunkHYQC3D4Zcjs.a.call(void 0, {},this.signalContext.value),{itemIndex:this.itemIndex}))}copyItemVariables(t){this.signalContext.value=_chunkHYQC3D4Zcjs.b.call(void 0, _chunkHYQC3D4Zcjs.a.call(void 0, {},this.signalContext.value),{items:this.signalContext.value.items.map(e=>e.identifier==t?_chunkHYQC3D4Zcjs.b.call(void 0, _chunkHYQC3D4Zcjs.a.call(void 0, {},e),{variables:this.getAssessmentItem(t).context.variables}):e)})}getAssessmentItem(t){return this.querySelector(`qti-assessment-item-ref[identifier="${t}"]`).assessmentItem}get currentAssessmentItem(){return this.querySelector(`qti-assessment-item-ref[identifier="${this.signalContext.value.items[this.signalContext.value.itemIndex].identifier}"]`).assessmentItem}onItemRefRegistered(t){this.itemRefEls.set(t.detail.identifier,t.target);let{href:e,identifier:r}=t.detail;this.signalContext.value.items=[...this.signalContext.value.items,{href:e,identifier:r,variables:[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"not_attempted",type:"outcome"}]}]}onTestRequestItem(t){t.stopImmediatePropagation(),t.detail!==this.signalContext.value.itemIndex&&(this.signalContext.value=_chunkHYQC3D4Zcjs.b.call(void 0, _chunkHYQC3D4Zcjs.a.call(void 0, {},this.signalContext.value),{itemIndex:t.detail}))}firstUpdated(t){if(super.firstUpdated(t),this.signalContext.value.items.length===0){console.warn("No items found in the test, please add at least one item");return}this._emit("qti-assessment-first-updated",this)}_requestItem(t,e){this.dispatchEvent(new CustomEvent("on-test-set-item",{bubbles:!0,composed:!0,detail:{old:e,new:t}}))}_emit(t,e=null){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}render(){return _lit.html`<slot></slot>`}};_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String,reflect:!0,attribute:"audience-context"})],E.prototype,"audienceContext",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:Number,reflect:!0,attribute:"item-index"})],E.prototype,"itemIndex",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],E.prototype,"identifier",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.provide.call(void 0, {context:m}),_decoratorsjs.property.call(void 0, {attribute:!1})],E.prototype,"_context",2),E= exports.d =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "qti-assessment-test")],E);var $=class extends _lit.LitElement{constructor(){super(...arguments);this.loading=!1;this._navigationMode="linear"}render(){return _lit.html`
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunk7FZSQALEcjs = require('./chunk-7FZSQALE.cjs');var _chunkHYQC3D4Zcjs = require('./chunk-HYQC3D4Z.cjs');var _decoratorsjs = require('lit/decorators.js');var q=class extends _chunk7FZSQALEcjs.a{connectedCallback(){super.connectedCallback();let t=new CustomEvent("register-item-ref",{bubbles:!0,composed:!0,detail:{identifier:this.identifier,href:this.href}});this.dispatchEvent(t)}};_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],q.prototype,"identifier",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],q.prototype,"href",2),q= exports.a =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "qti-assessment-item-ref")],q);var _lit = require('lit');var _context2 = require('@lit/context');var xt=class{},c= exports.c =_context2.createContext.call(void 0, "test");var _preactsignals = require('@lit-labs/preact-signals');var E=class extends _lit.LitElement{constructor(){super();this.itemIndex=0;this._initialValue={itemIndex:0,audienceContext:"candidate",items:[]};this.signalContext=_preactsignals.signal.call(void 0, this._initialValue);this.itemRefEls=new Map;this.restoreContext=t=>{var e;t||(t=this._initialValue),this.signalContext.value.itemIndex=t.itemIndex,(e=t.items)==null||e.forEach(r=>{let i=this.signalContext.value.items.find(m=>m.identifier===r.identifier);i?i.variables=r.variables:this.signalContext.value.items.push(r)})};this.itemConnected=t=>{let e=this.signalContext.value.items.find(r=>(r==null?void 0:r.identifier)===(t==null?void 0:t.identifier));e.variables.length===1?this.copyItemVariables(t.identifier):t.variables=[...e.variables]};this.addEventListener("register-item-ref",this.onItemRefRegistered),this.addEventListener("on-test-request-item",this.onTestRequestItem),this.addEventListener("qti-item-first-updated",t=>this.itemConnected(t.detail)),this.addEventListener("qti-interaction-changed",t=>this.copyItemVariables(t.detail.item)),this.addEventListener("qti-outcome-changed",t=>this.copyItemVariables(t.detail.item)),_preactsignals.effect.call(void 0, ()=>this._context=this.signalContext.value)}set context(t){console.log("set context",t),this.signalContext.value=t}updated(t){var e,r;if(t.has("_context")){let i=(e=t.get("_context"))==null?void 0:e.itemIndex;this.signalContext.value.items.length>0&&this.signalContext.value.itemIndex!==null&&i!==this.signalContext.value.itemIndex&&this._requestItem(this.signalContext.value.items[this.signalContext.value.itemIndex].identifier,(r=this.signalContext.value.items[i])==null?void 0:r.identifier)}t.has("audienceContext")&&(this._context=_chunkHYQC3D4Zcjs.b.call(void 0, _chunkHYQC3D4Zcjs.a.call(void 0, {},this._context),{audienceContext:this.audienceContext}),this.itemRefEls.forEach((i,m)=>i.audienceContext={view:this.audienceContext})),t.has("itemIndex")&&(this.signalContext.value=_chunkHYQC3D4Zcjs.b.call(void 0, _chunkHYQC3D4Zcjs.a.call(void 0, {},this.signalContext.value),{itemIndex:this.itemIndex}))}copyItemVariables(t){this.signalContext.value=_chunkHYQC3D4Zcjs.b.call(void 0, _chunkHYQC3D4Zcjs.a.call(void 0, {},this.signalContext.value),{items:this.signalContext.value.items.map(e=>e.identifier==t?_chunkHYQC3D4Zcjs.b.call(void 0, _chunkHYQC3D4Zcjs.a.call(void 0, {},e),{variables:this.getAssessmentItem(t).context.variables}):e)})}getAssessmentItem(t){return this.querySelector(`qti-assessment-item-ref[identifier="${t}"]`).assessmentItem}get currentAssessmentItem(){return this.querySelector(`qti-assessment-item-ref[identifier="${this.signalContext.value.items[this.signalContext.value.itemIndex].identifier}"]`).assessmentItem}onItemRefRegistered(t){this.itemRefEls.set(t.detail.identifier,t.target);let{href:e,identifier:r}=t.detail;this.signalContext.value.items=[...this.signalContext.value.items,{href:e,identifier:r,variables:[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"not_attempted",type:"outcome"}]}]}onTestRequestItem(t){t.stopImmediatePropagation(),t.detail!==this.signalContext.value.itemIndex&&(this.signalContext.value=_chunkHYQC3D4Zcjs.b.call(void 0, _chunkHYQC3D4Zcjs.a.call(void 0, {},this.signalContext.value),{itemIndex:t.detail}))}firstUpdated(t){if(super.firstUpdated(t),this.signalContext.value.items.length===0){console.warn("No items found in the test, please add at least one item");return}this._emit("qti-assessment-first-updated",this)}_requestItem(t,e){this.dispatchEvent(new CustomEvent("on-test-set-item",{bubbles:!0,composed:!0,detail:{old:e,new:t}}))}_emit(t,e=null){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}render(){return _lit.html`<slot></slot>`}};_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String,reflect:!0,attribute:"audience-context"})],E.prototype,"audienceContext",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:Number,reflect:!0,attribute:"item-index"})],E.prototype,"itemIndex",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],E.prototype,"identifier",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.provide.call(void 0, {context:c}),_decoratorsjs.property.call(void 0, {attribute:!1})],E.prototype,"_context",2),E= exports.d =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "qti-assessment-test")],E);var $=class extends _lit.LitElement{constructor(){super(...arguments);this.loading=!1;this._navigationMode="linear"}render(){return _lit.html`
2
2
  <slot name="qti-item"></slot>
3
3
  <slot> </slot>
4
- `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:Boolean,reflect:!0})],$.prototype,"loading",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String,attribute:"navigation-mode"})],$.prototype,"_navigationMode",2),$= exports.e =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "qti-test-part")],$);var A,gt=0;function tt(o){A=o}function et(){A=null,gt=0}function wt(){return gt++}var G=Symbol("haunted.phase"),S=Symbol("haunted.hook"),st=Symbol("haunted.update"),rt=Symbol("haunted.commit"),g=Symbol("haunted.effects"),_=Symbol("haunted.layoutEffects"),R="haunted.context";var Yt,Zt,Tt,O=class{constructor(s,t){_chunkHYQC3D4Zcjs.d.call(void 0, this,"update");_chunkHYQC3D4Zcjs.d.call(void 0, this,"host");_chunkHYQC3D4Zcjs.d.call(void 0, this,"virtual");_chunkHYQC3D4Zcjs.d.call(void 0, this,Yt);_chunkHYQC3D4Zcjs.d.call(void 0, this,Zt);_chunkHYQC3D4Zcjs.d.call(void 0, this,Tt);this.update=s,this.host=t,this[S]=new Map,this[g]=[],this[_]=[]}run(s){tt(this);let t=s();return et(),t}_runEffects(s){let t=this[s];tt(this);for(let e of t)e.call(this);et()}runEffects(){this._runEffects(g)}runLayoutEffects(){this._runEffects(_)}teardown(){this[S].forEach(t=>{typeof t.teardown=="function"&&t.teardown()})}};Yt=S,Zt=g,Tt=_;var te=Promise.resolve().then.bind(Promise.resolve());function yt(){let o=[],s;function t(){s=null;let e=o;o=[];for(var r=0,i=e.length;r<i;r++)e[r]()}return function(e){o.push(e),s==null&&(s=te(t))}}var ee=yt(),vt=yt(),se,I=class{constructor(s,t){_chunkHYQC3D4Zcjs.d.call(void 0, this,"renderer");_chunkHYQC3D4Zcjs.d.call(void 0, this,"host");_chunkHYQC3D4Zcjs.d.call(void 0, this,"state");_chunkHYQC3D4Zcjs.d.call(void 0, this,se);_chunkHYQC3D4Zcjs.d.call(void 0, this,"_updateQueued");this.renderer=s,this.host=t,this.state=new O(this.update.bind(this),t),this[G]=null,this._updateQueued=!1}update(){this._updateQueued||(ee(()=>{let s=this.handlePhase(st);vt(()=>{this.handlePhase(rt,s),vt(()=>{this.handlePhase(g)})}),this._updateQueued=!1}),this._updateQueued=!0)}handlePhase(s,t){switch(this[G]=s,s){case rt:this.commit(t),this.runEffects(_);return;case st:return this.render();case g:return this.runEffects(g)}}render(){return this.state.run(()=>this.renderer.call(this.host,this.host))}runEffects(s){this.state._runEffects(s)}teardown(){this.state.teardown()}};se=G;var re=(o="")=>o.replace(/-+([a-z])?/g,(s,t)=>t?t.toUpperCase():"");function Ct(o){class s extends I{constructor(i,c,u){super(i,u||c);_chunkHYQC3D4Zcjs.d.call(void 0, this,"frag");this.frag=c}commit(i){o(i,this.frag)}}function t(e,r,i){let c=(i||r||{}).baseElement||HTMLElement,{observedAttributes:u=[],useShadowDOM:l=!0,shadowRootInit:k={}}=i||r||{};class M extends c{constructor(){super();_chunkHYQC3D4Zcjs.d.call(void 0, this,"_scheduler");l===!1?this._scheduler=new s(e,this):(this.attachShadow(_chunkHYQC3D4Zcjs.a.call(void 0, {mode:"open"},k)),this._scheduler=new s(e,this.shadowRoot,this))}static get observedAttributes(){return e.observedAttributes||u||[]}connectedCallback(){this._scheduler.update()}disconnectedCallback(){this._scheduler.teardown()}attributeChangedCallback(b,w,d){if(w===d)return;let Ft=d===""?!0:d;Reflect.set(this,re(b),Ft)}}function Nt(C){let h=C,b=!1;return Object.freeze({enumerable:!0,configurable:!0,get(){return h},set(w){b&&h===w||(b=!0,h=w,this._scheduler&&this._scheduler.update())}})}let Qt=new Proxy(c.prototype,{getPrototypeOf(C){return C},set(C,h,b,w){let d;return h in C?(d=Object.getOwnPropertyDescriptor(C,h),d&&d.set?(d.set.call(w,b),!0):(Reflect.set(C,h,b,w),!0)):(typeof h=="symbol"||h[0]==="_"?d={enumerable:!0,configurable:!0,writable:!0,value:b}:d=Nt(b),Object.defineProperty(w,h,d),d.set&&d.set.call(w,b),!0)}});return Object.setPrototypeOf(M.prototype,Qt),M}return t}var p=class{constructor(s,t){_chunkHYQC3D4Zcjs.d.call(void 0, this,"id");_chunkHYQC3D4Zcjs.d.call(void 0, this,"state");this.id=s,this.state=t}};function oe(o,...s){let t=wt(),e=A[S],r=e.get(t);return r||(r=new o(t,A,...s),e.set(t,r)),r.update(...s)}function x(o){return oe.bind(null,o)}function K(o){return x(class extends p{constructor(t,e,r,i){super(t,e);_chunkHYQC3D4Zcjs.d.call(void 0, this,"callback");_chunkHYQC3D4Zcjs.d.call(void 0, this,"lastValues");_chunkHYQC3D4Zcjs.d.call(void 0, this,"values");_chunkHYQC3D4Zcjs.d.call(void 0, this,"_teardown");o(e,this)}update(t,e){this.callback=t,this.values=e}call(){(!this.values||this.hasChanged())&&this.run(),this.lastValues=this.values}run(){this.teardown(),this._teardown=this.callback.call(this.state)}teardown(){typeof this._teardown=="function"&&this._teardown()}hasChanged(){return!this.lastValues||this.values.some((t,e)=>this.lastValues[e]!==t)}})}function ot(o,s){o[g].push(s)}var Y=K(ot);var it=x(class extends p{constructor(s,t,e){super(s,t);_chunkHYQC3D4Zcjs.d.call(void 0, this,"Context");_chunkHYQC3D4Zcjs.d.call(void 0, this,"value");_chunkHYQC3D4Zcjs.d.call(void 0, this,"_ranEffect");_chunkHYQC3D4Zcjs.d.call(void 0, this,"_unsubscribe");this._updater=this._updater.bind(this),this._ranEffect=!1,this._unsubscribe=null,ot(t,this)}update(s){if(this.state.virtual)throw new Error("can't be used with virtual components");return this.Context!==s&&(this._subscribe(s),this.Context=s),this.value}call(){this._ranEffect||(this._ranEffect=!0,this._unsubscribe&&this._unsubscribe(),this._subscribe(this.Context),this.state.update())}_updater(s){this.value=s,this.state.update()}_subscribe(s){let t={Context:s,callback:this._updater};this.state.host.dispatchEvent(new CustomEvent(R,{detail:t,bubbles:!0,cancelable:!0,composed:!0}));let{unsubscribe:e=null,value:r}=t;this.value=e?r:s.defaultValue,this._unsubscribe=e}teardown(){this._unsubscribe&&this._unsubscribe()}});function Et(o){return s=>{let t={Provider:class extends HTMLElement{constructor(){super();_chunkHYQC3D4Zcjs.d.call(void 0, this,"listeners");_chunkHYQC3D4Zcjs.d.call(void 0, this,"_value");this.listeners=new Set,this.addEventListener(R,this)}disconnectedCallback(){this.removeEventListener(R,this)}handleEvent(r){let{detail:i}=r;i.Context===t&&(i.value=this.value,i.unsubscribe=this.unsubscribe.bind(this,i.callback),this.listeners.add(i.callback),r.stopPropagation())}unsubscribe(r){this.listeners.delete(r)}set value(r){this._value=r;for(let i of this.listeners)i(r)}get value(){return this._value}},Consumer:o(function({render:e}){let r=it(t);return e(r)}),defaultValue:s};return t}}var nt=x(class extends p{constructor(s,t,e,r){super(s,t);_chunkHYQC3D4Zcjs.d.call(void 0, this,"value");_chunkHYQC3D4Zcjs.d.call(void 0, this,"values");this.value=e(),this.values=r}update(s,t){return this.hasChanged(t)&&(this.values=t,this.value=s()),this.value}hasChanged(s=[]){return s.some((t,e)=>this.values[e]!==t)}});function ie(o,s){o[_].push(s)}var _t=K(ie);var Z=x(class extends p{constructor(s,t,e){super(s,t);_chunkHYQC3D4Zcjs.d.call(void 0, this,"args");this.updater=this.updater.bind(this),typeof e=="function"&&(e=e()),this.makeArgs(e)}update(){return this.args}updater(s){if(typeof s=="function"){let t=s,[e]=this.args;s=t(e)}this.makeArgs(s),this.state.update()}makeArgs(s){this.args=Object.freeze([s,this.updater])}});var Gr=Promise.resolve();var ne=x(class extends p{constructor(s,t,e,r,i){super(s,t);_chunkHYQC3D4Zcjs.d.call(void 0, this,"reducer");_chunkHYQC3D4Zcjs.d.call(void 0, this,"currentState");this.dispatch=this.dispatch.bind(this),this.currentState=i!==void 0?i(r):r}update(s){return this.reducer=s,[this.currentState,this.dispatch]}dispatch(s){this.currentState=this.reducer(this.currentState,s),this.state.update()}});function at({render:o}){let s=Ct(o),t=Et(s);return{component:s,createContext:t}}var _directivejs = require('lit/directive.js');var _asyncdirectivejs = require('lit/async-directive.js');var kt=Array.prototype.includes,ct=new WeakMap,It=new WeakMap,mt=class extends I{constructor(t,e,r){super(t,e);_chunkHYQC3D4Zcjs.d.call(void 0, this,"args");_chunkHYQC3D4Zcjs.d.call(void 0, this,"setValue");this.state.virtual=!0,this.setValue=r}render(){return this.state.run(()=>this.renderer.apply(this.host,this.args))}commit(t){this.setValue(t)}teardown(){super.teardown();let t=It.get(this);ct.delete(t)}};function qt(){function o(s){class t extends _asyncdirectivejs.AsyncDirective{constructor(i){super(i);_chunkHYQC3D4Zcjs.d.call(void 0, this,"cont");this.cont=void 0}update(i,c){return this.cont=ct.get(i),(!this.cont||this.cont.renderer!==s)&&(this.cont=new mt(s,i,u=>{this.setValue(u)}),ct.set(i,this.cont),It.set(this.cont,i),ut(this.cont,i)),this.cont.args=c,this.cont.update(),this.render(c)}render(i){return _lit.noChange}}return _directivejs.directive.call(void 0, t)}return o}function ut(o,s,t=s.startNode){let e=t.parentNode,r=new MutationObserver(i=>{for(let c of i)if(kt.call(c.removedNodes,t)){r.disconnect(),t.parentNode instanceof ShadowRoot?ut(o,s):o.teardown();break}else if(kt.call(c.addedNodes,t.nextSibling)){r.disconnect(),ut(o,s,t.nextSibling||void 0);break}});r.observe(e,{childList:!0})}var{component:lt,createContext:le}=at({render:_lit.render}),dt=qt();var _ifdefinedjs = require('lit/directives/if-defined.js');var _refjs = require('lit/directives/ref.js');var _cheerio = require('cheerio'); var pt = _interopRequireWildcard(_cheerio);var de=async o=>{let t=await(await fetch(o)).text();return pt.load(t,{xmlMode:!0,xml:{xmlMode:!0}})('resource[type="imsqti_test_xmlv3p0"]').first()},pe=async o=>{let t=await(await fetch(o)).text(),e=pt.load(t,{xmlMode:!0,xml:{xmlMode:!0}}),r=[];return e("qti-assessment-item-ref").each((i,c)=>{let u=e(c).attr("identifier"),l=e(c).attr("href"),k=e(c).attr("category");r.push({identifier:u,href:l,category:k})}),r},z=new AbortController;async function St(o){let s=async e=>{try{return await(await fetch(e,{signal:t})).text()}catch(r){r.name==="AbortError"?console.log("Fetch aborted"):console.error(r)}return""};z==null||z.abort(),z=new AbortController;let t=z.signal;return await s(o)}var Lt=async o=>{o.endsWith("/")||(o=o+"/");let s=await de(o+"/imsmanifest.xml"),t=await pe(o+s.attr("href"));return{itemLocation:`${o}/${s.attr("href").substring(0,s.attr("href").lastIndexOf("/"))}/`,items:t,testIdentifier:s.attr("identifier")}};var At=(o,s,t)=>{let e=_refjs.createRef.call(void 0, );return o?_lit.html`
4
+ `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:Boolean,reflect:!0})],$.prototype,"loading",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String,attribute:"navigation-mode"})],$.prototype,"_navigationMode",2),$= exports.e =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "qti-test-part")],$);var A,gt=0;function tt(o){A=o}function et(){A=null,gt=0}function wt(){return gt++}var G=Symbol("haunted.phase"),L=Symbol("haunted.hook"),st=Symbol("haunted.update"),rt=Symbol("haunted.commit"),g=Symbol("haunted.effects"),_=Symbol("haunted.layoutEffects"),R="haunted.context";var Yt,Zt,Tt,O=class{constructor(s,t){_chunkHYQC3D4Zcjs.d.call(void 0, this,"update");_chunkHYQC3D4Zcjs.d.call(void 0, this,"host");_chunkHYQC3D4Zcjs.d.call(void 0, this,"virtual");_chunkHYQC3D4Zcjs.d.call(void 0, this,Yt);_chunkHYQC3D4Zcjs.d.call(void 0, this,Zt);_chunkHYQC3D4Zcjs.d.call(void 0, this,Tt);this.update=s,this.host=t,this[L]=new Map,this[g]=[],this[_]=[]}run(s){tt(this);let t=s();return et(),t}_runEffects(s){let t=this[s];tt(this);for(let e of t)e.call(this);et()}runEffects(){this._runEffects(g)}runLayoutEffects(){this._runEffects(_)}teardown(){this[L].forEach(t=>{typeof t.teardown=="function"&&t.teardown()})}};Yt=L,Zt=g,Tt=_;var te=Promise.resolve().then.bind(Promise.resolve());function yt(){let o=[],s;function t(){s=null;let e=o;o=[];for(var r=0,i=e.length;r<i;r++)e[r]()}return function(e){o.push(e),s==null&&(s=te(t))}}var ee=yt(),vt=yt(),se,I=class{constructor(s,t){_chunkHYQC3D4Zcjs.d.call(void 0, this,"renderer");_chunkHYQC3D4Zcjs.d.call(void 0, this,"host");_chunkHYQC3D4Zcjs.d.call(void 0, this,"state");_chunkHYQC3D4Zcjs.d.call(void 0, this,se);_chunkHYQC3D4Zcjs.d.call(void 0, this,"_updateQueued");this.renderer=s,this.host=t,this.state=new O(this.update.bind(this),t),this[G]=null,this._updateQueued=!1}update(){this._updateQueued||(ee(()=>{let s=this.handlePhase(st);vt(()=>{this.handlePhase(rt,s),vt(()=>{this.handlePhase(g)})}),this._updateQueued=!1}),this._updateQueued=!0)}handlePhase(s,t){switch(this[G]=s,s){case rt:this.commit(t),this.runEffects(_);return;case st:return this.render();case g:return this.runEffects(g)}}render(){return this.state.run(()=>this.renderer.call(this.host,this.host))}runEffects(s){this.state._runEffects(s)}teardown(){this.state.teardown()}};se=G;var re=(o="")=>o.replace(/-+([a-z])?/g,(s,t)=>t?t.toUpperCase():"");function Ct(o){class s extends I{constructor(i,m,u){super(i,u||m);_chunkHYQC3D4Zcjs.d.call(void 0, this,"frag");this.frag=m}commit(i){o(i,this.frag)}}function t(e,r,i){let m=(i||r||{}).baseElement||HTMLElement,{observedAttributes:u=[],useShadowDOM:l=!0,shadowRootInit:k={}}=i||r||{};class M extends m{constructor(){super();_chunkHYQC3D4Zcjs.d.call(void 0, this,"_scheduler");l===!1?this._scheduler=new s(e,this):(this.attachShadow(_chunkHYQC3D4Zcjs.a.call(void 0, {mode:"open"},k)),this._scheduler=new s(e,this.shadowRoot,this))}static get observedAttributes(){return e.observedAttributes||u||[]}connectedCallback(){this._scheduler.update()}disconnectedCallback(){this._scheduler.teardown()}attributeChangedCallback(b,w,d){if(w===d)return;let Pt=d===""?!0:d;Reflect.set(this,re(b),Pt)}}function Dt(C){let f=C,b=!1;return Object.freeze({enumerable:!0,configurable:!0,get(){return f},set(w){b&&f===w||(b=!0,f=w,this._scheduler&&this._scheduler.update())}})}let Nt=new Proxy(m.prototype,{getPrototypeOf(C){return C},set(C,f,b,w){let d;return f in C?(d=Object.getOwnPropertyDescriptor(C,f),d&&d.set?(d.set.call(w,b),!0):(Reflect.set(C,f,b,w),!0)):(typeof f=="symbol"||f[0]==="_"?d={enumerable:!0,configurable:!0,writable:!0,value:b}:d=Dt(b),Object.defineProperty(w,f,d),d.set&&d.set.call(w,b),!0)}});return Object.setPrototypeOf(M.prototype,Nt),M}return t}var p=class{constructor(s,t){_chunkHYQC3D4Zcjs.d.call(void 0, this,"id");_chunkHYQC3D4Zcjs.d.call(void 0, this,"state");this.id=s,this.state=t}};function oe(o,...s){let t=wt(),e=A[L],r=e.get(t);return r||(r=new o(t,A,...s),e.set(t,r)),r.update(...s)}function x(o){return oe.bind(null,o)}function K(o){return x(class extends p{constructor(t,e,r,i){super(t,e);_chunkHYQC3D4Zcjs.d.call(void 0, this,"callback");_chunkHYQC3D4Zcjs.d.call(void 0, this,"lastValues");_chunkHYQC3D4Zcjs.d.call(void 0, this,"values");_chunkHYQC3D4Zcjs.d.call(void 0, this,"_teardown");o(e,this)}update(t,e){this.callback=t,this.values=e}call(){(!this.values||this.hasChanged())&&this.run(),this.lastValues=this.values}run(){this.teardown(),this._teardown=this.callback.call(this.state)}teardown(){typeof this._teardown=="function"&&this._teardown()}hasChanged(){return!this.lastValues||this.values.some((t,e)=>this.lastValues[e]!==t)}})}function ot(o,s){o[g].push(s)}var Y=K(ot);var it=x(class extends p{constructor(s,t,e){super(s,t);_chunkHYQC3D4Zcjs.d.call(void 0, this,"Context");_chunkHYQC3D4Zcjs.d.call(void 0, this,"value");_chunkHYQC3D4Zcjs.d.call(void 0, this,"_ranEffect");_chunkHYQC3D4Zcjs.d.call(void 0, this,"_unsubscribe");this._updater=this._updater.bind(this),this._ranEffect=!1,this._unsubscribe=null,ot(t,this)}update(s){if(this.state.virtual)throw new Error("can't be used with virtual components");return this.Context!==s&&(this._subscribe(s),this.Context=s),this.value}call(){this._ranEffect||(this._ranEffect=!0,this._unsubscribe&&this._unsubscribe(),this._subscribe(this.Context),this.state.update())}_updater(s){this.value=s,this.state.update()}_subscribe(s){let t={Context:s,callback:this._updater};this.state.host.dispatchEvent(new CustomEvent(R,{detail:t,bubbles:!0,cancelable:!0,composed:!0}));let{unsubscribe:e=null,value:r}=t;this.value=e?r:s.defaultValue,this._unsubscribe=e}teardown(){this._unsubscribe&&this._unsubscribe()}});function Et(o){return s=>{let t={Provider:class extends HTMLElement{constructor(){super();_chunkHYQC3D4Zcjs.d.call(void 0, this,"listeners");_chunkHYQC3D4Zcjs.d.call(void 0, this,"_value");this.listeners=new Set,this.addEventListener(R,this)}disconnectedCallback(){this.removeEventListener(R,this)}handleEvent(r){let{detail:i}=r;i.Context===t&&(i.value=this.value,i.unsubscribe=this.unsubscribe.bind(this,i.callback),this.listeners.add(i.callback),r.stopPropagation())}unsubscribe(r){this.listeners.delete(r)}set value(r){this._value=r;for(let i of this.listeners)i(r)}get value(){return this._value}},Consumer:o(function({render:e}){let r=it(t);return e(r)}),defaultValue:s};return t}}var nt=x(class extends p{constructor(s,t,e,r){super(s,t);_chunkHYQC3D4Zcjs.d.call(void 0, this,"value");_chunkHYQC3D4Zcjs.d.call(void 0, this,"values");this.value=e(),this.values=r}update(s,t){return this.hasChanged(t)&&(this.values=t,this.value=s()),this.value}hasChanged(s=[]){return s.some((t,e)=>this.values[e]!==t)}});function ie(o,s){o[_].push(s)}var _t=K(ie);var Z=x(class extends p{constructor(s,t,e){super(s,t);_chunkHYQC3D4Zcjs.d.call(void 0, this,"args");this.updater=this.updater.bind(this),typeof e=="function"&&(e=e()),this.makeArgs(e)}update(){return this.args}updater(s){if(typeof s=="function"){let t=s,[e]=this.args;s=t(e)}this.makeArgs(s),this.state.update()}makeArgs(s){this.args=Object.freeze([s,this.updater])}});var Gr=Promise.resolve();var ne=x(class extends p{constructor(s,t,e,r,i){super(s,t);_chunkHYQC3D4Zcjs.d.call(void 0, this,"reducer");_chunkHYQC3D4Zcjs.d.call(void 0, this,"currentState");this.dispatch=this.dispatch.bind(this),this.currentState=i!==void 0?i(r):r}update(s){return this.reducer=s,[this.currentState,this.dispatch]}dispatch(s){this.currentState=this.reducer(this.currentState,s),this.state.update()}});function at({render:o}){let s=Ct(o),t=Et(s);return{component:s,createContext:t}}var _directivejs = require('lit/directive.js');var _asyncdirectivejs = require('lit/async-directive.js');var kt=Array.prototype.includes,mt=new WeakMap,It=new WeakMap,ct=class extends I{constructor(t,e,r){super(t,e);_chunkHYQC3D4Zcjs.d.call(void 0, this,"args");_chunkHYQC3D4Zcjs.d.call(void 0, this,"setValue");this.state.virtual=!0,this.setValue=r}render(){return this.state.run(()=>this.renderer.apply(this.host,this.args))}commit(t){this.setValue(t)}teardown(){super.teardown();let t=It.get(this);mt.delete(t)}};function qt(){function o(s){class t extends _asyncdirectivejs.AsyncDirective{constructor(i){super(i);_chunkHYQC3D4Zcjs.d.call(void 0, this,"cont");this.cont=void 0}update(i,m){return this.cont=mt.get(i),(!this.cont||this.cont.renderer!==s)&&(this.cont=new ct(s,i,u=>{this.setValue(u)}),mt.set(i,this.cont),It.set(this.cont,i),ut(this.cont,i)),this.cont.args=m,this.cont.update(),this.render(m)}render(i){return _lit.noChange}}return _directivejs.directive.call(void 0, t)}return o}function ut(o,s,t=s.startNode){let e=t.parentNode,r=new MutationObserver(i=>{for(let m of i)if(kt.call(m.removedNodes,t)){r.disconnect(),t.parentNode instanceof ShadowRoot?ut(o,s):o.teardown();break}else if(kt.call(m.addedNodes,t.nextSibling)){r.disconnect(),ut(o,s,t.nextSibling||void 0);break}});r.observe(e,{childList:!0})}var{component:lt,createContext:le}=at({render:_lit.render}),dt=qt();var _ifdefinedjs = require('lit/directives/if-defined.js');var _refjs = require('lit/directives/ref.js');var _cheerio = require('cheerio'); var pt = _interopRequireWildcard(_cheerio);var de=async o=>{let t=await(await fetch(o)).text();return pt.load(t,{xmlMode:!0,xml:{xmlMode:!0}})('resource[type="imsqti_test_xmlv3p0"]').first()},pe=async o=>{let t=await(await fetch(o)).text(),e=pt.load(t,{xmlMode:!0,xml:{xmlMode:!0}}),r=[];return e("qti-assessment-item-ref").each((i,m)=>{let u=e(m).attr("identifier"),l=e(m).attr("href"),k=e(m).attr("category");r.push({identifier:u,href:l,category:k})}),r},Q=new AbortController;async function Lt(o){let s=async e=>{try{return await(await fetch(e,{signal:t})).text()}catch(r){r.name==="AbortError"?console.log("Fetch aborted"):console.error(r)}return""};Q==null||Q.abort(),Q=new AbortController;let t=Q.signal;return await s(o)}var St=async o=>{o.endsWith("/")||(o=o+"/");let s=await de(o+"/imsmanifest.xml"),t=await pe(o+s.attr("href"));return{itemLocation:`${o}/${s.attr("href").substring(0,s.attr("href").lastIndexOf("/"))}/`,items:t,testIdentifier:s.attr("identifier")}};var At=(o,s,t)=>{let e=_refjs.createRef.call(void 0, );return o?_lit.html`
5
5
  <qti-assessment-test
6
6
  ${_refjs.ref.call(void 0, e)}
7
7
  identifier="${o.testIdentifier}"
8
- @on-test-set-item=${async({detail:r})=>{var u;let i=e.value.itemRefEls.get(r.new),c=await St(`${o.itemLocation}/${i.href}`);i.xml=c,(u=e.value)==null||u.itemRefEls.forEach((l,k)=>l.identifier!==i.identifier&&(l.xml=""))}}
8
+ @on-test-set-item=${async({detail:r})=>{var u;let i=e.value.itemRefEls.get(r.new),m=await Lt(`${o.itemLocation}/${i.href}`);i.xml=m,(u=e.value)==null||u.itemRefEls.forEach((l,k)=>l.identifier!==i.identifier&&(l.xml=""))}}
9
9
  @qti-assessment-first-updated=${r=>{t&&(e.value.context=t)}}
10
10
  item-index=${s}
11
11
  >
@@ -36,299 +36,277 @@
36
36
  <test-manual-scoring></test-manual-scoring>
37
37
  </qti-assessment-test>
38
38
  `:""};var Rt=`*, ::before, ::after {
39
- --tw-border-spacing-x: 0;
40
- --tw-border-spacing-y: 0;
41
- --tw-translate-x: 0;
42
- --tw-translate-y: 0;
43
- --tw-rotate: 0;
44
- --tw-skew-x: 0;
45
- --tw-skew-y: 0;
46
- --tw-scale-x: 1;
47
- --tw-scale-y: 1;
48
- --tw-pan-x: ;
49
- --tw-pan-y: ;
50
- --tw-pinch-zoom: ;
51
- --tw-scroll-snap-strictness: proximity;
52
- --tw-gradient-from-position: ;
53
- --tw-gradient-via-position: ;
54
- --tw-gradient-to-position: ;
55
- --tw-ordinal: ;
56
- --tw-slashed-zero: ;
57
- --tw-numeric-figure: ;
58
- --tw-numeric-spacing: ;
59
- --tw-numeric-fraction: ;
60
- --tw-ring-inset: ;
61
- --tw-ring-offset-width: 0px;
62
- --tw-ring-offset-color: #fff;
63
- --tw-ring-color: rgb(59 130 246 / 0.5);
64
- --tw-ring-offset-shadow: 0 0 #0000;
65
- --tw-ring-shadow: 0 0 #0000;
66
- --tw-shadow: 0 0 #0000;
67
- --tw-shadow-colored: 0 0 #0000;
68
- --tw-blur: ;
69
- --tw-brightness: ;
70
- --tw-contrast: ;
71
- --tw-grayscale: ;
72
- --tw-hue-rotate: ;
73
- --tw-invert: ;
74
- --tw-saturate: ;
75
- --tw-sepia: ;
76
- --tw-drop-shadow: ;
77
- --tw-backdrop-blur: ;
78
- --tw-backdrop-brightness: ;
79
- --tw-backdrop-contrast: ;
80
- --tw-backdrop-grayscale: ;
81
- --tw-backdrop-hue-rotate: ;
82
- --tw-backdrop-invert: ;
83
- --tw-backdrop-opacity: ;
84
- --tw-backdrop-saturate: ;
85
- --tw-backdrop-sepia: ;
39
+ --tw-border-spacing-x: 0;
40
+ --tw-border-spacing-y: 0;
41
+ --tw-translate-x: 0;
42
+ --tw-translate-y: 0;
43
+ --tw-rotate: 0;
44
+ --tw-skew-x: 0;
45
+ --tw-skew-y: 0;
46
+ --tw-scale-x: 1;
47
+ --tw-scale-y: 1;
48
+ --tw-pan-x: ;
49
+ --tw-pan-y: ;
50
+ --tw-pinch-zoom: ;
51
+ --tw-scroll-snap-strictness: proximity;
52
+ --tw-gradient-from-position: ;
53
+ --tw-gradient-via-position: ;
54
+ --tw-gradient-to-position: ;
55
+ --tw-ordinal: ;
56
+ --tw-slashed-zero: ;
57
+ --tw-numeric-figure: ;
58
+ --tw-numeric-spacing: ;
59
+ --tw-numeric-fraction: ;
60
+ --tw-ring-inset: ;
61
+ --tw-ring-offset-width: 0px;
62
+ --tw-ring-offset-color: #fff;
63
+ --tw-ring-color: rgb(59 130 246 / 0.5);
64
+ --tw-ring-offset-shadow: 0 0 #0000;
65
+ --tw-ring-shadow: 0 0 #0000;
66
+ --tw-shadow: 0 0 #0000;
67
+ --tw-shadow-colored: 0 0 #0000;
68
+ --tw-blur: ;
69
+ --tw-brightness: ;
70
+ --tw-contrast: ;
71
+ --tw-grayscale: ;
72
+ --tw-hue-rotate: ;
73
+ --tw-invert: ;
74
+ --tw-saturate: ;
75
+ --tw-sepia: ;
76
+ --tw-drop-shadow: ;
77
+ --tw-backdrop-blur: ;
78
+ --tw-backdrop-brightness: ;
79
+ --tw-backdrop-contrast: ;
80
+ --tw-backdrop-grayscale: ;
81
+ --tw-backdrop-hue-rotate: ;
82
+ --tw-backdrop-invert: ;
83
+ --tw-backdrop-opacity: ;
84
+ --tw-backdrop-saturate: ;
85
+ --tw-backdrop-sepia: ;
86
86
  }
87
87
  ::backdrop {
88
- --tw-border-spacing-x: 0;
89
- --tw-border-spacing-y: 0;
90
- --tw-translate-x: 0;
91
- --tw-translate-y: 0;
92
- --tw-rotate: 0;
93
- --tw-skew-x: 0;
94
- --tw-skew-y: 0;
95
- --tw-scale-x: 1;
96
- --tw-scale-y: 1;
97
- --tw-pan-x: ;
98
- --tw-pan-y: ;
99
- --tw-pinch-zoom: ;
100
- --tw-scroll-snap-strictness: proximity;
101
- --tw-gradient-from-position: ;
102
- --tw-gradient-via-position: ;
103
- --tw-gradient-to-position: ;
104
- --tw-ordinal: ;
105
- --tw-slashed-zero: ;
106
- --tw-numeric-figure: ;
107
- --tw-numeric-spacing: ;
108
- --tw-numeric-fraction: ;
109
- --tw-ring-inset: ;
110
- --tw-ring-offset-width: 0px;
111
- --tw-ring-offset-color: #fff;
112
- --tw-ring-color: rgb(59 130 246 / 0.5);
113
- --tw-ring-offset-shadow: 0 0 #0000;
114
- --tw-ring-shadow: 0 0 #0000;
115
- --tw-shadow: 0 0 #0000;
116
- --tw-shadow-colored: 0 0 #0000;
117
- --tw-blur: ;
118
- --tw-brightness: ;
119
- --tw-contrast: ;
120
- --tw-grayscale: ;
121
- --tw-hue-rotate: ;
122
- --tw-invert: ;
123
- --tw-saturate: ;
124
- --tw-sepia: ;
125
- --tw-drop-shadow: ;
126
- --tw-backdrop-blur: ;
127
- --tw-backdrop-brightness: ;
128
- --tw-backdrop-contrast: ;
129
- --tw-backdrop-grayscale: ;
130
- --tw-backdrop-hue-rotate: ;
131
- --tw-backdrop-invert: ;
132
- --tw-backdrop-opacity: ;
133
- --tw-backdrop-saturate: ;
134
- --tw-backdrop-sepia: ;
135
- }
136
- button {
137
- all: unset;
138
- }
139
- button:focus {
140
- outline: revert;
88
+ --tw-border-spacing-x: 0;
89
+ --tw-border-spacing-y: 0;
90
+ --tw-translate-x: 0;
91
+ --tw-translate-y: 0;
92
+ --tw-rotate: 0;
93
+ --tw-skew-x: 0;
94
+ --tw-skew-y: 0;
95
+ --tw-scale-x: 1;
96
+ --tw-scale-y: 1;
97
+ --tw-pan-x: ;
98
+ --tw-pan-y: ;
99
+ --tw-pinch-zoom: ;
100
+ --tw-scroll-snap-strictness: proximity;
101
+ --tw-gradient-from-position: ;
102
+ --tw-gradient-via-position: ;
103
+ --tw-gradient-to-position: ;
104
+ --tw-ordinal: ;
105
+ --tw-slashed-zero: ;
106
+ --tw-numeric-figure: ;
107
+ --tw-numeric-spacing: ;
108
+ --tw-numeric-fraction: ;
109
+ --tw-ring-inset: ;
110
+ --tw-ring-offset-width: 0px;
111
+ --tw-ring-offset-color: #fff;
112
+ --tw-ring-color: rgb(59 130 246 / 0.5);
113
+ --tw-ring-offset-shadow: 0 0 #0000;
114
+ --tw-ring-shadow: 0 0 #0000;
115
+ --tw-shadow: 0 0 #0000;
116
+ --tw-shadow-colored: 0 0 #0000;
117
+ --tw-blur: ;
118
+ --tw-brightness: ;
119
+ --tw-contrast: ;
120
+ --tw-grayscale: ;
121
+ --tw-hue-rotate: ;
122
+ --tw-invert: ;
123
+ --tw-saturate: ;
124
+ --tw-sepia: ;
125
+ --tw-drop-shadow: ;
126
+ --tw-backdrop-blur: ;
127
+ --tw-backdrop-brightness: ;
128
+ --tw-backdrop-contrast: ;
129
+ --tw-backdrop-grayscale: ;
130
+ --tw-backdrop-hue-rotate: ;
131
+ --tw-backdrop-invert: ;
132
+ --tw-backdrop-opacity: ;
133
+ --tw-backdrop-saturate: ;
134
+ --tw-backdrop-sepia: ;
141
135
  }
142
136
  ::host {
143
- height: 100vh;
144
- width: 100vw;
145
- --tw-bg-opacity: 1;
146
- background-color: rgb(248 250 252 / var(--tw-bg-opacity)); /* bg-red-400; */
137
+ height: 100vh;
138
+ width: 100vw;
139
+ --tw-bg-opacity: 1;
140
+ background-color: rgb(248 250 252 / var(--tw-bg-opacity));
147
141
  }
148
142
  qti-assessment-test {
149
- display: block;
150
- padding: 2rem; /* bg-red-400; */
151
- }
152
- :host {
153
- --tw-bg-opacity: 1;
154
- background-color: rgb(96 165 250 / var(--tw-bg-opacity));
155
- }
156
- .arrow {
157
- height: 1.25rem;
158
- width: 1.25rem;
159
- }
160
- .nav {
161
- isolation: isolate;
162
- margin-top: 1rem;
163
- display: inline-flex;
164
- width: 100%;
165
- }
166
- .nav > :not([hidden]) ~ :not([hidden]) {
167
- --tw-space-x-reverse: 0;
168
- margin-right: calc(-1px * var(--tw-space-x-reverse));
169
- margin-left: calc(-1px * calc(1 - var(--tw-space-x-reverse)));
143
+ display: block;
144
+ padding: 2rem;
170
145
  }
171
- .nav {
172
- border-radius: 0.375rem;
173
- --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
174
- --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);
175
- box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
146
+ qti-assessment-test .nav {
147
+ isolation: isolate;
148
+ margin-top: 1rem;
149
+ display: inline-flex;
150
+ width: 100%;
176
151
  }
177
- test-prev::part(button) {
178
- all: unset;
179
- position: relative;
180
- display: inline-flex;
181
- align-items: center;
182
- border-top-left-radius: 0.375rem;
183
- border-bottom-left-radius: 0.375rem;
184
- --tw-bg-opacity: 1;
185
- background-color: rgb(255 255 255 / var(--tw-bg-opacity));
186
- padding-top: 0.5rem;
187
- padding-bottom: 0.5rem;
188
- padding-left: 0.5rem;
189
- padding-right: 1rem;
190
- --tw-text-opacity: 1;
191
- color: rgb(156 163 175 / var(--tw-text-opacity));
192
- --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
193
- --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
194
- box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
195
- --tw-ring-inset: inset;
196
- --tw-ring-opacity: 1;
197
- --tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity));
152
+ qti-assessment-test .nav > :not([hidden]) ~ :not([hidden]) {
153
+ --tw-space-x-reverse: 0;
154
+ margin-right: calc(-1px * var(--tw-space-x-reverse));
155
+ margin-left: calc(-1px * calc(1 - var(--tw-space-x-reverse)));
198
156
  }
199
- test-prev::part(button):hover {
200
- --tw-bg-opacity: 1;
201
- background-color: rgb(249 250 251 / var(--tw-bg-opacity));
157
+ qti-assessment-test .nav {
158
+ border-radius: 0.375rem;
159
+ --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
160
+ --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);
161
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
202
162
  }
203
- test-prev::part(button):focus {
204
- z-index: 20;
205
- outline-offset: 0px;
163
+ qti-assessment-test test-prev::part(button) {
164
+ all: unset;
165
+ position: relative;
166
+ display: inline-flex;
167
+ align-items: center;
168
+ border-top-left-radius: 0.375rem;
169
+ border-bottom-left-radius: 0.375rem;
170
+ --tw-bg-opacity: 1;
171
+ background-color: rgb(255 255 255 / var(--tw-bg-opacity));
172
+ padding-top: 0.5rem;
173
+ padding-bottom: 0.5rem;
174
+ padding-left: 0.5rem;
175
+ padding-right: 1rem;
176
+ --tw-text-opacity: 1;
177
+ color: rgb(156 163 175 / var(--tw-text-opacity));
178
+ --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
179
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
180
+ box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
181
+ --tw-ring-inset: inset;
182
+ --tw-ring-opacity: 1;
183
+ --tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity));
184
+ }
185
+ qti-assessment-test test-prev::part(button):hover {
186
+ --tw-bg-opacity: 1;
187
+ background-color: rgb(249 250 251 / var(--tw-bg-opacity));
206
188
  }
207
- test-slider::part(input) {
208
- width: 100%;
189
+ qti-assessment-test test-prev::part(button):focus {
190
+ z-index: 20;
191
+ outline-offset: 0px;
209
192
  }
210
- test-next::part(button) {
211
- all: unset;
212
- position: relative;
213
- display: inline-flex;
214
- align-items: center;
215
- border-top-right-radius: 0.375rem;
216
- border-bottom-right-radius: 0.375rem;
217
- --tw-bg-opacity: 1;
218
- background-color: rgb(255 255 255 / var(--tw-bg-opacity));
219
- padding-top: 0.5rem;
220
- padding-bottom: 0.5rem;
221
- padding-left: 1rem;
222
- padding-right: 0.5rem;
223
- --tw-text-opacity: 1;
224
- color: rgb(156 163 175 / var(--tw-text-opacity));
225
- --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
226
- --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
227
- box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
228
- --tw-ring-inset: inset;
229
- --tw-ring-opacity: 1;
230
- --tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity));
193
+ qti-assessment-test test-slider::part(input) {
194
+ width: 100%;
231
195
  }
232
- test-next::part(button):hover {
233
- --tw-bg-opacity: 1;
234
- background-color: rgb(249 250 251 / var(--tw-bg-opacity));
196
+ qti-assessment-test test-next::part(button) {
197
+ all: unset;
198
+ position: relative;
199
+ display: inline-flex;
200
+ align-items: center;
201
+ border-top-right-radius: 0.375rem;
202
+ border-bottom-right-radius: 0.375rem;
203
+ --tw-bg-opacity: 1;
204
+ background-color: rgb(255 255 255 / var(--tw-bg-opacity));
205
+ padding-top: 0.5rem;
206
+ padding-bottom: 0.5rem;
207
+ padding-left: 1rem;
208
+ padding-right: 0.5rem;
209
+ --tw-text-opacity: 1;
210
+ color: rgb(156 163 175 / var(--tw-text-opacity));
211
+ --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
212
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
213
+ box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
214
+ --tw-ring-inset: inset;
215
+ --tw-ring-opacity: 1;
216
+ --tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity));
217
+ }
218
+ qti-assessment-test test-next::part(button):hover {
219
+ --tw-bg-opacity: 1;
220
+ background-color: rgb(249 250 251 / var(--tw-bg-opacity));
235
221
  }
236
- test-next::part(button):focus {
237
- z-index: 20;
238
- outline-offset: 0px;
222
+ qti-assessment-test test-next::part(button):focus {
223
+ z-index: 20;
224
+ outline-offset: 0px;
239
225
  }
240
- test-paging-buttons {
241
- display: none;
242
- width: 100%;
243
- justify-content: center;
226
+ qti-assessment-test test-paging-buttons {
227
+ display: none;
228
+ width: 100%;
229
+ justify-content: center;
244
230
  }
245
231
  @media (min-width: 768px) {
246
- test-paging-buttons {
247
- margin-top: -1px;
248
- display: flex;
249
- }
232
+ qti-assessment-test test-paging-buttons {
233
+ margin-top: -1px;
234
+ display: flex;
235
+ }
250
236
  }
251
- test-paging-buttons > button {
252
- position: relative;
253
- display: inline-flex;
254
- align-items: center;
255
- --tw-bg-opacity: 1;
256
- background-color: rgb(255 255 255 / var(--tw-bg-opacity));
257
- padding-left: 1rem;
258
- padding-right: 1rem;
259
- padding-top: 0.5rem;
260
- padding-bottom: 0.5rem;
261
- font-size: 0.875rem;
262
- line-height: 1.25rem;
263
- font-weight: 600;
264
- --tw-text-opacity: 1;
265
- color: rgb(17 24 39 / var(--tw-text-opacity));
266
- --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
267
- --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
268
- box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
269
- --tw-ring-inset: inset;
270
- --tw-ring-opacity: 1;
271
- --tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity));
237
+ qti-assessment-test test-paging-buttons > button {
238
+ position: relative;
239
+ display: inline-flex;
240
+ align-items: center;
241
+ --tw-bg-opacity: 1;
242
+ background-color: rgb(255 255 255 / var(--tw-bg-opacity));
243
+ padding-left: 1rem;
244
+ padding-right: 1rem;
245
+ padding-top: 0.5rem;
246
+ padding-bottom: 0.5rem;
247
+ font-size: 0.875rem;
248
+ line-height: 1.25rem;
249
+ font-weight: 600;
250
+ --tw-text-opacity: 1;
251
+ color: rgb(17 24 39 / var(--tw-text-opacity));
252
+ --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
253
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
254
+ box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
255
+ --tw-ring-inset: inset;
256
+ --tw-ring-opacity: 1;
257
+ --tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity));
272
258
  }
273
- test-paging-buttons > button:hover {
274
- --tw-bg-opacity: 1;
275
- background-color: rgb(249 250 251 / var(--tw-bg-opacity));
259
+ qti-assessment-test test-paging-buttons > button:hover {
260
+ --tw-bg-opacity: 1;
261
+ background-color: rgb(249 250 251 / var(--tw-bg-opacity));
276
262
  }
277
- test-paging-buttons > button:focus {
278
- z-index: 20;
279
- outline-offset: 0px;
263
+ qti-assessment-test test-paging-buttons > button:focus {
264
+ z-index: 20;
265
+ outline-offset: 0px;
280
266
  }
281
- test-paging-buttons > button[data-active-item='true'] {
282
- position: relative;
283
- z-index: 10;
284
- display: inline-flex;
285
- align-items: center;
286
- --tw-bg-opacity: 1;
287
- background-color: rgb(79 70 229 / var(--tw-bg-opacity));
288
- padding-left: 1rem;
289
- padding-right: 1rem;
290
- padding-top: 0.5rem;
291
- padding-bottom: 0.5rem;
292
- font-size: 0.875rem;
293
- line-height: 1.25rem;
294
- font-weight: 600;
295
- --tw-text-opacity: 1;
296
- color: rgb(255 255 255 / var(--tw-text-opacity));
267
+ qti-assessment-test test-paging-buttons > button[data-active-item='true'] {
268
+ position: relative;
269
+ z-index: 10;
270
+ display: inline-flex;
271
+ align-items: center;
272
+ --tw-bg-opacity: 1;
273
+ background-color: rgb(79 70 229 / var(--tw-bg-opacity));
274
+ padding-left: 1rem;
275
+ padding-right: 1rem;
276
+ padding-top: 0.5rem;
277
+ padding-bottom: 0.5rem;
278
+ font-size: 0.875rem;
279
+ line-height: 1.25rem;
280
+ font-weight: 600;
281
+ --tw-text-opacity: 1;
282
+ color: rgb(255 255 255 / var(--tw-text-opacity));
297
283
  }
298
- test-paging-buttons > button[data-active-item='true']:focus {
299
- z-index: 20;
284
+ qti-assessment-test test-paging-buttons > button[data-active-item='true']:focus {
285
+ z-index: 20;
300
286
  }
301
- test-paging-buttons > button[data-active-item='true']:focus-visible {
302
- outline-style: solid;
303
- outline-width: 2px;
304
- outline-offset: 2px;
305
- outline-color: #4f46e5;
287
+ qti-assessment-test test-paging-buttons > button[data-active-item='true']:focus-visible {
288
+ outline-style: solid;
289
+ outline-width: 2px;
290
+ outline-offset: 2px;
291
+ outline-color: #4f46e5;
306
292
  }
307
- /* qti-test-part {
308
- qti-assessment-section {
309
- @apply flex aspect-video gap-8 overflow-x-hidden;
310
- qti-assessment-item-ref {
311
- @apply block h-full w-full max-w-none flex-shrink-0 bg-white p-8;
312
- }
313
- }
314
- } */
315
- qti-test-part qti-assessment-section {
316
- aspect-ratio: 16 / 9;
317
- width: 100%;
293
+ qti-assessment-test qti-test-part qti-assessment-section {
294
+ aspect-ratio: 16 / 9;
295
+ width: 100%;
318
296
  }
319
- `;function we(o){let[s,t]=Z();return Y(()=>{var r;let e=new CSSStyleSheet;e.replaceSync(Rt),(r=o.shadowRoot)==null||r.adoptedStyleSheets.push(e)},[]),Y(()=>{(async r=>await Lt(r))(o.packageUri).then(r=>{t(r)})},[o.packageUri]),_lit.html`${s?dt(At)(s):""}`}var ve=lt(we,{observedAttributes:["package-uri"]});customElements.define("qti-test",ve);var D=class extends _lit.LitElement{_requestItem(t){this.dispatchEvent(new CustomEvent("on-test-request-item",{composed:!0,bubbles:!0,detail:t}))}render(){var i;let{items:t,itemIndex:e}=this._testContext,r=Math.min(e+1,t.length-1);return _lit.html`
320
- <button part="button" @click=${c=>this._requestItem(r)} id="${(i=t[r])==null?void 0:i.identifier}">
297
+ `;function we(o){let[s,t]=Z();return Y(()=>{var r;let e=new CSSStyleSheet;e.replaceSync(Rt),(r=o.shadowRoot)==null||r.adoptedStyleSheets.push(e)},[]),Y(()=>{(async r=>await St(r))(o.packageUri).then(r=>{t(r)})},[o.packageUri]),_lit.html`${s?dt(At)(s):""}`}var ve=lt(we,{observedAttributes:["package-uri"]});customElements.define("qti-test",ve);var z=class extends _lit.LitElement{_requestItem(t){this.dispatchEvent(new CustomEvent("on-test-request-item",{composed:!0,bubbles:!0,detail:t}))}render(){var i;let{items:t,itemIndex:e}=this._testContext,r=Math.min(e+1,t.length-1);return _lit.html`
298
+ <button part="button" @click=${m=>this._requestItem(r)} id="${(i=t[r])==null?void 0:i.identifier}">
321
299
  <slot></slot>
322
300
  </button>
323
- `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.consume.call(void 0, {context:m,subscribe:!0}),_decoratorsjs.state.call(void 0, )],D.prototype,"_testContext",2),D= exports.i =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-next")],D);var N=class extends _lit.LitElement{_requestItem(t){this.dispatchEvent(new CustomEvent("on-test-request-item",{composed:!0,bubbles:!0,detail:t}))}render(){var i;let{items:t,itemIndex:e}=this._testContext,r=Math.max(e-1,0);return _lit.html`
324
- <button part="button" @click=${c=>this._requestItem(r)} id="${(i=t[r])==null?void 0:i.identifier}">
301
+ `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.consume.call(void 0, {context:c,subscribe:!0}),_decoratorsjs.state.call(void 0, )],z.prototype,"_testContext",2),z= exports.i =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-next")],z);var D=class extends _lit.LitElement{_requestItem(t){this.dispatchEvent(new CustomEvent("on-test-request-item",{composed:!0,bubbles:!0,detail:t}))}render(){var i;let{items:t,itemIndex:e}=this._testContext,r=Math.max(e-1,0);return _lit.html`
302
+ <button part="button" @click=${m=>this._requestItem(r)} id="${(i=t[r])==null?void 0:i.identifier}">
325
303
  <slot></slot>
326
304
  </button>
327
- `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.consume.call(void 0, {context:m,subscribe:!0}),_decoratorsjs.state.call(void 0, )],N.prototype,"_testContext",2),N= exports.j =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-prev")],N);var Q=class extends _lit.LitElement{render(){let{items:t,itemIndex:e}=this._testProvider;return _lit.html`
305
+ `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.consume.call(void 0, {context:c,subscribe:!0}),_decoratorsjs.state.call(void 0, )],D.prototype,"_testContext",2),D= exports.j =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-prev")],D);var N=class extends _lit.LitElement{render(){let{items:t,itemIndex:e}=this._testProvider;return _lit.html`
328
306
  <progress part="progress" id="file" max=${t.length-1} value=${e}>
329
307
  ${e/(t.length-1)}%
330
308
  </progress>
331
- `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.consume.call(void 0, {context:m,subscribe:!0}),_decoratorsjs.state.call(void 0, )],Q.prototype,"_testProvider",2),Q= exports.k =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-progress")],Q);var F=class extends _lit.LitElement{_requestItem(t){this.dispatchEvent(new CustomEvent("on-test-request-item",{composed:!0,bubbles:!0,detail:t}))}render(){let{items:t,itemIndex:e}=this._testProvider;return _lit.html`
309
+ `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.consume.call(void 0, {context:c,subscribe:!0}),_decoratorsjs.state.call(void 0, )],N.prototype,"_testProvider",2),N= exports.k =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-progress")],N);var P=class extends _lit.LitElement{_requestItem(t){this.dispatchEvent(new CustomEvent("on-test-request-item",{composed:!0,bubbles:!0,detail:t}))}render(){let{items:t,itemIndex:e}=this._testProvider;return _lit.html`
332
310
  <input
333
311
  part="input"
334
312
  type="range"
@@ -337,8 +315,8 @@ qti-test-part qti-assessment-section {
337
315
  max=${t.length-1}
338
316
  @input=${r=>this._requestItem(+r.target.value)}
339
317
  />
340
- `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.consume.call(void 0, {context:m,subscribe:!0}),_decoratorsjs.state.call(void 0, )],F.prototype,"_testProvider",2),F= exports.l =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-slider")],F);var P=class extends _lit.LitElement{createRenderRoot(){return this}_requestItem(t){this.dispatchEvent(new CustomEvent("on-test-request-item",{composed:!0,bubbles:!0,detail:t}))}render(){let{items:t,itemIndex:e}=this._testProvider;return _lit.html`
341
- ${t.map((r,i)=>{var c;return _lit.html` <label>
318
+ `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.consume.call(void 0, {context:c,subscribe:!0}),_decoratorsjs.state.call(void 0, )],P.prototype,"_testProvider",2),P= exports.l =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-slider")],P);var F=class extends _lit.LitElement{createRenderRoot(){return this}_requestItem(t){this.dispatchEvent(new CustomEvent("on-test-request-item",{composed:!0,bubbles:!0,detail:t}))}render(){let{items:t,itemIndex:e}=this._testProvider;return _lit.html`
319
+ ${t.map((r,i)=>{var m;return _lit.html` <label>
342
320
  <input
343
321
  type="radio"
344
322
  part="input"
@@ -346,13 +324,13 @@ qti-test-part qti-assessment-section {
346
324
  value="${i}"
347
325
  ?checked=${i===e}
348
326
  @change=${u=>this._requestItem(i)}
349
- data-completion-status=${(c=r.variables.find(u=>u.identifier==="completionStatus"))==null?void 0:c.value}
327
+ data-completion-status=${(m=r.variables.find(u=>u.identifier==="completionStatus"))==null?void 0:m.value}
350
328
  id="${r.identifier}"
351
329
  />
352
330
  ${i+1}
353
331
  </label>`})}
354
- `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.consume.call(void 0, {context:m,subscribe:!0}),_decoratorsjs.state.call(void 0, )],P.prototype,"_testProvider",2),P= exports.m =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-paging-radio")],P);var L=class extends _lit.LitElement{constructor(){super(...arguments);this.maxDisplayedItems=5}createRenderRoot(){return this}_requestItem(t){this.dispatchEvent(new CustomEvent("on-test-request-item",{composed:!0,bubbles:!0,detail:t}))}render(){let{items:t,itemIndex:e}=this._testProvider,r=Math.max(0,e-this.maxDisplayedItems),i=Math.min(t.length-1,e+this.maxDisplayedItems),c=t.slice(r,i+1);return _lit.html`
355
- ${c.map((u,l)=>{var k;return _lit.html`<button
332
+ `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.consume.call(void 0, {context:c,subscribe:!0}),_decoratorsjs.state.call(void 0, )],F.prototype,"_testProvider",2),F= exports.m =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-paging-radio")],F);var S=class extends _lit.LitElement{constructor(){super(...arguments);this.maxDisplayedItems=5}createRenderRoot(){return this}_requestItem(t){this.dispatchEvent(new CustomEvent("on-test-request-item",{composed:!0,bubbles:!0,detail:t}))}render(){let{items:t,itemIndex:e}=this._testProvider,r=Math.max(0,e-this.maxDisplayedItems),i=Math.min(t.length-1,e+this.maxDisplayedItems),m=t.slice(r,i+1);return _lit.html`
333
+ ${m.map((u,l)=>{var k;return _lit.html`<button
356
334
  part="button"
357
335
  data-completion-status=${(k=u.variables.find(M=>M.identifier==="completionStatus"))==null?void 0:k.value}
358
336
  data-active-item=${r+l===e}
@@ -361,15 +339,15 @@ qti-test-part qti-assessment-section {
361
339
  >
362
340
  ${r+l+1}
363
341
  </button>`})}
364
- `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.consume.call(void 0, {context:m,subscribe:!0}),_decoratorsjs.state.call(void 0, )],L.prototype,"_testProvider",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:Number})],L.prototype,"maxDisplayedItems",2),L= exports.n =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-paging-buttons")],L);var H=class extends _lit.LitElement{render(){var i,c,u;let{items:t,itemIndex:e}=this._testProvider;if(e==null)return _lit.html``;let r=(u=(c=this.closest("qti-assessment-test"))==null?void 0:c.itemRefEls.get((i=t[e])==null?void 0:i.identifier))==null?void 0:u.assessmentItem;return _lit.html`
342
+ `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.consume.call(void 0, {context:c,subscribe:!0}),_decoratorsjs.state.call(void 0, )],S.prototype,"_testProvider",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:Number})],S.prototype,"maxDisplayedItems",2),S= exports.n =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-paging-buttons")],S);var H=class extends _lit.LitElement{render(){var i,m,u;let{items:t,itemIndex:e}=this._testProvider;if(e==null)return _lit.html``;let r=(u=(m=this.closest("qti-assessment-test"))==null?void 0:m.itemRefEls.get((i=t[e])==null?void 0:i.identifier))==null?void 0:u.assessmentItem;return _lit.html`
365
343
  <button part="button" @click=${l=>r.showCorrectResponse(!0)}>
366
344
  <slot></slot>
367
345
  </button>
368
- `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.consume.call(void 0, {context:m,subscribe:!0}),_decoratorsjs.state.call(void 0, )],H.prototype,"_testProvider",2),H= exports.o =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-show-correct")],H);var V=class extends _lit.LitElement{constructor(){super(...arguments);this._printed=""}render(){return _lit.html`${this._printed}<slot @slotchange=${this.handleSlotChange}></slot>`}handleSlotChange(t){var r,i;let e=Array.from((r=this.childNodes)!=null?r:[]).find(c=>c.nodeType===Node.COMMENT_NODE);try{this.operatorFunction=new Function("context","item",(i=e.textContent)!=null?i:"")}catch(c){console.error("custom-operator contains invalid javascript code",c)}this._context=new (0, _context2.ContextConsumer)(this,m,c=>{this._printed=this.operatorFunction(c,this.closest("qti-assessment-item"))},!0)}};_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.state.call(void 0, )],V.prototype,"_printed",2),V= exports.p =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-script")],V);var U=class extends _lit.LitElement{_requestItem(t){this.dispatchEvent(new CustomEvent("on-test-request-item",{composed:!0,bubbles:!0,detail:t}))}render(){let{items:t,itemIndex:e}=this._testContext,r=t[e-1];return _lit.html` ${e+1}/${t.length} `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.consume.call(void 0, {context:m,subscribe:!0}),_decoratorsjs.state.call(void 0, )],U.prototype,"_testContext",2),U= exports.q =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-show-index")],U);var j=class extends _lit.LitElement{render(){return _lit.html`
346
+ `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.consume.call(void 0, {context:c,subscribe:!0}),_decoratorsjs.state.call(void 0, )],H.prototype,"_testProvider",2),H= exports.o =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-show-correct")],H);var U=class extends _lit.LitElement{constructor(){super(...arguments);this._printed=""}render(){return _lit.html`${this._printed}<slot @slotchange=${this.handleSlotChange}></slot>`}handleSlotChange(t){var r,i;let e=Array.from((r=this.childNodes)!=null?r:[]).find(m=>m.nodeType===Node.COMMENT_NODE);try{this.operatorFunction=new Function("context","item",(i=e.textContent)!=null?i:"")}catch(m){console.error("custom-operator contains invalid javascript code",m)}this._context=new (0, _context2.ContextConsumer)(this,c,m=>{this._printed=this.operatorFunction(m,this.closest("qti-assessment-item"))},!0)}};_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.state.call(void 0, )],U.prototype,"_printed",2),U= exports.p =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-script")],U);var V=class extends _lit.LitElement{_requestItem(t){this.dispatchEvent(new CustomEvent("on-test-request-item",{composed:!0,bubbles:!0,detail:t}))}render(){let{items:t,itemIndex:e}=this._testContext,r=t[e-1];return _lit.html` ${e+1}/${t.length} `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.consume.call(void 0, {context:c,subscribe:!0}),_decoratorsjs.state.call(void 0, )],V.prototype,"_testContext",2),V= exports.q =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-show-index")],V);var j=class extends _lit.LitElement{render(){return _lit.html`
369
347
  <pre>
370
348
  ${JSON.stringify(_chunkHYQC3D4Zcjs.b.call(void 0, _chunkHYQC3D4Zcjs.a.call(void 0, {},this._testProvider),{items:this._testProvider.items.map(t=>_chunkHYQC3D4Zcjs.b.call(void 0, _chunkHYQC3D4Zcjs.a.call(void 0, {},t),{itemEl:null}))}),null,2)}</pre
371
349
  >
372
- `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.consume.call(void 0, {context:m,subscribe:!0}),_decoratorsjs.state.call(void 0, )],j.prototype,"_testProvider",2),j= exports.r =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-print-variables")],j);var X=class extends _lit.LitElement{_requestItem(t){this.dispatchEvent(new CustomEvent("on-test-request-item",{composed:!0,bubbles:!0,detail:t}))}render(){let{items:t}=this._testContext,e=t.reduce((i,c)=>{let u=c.variables.find(l=>l.identifier==="SCORE");return i+(u?+u.value:0)},0),r=t.reduce((i,c)=>{let u=c.variables.find(l=>l.identifier==="MAXSCORE");return i+(u?+u.value:0)},0);return _lit.html` ${e}/${r}`}};_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.consume.call(void 0, {context:m,subscribe:!0}),_decoratorsjs.state.call(void 0, )],X.prototype,"_testContext",2),X= exports.s =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-print-score")],X);var y=class extends _lit.LitElement{constructor(){super(...arguments);this.disabled=!1;this.readonly=!1;this.value=0}textChanged(t){if(this.disabled||this.readonly)return;let e=t.target;this.value=Number(e.value),this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:"SCORE",value:this.value.toString()}}))}render(){return _lit.html`
350
+ `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.consume.call(void 0, {context:c,subscribe:!0}),_decoratorsjs.state.call(void 0, )],j.prototype,"_testProvider",2),j= exports.r =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-print-variables")],j);var X=class extends _lit.LitElement{_requestItem(t){this.dispatchEvent(new CustomEvent("on-test-request-item",{composed:!0,bubbles:!0,detail:t}))}render(){let{items:t}=this._testContext,e=t.reduce((i,m)=>{let u=m.variables.find(l=>l.identifier==="SCORE");return i+(u?+u.value:0)},0),r=t.reduce((i,m)=>{let u=m.variables.find(l=>l.identifier==="MAXSCORE");return i+(u?+u.value:0)},0);return _lit.html` ${e}/${r}`}};_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.consume.call(void 0, {context:c,subscribe:!0}),_decoratorsjs.state.call(void 0, )],X.prototype,"_testContext",2),X= exports.s =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-print-score")],X);var y=class extends _lit.LitElement{constructor(){super(...arguments);this.disabled=!1;this.readonly=!1;this.value=0}textChanged(t){if(this.disabled||this.readonly)return;let e=t.target;this.value=Number(e.value),this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:"SCORE",value:this.value.toString()}}))}render(){return _lit.html`
373
351
  <input
374
352
  part="input"
375
353
  type="number"
@@ -393,7 +371,7 @@ ${JSON.stringify(_chunkHYQC3D4Zcjs.b.call(void 0, _chunkHYQC3D4Zcjs.a.call(void
393
371
  />
394
372
  Toggle audience context
395
373
  </label>
396
- `}};T= exports.u =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-toggle-scoring")],T);var B=class extends _lit.LitElement{render(){var r;let{items:t,itemIndex:e}=this._testContext;return _lit.html` ${(r=t[e])==null?void 0:r.identifier} `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.consume.call(void 0, {context:m,subscribe:!0}),_decoratorsjs.state.call(void 0, )],B.prototype,"_testContext",2),B= exports.v =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-item-id")],B);exports.a = q; exports.b = xt; exports.c = m; exports.d = E; exports.e = $; exports.f = St; exports.g = Lt; exports.h = ve; exports.i = D; exports.j = N; exports.k = Q; exports.l = F; exports.m = P; exports.n = L; exports.o = H; exports.p = V; exports.q = U; exports.r = j; exports.s = X; exports.t = y; exports.u = T; exports.v = B;
374
+ `}};T= exports.u =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-toggle-scoring")],T);var B=class extends _lit.LitElement{render(){var r;let{items:t,itemIndex:e}=this._testContext;return _lit.html` ${(r=t[e])==null?void 0:r.identifier} `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_context2.consume.call(void 0, {context:c,subscribe:!0}),_decoratorsjs.state.call(void 0, )],B.prototype,"_testContext",2),B= exports.v =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-item-id")],B);exports.a = q; exports.b = xt; exports.c = c; exports.d = E; exports.e = $; exports.f = Lt; exports.g = St; exports.h = ve; exports.i = z; exports.j = D; exports.k = N; exports.l = P; exports.m = F; exports.n = S; exports.o = H; exports.p = U; exports.q = V; exports.r = j; exports.s = X; exports.t = y; exports.u = T; exports.v = B;
397
375
  /*! Bundled license information:
398
376
 
399
377
  haunted/lib/use-controller.js: