@citolab/qti-components 6.9.1-beta.1 → 6.9.1-beta.11
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.
- package/dist/{chunk-H4VLZ2F7.js → chunk-62FWJYVB.js} +3 -3
- package/dist/chunk-E7TLXHQH.js +2 -0
- package/dist/custom-elements.json +703 -432
- package/dist/index.js +3388 -124
- package/dist/item.css +2702 -550
- package/dist/qti-components/index.d.ts +6 -1157
- package/dist/qti-components/index.js +253 -130
- package/dist/qti-item/index.d.ts +19 -0
- package/dist/qti-item/index.js +3143 -0
- package/dist/qti-loader/index.d.ts +5 -0
- package/dist/qti-loader/index.js +2 -0
- package/dist/qti-simple-choice-bOvnZAEz.d.ts +1156 -0
- package/dist/qti-transformers/index.js +1 -1
- package/package.json +50 -27
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnPropertyDescriptor,Hs=Object.getOwnPropertyDescriptors;var Lr=Object.getOwnPropertySymbols;var Ns=Object.prototype.hasOwnProperty,Ps=Object.prototype.propertyIsEnumerable;var Hr=(i,t,e)=>t in i?Nr(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,C=(i,t)=>{for(var e in t||(t={}))Ns.call(t,e)&&Hr(i,e,t[e]);if(Lr)for(var e of Lr(t))Ps.call(t,e)&&Hr(i,e,t[e]);return i},T=(i,t)=>Ms(i,Hs(t));var l=(i,t,e,r)=>{for(var s=r>1?void 0:r?Ls(t,e):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(r?n(t,e,s):n(s))||s);return r&&s&&Nr(t,e,s),s};var te=class extends Event{constructor(t,e,r){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=e,this.subscribe=r!=null?r:!1}};var xe=class{constructor(t,e,r,s){var o;if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(n,a)=>{this.unsubscribe&&(this.unsubscribe!==a&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=n,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(n,a)),this.unsubscribe=a},this.host=t,e.context!==void 0){let n=e;this.context=n.context,this.callback=n.callback,this.subscribe=(o=n.subscribe)!=null?o:!1}else this.context=e,this.callback=r,this.subscribe=s!=null?s:!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new te(this.context,this.t,this.subscribe))}};var ht=class{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,e=!1){let r=e||!Object.is(t,this.o);this.o=t,r&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(let[e,{disposer:r}]of this.subscriptions)e(this.o,r)},t!==void 0&&(this.value=t)}addCallback(t,e,r){if(!r)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:e});let{disposer:s}=this.subscriptions.get(t);t(this.value,s)}clearCallbacks(){this.subscriptions.clear()}};var Yt=class extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}},Ee=class extends ht{constructor(t,e,r){var s,o;super(e.context!==void 0?e.initialValue:r),this.onContextRequest=n=>{let a=n.composedPath()[0];n.context===this.context&&a!==this.host&&(n.stopPropagation(),this.addCallback(n.callback,a,n.subscribe))},this.onProviderRequest=n=>{let a=n.composedPath()[0];if(n.context!==this.context||a===this.host)return;let c=new Set;for(let[p,{consumerHost:h}]of this.subscriptions)c.has(p)||(c.add(p),h.dispatchEvent(new te(this.context,p,!0)));n.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),(o=(s=this.host).addController)==null||o.call(s,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Yt(this.context))}};function zt({context:i}){return(t,e)=>{let r=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){r.set(this,new Ee(this,{context:i}))}),{get(){return t.get.call(this)},set(s){var o;return(o=r.get(this))==null||o.setValue(s),t.set.call(this,s)},init(s){var o;return(o=r.get(this))==null||o.setValue(s),s}};{t.constructor.addInitializer(n=>{r.set(n,new Ee(n,{context:i}))});let s=Object.getOwnPropertyDescriptor(t,e),o;if(s===void 0){let n=new WeakMap;o={get(){return n.get(this)},set(a){r.get(this).setValue(a),n.set(this,a)},configurable:!0,enumerable:!0}}else{let n=s.set;o=T(C({},s),{set(a){r.get(this).setValue(a),n==null||n.call(this,a)}})}return void Object.defineProperty(t,e,o)}}}function K({context:i,subscribe:t}){return(e,r)=>{typeof r=="object"?r.addInitializer(function(){new xe(this,{context:i,callback:s=>{e.set.call(this,s)},subscribe:t})}):e.constructor.addInitializer(s=>{new xe(s,{context:i,callback:o=>{s[r]=o},subscribe:t})})}}var Pr=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(t){this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBraileLabel="",this.ariaBraileRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=t}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}};var Vr=new WeakMap,He=i=>{let t=Vr.get(i);return t===void 0&&Vr.set(i,t=new Map),t},Ds=class{constructor(){this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(He(this)).map(([t,e])=>({name:t,value:e}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}setAttribute(t,e){He(this).set(t,String(e))}removeAttribute(t){He(this).delete(t)}toggleAttribute(t,e){if(this.hasAttribute(t)){if(e===void 0||!e)return this.removeAttribute(t),!1}else return e===void 0||e?(this.setAttribute(t,""),!0):!1;return!0}hasAttribute(t){return He(this).has(t)}attachShadow(t){let e={host:this};return this.__shadowRootMode=t.mode,t&&t.mode==="open"&&(this.__shadowRoot=e),e}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");let t=new Pr(this);return this.__internals=t,t}getAttribute(t){let e=He(this).get(t);return e!=null?e:null}};var Os=class extends Ds{},Dr=Os;var Us=class{constructor(){this.__definitions=new Map}define(t,e){var r;if(this.__definitions.has(t))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);this.__definitions.set(t,{ctor:e,observedAttributes:(r=e.observedAttributes)!=null?r:[]})}get(t){let e=this.__definitions.get(t);return e==null?void 0:e.ctor}},Is=Us;var Or=new Is;var Ne=globalThis,mt=Ne.ShadowRoot&&(Ne.ShadyCSS===void 0||Ne.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Wt=Symbol(),Ur=new WeakMap,Pe=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==Wt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(mt&&t===void 0){let r=e!==void 0&&e.length===1;r&&(t=Ur.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&Ur.set(e,t))}return t}toString(){return this.cssText}},Ir=i=>new Pe(typeof i=="string"?i:i+"",void 0,Wt),b=(i,...t)=>{let e=i.length===1?i[0]:t.reduce((r,s,o)=>r+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+i[o+1],i[0]);return new Pe(e,i,Wt)},Kt=(i,t)=>{if(mt)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let r=document.createElement("style"),s=Ne.litNonce;s!==void 0&&r.setAttribute("nonce",s),r.textContent=e.cssText,i.appendChild(r)}},ft=mt||Ne.CSSStyleSheet===void 0?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(let r of t.cssRules)e+=r.cssText;return Ir(e)})(i):i;var{is:Fs,defineProperty:Bs,getOwnPropertyDescriptor:Xs,getOwnPropertyNames:js,getOwnPropertySymbols:Ys,getPrototypeOf:zs}=Object,D=globalThis,Xr;(Xr=D.customElements)!=null||(D.customElements=Or);var Fr=D.trustedTypes,Ws=Fr?Fr.emptyScript:"",Jt=D.reactiveElementPolyfillSupport,Ve=(i,t)=>i,De={toAttribute(i,t){switch(t){case Boolean:i=i?Ws:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch(r){e=null}}return e}},gt=(i,t)=>!Fs(i,t),Br={attribute:!0,type:String,converter:De,reflect:!1,hasChanged:gt},jr,Yr;(jr=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(Yr=D.litPropertyMetadata)!=null||(D.litPropertyMetadata=new WeakMap);var zr,J=class extends((zr=globalThis.HTMLElement)!=null?zr:Dr){static addInitializer(t){var e;this._$Ei(),((e=this.l)!=null?e:this.l=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Br){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let r=Symbol(),s=this.getPropertyDescriptor(t,r,e);s!==void 0&&Bs(this.prototype,t,s)}}static getPropertyDescriptor(t,e,r){var n;let{get:s,set:o}=(n=Xs(this.prototype,t))!=null?n:{get(){return this[e]},set(a){this[e]=a}};return{get(){return s==null?void 0:s.call(this)},set(a){let c=s==null?void 0:s.call(this);o.call(this,a),this.requestUpdate(t,c,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return(e=this.elementProperties.get(t))!=null?e:Br}static _$Ei(){if(this.hasOwnProperty(Ve("elementProperties")))return;let t=zs(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Ve("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ve("properties"))){let e=this.properties,r=[...js(e),...Ys(e)];for(let s of r)this.createProperty(s,e[s])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[r,s]of e)this.elementProperties.set(r,s)}this._$Eh=new Map;for(let[e,r]of this.elementProperties){let s=this._$Eu(e,r);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let r=new Set(t.flat(1/0).reverse());for(let s of r)e.unshift(ft(s))}else t!==void 0&&e.push(ft(t));return e}static _$Eu(t,e){let r=e.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e,r;((e=this._$EO)!=null?e:this._$EO=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((r=t.hostConnected)==null||r.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){var e;let t=(e=this.shadowRoot)!=null?e:this.attachShadow(this.constructor.shadowRootOptions);return Kt(t,this.constructor.elementStyles),t}connectedCallback(){var t,e;(t=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(r=>{var s;return(s=r.hostConnected)==null?void 0:s.call(r)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var r;return(r=e.hostDisconnected)==null?void 0:r.call(e)})}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$EC(t,e){var o;let r=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,r);if(s!==void 0&&r.reflect===!0){let n=(((o=r.converter)==null?void 0:o.toAttribute)!==void 0?r.converter:De).toAttribute(e,r.type);this._$Em=t,n==null?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(t,e){var o;let r=this.constructor,s=r._$Eh.get(t);if(s!==void 0&&this._$Em!==s){let n=r.getPropertyOptions(s),a=typeof n.converter=="function"?{fromAttribute:n.converter}:((o=n.converter)==null?void 0:o.fromAttribute)!==void 0?n.converter:De;this._$Em=s,this[s]=a.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,r){var s;if(t!==void 0){if(r!=null||(r=this.constructor.getPropertyOptions(t)),!((s=r.hasChanged)!=null?s:gt)(this[t],e))return;this.P(t,e,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,r){var s;this._$AL.has(t)||this._$AL.set(t,e),r.reflect===!0&&this._$Em!==t&&((s=this._$Ej)!=null?s:this._$Ej=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r,s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((r=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[n,a]of this._$Ep)this[n]=a;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[n,a]of o)a.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],a)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(o=>{var n;return(n=o.hostUpdate)==null?void 0:n.call(o)}),this.update(e)):this._$EU()}catch(o){throw t=!1,this._$EU(),o}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(r=>{var s;return(s=r.hostUpdated)==null?void 0:s.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}},Wr;J.elementStyles=[],J.shadowRootOptions={mode:"open"},J[Ve("elementProperties")]=new Map,J[Ve("finalized")]=new Map,Jt==null||Jt({ReactiveElement:J}),((Wr=D.reactiveElementVersions)!=null?Wr:D.reactiveElementVersions=[]).push("2.0.4");var _e=globalThis,bt=_e.trustedTypes,Kr=bt?bt.createPolicy("lit-html",{createHTML:i=>i}):void 0,Qt="$lit$",Z=`lit$${Math.random().toFixed(9).slice(2)}$`,er="?"+Z,Ks=`<${er}>`,me=_e.document===void 0?{createTreeWalker:()=>({})}:document,Ue=()=>me.createComment(""),Ie=i=>i===null||typeof i!="object"&&typeof i!="function",tr=Array.isArray,rs=i=>tr(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Zt=`[
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Gr=/'/g,Qr=/"/g,ss=/^(?:script|style|textarea|title)$/i,rr=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),u=rr(1),sr=rr(2),po=rr(3),M=Symbol.for("lit-noChange"),_=Symbol.for("lit-nothing"),es=new WeakMap,he=me.createTreeWalker(me,129);function is(i,t){if(!tr(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Kr!==void 0?Kr.createHTML(t):t}var os=(i,t)=>{let e=i.length-1,r=[],s,o=t===2?"<svg>":t===3?"<math>":"",n=Oe;for(let a=0;a<e;a++){let c=i[a],p,h,g=-1,y=0;for(;y<c.length&&(n.lastIndex=y,h=n.exec(c),h!==null);)y=n.lastIndex,n===Oe?h[1]==="!--"?n=Jr:h[1]!==void 0?n=Zr:h[2]!==void 0?(ss.test(h[2])&&(s=RegExp("</"+h[2],"g")),n=ue):h[3]!==void 0&&(n=ue):n===ue?h[0]===">"?(n=s!=null?s:Oe,g=-1):h[1]===void 0?g=-2:(g=n.lastIndex-h[2].length,p=h[1],n=h[3]===void 0?ue:h[3]==='"'?Qr:Gr):n===Qr||n===Gr?n=ue:n===Jr||n===Zr?n=Oe:(n=ue,s=void 0);let v=n===ue&&i[a+1].startsWith("/>")?" ":"";o+=n===Oe?c+Ks:g>=0?(r.push(p),c.slice(0,g)+Qt+c.slice(g)+Z+v):c+Z+(g===-2?a:v)}return[is(i,o+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]},Fe=class i{constructor({strings:t,_$litType$:e},r){let s;this.parts=[];let o=0,n=0,a=t.length-1,c=this.parts,[p,h]=os(t,e);if(this.el=i.createElement(p,r),he.currentNode=this.el.content,e===2||e===3){let g=this.el.content.firstChild;g.replaceWith(...g.childNodes)}for(;(s=he.nextNode())!==null&&c.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(let g of s.getAttributeNames())if(g.endsWith(Qt)){let y=h[n++],v=s.getAttribute(g).split(Z),q=/([.?@])?(.*)/.exec(y);c.push({type:1,index:o,name:q[2],strings:v,ctor:q[1]==="."?yt:q[1]==="?"?xt:q[1]==="@"?Et:ge}),s.removeAttribute(g)}else g.startsWith(Z)&&(c.push({type:6,index:o}),s.removeAttribute(g));if(ss.test(s.tagName)){let g=s.textContent.split(Z),y=g.length-1;if(y>0){s.textContent=bt?bt.emptyScript:"";for(let v=0;v<y;v++)s.append(g[v],Ue()),he.nextNode(),c.push({type:2,index:++o});s.append(g[y],Ue())}}}else if(s.nodeType===8)if(s.data===er)c.push({type:2,index:o});else{let g=-1;for(;(g=s.data.indexOf(Z,g+1))!==-1;)c.push({type:7,index:o}),g+=Z.length-1}o++}}static createElement(t,e){let r=me.createElement("template");return r.innerHTML=t,r}};function fe(i,t,e=i,r){var n,a,c;if(t===M)return t;let s=r!==void 0?(n=e.o)==null?void 0:n[r]:e.l,o=Ie(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==o&&((a=s==null?void 0:s._$AO)==null||a.call(s,!1),o===void 0?s=void 0:(s=new o(i),s._$AT(i,e,r)),r!==void 0?((c=e.o)!=null?c:e.o=[])[r]=s:e.l=s),s!==void 0&&(t=fe(i,s._$AS(i,t.values),s,r)),t}var vt=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var p;let{el:{content:e},parts:r}=this._$AD,s=((p=t==null?void 0:t.creationScope)!=null?p:me).importNode(e,!0);he.currentNode=s;let o=he.nextNode(),n=0,a=0,c=r[0];for(;c!==void 0;){if(n===c.index){let h;c.type===2?h=new Ce(o,o.nextSibling,this,t):c.type===1?h=new c.ctor(o,c.name,c.strings,this,t):c.type===6&&(h=new _t(o,this,t)),this._$AV.push(h),c=r[++a]}n!==(c==null?void 0:c.index)&&(o=he.nextNode(),n++)}return he.currentNode=me,s}p(t){let e=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}},Ce=class i{get _$AU(){var t,e;return(e=(t=this._$AM)==null?void 0:t._$AU)!=null?e:this.v}constructor(t,e,r,s){var o;this.type=2,this._$AH=_,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=s,this.v=(o=s==null?void 0:s.isConnected)!=null?o:!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=fe(this,t,e),Ie(t)?t===_||t==null||t===""?(this._$AH!==_&&this._$AR(),this._$AH=_):t!==this._$AH&&t!==M&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):rs(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==_&&Ie(this._$AH)?this._$AA.nextSibling.data=t:this.T(me.createTextNode(t)),this._$AH=t}$(t){var o;let{values:e,_$litType$:r}=t,s=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=Fe.createElement(is(r.h,r.h[0]),this.options)),r);if(((o=this._$AH)==null?void 0:o._$AD)===s)this._$AH.p(e);else{let n=new vt(s,this),a=n.u(this.options);n.p(e),this.T(a),this._$AH=n}}_$AC(t){let e=es.get(t.strings);return e===void 0&&es.set(t.strings,e=new Fe(t)),e}k(t){tr(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,r,s=0;for(let o of t)s===e.length?e.push(r=new i(this.O(Ue()),this.O(Ue()),this,this.options)):r=e[s],r._$AI(o),s++;s<e.length&&(this._$AR(r&&r._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,e);t&&t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this.v=t,(e=this._$AP)==null||e.call(this,t))}},ge=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,s,o){this.type=1,this._$AH=_,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=_}_$AI(t,e=this,r,s){let o=this.strings,n=!1;if(o===void 0)t=fe(this,t,e,0),n=!Ie(t)||t!==this._$AH&&t!==M,n&&(this._$AH=t);else{let a=t,c,p;for(t=o[0],c=0;c<o.length-1;c++)p=fe(this,a[r+c],e,c),p===M&&(p=this._$AH[c]),n||(n=!Ie(p)||p!==this._$AH[c]),p===_?t=_:t!==_&&(t+=(p!=null?p:"")+o[c+1]),this._$AH[c]=p}n&&!s&&this.j(t)}j(t){t===_?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}},yt=class extends ge{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===_?void 0:t}},xt=class extends ge{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==_)}},Et=class extends ge{constructor(t,e,r,s,o){super(t,e,r,s,o),this.type=5}_$AI(t,e=this){var n;if((t=(n=fe(this,t,e,0))!=null?n:_)===M)return;let r=this._$AH,s=t===_&&r!==_||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==_&&(r===_||s);s&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,r;typeof this._$AH=="function"?this._$AH.call((r=(e=this.options)==null?void 0:e.host)!=null?r:this.element,t):this._$AH.handleEvent(t)}},_t=class{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){fe(this,t)}},ns={M:Qt,P:Z,A:er,C:1,L:os,R:vt,D:rs,V:fe,I:Ce,H:ge,N:xt,U:Et,B:yt,F:_t},Gt=_e.litHtmlPolyfillSupport,ts;Gt==null||Gt(Fe,Ce),((ts=_e.litHtmlVersions)!=null?ts:_e.litHtmlVersions=[]).push("3.2.0");var as=(i,t,e)=>{var o,n;let r=(o=e==null?void 0:e.renderBefore)!=null?o:t,s=r._$litPart$;if(s===void 0){let a=(n=e==null?void 0:e.renderBefore)!=null?n:null;r._$litPart$=s=new Ce(t.insertBefore(Ue(),a),a,void 0,e!=null?e:{})}return s._$AI(i),s};var f=class extends J{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var e,r;let t=super.createRenderRoot();return(r=(e=this.renderOptions).renderBefore)!=null||(e.renderBefore=t.firstChild),t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=as(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this.o)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.o)==null||t.setConnected(!1)}render(){return M}},ls;f._$litElement$=!0,f.finalized=!0,(ls=globalThis.litElementHydrateSupport)==null||ls.call(globalThis,{LitElement:f});var ir=globalThis.litElementPolyfillSupport;ir==null||ir({LitElement:f});var cs;((cs=globalThis.litElementVersions)!=null?cs:globalThis.litElementVersions=[]).push("4.1.0");var m=i=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(i,t)}):customElements.define(i,t)};var Js={attribute:!0,type:String,converter:De,reflect:!1,hasChanged:gt},Zs=(i=Js,t,e)=>{let{kind:r,metadata:s}=e,o=globalThis.litPropertyMetadata.get(s);if(o===void 0&&globalThis.litPropertyMetadata.set(s,o=new Map),o.set(e.name,i),r==="accessor"){let{name:n}=e;return{set(a){let c=t.get.call(this);t.set.call(this,a),this.requestUpdate(n,c,i)},init(a){return a!==void 0&&this.P(n,void 0,i),a}}}if(r==="setter"){let{name:n}=e;return function(a){let c=this[n];t.call(this,a),this.requestUpdate(n,c,i)}}throw Error("Unsupported decorator location: "+r)};function d(i){return(t,e)=>typeof e=="object"?Zs(i,t,e):((r,s,o)=>{let n=s.hasOwnProperty(o);return s.constructor.createProperty(o,n?T(C({},r),{wrapped:!0}):r),n?Object.getOwnPropertyDescriptor(s,o):void 0})(i,t,e)}function E(i){return d(T(C({},i),{state:!0,attribute:!1}))}var re=(i,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(i,t,e),e);function Be(i,t){return(e,r,s)=>{let o=n=>{var a,c;return(c=(a=n.renderRoot)==null?void 0:a.querySelector(i))!=null?c:null};if(t){let{get:n,set:a}=typeof r=="object"?e:s!=null?s:(()=>{let c=Symbol();return{get(){return this[c]},set(p){this[c]=p}}})();return re(e,r,{get(){let c=n.call(this);return c===void 0&&(c=o(this),(c!==null||this.hasUpdated)&&a.call(this,c)),c}})}return re(e,r,{get(){return o(this)}})}}function ps(i){return(t,e)=>{let{slot:r,selector:s}=i!=null?i:{},o="slot"+(r?`[name=${r}]`:":not([name])");return re(t,e,{get(){var c,p;let n=(c=this.renderRoot)==null?void 0:c.querySelector(o),a=(p=n==null?void 0:n.assignedElements(i))!=null?p:[];return s===void 0?a:a.filter(h=>h.matches(s))}})}}function S(i,t){let e=C({waitUntilFirstUpdate:!1},t);return(r,s)=>{let{update:o}=r,n=Array.isArray(i)?i:[i];r.update=function(a){n.forEach(c=>{let p=c;if(a.has(p)){let h=a.get(p),g=this[p];h!==g&&(!e.waitUntilFirstUpdate||this.hasUpdated)&&this[s](h,g)}}),o.call(this,a)}}}var ds=[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}],O="item";var L=class extends f{constructor(){super();this.identifier="";this.adaptive="false";this.timeDependent="false";this._handleDisabledChange=(e,r)=>{this._interactionElements.forEach(s=>s.disabled=r)};this._handleReadonlyChange=(e,r)=>this._interactionElements.forEach(s=>s.readonly=r);this._context={identifier:this.getAttribute("identifier"),variables:ds};this._initialContext=T(C({},this._context),{variables:this._context.variables});this._feedbackElements=[];this._interactionElements=[];this.addEventListener("qti-register-variable",e=>{this._context=T(C({},this._context),{variables:[...this._context.variables,e.detail.variable]}),this._initialContext=this._context,e.stopPropagation()}),this.addEventListener("qti-register-feedback",e=>{e.stopPropagation();let r=e.detail;this._feedbackElements.push(r),r.checkShowFeedback(r.outcomeIdentifier)}),this.addEventListener("qti-register-interaction",e=>{e.stopPropagation(),this._interactionElements.push(e.target)}),this.addEventListener("end-attempt",e=>{let{responseIdentifier:r,countAttempt:s}=e.detail;this.updateResponseVariable(r,"true"),this.processResponse(s)}),this.addEventListener("qti-set-outcome-value",e=>{let{outcomeIdentifier:r,value:s}=e.detail;this.updateOutcomeVariable(r,s),e.stopPropagation()}),this.addEventListener("qti-interaction-response",this.handleUpdateResponseVariable)}get variables(){return this._context.variables.map(e=>({identifier:e.identifier,value:e.value,type:e.type}))}set variables(e){if(!Array.isArray(e)||e.some(r=>!("identifier"in r))){console.warn("variables property should be an array of VariableDeclaration");return}this._context=T(C({},this._context),{variables:this._context.variables.map(r=>{let s=e.find(o=>o.identifier===r.identifier);return s?C(C({},r),s):r})}),this._context.variables.forEach(r=>{if(r.type==="response"){let s=this._interactionElements.find(o=>o.responseIdentifier===r.identifier);s&&(s.response=r.value)}r.type==="outcome"&&this._feedbackElements.forEach(s=>s.checkShowFeedback(r.identifier))})}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this._emit("qti-assessment-item-connected",this)}set responses(e){if(e)for(let r of e){this.getResponse(r.responseIdentifier)&&this.updateResponseVariable(r.responseIdentifier,r.response);let o=this._interactionElements.find(n=>n.getAttribute("response-identifier")===r.responseIdentifier);o&&(o.response=r.response)}}render(){return u`<slot></slot>`}showCorrectResponse(e){let s=this._context.variables.filter(o=>"correctResponse"in o&&o.correctResponse).map(o=>({responseIdentifier:o.identifier,response:o.correctResponse}));for(let o of s){let n=this._interactionElements.find(a=>a.getAttribute("response-identifier")===o.responseIdentifier);n&&(n.correctResponse=e?o.response:"")}}processResponse(e=!0){var s;let r=this.querySelector("qti-response-processing");return!r||!r.process?!1:(r.process(),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus()),e&&this.updateOutcomeVariable("numAttempts",(+((s=this._context.variables.find(o=>o.identifier==="numAttempts"))==null?void 0:s.value)+1).toString()),this._emit("qti-response-processed"),!0)}resetResponses(){this._context=this._initialContext}getResponse(e){return this.getVariable(e)}getOutcome(e){return this.getVariable(e)}getVariable(e){return this._context.variables.find(r=>r.identifier===e)||null}handleUpdateResponseVariable(e){let{responseIdentifier:r,response:s}=e.detail;this.updateResponseVariable(r,s)}updateResponseVariable(e,r){this._context=T(C({},this._context),{variables:this._context.variables.map(s=>s.identifier!==e?s:T(C({},s),{value:r}))}),this._emit("qti-interaction-changed",{item:this.identifier,responseIdentifier:e,response:Array.isArray(r)?[...r]:r}),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus())}updateOutcomeVariable(e,r){var o;let s=this.getOutcome(e);if(!s){console.warn(`Can not set qti-outcome-identifier: ${e}, it is not available`);return}this._context=T(C({},this._context),{variables:this._context.variables.map(n=>n.identifier!==e?n:T(C({},n),{value:s.cardinality==="single"?r:[...n.value,r]}))}),this._feedbackElements.forEach(n=>n.checkShowFeedback(e)),this._emit("qti-outcome-changed",{item:this.identifier,outcomeIdentifier:e,value:(o=this._context.variables.find(n=>n.identifier===e))==null?void 0:o.value})}_getCompletionStatus(){return this._interactionElements.every(e=>e.validate())?"completed":this._interactionElements.some(e=>e.validate())?"incomplete":"not_attempted"}_emit(e,r=null){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:r}))}};l([d({type:String})],L.prototype,"title",2),l([d({type:String})],L.prototype,"identifier",2),l([d({type:String})],L.prototype,"adaptive",2),l([d({type:String})],L.prototype,"timeDependent",2),l([d({type:Boolean})],L.prototype,"disabled",2),l([S("disabled",{waitUntilFirstUpdate:!0})],L.prototype,"_handleDisabledChange",2),l([d({type:Boolean})],L.prototype,"readonly",2),l([S("readonly",{waitUntilFirstUpdate:!0})],L.prototype,"_handleReadonlyChange",2),l([zt({context:O})],L.prototype,"_context",2),L=l([m("qti-assessment-item")],L);var Gs=String.raw,us=()=>{let i,t={async load(e,r=!1){return new Promise((s,o)=>{nr(e,r).then(n=>(i=n,s(t)))})},parse(e){return i=ar(e),t},path:e=>(ti(i,e),t),fn(e){return e(i),t},pciHooks(e){let r=["hook","module"],s=e.substring(0,e.lastIndexOf("/"));for(let o of r)i.querySelectorAll("["+o+"]").forEach(a=>{let c=a.getAttribute(o);!c.startsWith("data:")&&!c.startsWith("http")&&(a.setAttribute("base-url",e),a.setAttribute("module",s+"/"+encodeURIComponent(c+(c.endsWith(".js")?"":".js"))))});return t},customInteraction(e,r){let s=i.querySelector("qti-custom-interaction"),o=s.querySelector("object");return s.setAttribute("data-base-ref",e),s.setAttribute("data-base-item",e+r),s.setAttribute("data",o.getAttribute("data")),s.setAttribute("width",o.getAttribute("width")),s.setAttribute("height",o.getAttribute("height")),s.removeChild(o),t},convertCDATAtoComment(){return ri(i),t},stripStyleSheets(){return si(i),t},html(){return new XMLSerializer().serializeToString(Ct(i))},xml(){return new XMLSerializer().serializeToString(i)},htmldoc(){return Ct(i)},xmldoc(){return i}};return t},un=()=>{let i,t={async load(e){return new Promise((r,s)=>{nr(e).then(o=>(i=o,r(t)))})},parse(e){i=ar(e)},assessmentTest(){let e=i.querySelector('resource[type="imsqti_test_xmlv3p0"]');return{href:e.getAttribute("href"),identifier:e.getAttribute("identifier")}}};return t},hn=()=>{let i,t={async load(e){return new Promise((r,s)=>{nr(e).then(o=>(i=o,r(t)))})},parse(e){return i=ar(e),t},fn(e){return e(i),t},items(){return ei(i)},html(){return new XMLSerializer().serializeToString(Ct(i))},xml(){return new XMLSerializer().serializeToString(i)},htmldoc(){return Ct(i)},xmldoc(){return i}};return t},Qs=Gs`<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
1
|
+
var jr=Object.defineProperty,Ki=Object.defineProperties,Zi=Object.getOwnPropertyDescriptor,Ji=Object.getOwnPropertyDescriptors;var Fr=Object.getOwnPropertySymbols;var Gi=Object.prototype.hasOwnProperty,Qi=Object.prototype.propertyIsEnumerable;var Xr=s=>{throw TypeError(s)};var Br=(s,t,e)=>t in s?jr(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,C=(s,t)=>{for(var e in t||(t={}))Gi.call(t,e)&&Br(s,e,t[e]);if(Fr)for(var e of Fr(t))Qi.call(t,e)&&Br(s,e,t[e]);return s},_=(s,t)=>Ki(s,Ji(t));var l=(s,t,e,r)=>{for(var i=r>1?void 0:r?Zi(t,e):t,o=s.length-1,n;o>=0;o--)(n=s[o])&&(i=(r?n(t,e,i):n(i))||i);return r&&i&&jr(t,e,i),i};var Yr=(s,t,e)=>t.has(s)||Xr("Cannot "+e);var R=(s,t,e)=>(Yr(s,t,"read from private field"),e?e.call(s):t.get(s)),qt=(s,t,e)=>t.has(s)?Xr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),Wr=(s,t,e,r)=>(Yr(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e);var ie=class extends Event{constructor(t,e,r){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=e,this.subscribe=r!=null?r:!1}};var Ee=class{constructor(t,e,r,i){var o;if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(n,a)=>{this.unsubscribe&&(this.unsubscribe!==a&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=n,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(n,a)),this.unsubscribe=a},this.host=t,e.context!==void 0){let n=e;this.context=n.context,this.callback=n.callback,this.subscribe=(o=n.subscribe)!=null?o:!1}else this.context=e,this.callback=r,this.subscribe=i!=null?i:!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new ie(this.context,this.t,this.subscribe))}};var wt=class{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,e=!1){let r=e||!Object.is(t,this.o);this.o=t,r&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(let[e,{disposer:r}]of this.subscriptions)e(this.o,r)},t!==void 0&&(this.value=t)}addCallback(t,e,r){if(!r)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:e});let{disposer:i}=this.subscriptions.get(t);t(this.value,i)}clearCallbacks(){this.subscriptions.clear()}};var er=class extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}},Ce=class extends wt{constructor(t,e,r){var i,o;super(e.context!==void 0?e.initialValue:r),this.onContextRequest=n=>{let a=n.composedPath()[0];n.context===this.context&&a!==this.host&&(n.stopPropagation(),this.addCallback(n.callback,a,n.subscribe))},this.onProviderRequest=n=>{let a=n.composedPath()[0];if(n.context!==this.context||a===this.host)return;let c=new Set;for(let[p,{consumerHost:f}]of this.subscriptions)c.has(p)||(c.add(p),f.dispatchEvent(new ie(this.context,p,!0)));n.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),(o=(i=this.host).addController)==null||o.call(i,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new er(this.context))}};function tr({context:s}){return(t,e)=>{let r=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){r.set(this,new Ce(this,{context:s}))}),{get(){return t.get.call(this)},set(i){var o;return(o=r.get(this))==null||o.setValue(i),t.set.call(this,i)},init(i){var o;return(o=r.get(this))==null||o.setValue(i),i}};{t.constructor.addInitializer(n=>{r.set(n,new Ce(n,{context:s}))});let i=Object.getOwnPropertyDescriptor(t,e),o;if(i===void 0){let n=new WeakMap;o={get(){return n.get(this)},set(a){r.get(this).setValue(a),n.set(this,a)},configurable:!0,enumerable:!0}}else{let n=i.set;o=_(C({},i),{set(a){r.get(this).setValue(a),n==null||n.call(this,a)}})}return void Object.defineProperty(t,e,o)}}}function J({context:s,subscribe:t}){return(e,r)=>{typeof r=="object"?r.addInitializer(function(){new Ee(this,{context:s,callback:i=>{e.set.call(this,i)},subscribe:t})}):e.constructor.addInitializer(i=>{new Ee(i,{context:s,callback:o=>{i[r]=o},subscribe:t})})}}var Kr=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(t){this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBraileLabel="",this.ariaBraileRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=t}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}};var Zr=new WeakMap,Oe=s=>{let t=Zr.get(s);return t===void 0&&Zr.set(s,t=new Map),t},ts=class{constructor(){this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(Oe(this)).map(([t,e])=>({name:t,value:e}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}setAttribute(t,e){Oe(this).set(t,String(e))}removeAttribute(t){Oe(this).delete(t)}toggleAttribute(t,e){if(this.hasAttribute(t)){if(e===void 0||!e)return this.removeAttribute(t),!1}else return e===void 0||e?(this.setAttribute(t,""),!0):!1;return!0}hasAttribute(t){return Oe(this).has(t)}attachShadow(t){let e={host:this};return this.__shadowRootMode=t.mode,t&&t.mode==="open"&&(this.__shadowRoot=e),e}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");let t=new Kr(this);return this.__internals=t,t}getAttribute(t){let e=Oe(this).get(t);return e!=null?e:null}};var rs=class extends ts{},Jr=rs;var is=class{constructor(){this.__definitions=new Map}define(t,e){var r;if(this.__definitions.has(t))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);this.__definitions.set(t,{ctor:e,observedAttributes:(r=e.observedAttributes)!=null?r:[]})}get(t){let e=this.__definitions.get(t);return e==null?void 0:e.ctor}},ss=is;var Gr=new ss;var Ue=globalThis,Et=Ue.ShadowRoot&&(Ue.ShadyCSS===void 0||Ue.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,rr=Symbol(),Qr=new WeakMap,ze=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==rr)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(Et&&t===void 0){let r=e!==void 0&&e.length===1;r&&(t=Qr.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&Qr.set(e,t))}return t}toString(){return this.cssText}},ei=s=>new ze(typeof s=="string"?s:s+"",void 0,rr),b=(s,...t)=>{let e=s.length===1?s[0]:t.reduce((r,i,o)=>r+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+s[o+1],s[0]);return new ze(e,s,rr)},ir=(s,t)=>{if(Et)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let r=document.createElement("style"),i=Ue.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=e.cssText,s.appendChild(r)}},Ct=Et||Ue.CSSStyleSheet===void 0?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(let r of t.cssRules)e+=r.cssText;return ei(e)})(s):s;var{is:os,defineProperty:ns,getOwnPropertyDescriptor:as,getOwnPropertyNames:ls,getOwnPropertySymbols:cs,getPrototypeOf:ds}=Object,I=globalThis,ii;(ii=I.customElements)!=null||(I.customElements=Gr);var ti=I.trustedTypes,ps=ti?ti.emptyScript:"",sr=I.reactiveElementPolyfillSupport,Fe=(s,t)=>s,Be={toAttribute(s,t){switch(t){case Boolean:s=s?ps:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch(r){e=null}}return e}},kt=(s,t)=>!os(s,t),ri={attribute:!0,type:String,converter:Be,reflect:!1,hasChanged:kt},si,oi;(si=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(oi=I.litPropertyMetadata)!=null||(I.litPropertyMetadata=new WeakMap);var ni,G=class extends((ni=globalThis.HTMLElement)!=null?ni:Jr){static addInitializer(t){var e;this._$Ei(),((e=this.l)!=null?e:this.l=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=ri){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let r=Symbol(),i=this.getPropertyDescriptor(t,r,e);i!==void 0&&ns(this.prototype,t,i)}}static getPropertyDescriptor(t,e,r){var n;let{get:i,set:o}=(n=as(this.prototype,t))!=null?n:{get(){return this[e]},set(a){this[e]=a}};return{get(){return i==null?void 0:i.call(this)},set(a){let c=i==null?void 0:i.call(this);o.call(this,a),this.requestUpdate(t,c,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return(e=this.elementProperties.get(t))!=null?e:ri}static _$Ei(){if(this.hasOwnProperty(Fe("elementProperties")))return;let t=ds(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Fe("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Fe("properties"))){let e=this.properties,r=[...ls(e),...cs(e)];for(let i of r)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[r,i]of e)this.elementProperties.set(r,i)}this._$Eh=new Map;for(let[e,r]of this.elementProperties){let i=this._$Eu(e,r);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let r=new Set(t.flat(1/0).reverse());for(let i of r)e.unshift(Ct(i))}else t!==void 0&&e.push(Ct(t));return e}static _$Eu(t,e){let r=e.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e,r;((e=this._$EO)!=null?e:this._$EO=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((r=t.hostConnected)==null||r.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){var e;let t=(e=this.shadowRoot)!=null?e:this.attachShadow(this.constructor.shadowRootOptions);return ir(t,this.constructor.elementStyles),t}connectedCallback(){var t,e;(t=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(r=>{var i;return(i=r.hostConnected)==null?void 0:i.call(r)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var r;return(r=e.hostDisconnected)==null?void 0:r.call(e)})}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$EC(t,e){var o;let r=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,r);if(i!==void 0&&r.reflect===!0){let n=(((o=r.converter)==null?void 0:o.toAttribute)!==void 0?r.converter:Be).toAttribute(e,r.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){var o;let r=this.constructor,i=r._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let n=r.getPropertyOptions(i),a=typeof n.converter=="function"?{fromAttribute:n.converter}:((o=n.converter)==null?void 0:o.fromAttribute)!==void 0?n.converter:Be;this._$Em=i,this[i]=a.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,r){var i;if(t!==void 0){if(r!=null||(r=this.constructor.getPropertyOptions(t)),!((i=r.hasChanged)!=null?i:kt)(this[t],e))return;this.P(t,e,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,r){var i;this._$AL.has(t)||this._$AL.set(t,e),r.reflect===!0&&this._$Em!==t&&((i=this._$Ej)!=null?i:this._$Ej=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r,i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((r=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[n,a]of this._$Ep)this[n]=a;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[n,a]of o)a.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],a)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(i=this._$EO)==null||i.forEach(o=>{var n;return(n=o.hostUpdate)==null?void 0:n.call(o)}),this.update(e)):this._$EU()}catch(o){throw t=!1,this._$EU(),o}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(r=>{var i;return(i=r.hostUpdated)==null?void 0:i.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}},ai;G.elementStyles=[],G.shadowRootOptions={mode:"open"},G[Fe("elementProperties")]=new Map,G[Fe("finalized")]=new Map,sr==null||sr({ReactiveElement:G}),((ai=I.reactiveElementVersions)!=null?ai:I.reactiveElementVersions=[]).push("2.0.4");var ke=globalThis,Tt=ke.trustedTypes,li=Tt?Tt.createPolicy("lit-html",{createHTML:s=>s}):void 0,ar="$lit$",Q=`lit$${Math.random().toFixed(9).slice(2)}$`,lr="?"+Q,hs=`<${lr}>`,be=ke.document===void 0?{createTreeWalker:()=>({})}:document,Xe=()=>be.createComment(""),Ye=s=>s===null||typeof s!="object"&&typeof s!="function",cr=Array.isArray,gi=s=>cr(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",or=`[
|
|
2
|
+
\f\r]`,je=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ci=/-->/g,di=/>/g,ge=RegExp(`>|${or}(?:([^\\s"'>=/]+)(${or}*=${or}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),pi=/'/g,hi=/"/g,fi=/^(?:script|style|textarea|title)$/i,dr=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),h=dr(1),pr=dr(2),_o=dr(3),L=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),mi=new WeakMap,fe=be.createTreeWalker(be,129);function bi(s,t){if(!cr(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return li!==void 0?li.createHTML(t):t}var vi=(s,t)=>{let e=s.length-1,r=[],i,o=t===2?"<svg>":t===3?"<math>":"",n=je;for(let a=0;a<e;a++){let c=s[a],p,f,g=-1,y=0;for(;y<c.length&&(n.lastIndex=y,f=n.exec(c),f!==null);)y=n.lastIndex,n===je?f[1]==="!--"?n=ci:f[1]!==void 0?n=di:f[2]!==void 0?(fi.test(f[2])&&(i=RegExp("</"+f[2],"g")),n=ge):f[3]!==void 0&&(n=ge):n===ge?f[0]===">"?(n=i!=null?i:je,g=-1):f[1]===void 0?g=-2:(g=n.lastIndex-f[2].length,p=f[1],n=f[3]===void 0?ge:f[3]==='"'?hi:pi):n===hi||n===pi?n=ge:n===ci||n===di?n=je:(n=ge,i=void 0);let v=n===ge&&s[a+1].startsWith("/>")?" ":"";o+=n===je?c+hs:g>=0?(r.push(p),c.slice(0,g)+ar+c.slice(g)+Q+v):c+Q+(g===-2?a:v)}return[bi(s,o+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]},We=class s{constructor({strings:t,_$litType$:e},r){let i;this.parts=[];let o=0,n=0,a=t.length-1,c=this.parts,[p,f]=vi(t,e);if(this.el=s.createElement(p,r),fe.currentNode=this.el.content,e===2||e===3){let g=this.el.content.firstChild;g.replaceWith(...g.childNodes)}for(;(i=fe.nextNode())!==null&&c.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(let g of i.getAttributeNames())if(g.endsWith(ar)){let y=f[n++],v=i.getAttribute(g).split(Q),w=/([.?@])?(.*)/.exec(y);c.push({type:1,index:o,name:w[2],strings:v,ctor:w[1]==="."?_t:w[1]==="?"?St:w[1]==="@"?Rt:ye}),i.removeAttribute(g)}else g.startsWith(Q)&&(c.push({type:6,index:o}),i.removeAttribute(g));if(fi.test(i.tagName)){let g=i.textContent.split(Q),y=g.length-1;if(y>0){i.textContent=Tt?Tt.emptyScript:"";for(let v=0;v<y;v++)i.append(g[v],Xe()),fe.nextNode(),c.push({type:2,index:++o});i.append(g[y],Xe())}}}else if(i.nodeType===8)if(i.data===lr)c.push({type:2,index:o});else{let g=-1;for(;(g=i.data.indexOf(Q,g+1))!==-1;)c.push({type:7,index:o}),g+=Q.length-1}o++}}static createElement(t,e){let r=be.createElement("template");return r.innerHTML=t,r}};function ve(s,t,e=s,r){var n,a,c;if(t===L)return t;let i=r!==void 0?(n=e.o)==null?void 0:n[r]:e.l,o=Ye(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==o&&((a=i==null?void 0:i._$AO)==null||a.call(i,!1),o===void 0?i=void 0:(i=new o(s),i._$AT(s,e,r)),r!==void 0?((c=e.o)!=null?c:e.o=[])[r]=i:e.l=i),i!==void 0&&(t=ve(s,i._$AS(s,t.values),i,r)),t}var At=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var p;let{el:{content:e},parts:r}=this._$AD,i=((p=t==null?void 0:t.creationScope)!=null?p:be).importNode(e,!0);fe.currentNode=i;let o=fe.nextNode(),n=0,a=0,c=r[0];for(;c!==void 0;){if(n===c.index){let f;c.type===2?f=new Te(o,o.nextSibling,this,t):c.type===1?f=new c.ctor(o,c.name,c.strings,this,t):c.type===6&&(f=new Mt(o,this,t)),this._$AV.push(f),c=r[++a]}n!==(c==null?void 0:c.index)&&(o=fe.nextNode(),n++)}return fe.currentNode=be,i}p(t){let e=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}},Te=class s{get _$AU(){var t,e;return(e=(t=this._$AM)==null?void 0:t._$AU)!=null?e:this.v}constructor(t,e,r,i){var o;this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=i,this.v=(o=i==null?void 0:i.isConnected)!=null?o:!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=ve(this,t,e),Ye(t)?t===E||t==null||t===""?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==L&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):gi(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==E&&Ye(this._$AH)?this._$AA.nextSibling.data=t:this.T(be.createTextNode(t)),this._$AH=t}$(t){var o;let{values:e,_$litType$:r}=t,i=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=We.createElement(bi(r.h,r.h[0]),this.options)),r);if(((o=this._$AH)==null?void 0:o._$AD)===i)this._$AH.p(e);else{let n=new At(i,this),a=n.u(this.options);n.p(e),this.T(a),this._$AH=n}}_$AC(t){let e=mi.get(t.strings);return e===void 0&&mi.set(t.strings,e=new We(t)),e}k(t){cr(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,r,i=0;for(let o of t)i===e.length?e.push(r=new s(this.O(Xe()),this.O(Xe()),this,this.options)):r=e[i],r._$AI(o),i++;i<e.length&&(this._$AR(r&&r._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,e);t&&t!==this._$AB;){let i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this.v=t,(e=this._$AP)==null||e.call(this,t))}},ye=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,i,o){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=E}_$AI(t,e=this,r,i){let o=this.strings,n=!1;if(o===void 0)t=ve(this,t,e,0),n=!Ye(t)||t!==this._$AH&&t!==L,n&&(this._$AH=t);else{let a=t,c,p;for(t=o[0],c=0;c<o.length-1;c++)p=ve(this,a[r+c],e,c),p===L&&(p=this._$AH[c]),n||(n=!Ye(p)||p!==this._$AH[c]),p===E?t=E:t!==E&&(t+=(p!=null?p:"")+o[c+1]),this._$AH[c]=p}n&&!i&&this.j(t)}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}},_t=class extends ye{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===E?void 0:t}},St=class extends ye{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E)}},Rt=class extends ye{constructor(t,e,r,i,o){super(t,e,r,i,o),this.type=5}_$AI(t,e=this){var n;if((t=(n=ve(this,t,e,0))!=null?n:E)===L)return;let r=this._$AH,i=t===E&&r!==E||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==E&&(r===E||i);i&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,r;typeof this._$AH=="function"?this._$AH.call((r=(e=this.options)==null?void 0:e.host)!=null?r:this.element,t):this._$AH.handleEvent(t)}},Mt=class{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){ve(this,t)}},yi={M:ar,P:Q,A:lr,C:1,L:vi,R:At,D:gi,V:ve,I:Te,H:ye,N:St,U:Rt,B:_t,F:Mt},nr=ke.litHtmlPolyfillSupport,ui;nr==null||nr(We,Te),((ui=ke.litHtmlVersions)!=null?ui:ke.litHtmlVersions=[]).push("3.2.0");var xi=(s,t,e)=>{var o,n;let r=(o=e==null?void 0:e.renderBefore)!=null?o:t,i=r._$litPart$;if(i===void 0){let a=(n=e==null?void 0:e.renderBefore)!=null?n:null;r._$litPart$=i=new Te(t.insertBefore(Xe(),a),a,void 0,e!=null?e:{})}return i._$AI(s),i};var u=class extends G{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var e,r;let t=super.createRenderRoot();return(r=(e=this.renderOptions).renderBefore)!=null||(e.renderBefore=t.firstChild),t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=xi(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this.o)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.o)==null||t.setConnected(!1)}render(){return L}},qi;u._$litElement$=!0,u.finalized=!0,(qi=globalThis.litElementHydrateSupport)==null||qi.call(globalThis,{LitElement:u});var hr=globalThis.litElementPolyfillSupport;hr==null||hr({LitElement:u});var wi;((wi=globalThis.litElementVersions)!=null?wi:globalThis.litElementVersions=[]).push("4.1.0");var m=s=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(s,t)}):customElements.define(s,t)};var ms={attribute:!0,type:String,converter:Be,reflect:!1,hasChanged:kt},us=(s=ms,t,e)=>{let{kind:r,metadata:i}=e,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(e.name,s),r==="accessor"){let{name:n}=e;return{set(a){let c=t.get.call(this);t.set.call(this,a),this.requestUpdate(n,c,s)},init(a){return a!==void 0&&this.P(n,void 0,s),a}}}if(r==="setter"){let{name:n}=e;return function(a){let c=this[n];t.call(this,a),this.requestUpdate(n,c,s)}}throw Error("Unsupported decorator location: "+r)};function d(s){return(t,e)=>typeof e=="object"?us(s,t,e):((r,i,o)=>{let n=i.hasOwnProperty(o);return i.constructor.createProperty(o,n?_(C({},r),{wrapped:!0}):r),n?Object.getOwnPropertyDescriptor(i,o):void 0})(s,t,e)}function q(s){return d(_(C({},s),{state:!0,attribute:!1}))}var se=(s,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(s,t,e),e);function Ke(s,t){return(e,r,i)=>{let o=n=>{var a,c;return(c=(a=n.renderRoot)==null?void 0:a.querySelector(s))!=null?c:null};if(t){let{get:n,set:a}=typeof r=="object"?e:i!=null?i:(()=>{let c=Symbol();return{get(){return this[c]},set(p){this[c]=p}}})();return se(e,r,{get(){let c=n.call(this);return c===void 0&&(c=o(this),(c!==null||this.hasUpdated)&&a.call(this,c)),c}})}return se(e,r,{get(){return o(this)}})}}function Ei(s){return(t,e)=>{let{slot:r,selector:i}=s!=null?s:{},o="slot"+(r?`[name=${r}]`:":not([name])");return se(t,e,{get(){var c,p;let n=(c=this.renderRoot)==null?void 0:c.querySelector(o),a=(p=n==null?void 0:n.assignedElements(s))!=null?p:[];return i===void 0?a:a.filter(f=>f.matches(i))}})}}function S(s,t){let e=C({waitUntilFirstUpdate:!1},t);return(r,i)=>{let{update:o}=r,n=Array.isArray(s)?s:[s];r.update=function(a){n.forEach(c=>{let p=c;if(a.has(p)){let f=a.get(p),g=this[p];f!==g&&(!e.waitUntilFirstUpdate||this.hasUpdated)&&this[i](f,g)}}),o.call(this,a)}}}var Ci=[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}],O="item";var $=class extends u{constructor(){super();this.identifier="";this.adaptive="false";this.timeDependent=null;this._handleDisabledChange=(e,r)=>{this._interactionElements.forEach(i=>i.disabled=r)};this._handleReadonlyChange=(e,r)=>this._interactionElements.forEach(i=>i.readonly=r);this._context={identifier:this.getAttribute("identifier"),variables:Ci};this._initialContext=_(C({},this._context),{variables:this._context.variables});this._feedbackElements=[];this._interactionElements=[];this.addEventListener("qti-register-variable",e=>{this._context=_(C({},this._context),{variables:[...this._context.variables,e.detail.variable]}),this._initialContext=this._context,e.stopPropagation()}),this.addEventListener("qti-register-feedback",e=>{e.stopPropagation();let r=e.detail;this._feedbackElements.push(r),r.checkShowFeedback(r.outcomeIdentifier)}),this.addEventListener("qti-register-interaction",e=>{e.stopPropagation(),this._interactionElements.push(e.target)}),this.addEventListener("end-attempt",e=>{let{responseIdentifier:r,countAttempt:i}=e.detail;this.updateResponseVariable(r,"true"),this.processResponse(i)}),this.addEventListener("qti-set-outcome-value",e=>{let{outcomeIdentifier:r,value:i}=e.detail;this.updateOutcomeVariable(r,i),e.stopPropagation()}),this.addEventListener("qti-interaction-response",this.handleUpdateResponseVariable)}get variables(){return this._context.variables.map(e=>C({identifier:e.identifier,value:e.value,type:e.type},e.type==="outcome"&&e.identifier==="SCORE"?{externalScored:e.externalScored}:{}))}set variables(e){if(!Array.isArray(e)||e.some(r=>!("identifier"in r))){console.warn("variables property should be an array of VariableDeclaration");return}this._context=_(C({},this._context),{variables:this._context.variables.map(r=>{let i=e.find(o=>o.identifier===r.identifier);return i?C(C({},r),i):r})}),this._context.variables.forEach(r=>{if(r.type==="response"){let i=this._interactionElements.find(o=>o.responseIdentifier===r.identifier);i&&(i.response=r.value)}r.type==="outcome"&&this._feedbackElements.forEach(i=>i.checkShowFeedback(r.identifier))})}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this._emit("qti-assessment-item-connected",this)}set responses(e){if(e)for(let r of e){this.getResponse(r.responseIdentifier)&&this.updateResponseVariable(r.responseIdentifier,r.response);let o=this._interactionElements.find(n=>n.getAttribute("response-identifier")===r.responseIdentifier);o&&(o.response=r.response)}}render(){return h`<slot></slot>`}showCorrectResponse(e){let i=this._context.variables.filter(o=>"correctResponse"in o&&o.correctResponse).map(o=>({responseIdentifier:o.identifier,response:o.correctResponse}));for(let o of i){let n=this._interactionElements.find(a=>a.getAttribute("response-identifier")===o.responseIdentifier);n&&(n.correctResponse=e?o.response:"")}}processResponse(e=!0){var i;let r=this.querySelector("qti-response-processing");return!r||!r.process?!1:(r.process(),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus()),e&&this.updateOutcomeVariable("numAttempts",(+((i=this._context.variables.find(o=>o.identifier==="numAttempts"))==null?void 0:i.value)+1).toString()),this._emit("qti-response-processed"),!0)}resetResponses(){this._context=this._initialContext}getResponse(e){return this.getVariable(e)}getOutcome(e){return this.getVariable(e)}getVariable(e){return this._context.variables.find(r=>r.identifier===e)||null}handleUpdateResponseVariable(e){let{responseIdentifier:r,response:i}=e.detail;this.updateResponseVariable(r,i)}updateResponseVariable(e,r){this._context=_(C({},this._context),{variables:this._context.variables.map(i=>i.identifier!==e?i:_(C({},i),{value:r}))}),this._emit("qti-interaction-changed",{item:this.identifier,responseIdentifier:e,response:Array.isArray(r)?[...r]:r}),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus())}updateOutcomeVariable(e,r){var o;let i=this.getOutcome(e);if(!i){console.warn(`Can not set qti-outcome-identifier: ${e}, it is not available`);return}this._context=_(C({},this._context),{variables:this._context.variables.map(n=>n.identifier!==e?n:_(C({},n),{value:i.cardinality==="single"?r:[...n.value,r]}))}),this._feedbackElements.forEach(n=>n.checkShowFeedback(e)),this._emit("qti-outcome-changed",{item:this.identifier,outcomeIdentifier:e,value:(o=this._context.variables.find(n=>n.identifier===e))==null?void 0:o.value})}_getCompletionStatus(){return this._interactionElements.every(e=>e.validate())?"completed":this._interactionElements.some(e=>e.validate())?"incomplete":"not_attempted"}_emit(e,r=null){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:r}))}};l([d({type:String})],$.prototype,"title",2),l([d({type:String})],$.prototype,"identifier",2),l([d({type:String})],$.prototype,"adaptive",2),l([d({type:String})],$.prototype,"timeDependent",2),l([d({type:Boolean})],$.prototype,"disabled",2),l([S("disabled",{waitUntilFirstUpdate:!0})],$.prototype,"_handleDisabledChange",2),l([d({type:Boolean})],$.prototype,"readonly",2),l([S("readonly",{waitUntilFirstUpdate:!0})],$.prototype,"_handleReadonlyChange",2),l([tr({context:O})],$.prototype,"_context",2),$=l([m("qti-assessment-item")],$);var gs=String.raw,Ze=()=>{let s,t={async load(e,r=!1){return new Promise((i,o)=>{gr(e,r).then(n=>(s=n,i(t)))})},parse(e){return s=fr(e),t},path:e=>(vs(s,e),t),fn(e){return e(s),t},pciHooks(e){let r=["hook","module"],i=e.substring(0,e.lastIndexOf("/"));for(let o of r)s.querySelectorAll("["+o+"]").forEach(a=>{let c=a.getAttribute(o);!c.startsWith("data:")&&!c.startsWith("http")&&(a.setAttribute("base-url",e),a.setAttribute("module",i+"/"+encodeURIComponent(c+(c.endsWith(".js")?"":".js"))))});return t},customInteraction(e,r){let i=s.querySelector("qti-custom-interaction"),o=i.querySelector("object");return i.setAttribute("data-base-ref",e),i.setAttribute("data-base-item",e+r),i.setAttribute("data",o.getAttribute("data")),i.setAttribute("width",o.getAttribute("width")),i.setAttribute("height",o.getAttribute("height")),i.removeChild(o),t},convertCDATAtoComment(){return ys(s),t},stripStyleSheets(){return xs(s),t},html(){return new XMLSerializer().serializeToString(Lt(s))},xml(){return new XMLSerializer().serializeToString(s)},htmldoc(){return Lt(s)},xmldoc(){return s}};return t},ur=()=>{let s,t={async load(e){return new Promise((r,i)=>{gr(e).then(o=>(s=o,r(t)))})},parse(e){s=fr(e)},assessmentTest(){let e=s.querySelector('resource[type="imsqti_test_xmlv3p0"]');return{href:e.getAttribute("href"),identifier:e.getAttribute("identifier")}}};return t},$t=()=>{let s,t={async load(e){return new Promise((r,i)=>{gr(e).then(o=>(s=o,r(t)))})},parse(e){return s=fr(e),t},fn(e){return e(s),t},items(){return bs(s)},html(){return new XMLSerializer().serializeToString(Lt(s))},xml(){return new XMLSerializer().serializeToString(s)},htmldoc(){return Lt(s)},xmldoc(){return s}};return t},fs=gs`<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
4
4
|
<xsl:output method="html" version="5.0" encoding="UTF-8" indent="yes" />
|
|
5
5
|
<xsl:template match="@*|node()">
|
|
6
6
|
<xsl:copy>
|
|
@@ -22,23 +22,23 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
|
|
|
22
22
|
<xsl:apply-templates/>
|
|
23
23
|
</xsl:element>
|
|
24
24
|
</xsl:template>
|
|
25
|
-
</xsl:stylesheet>`;function
|
|
25
|
+
</xsl:stylesheet>`;function bs(s){let t=[];return s.querySelectorAll("qti-assessment-item-ref").forEach(e=>{let r=e.getAttribute("identifier"),i=e.getAttribute("href"),o=e.getAttribute("category");t.push({identifier:r,href:i,category:o})}),t}var mr=null;function gr(s,t=!0){return t&&mr!==null&&mr.abort(),new Promise((e,r)=>{let i=new XMLHttpRequest;mr=i,i.open("GET",s,!0),i.responseType="document",i.onload=()=>{i.status>=200&&i.status<300?e(i.responseXML):r(i.statusText)},i.onerror=()=>{r(i.statusText)},i.send()})}function fr(s){return new DOMParser().parseFromString(s,"text/xml")}function Lt(s){let t=new XSLTProcessor,e=new DOMParser().parseFromString(fs,"text/xml");return t.importStylesheet(e),t.transformToFragment(s,document)}function vs(s,t){t.endsWith("/")||(t+="/"),s.querySelectorAll("[src],[href],[primary-path]").forEach(e=>{var o;let r="";e.getAttribute("src")&&(r="src"),e.getAttribute("href")&&(r="href"),e.getAttribute("primary-path")&&(r="primary-path");let i=(o=e.getAttribute(r))==null?void 0:o.trim();if(!i.startsWith("data:")&&!i.startsWith("http")){let n=t+encodeURI(i);e.setAttribute(r,n)}})}function ys(s){s.querySelectorAll('qti-custom-operator[class="js.org"] > qti-base-value').forEach(e=>{let r=document.createComment(e.textContent);e.replaceChild(r,e.firstChild)})}function xs(s){s.querySelectorAll("qti-stylesheet").forEach(t=>t.remove())}var Ae=class extends u{constructor(){super(...arguments);this.identifier="";this.href=""}async connectedCallback(){super.connectedCallback();let e=new Event("qti-assessment-stimulus-ref-connected",{cancelable:!0,bubbles:!0});if(this.dispatchEvent(e)){let o=this.closest("qti-assessment-item").querySelector(`[data-stimulus-idref=${this.identifier}]`);o?await this.loadAndAppendStimulus(o):console.warn(`Stimulus with data-stimulus-idref ${this.identifier} not found`)}}async loadAndAppendStimulus(e){var o;let r=this.href.substring(0,this.href.lastIndexOf("/")),i=await Ze().load(this.href).then(n=>n.path(r).htmldoc());if(i){let n=i.querySelectorAll("qti-stimulus-body, qti-stylesheet");e.append(...n),((o=i.querySelector("qti-assessment-stimulus"))==null?void 0:o.title).includes("(lijst)")&&e.classList.add("qti-stimulus-list")}}};l([d({type:String})],Ae.prototype,"identifier",2),l([d({type:String})],Ae.prototype,"href",2),Ae=l([m("qti-assessment-stimulus-ref")],Ae);var ki={toAttribute:s=>s?"true":"false",fromAttribute:s=>s==="true"};function U(s,t){class e extends s{constructor(...o){super(...o);this.identifier="";this.tabIndex=0;this.disabled=!1;this.readonly=!1;this._internals=this.attachInternals()}handleDisabledChange(o,n){this.tabIndex=n?-1:0,n&&this.blur()}setInternalState(o,n){n&&!this._internals.states.has(o)?this._internals.states.add(o):!n&&this._internals.states.has(o)&&this._internals.states.delete(o)}connectedCallback(){super.connectedCallback(),this.addEventListener("keyup",this._onKeyUp),this.addEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent(`register-${t}`,{bubbles:!0,composed:!0}))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keyup",this._onKeyUp),this.removeEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent(`unregister-${t}`,{bubbles:!0,composed:!0}))}_onKeyUp(o){o.altKey||o.code==="Space"&&(o.preventDefault(),this._activate())}_onClick(){this.disabled||this.readonly||(this.focus(),this._activate())}_activate(){this.disabled||this.readonly||this.dispatchEvent(new CustomEvent(`activate-${t}`,{bubbles:!0,composed:!0,detail:{identifier:this.identifier}}))}render(){return h`<slot></slot>`}}return l([d({type:String})],e.prototype,"identifier",2),l([d({type:Number,reflect:!0,attribute:"tabindex"})],e.prototype,"tabIndex",2),l([d({type:Boolean,reflect:!0,attribute:"aria-disabled",converter:ki})],e.prototype,"disabled",2),l([d({type:Boolean,reflect:!0,attribute:"aria-readonly",converter:ki})],e.prototype,"readonly",2),l([S("disabled",{waitUntilFirstUpdate:!0})],e.prototype,"handleDisabledChange",1),e}var Ti=b`
|
|
26
26
|
:host {
|
|
27
27
|
display: block;
|
|
28
28
|
}
|
|
29
|
-
`;var
|
|
29
|
+
`;var _e=class extends u{render(){return h`<slot name="qti-rubric-block"></slot><slot></slot>`}};_e.styles=Ti,_e=l([m("qti-item-body")],_e);var Dt=class extends u{render(){return h`<slot></slot>`}connectedCallback(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}};Dt=l([m("qti-prompt")],Dt);var Ht=class extends u{firstUpdated(t){super.firstUpdated(t);let e=this,r=this.getAttribute("href");if(r!==null){let i=document.createElement("link");i.rel="stylesheet",i.type="text/css",i.media="screen",i.href=r,e.appendChild(i),this.styleLink=i}if(this.textContent!==null){let i=document.createElement("style");i.media="screen",i.textContent=this.textContent,e.appendChild(i),this.styleLink=i}}disconnectedCallback(){if(this.styleLink)try{this.styleLink.remove()}catch(t){console.log("could not remove stylesheet")}}};Ht=l([m("qti-stylesheet")],Ht);var oe=class extends u{render(){return h`<slot></slot>`}defaultValues(t){let e=Array.from(this.querySelectorAll("qti-default-value > qti-value"));if(e.length===0)return null;let r=e.map(i=>i.innerHTML);return r.length>1||t.cardinality==="multiple"||t.cardinality==="ordered"?r:r[0]}};oe=l([m("qti-variabledeclaration")],oe);var z=class extends oe{constructor(){super(...arguments);this.externalScored=null}render(){var r,i;let e=(i=(r=this.itemContext)==null?void 0:r.variables.find(o=>o.identifier===this.identifier))==null?void 0:i.value;return h`${JSON.stringify(e,null,2)}`}get interpolationTable(){let e=this.querySelector("qti-interpolation-table");if(e){let r=new Map;for(let i of e.querySelectorAll("qti-interpolation-table-entry")){!i.getAttribute("source-value")&&i.getAttribute("target-value")&&console.error("source-value or target-value is missing in qti-interpolation-table-entry");let o=parseInt(i.getAttribute("source-value")),n=parseInt(i.getAttribute("target-value"));(isNaN(o)||isNaN(n))&&console.error("source-value or target-value is not a number in qti-interpolation-table-entry"),r.set(o,n)}return r}return null}connectedCallback(){super.connectedCallback();let e={identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,type:"outcome",value:null,interpolationTable:this.interpolationTable,externalScored:this.externalScored};e.value=this.defaultValues(e),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:e}}))}};z.styles=[b`
|
|
30
30
|
:host {
|
|
31
31
|
display: none;
|
|
32
32
|
}
|
|
33
|
-
`],l([d({type:String,attribute:"base-type"})],
|
|
33
|
+
`],l([d({type:String,attribute:"base-type"})],z.prototype,"baseType",2),l([d({type:String,attribute:"external-scored"})],z.prototype,"externalScored",2),l([d({type:String})],z.prototype,"identifier",2),l([d({type:String})],z.prototype,"cardinality",2),l([J({context:O,subscribe:!0}),q()],z.prototype,"itemContext",2),z=l([m("qti-outcome-declaration")],z);var ee=class extends oe{render(){var e,r;let t=(r=(e=this.itemContext)==null?void 0:e.variables.find(i=>i.identifier===this.identifier))==null?void 0:r.value;return h`${JSON.stringify(t,null,2)}`}connectedCallback(){super.connectedCallback();let t={baseType:this.baseType,identifier:this.identifier,correctResponse:this.correctResponse,cardinality:this.cardinality||"single",mapping:this.mapping,value:null,type:"response",candidateResponse:null};t.value=this.defaultValues(t),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:t}}))}get correctResponse(){let t,e=this.querySelector("qti-correct-response");if(e){let r=e.querySelectorAll("qti-value");if(this.cardinality==="single"&&r.length>0)t=r[0].textContent,r[0].remove();else if(this.cardinality!=="single"){t=[];for(let i=0;i<r.length;i++)t.push(r[i].textContent),r[i].remove()}}return t}get mapping(){return this.querySelector("qti-mapping")}};ee.styles=[b`
|
|
34
34
|
:host {
|
|
35
35
|
display: none;
|
|
36
36
|
}
|
|
37
|
-
`],l([d({type:String,attribute:"base-type"})],
|
|
37
|
+
`],l([d({type:String,attribute:"base-type"})],ee.prototype,"baseType",2),l([d({type:String})],ee.prototype,"identifier",2),l([d({type:String})],ee.prototype,"cardinality",2),l([J({context:O,subscribe:!0}),q()],ee.prototype,"itemContext",2),ee=l([m("qti-response-declaration")],ee);var Pt=class extends u{};Pt=l([m("qti-companion-materials-info")],Pt);var Nt=class extends u{render(){return h`<slot></slot>`}};Nt=l([m("qti-content-body")],Nt);var F=class extends u{handleclassNamesChange(t,e){this.classNames.split(" ").forEach(i=>{switch(i){case"qti-rubric-discretionary-placement":this.setAttribute("slot","qti-rubric-block");break;case"qti-rubric-inline":this.setAttribute("slot","");break;default:break}})}render(){return h`<slot></slot>`}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-rubric-block")}};F.styles=b`
|
|
38
38
|
:host {
|
|
39
39
|
display: block;
|
|
40
40
|
}
|
|
41
|
-
`,l([d({type:String})],
|
|
41
|
+
`,l([d({type:String})],F.prototype,"id",2),l([d({type:String})],F.prototype,"use",2),l([d({type:String})],F.prototype,"view",2),l([d({type:String,attribute:"class"})],F.prototype,"classNames",2),l([S("classNames",{waitUntilFirstUpdate:!0})],F.prototype,"handleclassNamesChange",1),F=l([m("qti-rubric-block")],F);var qs=()=>new Intl.NumberFormat().format(.1).replace(/\d/g,""),Je=s=>{if(typeof s=="string")return s;let t=qs();return t==="."?s.toLocaleString():s.toString().replace(".","").replace(t,".")};function br(s){return s==null}function Ge(s){return s.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")}var D=class extends u{connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-feedback",{bubbles:!0,composed:!0,detail:this}))}checkShowFeedback(t){let e=this.closest("qti-assessment-item").getOutcome(t);if(this.outcomeIdentifier!==t||!e)return;let r=!1;Array.isArray(e.value)?r=e.value.includes(this.identifier):r=!br(this.identifier)&&!br(e==null?void 0:e.value)&&this.identifier===e.value||!1,this.showFeedback(r)}showFeedback(t){this.showStatus=t&&this.showHide==="show"||!t&&this.showHide==="hide"?"on":"off"}};l([d({type:String,attribute:"show-hide"})],D.prototype,"showHide",2),l([d({type:String,attribute:"outcome-identifier"})],D.prototype,"outcomeIdentifier",2),l([d({type:String})],D.prototype,"identifier",2),l([d({type:String,attribute:!1})],D.prototype,"showStatus",2);var Qe=class extends D{render(){return h` <slot part="feedback" class="feedback ${this.showStatus}"></slot> `}firstUpdated(t){this.checkShowFeedback(this.outcomeIdentifier)}};Qe.styles=b`
|
|
42
42
|
:host {
|
|
43
43
|
display: block;
|
|
44
44
|
}
|
|
@@ -48,21 +48,21 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
|
|
|
48
48
|
.off {
|
|
49
49
|
display: none;
|
|
50
50
|
}
|
|
51
|
-
`,
|
|
51
|
+
`,Qe=l([m("qti-feedback-block")],Qe);var et=class extends D{constructor(){super(...arguments);this.render=()=>h` <slot part="feedback" class="${this.showStatus}"></slot> `}};et.styles=b`
|
|
52
52
|
.on {
|
|
53
53
|
display: inline-block;
|
|
54
54
|
}
|
|
55
55
|
.off {
|
|
56
56
|
display: none;
|
|
57
57
|
}
|
|
58
|
-
`,
|
|
58
|
+
`,et=l([m("qti-feedback-inline")],et);var tt=class extends D{constructor(){super(...arguments);this.render=()=>h` <slot part="feedback" class="${this.showStatus}"></slot> `}};tt.styles=b`
|
|
59
59
|
.on {
|
|
60
60
|
display: inline-block;
|
|
61
61
|
}
|
|
62
62
|
.off {
|
|
63
63
|
display: none;
|
|
64
64
|
}
|
|
65
|
-
`,
|
|
65
|
+
`,tt=l([m("qti-modal-feedback")],tt);var B=s=>s!=null?s:E;var T=class extends u{constructor(){super(...arguments);this.responseIdentifier="";this.disabled=!1;this.readonly=!1}set correctResponse(e){console.warn("correctResponse is not implemented")}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,cancelable:!1,composed:!0}))}saveResponse(e){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,cancelable:!1,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:Array.isArray(e)?[...e]:e}}))}};l([d({attribute:"response-identifier"})],T.prototype,"responseIdentifier",2),l([d({reflect:!0,type:Boolean})],T.prototype,"disabled",2),l([d({reflect:!0,type:Boolean})],T.prototype,"readonly",2);var{I:ws}=yi;var _i=s=>s.strings===void 0,Ai=()=>document.createComment(""),Se=(s,t,e)=>{var o;let r=s._$AA.parentNode,i=t===void 0?s._$AB:t._$AA;if(e===void 0){let n=r.insertBefore(Ai(),i),a=r.insertBefore(Ai(),i);e=new ws(n,a,s,s.options)}else{let n=e._$AB.nextSibling,a=e._$AM,c=a!==s;if(c){let p;(o=e._$AQ)==null||o.call(e,s),e._$AM=s,e._$AP!==void 0&&(p=s._$AU)!==a._$AU&&e._$AP(p)}if(n!==i||c){let p=e._$AA;for(;p!==n;){let f=p.nextSibling;r.insertBefore(p,i),p=f}}}return e},ne=(s,t,e=s)=>(s._$AI(t,e),s),Es={},Si=(s,t=Es)=>s._$AH=t,Ri=s=>s._$AH,Vt=s=>{var r;(r=s._$AP)==null||r.call(s,!1,!0);let t=s._$AA,e=s._$AB.nextSibling;for(;t!==e;){let i=t.nextSibling;t.remove(),t=i}};var ae={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},te=s=>(...t)=>({_$litDirective$:s,values:t}),j=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this.t=t,this._$AM=e,this.i=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var rt=(s,t)=>{var r;let e=s._$AN;if(e===void 0)return!1;for(let i of e)(r=i._$AO)==null||r.call(i,t,!1),rt(i,t);return!0},It=s=>{let t,e;do{if((t=s._$AM)===void 0)break;e=t._$AN,e.delete(s),s=t}while((e==null?void 0:e.size)===0)},Mi=s=>{for(let t;t=s._$AM;s=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(s))break;e.add(s),Ts(t)}};function Cs(s){this._$AN!==void 0?(It(this),this._$AM=s,Mi(this)):this._$AM=s}function ks(s,t=!1,e=0){let r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(r))for(let o=e;o<r.length;o++)rt(r[o],!1),It(r[o]);else r!=null&&(rt(r,!1),It(r));else rt(this,s)}var Ts=s=>{var t,e;s.type==ae.CHILD&&((t=s._$AP)!=null||(s._$AP=ks),(e=s._$AQ)!=null||(s._$AQ=Cs))},Ot=class extends j{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,r){super._$AT(t,e,r),Mi(this),this.isConnected=t._$AU}_$AO(t,e=!0){var r,i;t!==this.isConnected&&(this.isConnected=t,t?(r=this.reconnected)==null||r.call(this):(i=this.disconnected)==null||i.call(this)),e&&(rt(this,t),It(this))}setValue(t){if(_i(this.t))this.t._$AI(t,this);else{let e=[...this.t._$AH];e[this.i]=t,this.t._$AI(e,this,0)}}disconnected(){}reconnected(){}};var Ut=()=>new yr,yr=class{},vr=new WeakMap,Li=te(class extends Ot{render(s){return E}update(s,[t]){var r;let e=t!==this.Y;return e&&this.Y!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.Y=t,this.ht=(r=s.options)==null?void 0:r.host,this.rt(this.ct=s.element)),E}rt(s){var t;if(this.isConnected||(s=void 0),typeof this.Y=="function"){let e=(t=this.ht)!=null?t:globalThis,r=vr.get(e);r===void 0&&(r=new WeakMap,vr.set(e,r)),r.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),r.set(this.Y,s),s!==void 0&&this.Y.call(this.ht,s)}else this.Y.value=s}get lt(){var s,t,e;return typeof this.Y=="function"?(t=vr.get((s=this.ht)!=null?s:globalThis))==null?void 0:t.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var X=class extends T{constructor(){super(...arguments);this.textareaRef=Ut();this._value=""}handleclassNamesChange(e,r){this.classNames.split(" ").forEach(o=>{if(o.startsWith("qti-height-lines")){let n=o.replace("qti-height-lines-","");this.textareaRef&&(this.textareaRef.value.rows=parseInt(n))}})}set response(e){this._value=e!==void 0?e:""}validate(){return this._value!==""}static get styles(){return[b`
|
|
66
66
|
/* PK: display host as block, else design will be collapsed */
|
|
67
67
|
:host {
|
|
68
68
|
display: block;
|
|
@@ -73,28 +73,28 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
|
|
|
73
73
|
height: 100%;
|
|
74
74
|
border: 0;
|
|
75
75
|
}
|
|
76
|
-
`]}render(){return
|
|
76
|
+
`]}render(){return h`<slot name="prompt"></slot
|
|
77
77
|
><textarea
|
|
78
78
|
part="textarea"
|
|
79
|
-
${
|
|
79
|
+
${Li(this.textareaRef)}
|
|
80
80
|
spellcheck="false"
|
|
81
81
|
autocomplete="off"
|
|
82
82
|
@keydown="${e=>e.stopImmediatePropagation()}"
|
|
83
83
|
@keyup="${this.textChanged}"
|
|
84
84
|
@change="${this.textChanged}"
|
|
85
85
|
@blur="${e=>{let r=e.target;r.checkValidity()?r.setCustomValidity(""):(r.setCustomValidity(this.dataset.patternmaskMessage||"Invalid input"),r.reportValidity())}}"
|
|
86
|
-
placeholder="${
|
|
87
|
-
maxlength="${
|
|
88
|
-
pattern="${
|
|
86
|
+
placeholder="${B(this.placeholderText?this.placeholderText:void 0)}"
|
|
87
|
+
maxlength="${B(this.expectedLength?this.expectedLength:void 0)}"
|
|
88
|
+
pattern="${B(this.patternMask?this.patternMask:void 0)}"
|
|
89
89
|
?disabled="${this.disabled}"
|
|
90
90
|
?readonly="${this.readonly}"
|
|
91
91
|
.value=${this._value}
|
|
92
|
-
></textarea>`}textChanged(e){if(this.disabled||this.readonly)return;let r=e.target;this.setEmptyAttribute(r.value),this._value!==r.value&&(this._value=r.value,this.saveResponse(r.value))}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};l([d({type:Number,attribute:"expected-length"})],X.prototype,"expectedLength",2),l([d({type:String,attribute:"pattern-mask"})],X.prototype,"patternMask",2),l([d({type:String,attribute:"placeholder-text"})],X.prototype,"placeholderText",2),l([
|
|
92
|
+
></textarea>`}textChanged(e){if(this.disabled||this.readonly)return;let r=e.target;this.setEmptyAttribute(r.value),this._value!==r.value&&(this._value=r.value,this.saveResponse(r.value))}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};l([d({type:Number,attribute:"expected-length"})],X.prototype,"expectedLength",2),l([d({type:String,attribute:"pattern-mask"})],X.prototype,"patternMask",2),l([d({type:String,attribute:"placeholder-text"})],X.prototype,"placeholderText",2),l([q()],X.prototype,"_value",2),l([d({type:String,attribute:"class"})],X.prototype,"classNames",2),l([S("classNames",{waitUntilFirstUpdate:!0})],X.prototype,"handleclassNamesChange",1),X=l([m("qti-extended-text-interaction")],X);function $i(s,t){let e,r=C({},t);return(i,o)=>{let{connectedCallback:n,disconnectedCallback:a}=i;i.connectedCallback=function(){var f;n.call(this);let c=g=>{let y=Array.from(this.querySelectorAll(s));for(let v of g){let w=Array.from(v.addedNodes).map(A=>A),k=Array.from(v.addedNodes).map(A=>A);v.type==="childList"&&w.find(A=>y.includes(A))&&this[o](w,k)}};e=new MutationObserver(c),e.observe(this,{childList:!0,subtree:!0});let p=(f=this.querySelectorAll(s))!=null?f:[];this[o](Array.from(p),[])},i.disconnectedCallback=function(){a.call(this),e.disconnect()}}}var H=class extends T{constructor(){super(...arguments);this._value="";this._correctValue="";this._size=5;this.inputRef=Ut()}handleclassNamesChange(e,r){r.split(" ").forEach(o=>{if(o.startsWith("qti-input-width")){let n=o.replace("qti-input-width-","");this._size=parseInt(n)}})}set response(e){this._value=e!==void 0?e:""}validate(){return this._value!==""}static get styles(){return[b`
|
|
93
93
|
[part='correct'] {
|
|
94
94
|
position: absolute;
|
|
95
95
|
width: 100%;
|
|
96
96
|
}
|
|
97
|
-
`]}set correctResponse(e){this._correctValue=e}render(){return
|
|
97
|
+
`]}set correctResponse(e){this._correctValue=e}render(){return h`
|
|
98
98
|
<input
|
|
99
99
|
part="input"
|
|
100
100
|
spellcheck="false"
|
|
@@ -104,37 +104,89 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
|
|
|
104
104
|
@keyup="${this.textChanged}"
|
|
105
105
|
@change="${this.textChanged}"
|
|
106
106
|
type="${this.patternMask=="[0-9]*"?"number":"text"}"
|
|
107
|
-
placeholder="${
|
|
107
|
+
placeholder="${B(this.placeholderText?this.placeholderText:void 0)}"
|
|
108
108
|
.value="${this._value}"
|
|
109
109
|
size="${this._size}"
|
|
110
|
-
pattern="${
|
|
110
|
+
pattern="${B(this.patternMask?this.patternMask:void 0)}"
|
|
111
111
|
?disabled="${this.disabled}"
|
|
112
112
|
?readonly="${this.readonly}"
|
|
113
113
|
/>
|
|
114
114
|
<div part="correct">${this._correctValue}</div>
|
|
115
|
-
`}textChanged(e){if(this.disabled||this.readonly)return;let r=e.target;this.setEmptyAttribute(r.value),this._value!==r.value&&(this._value=r.value,this.saveResponse(r.value))}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};l([d({type:Number,attribute:"expected-length"})],
|
|
115
|
+
`}textChanged(e){if(this.disabled||this.readonly)return;let r=e.target;this.setEmptyAttribute(r.value),this._value!==r.value&&(this._value=r.value,this.saveResponse(r.value))}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};l([d({type:Number,attribute:"expected-length"})],H.prototype,"expectedLength",2),l([d({type:String,attribute:"pattern-mask"})],H.prototype,"patternMask",2),l([d({type:String,attribute:"placeholder-text"})],H.prototype,"placeholderText",2),l([q()],H.prototype,"_value",2),l([q()],H.prototype,"_correctValue",2),l([q()],H.prototype,"_size",2),l([d({type:String,attribute:"class"})],H.prototype,"classNames",2),l([S("classNames")],H.prototype,"handleclassNamesChange",1),H=l([m("qti-text-entry-interaction")],H);var le=(s,t)=>{class e extends s{constructor(...o){super(...o);this._choiceElements=[];this.responseIdentifier="";this.minChoices=0;this.maxChoices=1;this.disabled=!1;this._handleDisabledChange=(o,n)=>{this._choiceElements.forEach(a=>a.disabled=n)};this.readonly=!1;this._handleReadonlyChange=(o,n)=>{this._choiceElements.forEach(a=>a.readonly=n)}}_handleMaxChoicesChange(o,n){this._determineInputType()}validate(){let o=this._choiceElements.filter(n=>this._getChoiceChecked(n)).length;return this.maxChoices!==0&&o>this.maxChoices?!1:o>=this.minChoices}set response(o){let n=Array.isArray(o)?o:[o];this._choiceElements.forEach(a=>{this._setChoiceChecked(a,n.includes(a.identifier))})}set correctResponse(o){let n=Array.isArray(o)?o:[o];if(n.length===0){this._choiceElements.forEach(a=>{a.removeAttribute("data-correct-response")});return}this._choiceElements.forEach(a=>{a.setAttribute("data-correct-response",n.includes(a.identifier)?"true":"false")})}connectedCallback(){super.connectedCallback(),this.addEventListener(`register-${t}`,this._registerChoiceElement),this.addEventListener(`unregister-${t}`,this._unregisterChoiceElement),this.addEventListener(`activate-${t}`,this._choiceElementSelectedHandler),this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0}))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`register-${t}`,this._registerChoiceElement),this.removeEventListener(`unregister-${t}`,this._unregisterChoiceElement),this.removeEventListener(`activate-${t}`,this._choiceElementSelectedHandler)}_registerChoiceElement(o){o.stopPropagation();let n=o.target;n.disabled=this.disabled,this._choiceElements.push(n),this._setInputType(n)}_unregisterChoiceElement(o){o.stopPropagation();let n=o.target;this._choiceElements=this._choiceElements.filter(a=>a!==n)}_determineInputType(){this._choiceElements.forEach(o=>{this._setInputType(o)})}_setInputType(o){o.setAttribute("role",this.maxChoices===1?"radio":"checkbox")}_choiceElementSelectedHandler(o){this._toggleChoiceChecked(o.target),this.maxChoices===1&&this._choiceElements.forEach(n=>{n.identifier!==o.detail.identifier&&this._setChoiceChecked(n,!1)}),this._handleChoiceSelection()}_setChoiceChecked(o,n){o.setAttribute("aria-checked",n.toString())}_getChoiceChecked(o){return o.getAttribute("aria-checked")==="true"}_toggleChoiceChecked(o){let n=this._getChoiceChecked(o);this._setChoiceChecked(o,!n)}_handleChoiceSelection(){let o=this._choiceElements.filter(c=>this._getChoiceChecked(c)),n=o.map(c=>c.identifier);if(this.maxChoices>1&&this.maxChoices!==0){let c=o.length>=this.maxChoices;this._choiceElements.forEach(p=>{this._getChoiceChecked(p)||(p.disabled=c)})}let a=this.maxChoices===1?n[0]||void 0:n;this._saveResponse(a)}_saveResponse(o){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:o}}))}}return l([d({attribute:"response-identifier"})],e.prototype,"responseIdentifier",2),l([d({type:Number,attribute:"min-choices"})],e.prototype,"minChoices",2),l([d({type:Number,attribute:"max-choices"})],e.prototype,"maxChoices",2),l([S("maxChoices",{waitUntilFirstUpdate:!0})],e.prototype,"_handleMaxChoicesChange",1),l([d({reflect:!0,type:Boolean})],e.prototype,"disabled",2),l([S("disabled",{waitUntilFirstUpdate:!0})],e.prototype,"_handleDisabledChange",2),l([d({reflect:!0,type:Boolean})],e.prototype,"readonly",2),l([S("readonly",{waitUntilFirstUpdate:!0})],e.prototype,"_handleReadonlyChange",2),e};var zt=class extends le(u,"qti-hottext"){constructor(){super(...arguments);this.render=()=>h`<slot></slot>`}connectedCallback(){super.connectedCallback(),this.setAttribute("qti-hottext-interaction","")}};zt=l([m("qti-hottext-interaction")],zt);var it=class extends j{constructor(t){if(super(t),this.it=E,t.type!==ae.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===E||t==null)return this._t=void 0,this.it=t;if(t===L)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;let e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};it.directiveName="unsafeHTML",it.resultType=1;var ce=te(it);var de=class extends T{constructor(){super(...arguments);this.options=[];this.correctOption="";this.dataPrompt="select"}static get styles(){return[b`
|
|
116
116
|
:host {
|
|
117
117
|
display: inline-block;
|
|
118
118
|
}
|
|
119
|
-
|
|
119
|
+
slot {
|
|
120
|
+
display: flex;
|
|
121
|
+
flex-direction: column;
|
|
122
|
+
}
|
|
123
|
+
[role='menu'] {
|
|
124
|
+
position: absolute;
|
|
125
|
+
z-index: 1000;
|
|
126
|
+
}
|
|
127
|
+
.anchor {
|
|
128
|
+
/* anchor-name: --infobox; */
|
|
129
|
+
width: fit-content;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.positionedElement {
|
|
133
|
+
position: absolute;
|
|
134
|
+
/* position-anchor: --infobox; */
|
|
135
|
+
/* top: anchor(bottom); */
|
|
136
|
+
}
|
|
137
|
+
`]}render(){return h`
|
|
120
138
|
<select part="select" @change="${this.choiceSelected}" ?disabled="${this.disabled}" ?readonly="${this.readonly}">
|
|
121
|
-
${this.options.map(e=>
|
|
122
|
-
<option value="${e.value}" ?selected="${e.selected}">${
|
|
139
|
+
${this.options.map(e=>h`
|
|
140
|
+
<option value="${e.value}" ?selected="${e.selected}">${ce(e.textContent)}</option>
|
|
123
141
|
`)}
|
|
124
142
|
</select>
|
|
125
143
|
|
|
126
|
-
${
|
|
127
|
-
`}connectedCallback(){super.connectedCallback(),this.addEventListener("on-dropdown-selected",this.choiceSelected);let e=Array.from(this.querySelectorAll("qti-inline-choice"));this.options=[{textContent:this.dataPrompt,value:"",selected:!1},...e.map(r=>({textContent:r.innerHTML,value:r.getAttribute("identifier"),selected:!1}))]}disconnectedCallback(){this.removeEventListener("on-dropdown-selected",this.choiceSelected)}validate(){let e=this.options.find(r=>r.selected);return e?e.value!=="":!1}reset(){this.options=this.options.map((e,r)=>
|
|
128
|
-
|
|
129
|
-
display: flex;
|
|
130
|
-
flex-direction: column;
|
|
131
|
-
|
|
144
|
+
${ce(this.correctOption)}
|
|
145
|
+
`}connectedCallback(){super.connectedCallback(),this.addEventListener("on-dropdown-selected",this.choiceSelected);let e=Array.from(this.querySelectorAll("qti-inline-choice"));this.options=[{textContent:this.dataPrompt,value:"",selected:!1},...e.map(r=>({textContent:r.innerHTML,value:r.getAttribute("identifier"),selected:!1}))]}disconnectedCallback(){this.removeEventListener("on-dropdown-selected",this.choiceSelected)}validate(){let e=this.options.find(r=>r.selected);return e?e.value!=="":!1}reset(){this.options=this.options.map((e,r)=>_(C({},e),{selected:r===0}))}set response(e){this.options=this.options.map(r=>(e===r.value&&(r.selected=!0),r))}set correctResponse(e){if(e===""){this.correctOption="";return}this.correctOption=`<span part="correct-option">${this.options.find(r=>e===r.value).textContent}</span>`}choiceSelected(e){let r=e.target.value;this.options=this.options.map(i=>_(C({},i),{selected:i.value===r})),this.saveResponse(r)}};de.inputWidthClass=["","qti-input-width-2","qti-input-width-1","qti-input-width-3","qti-input-width-4","qti-input-width-6","qti-input-width-10","qti-input-width-15","qti-input-width-20","qti-input-width-72"],l([q()],de.prototype,"options",2),l([q()],de.prototype,"correctOption",2),l([d({attribute:"data-prompt",type:String})],de.prototype,"dataPrompt",2),de=l([m("qti-inline-choice-interaction")],de);var Ft=(s,t)=>{class e extends s{constructor(){super(...arguments);this._shuffle=!1}set shuffle(o){let n=this._shuffle;this._shuffle=o,o?this._shuffleChoices():this._resetShuffleChoices(),this.requestUpdate("shuffle",n)}get shuffle(){return this._shuffle}connectedCallback(){super.connectedCallback(),this.shuffle?this._shuffleChoices():this._resetShuffleChoices()}_shuffleChoices(){let o=Array.from(this.querySelectorAll(t)),n=[],a=[];o.forEach((y,v)=>{y.hasAttribute("fixed")?n.push({element:y,index:v}):a.push(y)}),a.length<=1&&console.warn("Shuffling is not possible with fewer than 2 non-fixed elements.");let c=!1,p=10,f=0;for(;!c&&f<p;){f++;for(let y=a.length-1;y>0;y--){let v=Math.floor(Math.random()*(y+1));[a[y],a[v]]=[a[v],a[y]]}if(c=a.some((y,v)=>o.indexOf(y)!==v),c)break}c||console.warn("Failed to shuffle the choices after multiple attempts.");let g=1;o.forEach((y,v)=>{y.hasAttribute("fixed")?y.style.setProperty("order",String(g++)):a.shift().style.setProperty("order",String(g++))})}_resetShuffleChoices(){Array.from(this.querySelectorAll("qti-simple-choice")).forEach((n,a)=>{n.style.setProperty("order","initial")})}}return l([d({type:String,reflect:!0,converter:As})],e.prototype,"shuffle",1),e},As={fromAttribute(s){return s==="true"},toAttribute(s){return s?"true":"false"}};var Di=(s,t)=>{class e extends s{constructor(){super(...arguments);this._classes=[];this._allLabels=["qti-labels-decimal","qti-labels-lower-alpha","qti-labels-upper-alpha"];this._allLabelSuffixes=["qti-labels-suffix-period","qti-labels-suffix-parenthesis"]}set class(o){o&&(this._classes=o.split(" "),this._addLabels())}get class(){var o;return((o=this._classes)==null?void 0:o.join(" "))||""}updated(o){super.updated(o),o.has("shuffle")&&this._addLabels()}_addLabels(){let o=this._classes.some(a=>this._allLabels.includes(a)||this._allLabelSuffixes.includes(a)),n=a=>!isNaN(+a);if(o){let c=Array.from(this.querySelectorAll("qti-simple-choice")).map(p=>p).map((p,f)=>({el:p,order:n(p.style.order)?+p.style.order:f+1})).sort((p,f)=>p.order-f.order).map(p=>p.el);for(let p=0;p<c.length;p++)c[p].marker=this._getLabel(p+1)}}_getLabel(o){let n=this._classes.filter(p=>this._allLabels.includes(p)).pop(),a=this._classes.filter(p=>this._allLabelSuffixes.includes(p)).pop();!n&&a&&(n="qti-labels-upper-alpha");let c="";switch(n){case"qti-labels-decimal":c=`${o}`;break;case"qti-labels-lower-alpha":c=`${String.fromCharCode(97+o-1)}`;break;case"qti-labels-upper-alpha":c=`${String.fromCharCode(65+o-1)}`;break}return a==="qti-labels-suffix-period"?c+=".":a==="qti-labels-suffix-parenthesis"&&(c+=")"),c}}return l([d({type:String,reflect:!0})],e.prototype,"class",1),e};var Hi=b`
|
|
146
|
+
[part='slot'] {
|
|
147
|
+
/* display: flex; */
|
|
148
|
+
/* flex-direction: column; */
|
|
149
|
+
/* gap: var(--qti-gap-size); */
|
|
150
|
+
--choice-interactions-stacking: 1;
|
|
151
|
+
display: grid; /* grid */
|
|
152
|
+
grid-template-columns: repeat(var(--choice-interactions-stacking), minmax(0, 1fr)); /* grid-cols-2 */
|
|
153
|
+
gap: var(--qti-gap-size); /* gap-4 */
|
|
154
|
+
/* qti-prompt {
|
|
155
|
+
grid-column: span var(--choice-interactions-stacking) / span var(--choice-interactions-stacking);
|
|
156
|
+
} */
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
:host(.qti-choices-stacking-1) [part='slot'] {
|
|
160
|
+
--choice-interactions-stacking: 1;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
:host(.qti-choices-stacking-2) [part='slot'] {
|
|
164
|
+
--choice-interactions-stacking: 2;
|
|
165
|
+
}
|
|
166
|
+
:host(.qti-choices-stacking-3) [part='slot'] {
|
|
167
|
+
--choice-interactions-stacking: 3;
|
|
168
|
+
}
|
|
169
|
+
:host(.qti-choices-stacking-4) [part='slot'] {
|
|
170
|
+
--choice-interactions-stacking: 4;
|
|
132
171
|
}
|
|
133
|
-
|
|
172
|
+
:host(.qti-choices-stacking-5) [part='slot'] {
|
|
173
|
+
--choice-interactions-stacking: 5;
|
|
174
|
+
}
|
|
175
|
+
:host()[part='slot'] {
|
|
176
|
+
&.qti-orientation-horizontal {
|
|
177
|
+
/* is the default layout */
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
:host()[part='slot'] {
|
|
181
|
+
&[orientation='horizontal'] {
|
|
182
|
+
flex-direction: row;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
`;var Re=class extends Di(Ft(le(u,"qti-simple-choice"),"qti-simple-choice"),"qti-simple-choice"){render(){return h` <slot name="prompt"></slot><slot part="slot"></slot>`}};Re.styles=Hi,l([d({type:String})],Re.prototype,"orientation",2),Re=l([m("qti-choice-interaction")],Re);var st=class extends u{render(){return h`<slot></slot>`}process(){let t=new xr,e=[...this.children];t.process(e)}};st.styles=[b`
|
|
134
186
|
:host {
|
|
135
187
|
display: none;
|
|
136
188
|
}
|
|
137
|
-
`],
|
|
189
|
+
`],st=l([m("qti-outcome-processing")],st);var xr=class{process(t){for(let e of t)e.process()}};var Pi=`<qti-response-processing>
|
|
138
190
|
<qti-response-condition>
|
|
139
191
|
<qti-response-if>
|
|
140
192
|
<qti-match>
|
|
@@ -151,7 +203,7 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
|
|
|
151
203
|
</qti-set-outcome-value>
|
|
152
204
|
</qti-response-else>
|
|
153
205
|
</qti-response-condition>
|
|
154
|
-
</qti-response-processing>`,
|
|
206
|
+
</qti-response-processing>`,Ni=`<qti-response-processing>
|
|
155
207
|
<qti-response-condition>
|
|
156
208
|
<qti-response-if>
|
|
157
209
|
<qti-is-null>
|
|
@@ -167,7 +219,7 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
|
|
|
167
219
|
</qti-set-outcome-value>
|
|
168
220
|
</qti-response-else>
|
|
169
221
|
</qti-response-condition>
|
|
170
|
-
</qti-response-processing>`,
|
|
222
|
+
</qti-response-processing>`,Vi=`<qti-response-processing>
|
|
171
223
|
<qti-response-condition>
|
|
172
224
|
<qti-response-if>
|
|
173
225
|
<qti-is-null>
|
|
@@ -183,41 +235,54 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
|
|
|
183
235
|
</qti-set-outcome-value>
|
|
184
236
|
</qti-response-else>
|
|
185
237
|
</qti-response-condition>
|
|
186
|
-
</qti-response-processing>`;var
|
|
238
|
+
</qti-response-processing>`;var xe=class extends u{render(){return h`<slot></slot>`}process(){let t=[...this.children];for(let e of t)e.process()}firstUpdated(t){if(this.getAttribute("template")){let e=this.getAttribute("template").split("/"),r=e[e.length-1].replace(".xml","");switch(this.innerHTML="",r){case"map_response":{this.appendChild(this.fragmentFromString(Ni).firstElementChild.firstElementChild);break}case"map_response_point":{this.appendChild(this.fragmentFromString(Vi).firstElementChild.firstElementChild);break}case"match_correct":this.appendChild(this.fragmentFromString(Pi).firstElementChild.firstElementChild);break}}}fragmentFromString(t){return document.createRange().createContextualFragment(t)}};xe.styles=[b`
|
|
187
239
|
:host {
|
|
188
240
|
display: none;
|
|
189
241
|
}
|
|
190
|
-
`],
|
|
242
|
+
`],xe=l([m("qti-response-processing")],xe);var Y=class extends u{render(){return h`<slot></slot>`}process(){throw new Error("Not implemented")}};Y=l([m("qti-rule")],Y);var Bt=class extends Y{get childExpression(){return this.firstElementChild}process(){let t=this.getAttribute("identifier"),e=this.closest("qti-assessment-item").getVariable(t),r;return e.interpolationTable&&(r=e.interpolationTable.get(parseInt(this.childExpression.calculate()))),r==null?(console.warn("lookupOutcomeValue: value is null or undefined"),0):(this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:this.identifier,value:Je(r)}})),r)}};l([d({type:String})],Bt.prototype,"identifier",2);customElements.define("qti-lookup-outcome-value",Bt);var qr=class extends Y{render(){return h`<slot></slot>`}process(){let t=[...this.children];for(let e=0;e<t.length;e++){let r=t[e];if(r.calculate()){r.process();return}}}};customElements.define("qti-response-condition",qr);var wr=class extends Y{process(){let t=this.getAttribute("identifier"),e=this.firstElementChild,i=new Er(e).process();this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:t,value:Array.isArray(i)?i.map(o=>Je(o)):Je(i)}}))}},Er=class{constructor(t){this.expression=t}process(){let t=this.expression?this.expression.calculate():null;if(t==null){console.warn("setOutcomeValue: value is null or undefined");return}return t}};customElements.define("qti-set-outcome-value",wr);var ot=class extends u{render(){return h`<slot></slot>`}calculate(){return!0}getSubRules(){return[...this.children]}process(){let t=this.getSubRules();for(let e=0;e<t.length;e++)t[e].process()}};customElements.define("qti-response-else",ot);var nt=class extends ot{calculate(){return this.firstElementChild.calculate()}getSubRules(){let t=[];for(let e=1;e<this.children.length;e++)t.push(this.children[e]);return t}};customElements.define("qti-response-if",nt);var Cr=class extends nt{render(){return h`${super.render()}`}};customElements.define("qti-response-else-if",Cr);var x=class extends u{constructor(){super(...arguments);this.getVariables=()=>Array.from(this.children).map(e=>{switch(e.tagName.toLowerCase()){case"qti-base-value":return{baseType:e.getAttribute("base-type"),value:e.textContent,cardinality:"single"};case"qti-variable":{let r=e.getAttribute("identifier")||"";return this.assessmentItem.getVariable(r)}case"qti-multiple":{let i=e.getResult();return i.length>0?{identifier:"",baseType:i[0].baseType,value:i.map(o=>o.value),cardinality:"multiple",type:"response"}:null}case"qti-correct":{let r=e.getAttribute("identifier")||"",i=this.assessmentItem.getResponse(r);return{baseType:i.baseType,value:i.correctResponse,cardinality:i.cardinality}}default:{try{return{baseType:"integer",value:e.getResult().toString(),cardinality:"single"}}catch(r){console.warn("default not sufficient")}return null}}}).filter(e=>e!==null)}render(){return h`<pre>${JSON.stringify(this.result,null,2)}</pre>
|
|
191
243
|
<slot></slot>`}calculate(){return this.result=this.getResult(),this.result}getResult(){throw new Error("Not implemented")}get assessmentItem(){return this.closest("qti-assessment-item")}};x.styles=b`
|
|
192
244
|
slot {
|
|
193
245
|
display: none;
|
|
194
246
|
}
|
|
195
|
-
`,l([E()],x.prototype,"result",2);var P=class extends x{calculate(){return this.result=this.getResult(),this.result}getResult(){throw new Error("Not implemented")}};var Nt=class extends ui(P){calculate(){return this.calculateChildren(Array.from(this.children))}};function ui(i){return class extends i{calculateChildren(e){return e.map(s=>{let o=s;if(!o.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let n=o.calculate();if(typeof n=="string")if(n==="true")n=!0;else if(n==="false")n=!1;else return console.error("unexpected value in qti-and, expected boolean"),null;return n}).every(s=>typeof s=="boolean"&&s)}}}customElements.define("qti-and",Nt);var Pt=class extends x{constructor(){super(...arguments);this.baseType="string"}getResult(){return this.textContent}};l([d({type:String,attribute:"base-type"})],Pt.prototype,"baseType",2);customElements.define("qti-base-value",Pt);var gr=class extends P{getResult(){let t=this.getVariables();if(this.children.length===2){let e=t[0],r=t[1];if(e.baseType==="directedPair"&&r.baseType==="directedPair"&&e.cardinality==="multiple"){let s=e.value,o=r.value;return s.filter(c=>o.includes(c)).length>0}else if(e.baseType==="directedPair"&&r.baseType==="directedPair"&&e.cardinality==="single"){let s=e.value;return r.value.includes(s)}else console.error("unsupported baseType or cardinality in qti contains, only baseType: directedPair and cardinality: multiple is supported")}else console.error("unexpected number of children in qti contains");return!1}};customElements.define("qti-contains",gr);var br=class extends x{get interpretation(){return this.getAttribute("interpretation")||""}getResult(){let t=this.getAttribute("identifier")||"",e=this.closest("qti-assessment-item").getResponse(t);return e.correctResponse,e.cardinality!=="single"?e.correctResponse.length>0?e.correctResponse[0]:"":e.correctResponse}};customElements.define("qti-correct",br);var Vt=class extends x{constructor(){super(...arguments);this.roundingMode="significantFigures"}get figures(){if(!this.getAttribute("figures"))return console.error("figures attribute is missing"),null;let r=parseInt(this.getAttribute("figures")||"0");return isNaN(r)?(console.error("figures attribute is not a number"),null):r<0?(console.error("figures attribute is negative"),null):r<1&&this.roundingMode==="significantFigures"?(console.error("figures cannot be smaller than 1 for RoundingMode significantFigures"),null):r}getResult(){if(this.children.length===2){let e=this.getVariables(),r=e[0],s=e[1];if(this.roundingMode===null)return null;if(r.cardinality!=="single"||s.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(s.value))return console.error("unexpected cardinality in qti equal"),!1;switch(e[0].baseType){case"integer":case"float":{let o=parseFloat(r.value),n=parseFloat(s.value);if(!isNaN(o)&&!isNaN(n))return this.roundingMode==="significantFigures"?o.toPrecision(this.figures)===n.toPrecision(this.figures):Math.round(o*Math.pow(10,this.figures))/Math.pow(10,this.figures)===Math.round(n*Math.pow(10,this.figures))/Math.pow(10,this.figures);console.error(`value cannot be casted to numeric value in equalRounded operator: ${o}, ${n}`);break}default:{console.error("values other than float and int cannot be used in equalRounded operator.");break}}return!1}return console.error("unexpected number of children in qti-equal-rounded"),null}};l([d({type:String})],Vt.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",Vt);var V=class{static compareSingleValues(t,e,r){switch(r){case"identifier":case"string":return t===e;case"integer":{let s=parseInt(t,10),o=parseInt(e,10);if(!isNaN(s)&&!isNaN(o))return s===o;console.error(`Cannot convert ${t} and/or ${e} to int.`);break}case"float":{let s=parseFloat(t),o=parseFloat(e);if(!isNaN(s)&&!isNaN(o))return s===o;console.error(`couldn't convert ${t} and/or ${e} to float.`);break}case"pair":case"directedPair":{let s=t.split(" ").sort(),o=e.split(" ").sort();if(s.length===2&&o.length===2)return r==="pair"&&(s.sort(),o.sort()),s.join(" ")===o.join(" ");console.error(`compared two pair but one of the values does not have 2 values: 1: ${t} 2: ${e}`);break}}return!1}};var Dt=class extends x{constructor(){super(...arguments);this.toleranceMode="exact"}getResult(){if(this.children.length===2){let e=this.getVariables(),r=e[0],s=e[1];return this.toleranceMode!=="exact"?(console.error("toleranceMode is not supported yet"),!1):r.cardinality!=="single"||s.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(s.value)?(console.error("unexpected cardinality in qti equal"),!1):V.compareSingleValues(r.value,s.value,r.baseType)}return console.error("unexpected number of children in qti-equal"),null}};l([d({type:String})],Dt.prototype,"toleranceMode",2);customElements.define("qti-equal",Dt);var vr=class extends x{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];if(e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value>+r.value;console.error("unexpected baseType or cardinality in qti gt")}return console.error("unexpected number of children in qt"),null}};customElements.define("qti-gt",vr);var yr=class extends P{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];return e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value>=+r.value:(console.error("unexpected baseType or cardinality in qti gte"),null)}return console.log("unexpected number of children in qte"),null}};customElements.define("qti-gte",yr);var xr=class extends x{getResult(){if(this.children.length===1){let t=this.getVariables();if(!t)return!0;let e=t[0].value;return e==null||e==null||e===""}return console.error("unexpected number of children in qti Null"),null}};customElements.define("qti-is-null",xr);var Er=class extends x{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];if(e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value<+r.value;console.error("unexpected baseType or cardinality in qti lt")}return console.error("unexpected number of children in lt"),null}};customElements.define("qti-lt",Er);var _r=class extends P{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];return e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value<=+r.value:(console.error("unexpected baseType or cardinality in qti lte"),null)}return console.log("unexpected number of children in lte"),null}};customElements.define("qti-lte",_r);var Ot=class extends x{getResult(){let t=this.assessmentItem.getResponse(this.identifier);if(!t)return console.warn(`Response ${this.identifier} can not be found`),null;let e=t.mapping,r=Array.isArray(t.value)?t.value:[t.value],s=0;for(let o of r){let n=e.mapEntries.find(a=>V.compareSingleValues(a.mapKey,o,t.baseType));n==null||n.mappedValue==null?s+=e.defaultValue:s+=n.mappedValue}return e.lowerBound!=null&&(s=Math.max(e.lowerBound,s)),e.upperBound!=null&&(s=Math.min(e.upperBound,s)),s}};l([d({type:String})],Ot.prototype,"identifier",2);customElements.define("qti-map-response",Ot);var Te=class extends f{constructor(){super(...arguments);this.defaultValue=0}get mapEntries(){return Array.from(this.querySelectorAll("qti-map-entry")).map(e=>({mapKey:e.getAttribute("map-key"),mappedValue:+e.getAttribute("mapped-value")}))}};l([d({attribute:"default-value",type:Number})],Te.prototype,"defaultValue",2),l([d({attribute:"lower-bound",type:Number})],Te.prototype,"lowerBound",2),l([d({attribute:"upper-bound",type:Number})],Te.prototype,"upperBound",2);customElements.define("qti-mapping",Te);var Cr=class i extends x{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];return i.match(e,r)}return console.error("unexpected number of children in match"),null}static match(t,e){var r;switch(e.cardinality){case"single":return t.value===null?!1:Array.isArray(t.value)||Array.isArray(e.value)?(console.error("unexpected cardinality in qti match"),!1):V.compareSingleValues((r=t.value)==null?void 0:r.toString(),e.value.toString(),e.baseType);case"ordered":{if(!Array.isArray(t.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(t.value.length!==e.value.length)return!1;for(let s=0;s<t.value.length;s++)if(!V.compareSingleValues(e.value[s],t.value[s],e.baseType))return!1;return!0}case"multiple":{if(!Array.isArray(t.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(t.value.length!==e.value.length)return!1;let s=0;for(let o of e.value){let n=null,a=[...t.value];for(let c of a)if(V.compareSingleValues(o,c,e.baseType)){n=c;break}if(n!==null)a.splice(a.indexOf(n),1);else return!1;s++}return!0}default:return console.error("unexpected cardinality in qti match"),!1}}};customElements.define("qti-match",Cr);var qr=class extends x{getResult(){let t=this.getVariables();this.children.length!==2&&console.warn("The member operator takes two sub-expressions");let[e,r]=t;if(e.baseType!==r.baseType&&console.warn("Which must both have the same base-type"),r.cardinality==="multiple"||r.cardinality==="ordered"||console.warn("and the second must be a multiple or ordered container"),(e.baseType==="float"||r.baseType==="float")&&console.warn("The member operator should not be used on sub-expressions with a base-type of float"),(e.baseType==="duration"||r.baseType==="duration")&&console.warn("It must not be used on sub-expressions with a base-type of duration"),e.value===null||r.value===null)return null;let s=e.value;return r.value.includes(s)}};customElements.define("qti-member",qr);var Ar=class extends x{getResult(){let t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let e of t)if(e.cardinality!=="multiple"&&e.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[];return t}};customElements.define("qti-multiple",Ar);var wr=class extends x{render(){return u`${super.render()}`}getResult(){return!this.firstElementChild.calculate()}};customElements.define("qti-not",wr);var Sr=class extends P{getResult(){return Array.from(this.children).map(e=>{let r=e;if(!r.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let s=r.calculate();if(typeof s=="string")if(s==="true")s=!0;else if(s==="false")s=!1;else return console.error("unexpected value in qti-or, expected boolean"),null;return s}).some(e=>typeof e=="boolean"&&e)}};customElements.define("qti-or",Sr);var Tr=class extends x{getResult(){let t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let e of t)if(e.cardinality!=="ordered"&&e.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[];return t}};customElements.define("qti-ordered",Tr);var et=class extends f{render(){var e,r;let t=(r=(e=this.itemContext)==null?void 0:e.variables.find(s=>s.identifier===this.identifier))==null?void 0:r.value;return u`${JSON.stringify(t,null,2)}`}calculate(){let t=this.closest("qti-assessment-item"),e=this.identifier;return t.getVariable(e).value}};l([d({type:String})],et.prototype,"identifier",2),l([K({context:O,subscribe:!0}),E()],et.prototype,"itemContext",2);customElements.define("qti-printed-variable",et);var Rr=class extends x{getResult(){return this.getVariables().reduce((r,s)=>{if(s.baseType=="float"||s.baseType=="integer")try{return r*parseInt(s.value.toString())}catch(o){console.warn("can not convert to number")}else console.warn(`has another baseType ${s.baseType}`);return r},1)}};customElements.define("qti-product",Rr);var Ut=class extends x{constructor(){super(...arguments);this.caseSensitive="true"}getResult(){if(this.children.length===2){let e=this.getVariables(),r=e[0],s=e[1];if(r.cardinality!=="single"||s.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(s.value))return console.error("unexpected cardinality in qti string-match"),!1;let o=this.caseSensitive==="true"?r.value:r.value.toLowerCase(),n=this.caseSensitive==="true"?s.value:s.value.toLowerCase();return V.compareSingleValues(o,n,r.baseType)}return console.error("unexpected number of children in qti-string-match"),null}};l([d({type:String,attribute:"case-sensitive"})],Ut.prototype,"caseSensitive",2);customElements.define("qti-string-match",Ut);var $r=class extends x{constructor(){super(),this._expression=new kr(Array.from(this.children))}getResult(){return this._expression.calculate()}},kr=class{constructor(t){this.expressions=t}calculate(){return this.expressions.map(e=>{if(!e.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let r=e.calculate();return Number.isNaN(r)?(console.error("unexpected value in qti-sum, expected number"),null):Number(r)}).reduce((e,r)=>e+r,0)}};customElements.define("qti-sum",$r);var Mr=class extends x{getResult(){let t=this.getAttribute("identifier");return this.closest("qti-assessment-item").getVariable(t).value}};customElements.define("qti-variable",Mr);var ce=class extends A{constructor(){super(...arguments);this._errorMessage=null;this.loadConfig=async(e,r)=>{e=this.removeDoubleSlashes(e);try{let s=await fetch(e);if(s.ok){let n=await s.json();for(let a in n.paths)r&&(n.paths[a]=this.getResolvablePath(n.paths[a],r));return n}}catch(s){}return null};this.getResolvablePathString=(e,r)=>(e=e.replace(/\.js$/,""),e!=null&&e.toLocaleLowerCase().startsWith("http")||!r?e:this.removeDoubleSlashes(`${r}/${e}`));this.getResolvablePath=(e,r)=>Array.isArray(e)?e.map(s=>this.getResolvablePathString(s,r)):this.getResolvablePathString(e,r)}convertQtiVariableJSON(e){for(let r in e)if(e.hasOwnProperty(r)){let s=e[r];if(s){for(let o in s)if(s.hasOwnProperty(o)){let n=s[o];if(Array.isArray(n))return n.map(String);if(n!=null)return String(n)}}}return null}startChecking(){this.intervalId=setInterval(()=>{let e=this.pci.getResponse(),r=this.pci.getResponse(),s=JSON.stringify(e);if(s!==this.rawResponse){this.rawResponse=s;let o=this.convertQtiVariableJSON(r);this.response=o,this.saveResponse(o)}},200)}stopChecking(){this.intervalId!==void 0&&clearInterval(this.intervalId)}validate(){return!0}set response(e){}getTAOConfig(e){let r=e.querySelectorAll("properties"),s={},o=a=>{let c={},p=a.getAttribute("key");if(p){let h=Array.from(a.children),g=h.map(v=>v.getAttribute("key"));g.length>0&&!g.find(v=>!Number.isInteger(+v))?c[p]=h.map(v=>n(v)):c[p]=a.textContent}return c},n=a=>{if(a){let c={};for(let p of a.children)c=C(C({},c),o(p));return c}};for(let a of r)return a.getAttribute("key")||(s=C(C({},s),n(a))),s;return console.log("Can not find qti-custom-interaction config"),null}register(e){this.pci=e;let r=this.parentElement.tagName==="QTI-CUSTOM-INTERACTION"?"TAO":"IMS",s=r=="IMS"?this.querySelector("qti-interaction-markup"):this.querySelector("markup");s.classList.add("qti-customInteraction"),r=="TAO"&&this.querySelector("properties")&&(this.querySelector("properties").style.display="none");let o=r=="IMS"?{properties:this.dataset,onready:()=>{console.log("onready")}}:this.getTAOConfig(this);r=="IMS"?e.getInstance(s,o,void 0):e.initialize(this.customInteractionTypeIdentifier,s.firstElementChild,o),r=="TAO"&&Array.from(this.querySelectorAll("link")).map(a=>a.getAttribute("href")).forEach(a=>{let c=document.createElement("link");c.rel="stylesheet",c.type="text/css",c.media="screen",c.href=a,s.appendChild(c)}),this.startChecking()}connectedCallback(){super.connectedCallback(),define("qtiCustomInteractionContext",()=>({register:s=>{this.register(s)},notifyReady:()=>{}}));let e=this.buildRequireConfig();requirejs.config(e)(["require"],s=>{s([this.module])})}disconnectedCallback(){super.disconnectedCallback(),requirejs.undef(this.customInteractionTypeIdentifier);let e=requirejs.s.contexts;delete e[this.customInteractionTypeIdentifier],this.stopChecking()}buildRequireConfig(){let e={context:this.customInteractionTypeIdentifier,catchError:!0,paths:window.requirePaths||{},shim:window.requireShim||{}};if(!globalThis.require)return this._errorMessage="RequireJS not found. Please load it via CDN: https://cdnjs.com/libraries/require.js",null;let r=this.getAttribute("data-base-url"),s=this.querySelector("qti-interaction-modules");if(s){let o=s.querySelectorAll("qti-interaction-module");for(let n of o){let a=n.getAttribute("id"),c=n.getAttribute("primary-path"),p=n.getAttribute("fallback-path");if(a&&c){let h=p?this.combineRequireResolvePaths(this.getResolvablePath(c,r),this.getResolvablePath(p,r)):this.getResolvablePath(c,r),g=e.paths[a]||[];e.paths[a]=this.combineRequireResolvePaths(g,h)}}}return e}combineRequireResolvePaths(e,r){let s=Array.isArray(e)?e:[e],o=Array.isArray(r)?r:[r];return s.concat(o)}removeDoubleSlashes(e){return e.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")}render(){return u`<slot></slot>${this._errorMessage&&u`<div style="color:red">
|
|
247
|
+
`,l([q()],x.prototype,"result",2);var P=class extends x{calculate(){return this.result=this.getResult(),this.result}getResult(){throw new Error("Not implemented")}};var jt=class extends _s(P){calculate(){return this.calculateChildren(Array.from(this.children))}};function _s(s){return class extends s{calculateChildren(e){return e.map(i=>{let o=i;if(!o.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let n=o.calculate();if(typeof n=="string")if(n==="true")n=!0;else if(n==="false")n=!1;else return console.error("unexpected value in qti-and, expected boolean"),null;return n}).every(i=>typeof i=="boolean"&&i)}}}customElements.define("qti-and",jt);var Xt=class extends x{constructor(){super(...arguments);this.baseType="string"}getResult(){return this.textContent}};l([d({type:String,attribute:"base-type"})],Xt.prototype,"baseType",2);customElements.define("qti-base-value",Xt);var kr=class extends P{getResult(){let t=this.getVariables();if(this.children.length===2){let e=t[0],r=t[1];if(e.baseType==="directedPair"&&r.baseType==="directedPair"&&e.cardinality==="multiple"){let i=e.value,o=r.value;return i.filter(c=>o.includes(c)).length>0}else if(e.baseType==="directedPair"&&r.baseType==="directedPair"&&e.cardinality==="single"){let i=e.value;return r.value.includes(i)}else console.error("unsupported baseType or cardinality in qti contains, only baseType: directedPair and cardinality: multiple is supported")}else console.error("unexpected number of children in qti contains");return!1}};customElements.define("qti-contains",kr);var Tr=class extends x{get interpretation(){return this.getAttribute("interpretation")||""}getResult(){let t=this.getAttribute("identifier")||"",e=this.closest("qti-assessment-item").getResponse(t);return e.correctResponse,e.cardinality!=="single"?e.correctResponse.length>0?e.correctResponse[0]:"":e.correctResponse}};customElements.define("qti-correct",Tr);var Yt=class extends x{constructor(){super(...arguments);this.roundingMode="significantFigures"}get figures(){if(!this.getAttribute("figures"))return console.error("figures attribute is missing"),null;let r=parseInt(this.getAttribute("figures")||"0");return isNaN(r)?(console.error("figures attribute is not a number"),null):r<0?(console.error("figures attribute is negative"),null):r<1&&this.roundingMode==="significantFigures"?(console.error("figures cannot be smaller than 1 for RoundingMode significantFigures"),null):r}getResult(){if(this.children.length===2){let e=this.getVariables(),r=e[0],i=e[1];if(this.roundingMode===null)return null;if(r.cardinality!=="single"||i.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(i.value))return console.error("unexpected cardinality in qti equal"),!1;switch(e[0].baseType){case"integer":case"float":{let o=parseFloat(r.value),n=parseFloat(i.value);if(!isNaN(o)&&!isNaN(n))return this.roundingMode==="significantFigures"?o.toPrecision(this.figures)===n.toPrecision(this.figures):Math.round(o*Math.pow(10,this.figures))/Math.pow(10,this.figures)===Math.round(n*Math.pow(10,this.figures))/Math.pow(10,this.figures);console.error(`value cannot be casted to numeric value in equalRounded operator: ${o}, ${n}`);break}default:{console.error("values other than float and int cannot be used in equalRounded operator.");break}}return!1}return console.error("unexpected number of children in qti-equal-rounded"),null}};l([d({type:String})],Yt.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",Yt);var N=class{static compareSingleValues(t,e,r){switch(r){case"identifier":case"string":return t===e;case"integer":{let i=parseInt(t,10),o=parseInt(e,10);if(!isNaN(i)&&!isNaN(o))return i===o;console.error(`Cannot convert ${t} and/or ${e} to int.`);break}case"float":{let i=parseFloat(t),o=parseFloat(e);if(!isNaN(i)&&!isNaN(o))return i===o;console.error(`couldn't convert ${t} and/or ${e} to float.`);break}case"pair":case"directedPair":{let i=t.split(" ").sort(),o=e.split(" ").sort();if(i.length===2&&o.length===2)return r==="pair"&&(i.sort(),o.sort()),i.join(" ")===o.join(" ");console.error(`compared two pair but one of the values does not have 2 values: 1: ${t} 2: ${e}`);break}}return!1}};var Wt=class extends x{constructor(){super(...arguments);this.toleranceMode="exact"}getResult(){if(this.children.length===2){let e=this.getVariables(),r=e[0],i=e[1];return this.toleranceMode!=="exact"?(console.error("toleranceMode is not supported yet"),!1):r.cardinality!=="single"||i.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(i.value)?(console.error("unexpected cardinality in qti equal"),!1):N.compareSingleValues(r.value,i.value,r.baseType)}return console.error("unexpected number of children in qti-equal"),null}};l([d({type:String})],Wt.prototype,"toleranceMode",2);customElements.define("qti-equal",Wt);var Ar=class extends x{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];if(e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value>+r.value;console.error("unexpected baseType or cardinality in qti gt")}return console.error("unexpected number of children in qt"),null}};customElements.define("qti-gt",Ar);var _r=class extends P{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];return e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value>=+r.value:(console.error("unexpected baseType or cardinality in qti gte"),null)}return console.log("unexpected number of children in qte"),null}};customElements.define("qti-gte",_r);var Sr=class extends x{getResult(){if(this.children.length===1){let t=this.getVariables();if(!t)return!0;let e=t[0].value;return e==null||e==null||e===""}return console.error("unexpected number of children in qti Null"),null}};customElements.define("qti-is-null",Sr);var Rr=class extends x{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];if(e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value<+r.value;console.error("unexpected baseType or cardinality in qti lt")}return console.error("unexpected number of children in lt"),null}};customElements.define("qti-lt",Rr);var Mr=class extends P{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];return e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value<=+r.value:(console.error("unexpected baseType or cardinality in qti lte"),null)}return console.log("unexpected number of children in lte"),null}};customElements.define("qti-lte",Mr);var Kt=class extends x{getResult(){let t=this.assessmentItem.getResponse(this.identifier);if(!t)return console.warn(`Response ${this.identifier} can not be found`),null;let e=t.mapping,r=Array.isArray(t.value)?t.value:[t.value],i=0;for(let o of r){let n=e.mapEntries.find(a=>N.compareSingleValues(a.mapKey,o,t.baseType));n==null||n.mappedValue==null?i+=e.defaultValue:i+=n.mappedValue}return e.lowerBound!=null&&(i=Math.max(e.lowerBound,i)),e.upperBound!=null&&(i=Math.min(e.upperBound,i)),i}};l([d({type:String})],Kt.prototype,"identifier",2);customElements.define("qti-map-response",Kt);var Me=class extends u{constructor(){super(...arguments);this.defaultValue=0}get mapEntries(){return Array.from(this.querySelectorAll("qti-map-entry")).map(e=>({mapKey:e.getAttribute("map-key"),mappedValue:+e.getAttribute("mapped-value")}))}};l([d({attribute:"default-value",type:Number})],Me.prototype,"defaultValue",2),l([d({attribute:"lower-bound",type:Number})],Me.prototype,"lowerBound",2),l([d({attribute:"upper-bound",type:Number})],Me.prototype,"upperBound",2);customElements.define("qti-mapping",Me);var Lr=class s extends x{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];return s.match(e,r)}return console.error("unexpected number of children in match"),null}static match(t,e){var r;switch(e.cardinality){case"single":return t.value===null?!1:Array.isArray(t.value)||Array.isArray(e.value)?(console.error("unexpected cardinality in qti match"),!1):N.compareSingleValues((r=t.value)==null?void 0:r.toString(),e.value.toString(),e.baseType);case"ordered":{if(!Array.isArray(t.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(t.value.length!==e.value.length)return!1;for(let i=0;i<t.value.length;i++)if(!N.compareSingleValues(e.value[i],t.value[i],e.baseType))return!1;return!0}case"multiple":{if(!Array.isArray(t.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(t.value.length!==e.value.length)return!1;let i=0;for(let o of e.value){let n=null,a=[...t.value];for(let c of a)if(N.compareSingleValues(o,c,e.baseType)){n=c;break}if(n!==null)a.splice(a.indexOf(n),1);else return!1;i++}return!0}default:return console.error("unexpected cardinality in qti match"),!1}}};customElements.define("qti-match",Lr);var $r=class extends x{getResult(){let t=this.getVariables();this.children.length!==2&&console.warn("The member operator takes two sub-expressions");let[e,r]=t;if(e.baseType!==r.baseType&&console.warn("Which must both have the same base-type"),r.cardinality==="multiple"||r.cardinality==="ordered"||console.warn("and the second must be a multiple or ordered container"),(e.baseType==="float"||r.baseType==="float")&&console.warn("The member operator should not be used on sub-expressions with a base-type of float"),(e.baseType==="duration"||r.baseType==="duration")&&console.warn("It must not be used on sub-expressions with a base-type of duration"),e.value===null||r.value===null)return null;let i=e.value;return r.value.includes(i)}};customElements.define("qti-member",$r);var Dr=class extends x{getResult(){let t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let e of t)if(e.cardinality!=="multiple"&&e.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[];return t}};customElements.define("qti-multiple",Dr);var Hr=class extends x{render(){return h`${super.render()}`}getResult(){return!this.firstElementChild.calculate()}};customElements.define("qti-not",Hr);var Pr=class extends P{getResult(){return Array.from(this.children).map(e=>{let r=e;if(!r.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let i=r.calculate();if(typeof i=="string")if(i==="true")i=!0;else if(i==="false")i=!1;else return console.error("unexpected value in qti-or, expected boolean"),null;return i}).some(e=>typeof e=="boolean"&&e)}};customElements.define("qti-or",Pr);var Nr=class extends x{getResult(){let t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let e of t)if(e.cardinality!=="ordered"&&e.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[];return t}};customElements.define("qti-ordered",Nr);var at=class extends u{render(){var e,r;let t=(r=(e=this.itemContext)==null?void 0:e.variables.find(i=>i.identifier===this.identifier))==null?void 0:r.value;return h`${JSON.stringify(t,null,2)}`}calculate(){let t=this.closest("qti-assessment-item"),e=this.identifier;return t.getVariable(e).value}};l([d({type:String})],at.prototype,"identifier",2),l([J({context:O,subscribe:!0}),q()],at.prototype,"itemContext",2);customElements.define("qti-printed-variable",at);var Vr=class extends x{getResult(){return this.getVariables().reduce((r,i)=>{if(i.baseType=="float"||i.baseType=="integer")try{return r*parseInt(i.value.toString())}catch(o){console.warn("can not convert to number")}else console.warn(`has another baseType ${i.baseType}`);return r},1)}};customElements.define("qti-product",Vr);var Zt=class extends x{constructor(){super(...arguments);this.caseSensitive="true"}getResult(){if(this.children.length===2){let e=this.getVariables(),r=e[0],i=e[1];if(r.cardinality!=="single"||i.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(i.value))return console.error("unexpected cardinality in qti string-match"),!1;let o=this.caseSensitive==="true"?r.value:r.value.toLowerCase(),n=this.caseSensitive==="true"?i.value:i.value.toLowerCase();return N.compareSingleValues(o,n,r.baseType)}return console.error("unexpected number of children in qti-string-match"),null}};l([d({type:String,attribute:"case-sensitive"})],Zt.prototype,"caseSensitive",2);customElements.define("qti-string-match",Zt);var Ir=class extends x{constructor(){super(),this._expression=new Or(Array.from(this.children))}getResult(){return this._expression.calculate()}},Or=class{constructor(t){this.expressions=t}calculate(){return this.expressions.map(e=>{if(!e.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let r=e.calculate();return Number.isNaN(r)?(console.error("unexpected value in qti-sum, expected number"),null):Number(r)}).reduce((e,r)=>e+r,0)}};customElements.define("qti-sum",Ir);var Ur=class extends x{getResult(){let t=this.getAttribute("identifier");return this.closest("qti-assessment-item").getVariable(t).value}};customElements.define("qti-variable",Ur);var pe=class extends T{constructor(){super(...arguments);this._errorMessage=null;this.loadConfig=async(e,r)=>{e=this.removeDoubleSlashes(e);try{let i=await fetch(e);if(i.ok){let n=await i.json();for(let a in n.paths)r&&(n.paths[a]=this.getResolvablePath(n.paths[a],r));return n}}catch(i){}return null};this.getResolvablePathString=(e,r)=>(e=e.replace(/\.js$/,""),e!=null&&e.toLocaleLowerCase().startsWith("http")||!r?e:this.removeDoubleSlashes(`${r}/${e}`));this.getResolvablePath=(e,r)=>Array.isArray(e)?e.map(i=>this.getResolvablePathString(i,r)):this.getResolvablePathString(e,r)}convertQtiVariableJSON(e){for(let r in e)if(e.hasOwnProperty(r)){let i=e[r];if(i){for(let o in i)if(i.hasOwnProperty(o)){let n=i[o];if(Array.isArray(n))return n.map(String);if(n!=null)return String(n)}}}return null}startChecking(){this.intervalId=setInterval(()=>{let e=this.pci.getResponse(),r=this.pci.getResponse(),i=JSON.stringify(e);if(i!==this.rawResponse){this.rawResponse=i;let o=this.convertQtiVariableJSON(r);this.response=o,this.saveResponse(o)}},200)}stopChecking(){this.intervalId!==void 0&&clearInterval(this.intervalId)}validate(){return!0}set response(e){}getTAOConfig(e){let r=e.querySelectorAll("properties"),i={},o=a=>{let c={},p=a.getAttribute("key");if(p){let f=Array.from(a.children),g=f.map(v=>v.getAttribute("key"));g.length>0&&!g.find(v=>!Number.isInteger(+v))?c[p]=f.map(v=>n(v)):c[p]=a.textContent}return c},n=a=>{if(a){let c={};for(let p of a.children)c=C(C({},c),o(p));return c}};for(let a of r)return a.getAttribute("key")||(i=C(C({},i),n(a))),i;return console.log("Can not find qti-custom-interaction config"),null}register(e){this.pci=e;let r=this.parentElement.tagName==="QTI-CUSTOM-INTERACTION"?"TAO":"IMS",i=r=="IMS"?this.querySelector("qti-interaction-markup"):this.querySelector("markup");i.classList.add("qti-customInteraction"),r=="TAO"&&this.querySelector("properties")&&(this.querySelector("properties").style.display="none");let o=r=="IMS"?{properties:this.dataset,onready:()=>{console.log("onready")}}:this.getTAOConfig(this);r=="IMS"?e.getInstance(i,o,void 0):e.initialize(this.customInteractionTypeIdentifier,i.firstElementChild,o),r=="TAO"&&Array.from(this.querySelectorAll("link")).map(a=>a.getAttribute("href")).forEach(a=>{let c=document.createElement("link");c.rel="stylesheet",c.type="text/css",c.media="screen",c.href=a,i.appendChild(c)}),this.startChecking()}connectedCallback(){super.connectedCallback(),define("qtiCustomInteractionContext",()=>({register:i=>{this.register(i)},notifyReady:()=>{}}));let e=this.buildRequireConfig();requirejs.config(e)(["require"],i=>{i([this.module])})}disconnectedCallback(){super.disconnectedCallback(),requirejs.undef(this.customInteractionTypeIdentifier);let e=requirejs.s.contexts;delete e[this.customInteractionTypeIdentifier],this.stopChecking()}buildRequireConfig(){let e={context:this.customInteractionTypeIdentifier,catchError:!0,paths:window.requirePaths||{},shim:window.requireShim||{}};if(!globalThis.require)return this._errorMessage="RequireJS not found. Please load it via CDN: https://cdnjs.com/libraries/require.js",null;let r=this.getAttribute("data-base-url"),i=this.querySelector("qti-interaction-modules");if(i){let o=i.querySelectorAll("qti-interaction-module");for(let n of o){let a=n.getAttribute("id"),c=n.getAttribute("primary-path"),p=n.getAttribute("fallback-path");if(a&&c){let f=p?this.combineRequireResolvePaths(this.getResolvablePath(c,r),this.getResolvablePath(p,r)):this.getResolvablePath(c,r),g=e.paths[a]||[];e.paths[a]=this.combineRequireResolvePaths(g,f)}}}return e}combineRequireResolvePaths(e,r){let i=Array.isArray(e)?e:[e],o=Array.isArray(r)?r:[r];return i.concat(o)}removeDoubleSlashes(e){return e.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")}render(){return h`<slot></slot>${this._errorMessage&&h`<div style="color:red">
|
|
196
248
|
<h1>Error</h1>
|
|
197
249
|
${this._errorMessage}
|
|
198
|
-
</div>`}`}};l([d({type:String,attribute:"response-identifier"})],ce.prototype,"responseIdentifier",2),l([d({type:String,attribute:"module"})],ce.prototype,"module",2),l([d({type:String,attribute:"custom-interaction-type-identifier"})],ce.prototype,"customInteractionTypeIdentifier",2),l([E()],ce.prototype,"_errorMessage",2),ce=l([m("qti-portable-custom-interaction")],ce);var It=class i{constructor(){this._touchBegin=0;this._touchDown=null;this._lastClick=0;this._canDrag=!1;this._dragSrc=null;this._dragCopy=null;this._touchEndCalled=!1;this._dragRunning=!1;this._dataTransfer={data:{},setData:function(t,e){this.data[t]=e},getData:function(t){return this.data[t]},effectAllowed:"move"};this._copyOffset={x:0,y:0};this._lastTarget=null;this._currentDropContainer=null;this._handleClick=!0;this._DBLCLICKDELAY=500;this._CONTEXTMENUDELAY=1e3;this._DRAGDELTA=5;this._COPYOPACITY=.7;this.copyStylesDragClone=!0;this.dragOnClick=!1;this._createDragCopy=(t,e)=>{if(this._dragCopy===null&&this._dragRunning){this._dragSrc.style.opacity=this._COPYOPACITY,this._dragCopy=this._dragSrc.cloneNode(!0);let r=window.getComputedStyle(this._dragSrc);if(this._dragCopy.style="",this._dragCopy.setAttribute("dragclone",""),this.copyStylesDragClone)for(let s of r)this._dragCopy.style[s]=r.getPropertyValue(s);this._calculateDragCopyPosition(e),this._dragCopy.style.top=e.clientY-this._copyOffset.y+"px",this._dragCopy.style.left=e.clientX-this._copyOffset.x+"px",this._dragCopy.style.position="fixed",this._dragCopy.style.pointerEvents="none",this._dragCopy.style.zIndex="999999",this._dragCopy=document.body.appendChild(this._dragCopy),this._dispatchEvent(this._dragSrc,"dragstart")}if(this._dragRunning){let r=this;requestAnimationFrame(function(){r._touchEndCalled||r._dragCopy===null||(r._dragCopy.style.top=e.clientY-r._copyOffset.y+"px",r._dragCopy.style.left=e.clientX-r._copyOffset.x+"px")});let s=this._findDroppable(t);s!=this._lastTarget&&(this._dispatchEvent(s,"dragenter"),this._dispatchEvent(this._lastTarget,"dragleave"),this._lastTarget=s),this._currentDropContainer=s,this._currentDropContainer&&this._dispatchEvent(s,"dragover")}};return i._instance?i._instance:(i._instance=this,document.addEventListener("touchmove",this._touchMove.bind(this),{passive:!1,capture:!1}),document.addEventListener("mousemove",this._touchMove.bind(this),{passive:!1,capture:!1}),document.addEventListener("touchend",this._touchEnd.bind(this),{passive:!1,capture:!1}),document.addEventListener("mouseup",this._touchEnd.bind(this),{passive:!1,capture:!1}),document.addEventListener("touchcancel",this._touchCancel.bind(this),{passive:!1,capture:!1}),this)}addDraggables(t){t.forEach(e=>{e.addEventListener("touchstart",this._touchStart.bind(this),{passive:!1,capture:!1}),e.addEventListener("mousedown",this._touchStart.bind(this),{passive:!1,capture:!1})})}_touchStart(t){this._touchBegin=Date.now();let{x:e,y:r}=this._getPoint(t);if(this._touchDown={x:e,y:r},this._dragSrc=t.currentTarget,this._canDrag=!0,this.dragOnClick){let s={clientX:e,clientY:r};this._dragRunning=!0,this._createDragCopy(t,s)}t.preventDefault()}_touchMove(t){if(this._canDrag&&this._dragSrc){let{x:e,y:r}=this._getPoint(t),s={clientX:e,clientY:r};this._getDelta(s)>=this._DRAGDELTA&&(this._dragRunning=!0),this._createDragCopy(t,s),t.preventDefault()}}_touchEnd(t){var e;if(this._touchEndCalled=!0,this._canDrag=!1,this._currentDropContainer)this._dispatchEvent(this._currentDropContainer,"drop"),this._dispatchEvent(this._dragSrc,"dragend");else if(this._dragRunning){let r=new CustomEvent("dragend",{bubbles:!0,cancelable:!0});r.dataTransfer={dropEffect:"none"},(e=this._dragSrc)==null||e.dispatchEvent(r)}this._reset()}_touchCancel(t){this._reset()}_findDroppable(t){let e=this._getPoint(t);return this.elementFromPoint(e.x,e.y)}elementFromPoint(t,e){let r=document.elementFromPoint(t,e);if(r){for(;r.shadowRoot;){let s=r.shadowRoot.elementFromPoint(t,e);if(s===null||s===r)break;r=s}return r}return null}_getPoint(t,e){return t&&t.touches&&(t=t.touches[0]),{x:e?t.pageX:t.clientX,y:e?t.pageY:t.clientY}}_calculateDragCopyPosition(t){let e=this._dragSrc.getBoundingClientRect();this._copyOffset.x=t.clientX-e.left,this._copyOffset.y=t.clientY-e.top}_getDelta(t){let e=Math.abs(t.clientX-this._touchDown.x),r=Math.abs(t.clientY-this._touchDown.y);return e+r}_dispatchEvent(t,e,r=!0){if(!t)return!1;let s=new CustomEvent(e,{bubbles:r,cancelable:!0});return s.dataTransfer=this._dataTransfer,t.dispatchEvent(s),s.defaultPrevented}_reset(){this._dragRunning&&(this._dragSrc.style.opacity="1.0",this._dragCopy.parentElement.removeChild(this._dragCopy)),this._dragRunning=!1,this._dragSrc=null,this._dragCopy=null,this._canDrag=!1,this._touchBegin=0,this._touchDown=null,this._lastClick=0,this._touchEndCalled=!1,this._dataTransfer={data:{},setData:function(t,e){this.data[t]=e},getData:function(t){return this.data[t]},effectAllowed:"move"},this._copyOffset={x:0,y:0},this._lastTarget=null,this._currentDropContainer=null,this._handleClick=!0}};var ws=(i,t,e)=>{class r extends i{constructor(){super(...arguments);this.disabled=!1}firstUpdated(n){if(this.classList.contains("qti-match-tabular"))return;super.firstUpdated(n);let a=Array.from(t?this.shadowRoot.querySelectorAll(e):this.querySelectorAll(e));this.dragoverHandler=this.dragoverHandler.bind(this),this.dragleaveHandler=this.dragleaveHandler.bind(this),this.dragenterHandler=this.dragenterHandler.bind(this),this.dropHandler=this.dropHandler.bind(this),a.forEach(c=>{c.setAttribute("dropzone","move"),c.addEventListener("dragleave",this.dragleaveHandler),this.attachHandler(c)});for(let c of a)this.observer=new MutationObserver(p=>{p.forEach(h=>{if(h.type==="attributes")switch(h.attributeName){case"disabled":{c.hasAttribute("disabled")?this.removeHandler(c):this.attachHandler(c);break}}})}),this.observer.observe(c,{attributes:!0})}attachHandler(n){n.addEventListener("dragover",this.dragoverHandler),n.addEventListener("dragenter",this.dragenterHandler),n.addEventListener("drop",this.dropHandler)}removeHandler(n){n.removeEventListener("dragover",this.dragoverHandler),n.removeEventListener("dragenter",this.dragenterHandler),n.removeEventListener("drop",this.dropHandler)}disconnectedCallback(){var n;this.classList.contains("qti-match-tabular")||(super.disconnectedCallback(),(n=this.observer)==null||n.disconnect())}dragenterHandler(n){n.preventDefault()}dragoverHandler(n){return n.preventDefault(),n.currentTarget.setAttribute("active",""),n.dataTransfer.dropEffect="move",!1}dropHandler(n){n.preventDefault();let a=n.currentTarget,c=this.querySelector(`[identifier=${n.dataTransfer.getData("text")}`),p=c||this.shadowRoot.querySelector(`[identifier=${n.dataTransfer.getData("text")}`);return a?p.parentElement.getAttribute("identifier")!==a.getAttribute("identifier")&&a.appendChild(p):console.error(`cannot find droppable, target: ${n.target?JSON.stringify(n.target):"null"}`),a.removeAttribute("active"),!1}dragleaveHandler(n){return n.preventDefault(),n.currentTarget.removeAttribute("active"),n.dataTransfer.dropEffect="none",!1}}return l([d({type:Boolean,reflect:!0})],r.prototype,"disabled",2),r};var Ss=(i,t,e)=>{class r extends i{}return r};var Y=(i,t,e,r)=>{class s extends Ss(ws(i,e,r),r,t){constructor(){super(...arguments);this.draggables=new Map;this.responseIdentifier="";this.configuration={copyStylesDragClone:!0,dragCanBePlacedBack:!0,dragOnClick:!1};this.disabled=!1;this.readonly=!1;this.minAssociations=1;this.maxAssociations=1;this.handleDragStart=a=>{a.dataTransfer.setData("text",a.currentTarget.getAttribute("identifier")),a.currentTarget.setAttribute("dragging",""),this.droppables.forEach(c=>c.setAttribute("enabled",""))};this.handleDragEnd=a=>{a.preventDefault(),this.droppables.forEach(p=>p.removeAttribute("enabled"));let c=a.currentTarget;c.removeAttribute("over"),c.removeAttribute("dragging"),(a.dataTransfer.dropEffect==="none"||a.dataTransfer.dropEffect===void 0)&&this.configuration.dragCanBePlacedBack&&this.placeDraggableBack(c),a.dataTransfer.dropEffect==="move"&&(this.saveResponse(),this.checkMaxMatchAssociations())}}reInitDragAndDrop(a,c){if(this.classList.contains("qti-match-tabular"))return;a.filter(h=>!this.draggables||!this.draggables.get(h)).length>0&&(this.dragDropApi.addDraggables(a),a.forEach(h=>{this.draggables.set(h,{parent:h.parentElement,index:Array.from(h.parentNode.children).indexOf(h)}),h.setAttribute("qti-draggable","true"),h.addEventListener("dragstart",this.handleDragStart),h.addEventListener("dragend",this.handleDragEnd)}))}handleDragOptionsChanged(a,c){this.dragDropApi.copyStylesDragClone=c.copyStylesDragClone,this.dragDropApi.dragOnClick=c.dragOnClick}handleDisabledChange(a,c){this.draggables.forEach((p,h)=>{c?h.setAttribute("disabled",""):h.removeAttribute("disabled"),c?h.removeAttribute("qti-draggable"):h.setAttribute("qti-draggable","true")})}handleReadonlyChange(a,c){this.draggables.forEach((p,h)=>{c?h.setAttribute("readonly",""):h.removeAttribute("readonly"),c?h.removeAttribute("qti-draggable"):h.setAttribute("qti-draggable","true")})}firstUpdated(a){super.firstUpdated(a),this.droppables=Array.from(e?this.shadowRoot.querySelectorAll(r):this.querySelectorAll(r))}connectedCallback(){super.connectedCallback(),this.dragDropApi=new It,this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,detail:this}))}placeDraggableBack(a){let c=this.draggables.get(a),p=c.index<=c.parent.children.length?c.index:c.parent.children.length-1,h=c.parent,g=c.parent.children[p];h.insertBefore(a,g),this.saveResponse(),this.checkMaxMatchAssociations()}reset(a=!0){this.draggables.forEach((c,p)=>{let h=c.parent.children,g=c.index<h.length?c.index:h.length;c.parent.insertBefore(p,h[g])}),a&&this.saveResponse()}checkMaxMatchAssociations(){this.droppables.forEach(a=>{let p=+(a.getAttribute("match-max")||1)<=(a.querySelectorAll('[qti-draggable="true"]').length||0);p?a.setAttribute("disabled",""):a.removeAttribute("disabled"),p?a.removeAttribute("dropzone"):a.setAttribute("dropzone","move")})}set response(a){this.classList.contains("qti-match-tabular")||(this.reset(!1),a!==null&&Array.isArray(a)&&a.forEach(c=>{let[p,...h]=c.split(" ").reverse();if(p){let g=this.droppables.find(y=>y.getAttribute("identifier")===p);h.forEach(y=>{let v=this.querySelector(`[identifier=${y}]`);g?v?(g.appendChild(v),this.checkMaxMatchAssociations()):console.error(`cannot find draggable with identifier: ${y}`):console.error(`cannot find droppable with identifier: ${p}`)})}}))}validate(){let c=(e?Array.from(this.shadowRoot.querySelectorAll(r)):Array.from(this.querySelectorAll(r))).filter(p=>p.childElementCount>0).length;return this.minAssociations<=0||this.minAssociations<=c}saveResponse(){let a;typeof this.getResponse=="function"?a=this.getResponse():a=this.droppables.map(c=>{let p=c.querySelectorAll('[qti-draggable="true"]'),h=Array.from(p).map(y=>y.getAttribute("identifier")),g=c.getAttribute("identifier");return[...h,g].join(" ")}),this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:a}}))}}return l([xs(t)],s.prototype,"reInitDragAndDrop",1),l([d({type:String,attribute:"response-identifier"})],s.prototype,"responseIdentifier",2),l([d({attribute:!1,type:Object})],s.prototype,"configuration",2),l([S("configuration")],s.prototype,"handleDragOptionsChanged",1),l([d({type:Boolean,reflect:!0})],s.prototype,"disabled",2),l([S("disabled",{waitUntilFirstUpdate:!0})],s.prototype,"handleDisabledChange",1),l([d({type:Boolean,reflect:!0})],s.prototype,"readonly",2),l([S("readonly",{waitUntilFirstUpdate:!0})],s.prototype,"handleReadonlyChange",1),l([d({type:Number,reflect:!0,attribute:"min-associations"})],s.prototype,"minAssociations",2),l([d({type:Number,reflect:!0,attribute:"max-associations"})],s.prototype,"maxAssociations",2),s};var Re=class extends Y(f,"qti-simple-associable-choice",!0,".dl"){render(){return u` <slot name="prompt"></slot>
|
|
250
|
+
</div>`}`}};l([d({type:String,attribute:"response-identifier"})],pe.prototype,"responseIdentifier",2),l([d({type:String,attribute:"module"})],pe.prototype,"module",2),l([d({type:String,attribute:"custom-interaction-type-identifier"})],pe.prototype,"customInteractionTypeIdentifier",2),l([q()],pe.prototype,"_errorMessage",2),pe=l([m("qti-portable-custom-interaction")],pe);var Jt=class s{constructor(){this.touchStartTime=0;this.touchStartPoint=null;this.lastClickTime=0;this.isDraggable=!1;this.dragSource=null;this.dragClone=null;this.touchEndTriggered=!1;this.isDragging=!1;this.initialTransform="";this.hasDispatchedDragStart=!1;this.rootNode=null;this.focusedElement=null;this.focusableDropZones=[];this.currentDropZoneIndex=-1;this.dataTransfer={data:{},setData(t,e){this.data[t]=e},getData(t){return this.data[t]},effectAllowed:"move"};this.cloneOffset={x:0,y:0};this.lastTarget=null;this.currentDropTarget=null;this.allowClick=!0;this.copyStylesForDragClone=!0;this.dragOnClickEnabled=!1;this.useDragClone=!1;this.MIN_DRAG_DISTANCE=5;this.DRAG_CLONE_OPACITY=1;if(s.instance)return s.instance;s.instance=this,document.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!1}),document.addEventListener("mousemove",this.handleTouchMove.bind(this),{passive:!1}),document.addEventListener("touchend",this.handleTouchEnd.bind(this),{passive:!1}),document.addEventListener("mouseup",this.handleTouchEnd.bind(this),{passive:!1}),document.addEventListener("touchcancel",this.handleTouchCancel.bind(this),{passive:!1}),document.addEventListener("keydown",this.handleKeyDown.bind(this)),document.addEventListener("keyup",this.handleKeyUp.bind(this))}addDraggableElements(t){t.forEach(e=>{e.setAttribute("tabindex","0"),e.addEventListener("focus",()=>this.focusedElement=e),e.addEventListener("blur",()=>this.focusedElement=null),e.addEventListener("touchstart",this.handleTouchStart.bind(this),{passive:!1}),e.addEventListener("mousedown",this.handleTouchStart.bind(this),{passive:!1})})}handleTouchStart(t){this.touchStartTime=Date.now();let{x:e,y:r}=this.getEventCoordinates(t);if(this.touchStartPoint={x:e,y:r},this.dragSource=t.currentTarget,this.isDraggable=!0,this.rootNode=this.dragSource.getRootNode(),this.dragOnClickEnabled&&(this.isDragging=!0,this.createDragClone(t,{clientX:e,clientY:r})),!this.useDragClone){let i=window.getComputedStyle(this.dragSource);this.initialTransform=i.transform==="none"?"":i.transform,this.initialTransition=i.transition||"",this.dragSource.style.transition="none";let o=this.dragSource.getBoundingClientRect();this.cloneOffset.x=e-o.left,this.cloneOffset.y=r-o.top,this.dragSource.style.zIndex="9999",this.dragSource.focus()}t.preventDefault()}handleTouchMove(t){if(this.isDraggable&&this.dragSource){let{x:e,y:r}=this.getEventCoordinates(t),i={clientX:e,clientY:r};this.calculateDragDistance(i)>=this.MIN_DRAG_DISTANCE&&(this.dragSource.style.pointerEvents="none",this.isDragging=!0),this.createDragClone(t,i),t.preventDefault()}}createDragClone(t,e){if(!this.isDragging)return;if(this.useDragClone){if(!this.dragClone){if(this.dragSource.style.opacity=this.DRAG_CLONE_OPACITY.toString(),this.dragClone=this.dragSource.cloneNode(!0),this.copyStylesForDragClone){let i=window.getComputedStyle(this.dragSource);for(let o of i)this.dragClone.style[o]=i.getPropertyValue(o)}this.rootNode instanceof ShadowRoot?this.rootNode.host.appendChild(this.dragClone):this.rootNode instanceof Document&&document.body.appendChild(this.dragClone),this.calculateClonePosition(e),this.setDragCloneStyles(e),this.dispatchCustomEvent(this.dragSource,"dragstart")}this.updateDragClonePosition(e)}else if(this.touchStartPoint){let i=e.clientX-this.touchStartPoint.x,o=e.clientY-this.touchStartPoint.y;this.dragSource.style.transform=`${this.initialTransform} translate(${i}px, ${o}px)`,this.hasDispatchedDragStart||(this.dispatchCustomEvent(this.dragSource,"dragstart"),this.hasDispatchedDragStart=!0)}let r=this.findDropTarget(t);r!==this.lastTarget&&(this.dispatchCustomEvent(r,"dragenter"),this.dispatchCustomEvent(this.lastTarget,"dragleave"),this.lastTarget=r),this.currentDropTarget=r,this.currentDropTarget&&this.dispatchCustomEvent(r,"dragover")}handleTouchEnd(t){var r;this.touchEndTriggered=!0,this.isDraggable=!1;let e=!1;if(this.currentDropTarget)this.dispatchCustomEvent(this.currentDropTarget,"drop"),this.dispatchCustomEvent(this.dragSource,"dragend"),e=!0;else if(this.isDragging){let i=new CustomEvent("dragend",{bubbles:!0,cancelable:!0});i.dataTransfer={dropEffect:"none"},(r=this.dragSource)==null||r.dispatchEvent(i)}this.resetDragState(e)}handleTouchCancel(t){this.resetDragState()}findDropTarget(t){let{x:e,y:r}=this.getEventCoordinates(t);return this.getDropTargetAtPoint(document,e,r)}getDropTargetAtPoint(t,e,r,i=0){if(i>2)return null;let n=t.elementFromPoint(e,r);if(!n)return null;if(n.hasAttribute("dropzone"))return n;let a=n.parentElement;for(;a;){if(a.hasAttribute("dropzone"))return a;a=a.parentElement}if(n.shadowRoot&&i<2){let c=this.getDropTargetAtPoint(n.shadowRoot,e,r,i+1);if(c)return c}return null}handleKeyDown(t){this.focusedElement&&(t.key===" "&&!this.isDragging?(t.preventDefault(),this.isDraggable=!0,this.dragSource=this.focusedElement,this.isDragging=!0,this.collectDropZones(),this.dispatchCustomEvent(this.dragSource,"dragstart")):t.key==="Tab"&&this.isDragging&&(t.preventDefault(),this.moveToNextDropZone()))}handleKeyUp(t){t.key===" "&&this.isDragging&&this.currentDropTarget&&(t.preventDefault(),this.dispatchCustomEvent(this.currentDropTarget,"drop"),this.dispatchCustomEvent(this.dragSource,"dragend"),this.resetDragState(!0))}collectDropZones(){this.focusableDropZones=Array.from(document.querySelectorAll("[dropzone]")),this.currentDropZoneIndex=-1}moveToNextDropZone(){if(this.focusableDropZones.length===0)return;this.currentDropZoneIndex=(this.currentDropZoneIndex+1)%this.focusableDropZones.length;let t=this.focusableDropZones[this.currentDropZoneIndex];t.focus(),this.currentDropTarget=t,this.dispatchCustomEvent(t,"dragenter")}getEventCoordinates(t,e=!1){let r=t.touches?t.touches[0]:t;return{x:e?r.pageX:r.clientX,y:e?r.pageY:r.clientY}}calculateClonePosition(t){let e=this.dragSource.getBoundingClientRect();this.cloneOffset.x=t.clientX-e.left,this.cloneOffset.y=t.clientY-e.top}setDragCloneStyles(t){this.dragClone.style.position="fixed",this.dragClone.style.top=`${t.clientY-this.cloneOffset.y}px`,this.dragClone.style.left=`${t.clientX-this.cloneOffset.x}px`,this.dragClone.style.pointerEvents="none",this.dragClone.style.zIndex="999999"}updateDragClonePosition(t){requestAnimationFrame(()=>{if(this.touchEndTriggered||!this.dragClone)return;let e=t.clientX-this.cloneOffset.x,r=t.clientY-this.cloneOffset.y,{newLeft:i,newTop:o}=this.applyBoundaries(e,r,this.dragClone);this.dragClone.style.left=`${i}px`,this.dragClone.style.top=`${o}px`})}applyTransformBoundaries(t,e){let r;this.rootNode instanceof ShadowRoot?r=this.rootNode.host.getBoundingClientRect():this.rootNode instanceof Document?r=document.documentElement.getBoundingClientRect():r=new DOMRect(0,0,window.innerWidth,window.innerHeight);let i=this.dragSource.getBoundingClientRect(),o=i.width,n=i.height,a=i.left+t,c=i.top+e,p=Math.max(r.left,Math.min(a,r.right-o)),f=Math.max(r.top,Math.min(c,r.bottom-n)),g=p-i.left,y=f-i.top;return{boundedDeltaX:g,boundedDeltaY:y}}applyBoundaries(t,e,r){let i;this.rootNode instanceof ShadowRoot?i=this.rootNode.host.getBoundingClientRect():this.rootNode instanceof Document?i=document.documentElement.getBoundingClientRect():i=new DOMRect(0,0,window.innerWidth,window.innerHeight);let o=r.getBoundingClientRect(),n=o.width,a=o.height,c=Math.max(i.left,Math.min(t,i.right-n)),p=Math.max(i.top,Math.min(e,i.bottom-a));return{newLeft:c,newTop:p}}calculateDragDistance(t){let e=Math.abs(t.clientX-this.touchStartPoint.x),r=Math.abs(t.clientY-this.touchStartPoint.y);return e+r}dispatchCustomEvent(t,e,r=!0){if(!t)return;let i=new CustomEvent(e,{bubbles:r,cancelable:!0});i.dataTransfer=this.dataTransfer,t.dispatchEvent(i)}resetDragState(t=!1){var e;this.isDragging&&(this.useDragClone?(this.dragSource.style.opacity="1.0",(e=this.dragClone)==null||e.parentElement.removeChild(this.dragClone)):(t||(this.dragSource.style.transform="translate(0, 0)"),this.dragSource.style.zIndex="",this.dragSource.style.pointerEvents="",this.dragSource.style.transition=this.initialTransition,this.initialTransition="")),this.isDragging=!1,this.dragSource=null,this.dragClone=null,this.isDraggable=!1,this.touchStartTime=0,this.touchStartPoint=null,this.touchEndTriggered=!1,this.dataTransfer={data:{},setData(r,i){this.data[r]=i},getData(r){return this.data[r]},effectAllowed:"move"},this.cloneOffset={x:0,y:0},this.lastTarget=null,this.currentDropTarget=null,this.allowClick=!0,this.initialTransform="",this.hasDispatchedDragStart=!1,this.rootNode=null}};var Ii=(s,t,e)=>{class r extends s{constructor(){super(...arguments);this.disabled=!1}firstUpdated(n){if(this.isMatchTabular())return;super.firstUpdated(n);let a=this.getDroppableElements();this.initializeEventHandlers(),a.forEach(c=>{this.prepareDroppable(c),this.observeDroppableAttributes(c)})}isMatchTabular(){return this.classList.contains("qti-match-tabular")}getDroppableElements(){return Array.from(t?this.shadowRoot.querySelectorAll(e):this.querySelectorAll(e))}initializeEventHandlers(){this.dragoverHandler=this.dragoverHandler.bind(this),this.dragleaveHandler=this.dragleaveHandler.bind(this),this.dragenterHandler=this.dragenterHandler.bind(this),this.dropHandler=this.dropHandler.bind(this)}prepareDroppable(n){n.setAttribute("dropzone","move"),n.addEventListener("dragleave",this.dragleaveHandler),this.attachEventListeners(n)}observeDroppableAttributes(n){this.observer=new MutationObserver(a=>{a.forEach(({attributeName:c})=>{c==="disabled"&&this.toggleDroppableHandlers(n)})}),this.observer.observe(n,{attributes:!0})}toggleDroppableHandlers(n){n.hasAttribute("disabled")?this.removeEventListeners(n):this.attachEventListeners(n)}attachEventListeners(n){n.addEventListener("dragover",this.dragoverHandler),n.addEventListener("dragenter",this.dragenterHandler),n.addEventListener("drop",this.dropHandler)}removeEventListeners(n){n.removeEventListener("dragover",this.dragoverHandler),n.removeEventListener("dragenter",this.dragenterHandler),n.removeEventListener("drop",this.dropHandler)}disconnectedCallback(){var n;this.isMatchTabular()||(super.disconnectedCallback(),(n=this.observer)==null||n.disconnect())}dragenterHandler(n){n.preventDefault()}dragoverHandler(n){return n.preventDefault(),this.activateDroppable(n.currentTarget),n.dataTransfer.dropEffect="move",!1}activateDroppable(n){n.setAttribute("active","")}async dropHandler(n){n.preventDefault();let a=n.currentTarget,c=this.findDraggable(n.dataTransfer.getData("text"));return!c||!this.isValidDrop(a,c)?(c.style.transform="translate(0, 0)",!1):(await this.moveDraggableToDroppable(c,a),this.deactivateDroppable(a),!1)}findDraggable(n){return this.querySelector(`[identifier=${n}]`)||this.shadowRoot.querySelector(`[identifier=${n}]`)}isValidDrop(n,a){return a.parentElement.getAttribute("identifier")!==n.getAttribute("identifier")}async moveDraggableToDroppable(n,a){let c=()=>{n.style.transform="translate(0, 0)",a.appendChild(n),this.checkMaxAssociations()};if(!document.startViewTransition){c();return}await document.startViewTransition(c).finished}deactivateDroppable(n){n.removeAttribute("active")}dragleaveHandler(n){return n.preventDefault(),this.deactivateDroppable(n.currentTarget),n.dataTransfer.dropEffect="none",!1}}return l([d({type:Boolean,reflect:!0})],r.prototype,"disabled",2),r};var Oi=(s,t,e)=>{class r extends s{}return r};var W=(s,t,e,r)=>{class i extends Oi(Ii(s,e,r),r,t){constructor(){super(...arguments);this.draggables=new Map;this.droppables=[];this.responseIdentifier="";this.configuration={copyStylesDragClone:!0,dragCanBePlacedBack:!0,dragOnClick:!1};this.disabled=!1;this.readonly=!1;this.minAssociations=1;this.maxAssociations=1;this.handleDragStart=a=>{let c=a.currentTarget;a.dataTransfer.setData("text",c.getAttribute("identifier")),c.setAttribute("dragging",""),this.activateDroppables()};this.handleDragEnd=a=>{a.preventDefault(),this.deactivateDroppables();let c=a.currentTarget;c.removeAttribute("dragging"),this.wasDropped(a)||this.configuration.dragCanBePlacedBack&&this.restoreInitialDraggablePosition(c),this.wasMoved(a)&&this.saveResponse()}}handleDraggablesChange(a,c){if(this.isMatchTabular())return;let p=this.filterExistingDraggables(a);p.length>0&&this.addNewDraggables(p)}firstUpdated(a){super.firstUpdated(a),this.initializeDroppables()}connectedCallback(){super.connectedCallback(),this.initializeDragDropApi()}initializeDragDropApi(){this.dragDropApi=new Jt,this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,detail:this}))}isMatchTabular(){return this.classList.contains("qti-match-tabular")}filterExistingDraggables(a){return a.filter(c=>!this.draggables.has(c))}addNewDraggables(a){this.dragDropApi.addDraggableElements(a),a.forEach(c=>this.storeDraggable(c))}storeDraggable(a){let c=Array.from(a.parentNode.children).indexOf(a);this.draggables.set(a,{parent:a.parentElement,index:c}),a.style.viewTransitionName=`drag-${c}-${this.getAttribute("identifier")}`,a.setAttribute("qti-draggable","true"),a.addEventListener("dragstart",this.handleDragStart),a.addEventListener("dragend",this.handleDragEnd)}initializeDroppables(){this.droppables=Array.from(e?this.shadowRoot.querySelectorAll(r):this.querySelectorAll(r))}activateDroppables(){this.droppables.forEach(a=>a.setAttribute("enabled",""))}deactivateDroppables(){this.droppables.forEach(a=>a.removeAttribute("enabled"))}wasDropped(a){return a.dataTransfer.dropEffect!=="none"}wasMoved(a){return a.dataTransfer.dropEffect==="move"}async restoreInitialDraggablePosition(a){let{parent:c,index:p}=this.draggables.get(a),f=Math.min(p,c.children.length),g=(v,w,k)=>{let A=Math.min(k,w.children.length);w.insertBefore(v,w.children[A]),v.style.transform="translate(0, 0)",this.checkMaxAssociations(),this.saveResponse()};if(!document.startViewTransition){g(a,c,p);return}let y=document.startViewTransition(()=>{a.style.transform="",g(a,c,p)})}checkMaxAssociations(){this.droppables.forEach((a,c)=>{let p=+(a.getAttribute("match-max")||1);a.querySelectorAll('[qti-draggable="true"]').length>=p?this.disableDroppable(a):this.enableDroppable(a)})}disableDroppable(a){a.setAttribute("disabled",""),a.removeAttribute("dropzone")}enableDroppable(a){a.removeAttribute("disabled"),a.setAttribute("dropzone","move")}set response(a){this.isMatchTabular()||(this.resetDroppables(),a==null||a.forEach(c=>this.placeResponse(c)))}placeResponse(a){let[c,...p]=a.split(" ").reverse(),f=this.findDroppableById(c);p.forEach(g=>this.placeDraggableInDroppable(g,f))}findDroppableById(a){return this.droppables.find(c=>c.getAttribute("identifier")===a)}async placeDraggableInDroppable(a,c){let p=this.querySelector(`[identifier=${a}]`);if(!c||!p){console.error(`Cannot find draggable or droppable with the given identifier: ${a}`);return}let f=()=>{p.style.transform="translate(0, 0)",c.appendChild(p),this.checkMaxAssociations()};document.startViewTransition?await document.startViewTransition(f).finished:f()}validate(){let a=this.getValidAssociations();return this.minAssociations<=0||this.minAssociations<=a}getValidAssociations(){return this.droppables.filter(a=>a.childElementCount>0).length}saveResponse(){let a=this.collectResponseData();this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:a}}))}collectResponseData(){return this.droppables.map(a=>{let c=a.querySelectorAll('[qti-draggable="true"]'),p=Array.from(c).map(g=>g.getAttribute("identifier")),f=a.getAttribute("identifier");return[...p,f].join(" ")})}reset(a=!0){this.resetDroppables(),a&&this.saveResponse()}async resetDroppables(){let a=(p,f,g)=>{p.style.transform="translate(0, 0)";let y=Math.min(g,f.children.length);f.insertBefore(p,f.children[y])};if(!document.startViewTransition){this.draggables.forEach(({parent:p,index:f},g)=>{a(g,p,f)});return}await document.startViewTransition(()=>{this.draggables.forEach(({parent:p,index:f},g)=>{a(g,p,f)})}).finished}}return l([d({type:String,attribute:"response-identifier"})],i.prototype,"responseIdentifier",2),l([d({attribute:!1,type:Object})],i.prototype,"configuration",2),l([d({type:Boolean,reflect:!0})],i.prototype,"disabled",2),l([d({type:Boolean,reflect:!0})],i.prototype,"readonly",2),l([d({type:Number,reflect:!0,attribute:"min-associations"})],i.prototype,"minAssociations",2),l([d({type:Number,reflect:!0,attribute:"max-associations"})],i.prototype,"maxAssociations",2),l([$i(t)],i.prototype,"handleDraggablesChange",1),i};var Ui=b`
|
|
251
|
+
:host {
|
|
252
|
+
display: block; /* necessary to calculate scaling position */
|
|
253
|
+
}
|
|
254
|
+
slot[name='qti-simple-associable-choice'] {
|
|
255
|
+
display: flex;
|
|
256
|
+
flex-wrap: wrap;
|
|
257
|
+
gap: 0.5rem;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
:host::part(associables-container) {
|
|
261
|
+
display: flex;
|
|
262
|
+
justify-content: space-between;
|
|
263
|
+
background: linear-gradient(
|
|
264
|
+
180deg,
|
|
265
|
+
rgb(0 0 0 / 0%) calc(50% - 1px),
|
|
266
|
+
var(--qti-border-color-gray) calc(50%),
|
|
267
|
+
rgb(0 0 0 / 0%) calc(50% + 1px)
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
`;var Le=class extends W(u,"qti-simple-associable-choice",!0,".dl"){constructor(){super();this._childrenMap=[];this.addEventListener("register-qti-simple-associable-choice",e=>{let r=e.target;this._childrenMap.push(r)})}render(){return h` <slot name="prompt"></slot>
|
|
199
271
|
<slot name="qti-simple-associable-choice"></slot>
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
slot[name='qti-simple-associable-choice'] {
|
|
208
|
-
display: flex;
|
|
209
|
-
flex-wrap: wrap;
|
|
210
|
-
gap: 0.5rem;
|
|
211
|
-
}
|
|
212
|
-
`,l([E()],Re.prototype,"_childrenMap",2),Re=l([m("qti-associate-interaction")],Re);var z=class extends A{constructor(){super();this._errorMessage=null;this.handlePostMessage=this.handlePostMessage.bind(this)}connectedCallback(){super.connectedCallback();let e=this.data.startsWith("http")?this.data:je(this.baseItemUrl+"/"+this.data);fetch(e).then(r=>r.json()).then(r=>{this.manifest=r,this.setupCES()}).catch(r=>{this._errorMessage=r})}setupCES(){let e=this.shadowRoot.querySelector("#pciContainer"),r=e.contentWindow||e,s=e.contentDocument;window.addEventListener("message",this.handlePostMessage),s.open(),s.write(`
|
|
272
|
+
<div part="drop-container">
|
|
273
|
+
${this._childrenMap.length>0&&Array.from(Array(Math.ceil(this._childrenMap.length/2)).keys()).map((e,r)=>h`<div part="associables-container">
|
|
274
|
+
<div name="left${r}" part="drop-list" class="dl" identifier="droplist${r}_left"></div>
|
|
275
|
+
<div name="right${r}" part="drop-list" class="dl" identifier="droplist${r}_right"></div>
|
|
276
|
+
</div>`)}
|
|
277
|
+
</div>`}};Le.styles=Ui,l([q()],Le.prototype,"_childrenMap",2),Le=l([m("qti-associate-interaction")],Le);var K=class extends T{constructor(){super();this._errorMessage=null;this.handlePostMessage=this.handlePostMessage.bind(this)}connectedCallback(){super.connectedCallback();let e=this.data.startsWith("http")?this.data:Ge(this.baseItemUrl+"/"+this.data);fetch(e).then(r=>r.json()).then(r=>{this.manifest=r,this.setupCES()}).catch(r=>{this._errorMessage=r})}setupCES(){let e=this.shadowRoot.querySelector("#pciContainer"),r=e.contentWindow||e,i=e.contentDocument;window.addEventListener("message",this.handlePostMessage),i.open(),i.write(`
|
|
213
278
|
<html>
|
|
214
279
|
<head>
|
|
215
|
-
<link href='${
|
|
216
|
-
<script src='${
|
|
280
|
+
<link href='${Ge(`${this.baseRefUrl}/${this.manifest.style[0]}`)}' rel="stylesheet" />
|
|
281
|
+
<script src='${Ge(`${this.baseRefUrl}/${this.manifest.script[0]}`)}'></script>
|
|
217
282
|
</head>
|
|
218
283
|
<body></body>
|
|
219
284
|
</html>
|
|
220
|
-
`),
|
|
285
|
+
`),i.close()}getIFrames(){let e=this.shadowRoot.querySelectorAll("iframe"),r=this.querySelectorAll("iframe"),i=[...e,...r];for(let o of i){let n=o.src;if(new URL(n,window.location.href).origin===window.location.origin)try{let c=o.contentDocument||o.contentWindow.document;c&&this.getInnerIFrames(c,i)}catch(c){console.error("Error accessing nested iframe:",c)}}return i.forEach((o,n)=>{i.indexOf(o)!==n&&i.splice(n,1)}),i}getInnerIFrames(e,r=[]){return e.querySelectorAll("iframe").forEach(o=>{r.push(o);let n=o.src;if(new URL(n,window.location.href).origin===window.location.origin)try{let c=o.contentDocument||o.contentWindow.document;this.getInnerIFrames(c,r)}catch(c){console.error("Error accessing nested iframe:",c)}else console.warn("Skipped cross-origin iframe:",n)}),r}postToWindowAndIframes(e,r){window.postMessage({type:e,data:r},"*");let i=this.getIFrames();for(let o of i)o.contentWindow&&o.contentWindow.postMessage({type:e,data:r},"*")}handlePostMessage(e){let{type:r,data:i}=e.data;switch(r){case"setResponse":this.rawResponse=i,this.saveResponse(i);break;case"getResponse":{this.postToWindowAndIframes("responseData",this.rawResponse);break}case"getMedia":{let o=this.manifest.media.map(n=>n.startsWith("http")?n:Ge(this.baseRefUrl+"/"+n));this.postToWindowAndIframes("mediaData",o);break}case"setStageHeight":console.log("setStageHeight not implemented");break}}validate(){return this.rawResponse!==""}set response(e){this.rawResponse=e}disconnectedCallback(){window.removeEventListener("message",this.handlePostMessage),super.disconnectedCallback()}render(){return h`<iframe
|
|
221
286
|
width=${this.getAttribute("width")}
|
|
222
287
|
height=${this.getAttribute("height")}
|
|
223
288
|
frameborder="0"
|
|
@@ -225,14 +290,14 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
|
|
|
225
290
|
id="pciContainer"
|
|
226
291
|
>
|
|
227
292
|
</iframe>
|
|
228
|
-
${this._errorMessage&&
|
|
293
|
+
${this._errorMessage&&h`<div style="color:red">
|
|
229
294
|
<h1>Error</h1>
|
|
230
295
|
${this._errorMessage}
|
|
231
|
-
</div>`}`}};l([d({type:String,attribute:"response-identifier"})],
|
|
232
|
-
<slot part="drops"></slot>`}set correctResponse(t){let e=[],r=Array.isArray(t)?t:[t];r&&(e=r.map(o=>{let n=o.split(" ");return{text:n[0],gap:n[1]}})),this.querySelectorAll("qti-gap").forEach((o,n)=>{var h,g,y,v;let a=o.getAttribute("identifier"),c=(h=e.find(q=>q.gap===a))==null?void 0:h.text,p=(g=this.querySelector(`qti-gap-text[identifier="${c}"]`))==null?void 0:g.textContent.trim();if(c&&p){if(!((y=o.nextElementSibling)!=null&&y.classList.contains("correct-option"))){let q=document.createElement("span");q.classList.add("correct-option"),q.textContent=p,o.insertAdjacentElement("afterend",q)}}else(v=o.nextElementSibling)!=null&&v.classList.contains("correct-option")&&o.nextElementSibling.remove()})}};tt.styles=[b`
|
|
296
|
+
</div>`}`}};l([d({type:String,attribute:"response-identifier"})],K.prototype,"responseIdentifier",2),l([d({type:String,attribute:"data"})],K.prototype,"data",2),l([d({type:String,attribute:"data-base-item"})],K.prototype,"baseItemUrl",2),l([d({type:String,attribute:"data-base-ref"})],K.prototype,"baseRefUrl",2),l([d({type:String,attribute:"id"})],K.prototype,"id",2),l([q()],K.prototype,"_errorMessage",2),K=l([m("qti-custom-interaction")],K);var $e=class extends T{constructor(){super(...arguments);this.countAttempt="true"}validate(){return!0}set response(e){}render(){return h`<button ?disabled=${this.disabled} part="button" @click=${this.endAttempt}>${this.title}</button>`}endAttempt(e){this.dispatchEvent(new CustomEvent("end-attempt",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,countAttempt:this.countAttempt==="true"}}))}};l([d({type:String,attribute:"count-attempt"})],$e.prototype,"countAttempt",2),l([d({type:String})],$e.prototype,"title",2),$e=l([m("qti-end-attempt-interaction")],$e);var lt=class extends W(u,"qti-gap-text",!1,"qti-gap"){render(){return h`<slot name="prompt"> </slot><slot part="drags" name="qti-gap-text"></slot> <slot part="drops"></slot>`}set correctResponse(t){let e=[],r=Array.isArray(t)?t:[t];r&&(e=r.map(o=>{let n=o.split(" ");return{text:n[0],gap:n[1]}})),this.querySelectorAll("qti-gap").forEach((o,n)=>{var f,g,y,v;let a=o.getAttribute("identifier"),c=(f=e.find(w=>w.gap===a))==null?void 0:f.text,p=(g=this.querySelector(`qti-gap-text[identifier="${c}"]`))==null?void 0:g.textContent.trim();if(c&&p){if(!((y=o.nextElementSibling)!=null&&y.classList.contains("correct-option"))){let w=document.createElement("span");w.classList.add("correct-option"),w.textContent=p,o.insertAdjacentElement("afterend",w)}}else(v=o.nextElementSibling)!=null&&v.classList.contains("correct-option")&&o.nextElementSibling.remove()})}};lt.styles=[b`
|
|
233
297
|
:host {
|
|
234
298
|
display: flex;
|
|
235
299
|
align-items: flex-start;
|
|
300
|
+
flex-direction: column;
|
|
236
301
|
gap: 0.5rem;
|
|
237
302
|
}
|
|
238
303
|
|
|
@@ -248,21 +313,21 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
|
|
|
248
313
|
:host(.qti-choices-right) {
|
|
249
314
|
flex-direction: row-reverse;
|
|
250
315
|
}
|
|
251
|
-
[part='
|
|
252
|
-
[part='
|
|
316
|
+
/* [part='drops'] , */
|
|
317
|
+
[part='drags'] {
|
|
253
318
|
display: flex;
|
|
254
319
|
align-items: flex-start;
|
|
255
320
|
flex: 1;
|
|
256
321
|
gap: 0.5rem;
|
|
257
322
|
}
|
|
258
|
-
`],
|
|
323
|
+
`],lt=l([m("qti-gap-match-interaction")],lt);var zi=(s,t,e)=>{let r=new Map;for(let i=t;i<=e;i++)r.set(s[i],i);return r},Gt=te(class extends j{constructor(s){if(super(s),s.type!==ae.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,t,e){let r;e===void 0?e=t:t!==void 0&&(r=t);let i=[],o=[],n=0;for(let a of s)i[n]=r?r(a,n):n,o[n]=e(a,n),n++;return{values:o,keys:i}}render(s,t,e){return this.dt(s,t,e).values}update(s,[t,e,r]){var k;let i=Ri(s),{values:o,keys:n}=this.dt(t,e,r);if(!Array.isArray(i))return this.ut=n,o;let a=(k=this.ut)!=null?k:this.ut=[],c=[],p,f,g=0,y=i.length-1,v=0,w=o.length-1;for(;g<=y&&v<=w;)if(i[g]===null)g++;else if(i[y]===null)y--;else if(a[g]===n[v])c[v]=ne(i[g],o[v]),g++,v++;else if(a[y]===n[w])c[w]=ne(i[y],o[w]),y--,w--;else if(a[g]===n[w])c[w]=ne(i[g],o[w]),Se(s,c[w+1],i[g]),g++,w--;else if(a[y]===n[v])c[v]=ne(i[y],o[v]),Se(s,i[g],i[y]),y--,v++;else if(p===void 0&&(p=zi(n,v,w),f=zi(a,g,y)),p.has(a[g]))if(p.has(a[y])){let A=f.get(n[v]),we=A!==void 0?i[A]:null;if(we===null){let xt=Se(s,i[g]);ne(xt,o[v]),c[v]=xt}else c[v]=ne(we,o[v]),Se(s,i[g],we),i[A]=null;v++}else Vt(i[y]),y--;else Vt(i[g]),g++;for(;v<=w;){let A=Se(s,c[w+1]);ne(A,o[v]),c[v++]=A}for(;g<=y;){let A=i[g++];A!==null&&Vt(A)}return this.ut=n,Si(s,c),L}});function De(s,t,e,r){switch(s){case"circle":{let[i,o,n]=t,a=i/e.width*100,c=o/e.height*100,p=n/e.width*100;r.style.left=a-p+"%",r.style.top=c-p+"%",r.style.width=r.style.height=4*p+"px",r.style.borderRadius="9999px"}break;case"rect":{let[i,o,n,a]=t,c=i/e.width*100,p=o/e.height*100,f=n/e.width*100,g=a/e.height*100;r.style.left=c+"%",r.style.top=p+"%",r.style.width=f-c+"%",r.style.height=g-p+"%"}break;case"poly":{let i=t.reduce((k,A,we,xt)=>{if(we%2===1){let Wi=k.pop();k[k.length]={x:Wi,y:xt[we]}}else k.push(A);return k},[]),o=Math.min(...i.map(k=>k.x)),n=Math.max(...i.map(k=>k.x)),a=Math.min(...i.map(k=>k.y)),c=Math.max(...i.map(k=>k.y)),p=o/e.width*100,f=a/e.height*100,g=n/e.width*100,y=c/e.height*100;r.style.left=o/e.width*100+"%",r.style.top=a/e.height*100+"%",r.style.width=g-p+"%",r.style.height=y-f+"%";let w=i.map(k=>({x:(k.x-o)/(n-o)*100,y:(k.y-a)/(c-a)*100})).map(k=>Math.round(k.x)+"% "+Math.round(k.y)+"%").join(",");r.style.clipPath=`polygon(${w})`}break;default:break}}var Z=class extends T{constructor(){super();this.startPoint=null;this.endPoint=null;this._lines=[];this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}reset(){this._lines=[]}validate(){return this._lines.length>0}set response(e){Array.isArray(e)&&(this._lines=e)}render(){var e,r,i,o;return h`<slot name="prompt"></slot>
|
|
259
324
|
<line-container>
|
|
260
325
|
<svg
|
|
261
|
-
width=${
|
|
262
|
-
height=${
|
|
263
|
-
viewbox="0 0 ${(
|
|
326
|
+
width=${B((e=this.grImage[0])==null?void 0:e.width)}
|
|
327
|
+
height=${B((r=this.grImage[0])==null?void 0:r.height)}
|
|
328
|
+
viewbox="0 0 ${(i=this.grImage[0])==null?void 0:i.width} ${(o=this.grImage[0])==null?void 0:o.height}"
|
|
264
329
|
>
|
|
265
|
-
${
|
|
330
|
+
${Gt(this._lines,n=>n,(n,a)=>pr`
|
|
266
331
|
<line
|
|
267
332
|
part="line"
|
|
268
333
|
x1=${parseInt(this.querySelector("[identifier="+n.split(" ")[0]+"]").style.left)}
|
|
@@ -271,10 +336,10 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
|
|
|
271
336
|
y2=${parseInt(this.querySelector("[identifier="+n.split(" ")[1]+"]").style.top)}
|
|
272
337
|
stroke="red"
|
|
273
338
|
stroke-width="3"
|
|
274
|
-
@click=${c=>{c.stopPropagation(),this._lines=this._lines.filter((p,
|
|
339
|
+
@click=${c=>{c.stopPropagation(),this._lines=this._lines.filter((p,f)=>f!==a),this.saveResponse(this._lines)}}
|
|
275
340
|
/>
|
|
276
341
|
`)}
|
|
277
|
-
${this.startPoint&&
|
|
342
|
+
${this.startPoint&&pr`<line
|
|
278
343
|
part="point"
|
|
279
344
|
x1=${this.startCoord.x}
|
|
280
345
|
y1=${this.startCoord.y}
|
|
@@ -285,7 +350,7 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
|
|
|
285
350
|
/>`}
|
|
286
351
|
</svg>
|
|
287
352
|
<slot></slot>
|
|
288
|
-
</line-container>`}positionHotspotOnRegister(e){let r=this.querySelector("img"),
|
|
353
|
+
</line-container>`}positionHotspotOnRegister(e){let r=this.querySelector("img"),i=e.target,o=i.getAttribute("coords"),n=i.getAttribute("shape"),a=o.split(",").map(c=>parseInt(c));De(n,a,r,i)}firstUpdated(e){super.firstUpdated(e),this.hotspots=this.querySelectorAll("qti-associable-hotspot"),document.addEventListener("mousemove",r=>{this.mouseCoord={x:r.clientX-this.grImage[0].getBoundingClientRect().left,y:r.clientY-this.grImage[0].getBoundingClientRect().top}}),this.hotspots.forEach(r=>{r.style.left=r.getAttribute("coords").split(",")[0]+"px",r.style.top=r.getAttribute("coords").split(",")[1]+"px",r.addEventListener("click",i=>{this.startPoint?this.endPoint||(this.endPoint=i.target,this._lines=[...this._lines,this.startPoint.getAttribute("identifier")+" "+this.endPoint.getAttribute("identifier")],this.saveResponse(this._lines),this.startPoint=null,this.endPoint=null):(this.startPoint=i.target,this.startCoord={x:this.startPoint.getAttribute("coords").split(",")[0],y:this.startPoint.getAttribute("coords").split(",")[1]})})})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}};Z.styles=[b`
|
|
289
354
|
slot:not([name='prompt']) {
|
|
290
355
|
// position: relative; /* qti-hotspot-choice relative to the slot */
|
|
291
356
|
display: block;
|
|
@@ -308,8 +373,9 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
|
|
|
308
373
|
top: 0px;
|
|
309
374
|
left: 0px;
|
|
310
375
|
}
|
|
311
|
-
`],l([
|
|
312
|
-
<slot
|
|
376
|
+
`],l([q()],Z.prototype,"_lines",2),l([q()],Z.prototype,"startCoord",2),l([q()],Z.prototype,"mouseCoord",2),l([Ke("svg")],Z.prototype,"svgContainer",2),l([Ei({selector:"img"})],Z.prototype,"grImage",2),Z=l([m("qti-graphic-associate-interaction")],Z);var ct=class extends W(u,"qti-gap-img",!1,"qti-associable-hotspot"){render(){return h` <slot name="prompt"></slot>
|
|
377
|
+
<slot></slot>
|
|
378
|
+
<slot name="qti-gap-img"></slot>`}positionHotspotOnRegister(t){let e=this.querySelector("img"),r=t.target,i=r.getAttribute("coords"),o=r.getAttribute("shape"),n=i.split(",").map(a=>parseInt(a));switch(o){case"circle":{let[a,c,p]=n;r.style.left=a-p+"px",r.style.top=c-p+"px",r.style.width=r.style.height=2*p+"px"}break;case"rect":{let[a,c,p,f]=n;r.style.left=a+"px",r.style.top=c+"px",r.style.width=p-a+"px",r.style.height=f-c+"px"}break;default:break}}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}};ct.styles=b`
|
|
313
379
|
:host {
|
|
314
380
|
display: inline-block;
|
|
315
381
|
position: relative;
|
|
@@ -318,12 +384,12 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
|
|
|
318
384
|
display: flex;
|
|
319
385
|
gap: 1rem;
|
|
320
386
|
}
|
|
321
|
-
`,
|
|
387
|
+
`,ct=l([m("qti-graphic-gap-match-interaction")],ct);var dt=class extends le(u,"qti-hotspot-choice"){render(){return h`
|
|
322
388
|
<slot name="prompt"></slot>
|
|
323
389
|
<!-- slot for the prompt -->
|
|
324
390
|
<slot></slot>
|
|
325
391
|
<!-- slot for the image and hotspots -->
|
|
326
|
-
`}setHotspotOrder(t){let{identifier:e}=t.detail,r=this._choiceElements.find(o=>o.getAttribute("identifier")===e),
|
|
392
|
+
`}setHotspotOrder(t){let{identifier:e}=t.detail,r=this._choiceElements.find(o=>o.getAttribute("identifier")===e),i=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,r.order==null){if(this._choiceElements.filter(o=>o.order>0).length>=i){this.choiceOrdering=!1;return}r.order=this._choiceElements.filter(o=>!!o.order).length+1,this.choiceOrdering=!1;return}else this._choiceElements.forEach(o=>(o.order>o.order&&o.order--,o)),r.order=null;this.choiceOrdering=!1}}positionHotspotOnRegister(t){let e=this.querySelector("img"),r=t.target,i=r.getAttribute("coords"),o=r.getAttribute("shape"),n=i.split(",").map(a=>parseInt(a));De(o,n,e,r)}connectedCallback(){super.connectedCallback(),this.addEventListener("activate-qti-hotspot-choice",this.setHotspotOrder),this.addEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("activate-qti-hotspot-choice",this.setHotspotOrder),this.removeEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}};dt.styles=[b`
|
|
327
393
|
slot:not([name='prompt']) {
|
|
328
394
|
position: relative; /* qti-hotspot-choice relative to the slot */
|
|
329
395
|
display: block;
|
|
@@ -334,12 +400,12 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
|
|
|
334
400
|
pointer-events: none;
|
|
335
401
|
user-select: none;
|
|
336
402
|
}
|
|
337
|
-
`],
|
|
403
|
+
`],dt=l([m("qti-graphic-order-interaction")],dt);var pt=class extends le(u,"qti-hotspot-choice"){render(){return h`
|
|
338
404
|
<slot name="prompt"></slot>
|
|
339
405
|
<!-- slot for the prompt -->
|
|
340
406
|
<slot></slot>
|
|
341
407
|
<!-- slot for the image and hotspots -->
|
|
342
|
-
`}positionHotspotOnRegister(t){let e=this.querySelector("img"),r=t.target,
|
|
408
|
+
`}positionHotspotOnRegister(t){let e=this.querySelector("img"),r=t.target,i=r.getAttribute("coords"),o=r.getAttribute("shape"),n=i.split(",").map(a=>parseInt(a));De(o,n,e,r)}connectedCallback(){super.connectedCallback(),this.addEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}};pt.styles=[b`
|
|
343
409
|
slot:not([name='prompt']) {
|
|
344
410
|
position: relative; /* qti-hotspot-choice relative to the slot */
|
|
345
411
|
display: block;
|
|
@@ -351,20 +417,59 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
|
|
|
351
417
|
user-select: none;
|
|
352
418
|
/* width:100%; */
|
|
353
419
|
}
|
|
354
|
-
`],
|
|
355
|
-
<slot></slot>
|
|
356
|
-
<slot name="qti-simple-associable-choice"></slot>
|
|
357
|
-
`}};
|
|
420
|
+
`],pt=l([m("qti-hotspot-interaction")],pt);var he=class extends U(u,"qti-simple-associable-choice"){constructor(){super(...arguments);this.matchMin=0;this.matchMax=1;this.fixed=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-simple-associable-choice"),this.setAttribute("part","qti-simple-associable-choice")}render(){return h`
|
|
421
|
+
<slot part="slot"></slot>
|
|
422
|
+
<slot part="dropslot" name="qti-simple-associable-choice"></slot>
|
|
423
|
+
`}};he.styles=b`
|
|
424
|
+
:host {
|
|
425
|
+
display: flex;
|
|
426
|
+
user-select: none;
|
|
427
|
+
}
|
|
428
|
+
slot {
|
|
429
|
+
width: 100%;
|
|
430
|
+
display: block;
|
|
431
|
+
}
|
|
432
|
+
slot[name='qti-simple-associable-choice'] {
|
|
433
|
+
width: 100%;
|
|
434
|
+
}
|
|
435
|
+
`,l([d({type:Number,attribute:"match-min"})],he.prototype,"matchMin",2),l([d({type:Number,attribute:"match-max"})],he.prototype,"matchMax",2),l([d({type:Boolean,attribute:"fixed"})],he.prototype,"fixed",2),he=l([m("qti-simple-associable-choice")],he);var Fi=b`
|
|
436
|
+
slot {
|
|
437
|
+
/* slot where the */
|
|
438
|
+
display: flex;
|
|
439
|
+
flex-direction: column;
|
|
440
|
+
gap: 0.5rem;
|
|
441
|
+
align-items: flex-start; /* prevents the drag and drop container slots having the same height */
|
|
442
|
+
}
|
|
443
|
+
:host(.qti-choices-top) slot {
|
|
444
|
+
flex-direction: column;
|
|
445
|
+
}
|
|
446
|
+
:host(.qti-choices-bottom) slot {
|
|
447
|
+
flex-direction: column-reverse;
|
|
448
|
+
}
|
|
449
|
+
:host(.qti-choices-left) slot {
|
|
450
|
+
flex-direction: row;
|
|
451
|
+
}
|
|
452
|
+
:host(.qti-choices-right) slot {
|
|
453
|
+
flex-direction: row-reverse;
|
|
454
|
+
}
|
|
455
|
+
slot[name='prompt'] {
|
|
456
|
+
display: block;
|
|
457
|
+
}
|
|
458
|
+
::slotted(qti-simple-match-set) {
|
|
459
|
+
/* Make sure the drag and drop container slots have the same width */
|
|
460
|
+
flex: 1;
|
|
461
|
+
}
|
|
462
|
+
`;var me=class extends W(u,"qti-simple-match-set:first-of-type qti-simple-associable-choice",!1,"qti-simple-match-set:last-of-type qti-simple-associable-choice"){constructor(){super(...arguments);this.lastCheckedRadio=null;this._response=[];this.correctOptions=[];this.responseIdentifier="";this.handleRadioClick=e=>{let r=e.target;this.lastCheckedRadio===r?(r.checked=!1,this.lastCheckedRadio=null,this.handleRadioChange(e)):this.lastCheckedRadio=r};this.handleRadioChange=e=>{let r=e.target,i=r.value,o=r.name,n=r.type;r.checked?(this.response?this.response.indexOf(i)===-1&&(n==="radio"&&(this.response=this.response.filter(a=>a.indexOf(o)===-1)),this.response=[...this.response,i]):this.response=[i],this.lastCheckedRadio=r):(this.response=this.response.filter(a=>a!==i),this.lastCheckedRadio=null),this.requestUpdate(),this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:Array.isArray(this.response)?[...this.response]:this.response}}))}}get response(){return this.classList.contains("qti-match-tabular")?this._response:super.response}set response(e){this.classList.contains("qti-match-tabular")?this._response=e:super.response=e}async connectedCallback(){super.connectedCallback(),this.rows=Array.from(this.querySelectorAll("qti-simple-match-set:first-of-type qti-simple-associable-choice")),this.cols=Array.from(this.querySelectorAll("qti-simple-match-set:last-of-type qti-simple-associable-choice")),this.response=[]}set correctResponse(e){if(e===""){this.correctOptions=[];return}else Array.isArray(e)&&(this.correctOptions=e)}render(){return this.classList.contains("qti-match-tabular")?h`
|
|
358
463
|
<slot name="prompt"></slot>
|
|
359
464
|
<table>
|
|
360
465
|
<tr>
|
|
361
466
|
<td></td>
|
|
362
|
-
${this.cols.map((e,r)=>
|
|
467
|
+
${this.cols.map((e,r)=>h`<th part="r-header">${ce(e.innerHTML)}</th>`)}
|
|
363
468
|
</tr>
|
|
364
469
|
|
|
365
|
-
${this.rows.map((e,r)=>
|
|
366
|
-
<td part="c-header">${
|
|
367
|
-
${this.cols.map((
|
|
470
|
+
${this.rows.map((e,r)=>h`<tr>
|
|
471
|
+
<td part="c-header">${ce(e.innerHTML)}</td>
|
|
472
|
+
${this.cols.map((i,o)=>{let n=e.getAttribute("identifier"),a=i.getAttribute("identifier"),c=`${n} ${a}`,p=this.response.filter(v=>v.split(" ")[0]===n).length||0,f=this.response.includes(c),g=`rb ${f?"rb-checked":""} ${this.correctOptions.includes(c)?"rb-correct":""}`,y=this.correctOptions.length>0?!0:e.matchMax===1?!1:p>=e.matchMax&&!f;return h`<td>
|
|
368
473
|
<input
|
|
369
474
|
type=${e.matchMax===1?"radio":"checkbox"}
|
|
370
475
|
part=${g}
|
|
@@ -377,33 +482,14 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
|
|
|
377
482
|
</td>`})}
|
|
378
483
|
</tr>`)}
|
|
379
484
|
</table>
|
|
380
|
-
`:
|
|
381
|
-
|
|
382
|
-
display: flex;
|
|
383
|
-
flex-direction: column;
|
|
384
|
-
gap: 0.5rem;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
/* :host(.qti-choices-top) {
|
|
388
|
-
flex-direction: column;
|
|
389
|
-
} */
|
|
390
|
-
:host(.qti-choices-bottom) {
|
|
391
|
-
flex-direction: column-reverse;
|
|
392
|
-
}
|
|
393
|
-
:host(.qti-choices-left) {
|
|
394
|
-
flex-direction: row;
|
|
395
|
-
}
|
|
396
|
-
:host(.qti-choices-right) {
|
|
397
|
-
flex-direction: row-reverse;
|
|
398
|
-
}
|
|
399
|
-
`],l([E()],pe.prototype,"response",2),l([E()],pe.prototype,"correctOptions",2),l([d({type:String,attribute:"response-identifier"})],pe.prototype,"responseIdentifier",2),pe=l([m("qti-match-interaction")],pe);var ot=class extends A{constructor(){super();this.value=0}reset(){}validate(){return!0}set response(e){}static get properties(){return T(C({},A.properties),{step:{type:Number,attribute:"step",default:10}})}render(){return u` <slot name="prompt"></slot>
|
|
400
|
-
<slot></slot>`}connectedCallback(){super.connectedCallback();let e=this.querySelector("audio")||this.querySelector("video")||this.querySelector("object");e&&e.addEventListener("ended",()=>{this.value++,this.saveResponse(this.value.toString())})}};ot.styles=[b``],ot=l([m("qti-media-interaction")],ot);var ee=class extends Lt(Y(f,"qti-simple-choice",!0,"drop-list"),"qti-simple-choice"){constructor(){super(...arguments);this.nrChoices=0;this.correctResponses=[];this.showCorrectResponses=!1}render(){let e=Array.from(this.querySelectorAll("qti-simple-choice"));return this.nrChoices<e.length&&(this.nrChoices=e.length),u` <slot name="prompt"> </slot>
|
|
485
|
+
`:h`<slot name="prompt"></slot> <slot></slot>`}};me.styles=Fi,l([q()],me.prototype,"_response",2),l([q()],me.prototype,"correctOptions",2),l([d({type:String,attribute:"response-identifier"})],me.prototype,"responseIdentifier",2),me=l([m("qti-match-interaction")],me);var ht=class extends T{constructor(){super();this.value=0}reset(){}validate(){return!0}set response(e){}static get properties(){return _(C({},T.properties),{step:{type:Number,attribute:"step",default:10}})}render(){return h` <slot name="prompt"></slot>
|
|
486
|
+
<slot></slot>`}connectedCallback(){super.connectedCallback();let e=this.querySelector("audio")||this.querySelector("video")||this.querySelector("object");e&&e.addEventListener("ended",()=>{this.value++,this.saveResponse(this.value.toString())})}};ht.styles=[b``],ht=l([m("qti-media-interaction")],ht);var re=class extends Ft(W(u,"qti-simple-choice",!0,"drop-list"),"qti-simple-choice"){constructor(){super(...arguments);this.nrChoices=0;this.correctResponses=[];this.showCorrectResponses=!1}render(){let e=Array.from(this.querySelectorAll("qti-simple-choice"));return this.nrChoices<e.length&&(this.nrChoices=e.length),h` <slot name="prompt"> </slot>
|
|
401
487
|
<div part="container">
|
|
402
488
|
<slot part="drags"> </slot>
|
|
403
489
|
<div part="drops">
|
|
404
|
-
${Array.from(Array(this.nrChoices)).map((r,
|
|
490
|
+
${Array.from(Array(this.nrChoices)).map((r,i)=>h`<drop-list part="drop-list" identifier="droplist${i}"></drop-list>${this.showCorrectResponses&&this.correctResponses.length>i?ce(`<span part='correct-response'>${this.correctResponses[i]}</span>`):""}`)}
|
|
405
491
|
</div>
|
|
406
|
-
</div>`}set correctResponse(e){if(e===""){this.showCorrectResponses=!1;return}this.correctResponses.length===0&&(Array.isArray(e)?e:[e]).forEach((
|
|
492
|
+
</div>`}set correctResponse(e){if(e===""){this.showCorrectResponses=!1;return}this.correctResponses.length===0&&(Array.isArray(e)?e:[e]).forEach((i,o)=>{let n=this.querySelector(`qti-simple-choice[identifier="${i}"]`);n||(n=this.shadowRoot.querySelector(`qti-simple-choice[identifier="${i}"]`));let a=n==null?void 0:n.textContent.trim();this.correctResponses=[...this.correctResponses,a]}),this.showCorrectResponses=!0}getResponse(){return Array.from(this.shadowRoot.querySelectorAll("drop-list")).map(i=>{let o=i.querySelectorAll('[qti-draggable="true"]');return[...Array.from(o).map(a=>a.getAttribute("identifier"))].join(" ")})}async firstUpdated(e){super.firstUpdated(e),this.childrenMap=Array.from(this.querySelectorAll("qti-simple-choice")),this.childrenMap.forEach(r=>r.setAttribute("part","qti-simple-choice"))}};re.styles=[b`
|
|
407
493
|
[part='drags'] {
|
|
408
494
|
display: flex;
|
|
409
495
|
align-items: flex-start;
|
|
@@ -451,7 +537,7 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
|
|
|
451
537
|
:host(.qti-choices-right) [part='container'] {
|
|
452
538
|
flex-direction: row-reverse;
|
|
453
539
|
}
|
|
454
|
-
`],l([
|
|
540
|
+
`],l([q()],re.prototype,"nrChoices",2),l([q()],re.prototype,"correctResponses",2),l([q()],re.prototype,"showCorrectResponses",2),l([d({type:String})],re.prototype,"orientation",2),re=l([m("qti-order-interaction")],re);var Qt=class extends u{render(){return h`<slot></slot>`}};Qt.styles=[b`
|
|
455
541
|
:host {
|
|
456
542
|
display: block;
|
|
457
543
|
}
|
|
@@ -462,23 +548,23 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
|
|
|
462
548
|
left: 50%;
|
|
463
549
|
transform: translateX(-50%);
|
|
464
550
|
}
|
|
465
|
-
`];customElements.define("qti-position-object-interaction",
|
|
551
|
+
`];customElements.define("qti-position-object-interaction",Qt);var mt=class extends u{render(){return h`<slot></slot>`}constructor(){super(),this.removeMoveListener=this.removeMoveListener.bind(this),this.dragElementHandler=this.dragElementHandler.bind(this)}dragElementHandler(t){t.preventDefault();let e=t.clientX-this.startX,r=t.clientY-this.startY;this.dragElement.style.left=this.dragElement.offsetLeft+e+"px",this.dragElement.style.top=this.dragElement.offsetTop+r+"px",this.startX=t.clientX,this.startY=t.clientY}firstUpdated(t){super.firstUpdated(t),this.dragElement=this.querySelector("qti-position-object-interaction>img"),this.startX=0,this.startY=0,this.dragElement.addEventListener("mousedown",e=>{this.startX=e.clientX,this.startY=e.clientY,document.addEventListener("mousemove",this.dragElementHandler,!0)}),document.addEventListener("mouseup",this.removeMoveListener)}removeMoveListener(t){document.removeEventListener("mousemove",this.dragElementHandler,!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("mousemove",this.dragElementHandler),document.removeEventListener("mouseup",this.removeMoveListener)}};mt.styles=[b`
|
|
466
552
|
:host {
|
|
467
553
|
display: inline-block;
|
|
468
554
|
position: relative;
|
|
469
555
|
}
|
|
470
|
-
`],
|
|
556
|
+
`],mt=l([m("qti-position-object-stage")],mt);var Bi="important",Ss=" !"+Bi,ji=te(class extends j{constructor(s){var t;if(super(s),s.type!==ae.ATTRIBUTE||s.name!=="style"||((t=s.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce((t,e)=>{let r=s[e];return r==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(s,[t]){let{style:e}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let r of this.ft)t[r]==null&&(this.ft.delete(r),r.includes("-")?e.removeProperty(r):e[r]=null);for(let r in t){let i=t[r];if(i!=null){this.ft.add(r);let o=typeof i=="string"&&i.endsWith(Ss);r.includes("-")||o?e.setProperty(r,o?i.slice(0,-11):i,o?Bi:""):e[r]=i}}return L}});var ue=class extends T{constructor(){super(...arguments);this.maxChoices=1/0;this.minChoices=0;this._points=[];this._imgElement=null;this._onImageClick=e=>{if(this._points.length<this.maxChoices){let r=e.offsetX,i=e.offsetY;this._points=[...this._points,`${r} ${i}`],this.saveResponse(this._points)}}}render(){return h` <slot name="prompt"></slot>
|
|
471
557
|
<point-container>
|
|
472
|
-
${
|
|
558
|
+
${Gt(this._points,e=>e,(e,r)=>h`
|
|
473
559
|
<button
|
|
474
560
|
part="point"
|
|
475
|
-
style=${
|
|
561
|
+
style=${ji({position:"absolute",transform:"translate(-50%, -50%)",left:`${e.split(" ")[0]}px`,top:`${e.split(" ")[1]}px`})}
|
|
476
562
|
aria-label="Remove point at ${e}"
|
|
477
|
-
@click=${
|
|
563
|
+
@click=${i=>{i.stopPropagation(),this._points=this._points.filter((o,n)=>n!==r),this.saveResponse(this._points)}}
|
|
478
564
|
></button>
|
|
479
565
|
`)}
|
|
480
566
|
<slot></slot>
|
|
481
|
-
</point-container>`}reset(){this._points=[]}validate(){return this._points.length>=this.minChoices&&this._points.length<=this.maxChoices}set response(e){this._points=Array.isArray(e)?e:[e]}
|
|
567
|
+
</point-container>`}reset(){this._points=[]}validate(){return this._points.length>=this.minChoices&&this._points.length<=this.maxChoices}set response(e){this._points=Array.isArray(e)?e:[e]}firstUpdated(){this._imgElement=this.querySelector("img"),this._imgElement?this._imgElement.addEventListener("click",this._onImageClick):console.warn("No <img> element found in <qti-select-point-interaction>")}disconnectedCallback(){super.disconnectedCallback(),this._imgElement&&this._imgElement.removeEventListener("click",this._onImageClick)}};ue.styles=[b`
|
|
482
568
|
:host {
|
|
483
569
|
display: block;
|
|
484
570
|
}
|
|
@@ -486,40 +572,3218 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
|
|
|
486
572
|
display: block;
|
|
487
573
|
position: relative;
|
|
488
574
|
}
|
|
489
|
-
`],l([d({type:Number,attribute:"max-choices"})],
|
|
575
|
+
`],l([d({type:Number,attribute:"max-choices"})],ue.prototype,"maxChoices",2),l([d({type:Number,attribute:"min-choices"})],ue.prototype,"minChoices",2),l([q()],ue.prototype,"_points",2),ue=l([m("qti-select-point-interaction")],ue);var M=class extends T{constructor(){super();this.stepLabel=!1;this.reverse=!1;this._handleDisabledChange=(e,r)=>{};this._handleReadonlyChange=(e,r)=>{};this.csLive=getComputedStyle(this)}set min(e){this._min=e,this.value=e,this.style.setProperty("--min",`${this._min}`)}get min(){return this._min}set max(e){this._max=e,this.style.setProperty("--max",`${this._max}`)}get max(){return this._max}set step(e){this._step=e,this.style.setProperty("--step",`${this._step}`)}get step(){return this._step}reset(){}validate(){return!0}set response(e){if(Array.isArray(e)){console.error("QtiSliderInteraction: response is an array, but should be a single value");return}let r=parseInt(e);if(Number.isNaN(r)){console.error("QtiSliderInteraction: response is not a number");return}this.value=r}render(){this.value<this.min&&(this.value=this.min),this.value>this.max&&(this.value=this.max);let e=(this.value-this.min)/(this.max-this.min)*100;return this.style.setProperty("--value-percentage",`${e}%`),this.setAttribute("aria-valuenow",this.value.toString()),h`<slot name="prompt"></slot>
|
|
490
576
|
<div id="slider" part="slider">
|
|
491
|
-
${this.csLive.getPropertyValue("--show-bounds")=="true"?
|
|
577
|
+
${this.csLive.getPropertyValue("--show-bounds")=="true"?h`<div id="bounds" part="bounds">
|
|
492
578
|
<div>${this._min}</div>
|
|
493
579
|
<div>${this._max}</div>
|
|
494
|
-
</div>`:
|
|
495
|
-
${this.csLive.getPropertyValue("--show-ticks")=="true"?
|
|
580
|
+
</div>`:E}
|
|
581
|
+
${this.csLive.getPropertyValue("--show-ticks")=="true"?h`<div id="ticks" part="ticks"></div>`:E}
|
|
496
582
|
<div id="rail" part="rail" @mousedown=${this._onMouseDown} @touchstart=${this._onTouchMove}>
|
|
497
583
|
<div id="knob" part="knob">
|
|
498
|
-
${this.csLive.getPropertyValue("--show-value")=="true"?
|
|
584
|
+
${this.csLive.getPropertyValue("--show-value")=="true"?h`<div id="value" part="value">${this.value}</div>`:E}
|
|
499
585
|
</div>
|
|
500
586
|
</div>
|
|
501
|
-
</div>`}connectedCallback(){super.connectedCallback(),this.step=1,this.setAttribute("tabindex","0"),this.setAttribute("role","slider")}_onTouchMove(e){let r=a=>{let{x:c}=this.getPositionFromEvent(a),p=c-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(p),a.stopPropagation()},
|
|
587
|
+
</div>`}connectedCallback(){super.connectedCallback(),this.step=1,this.setAttribute("tabindex","0"),this.setAttribute("role","slider")}_onTouchMove(e){let r=a=>{let{x:c}=this.getPositionFromEvent(a),p=c-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(p),a.stopPropagation()},i=()=>{document.removeEventListener("touchmove",r),document.removeEventListener("touchend",i),this.saveResponse(this.value.toString())};document.addEventListener("touchmove",r),document.addEventListener("touchend",i);let{x:o}=this.getPositionFromEvent(e),n=o-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(n),e.stopPropagation()}_onMouseDown(e){let r=n=>{let a=n.pageX-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(a),n.preventDefault(),n.stopPropagation()},i=()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",i),this.saveResponse(this.value.toString())};document.addEventListener("mousemove",r),document.addEventListener("mouseup",i);let o=e.pageX-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(o),e.preventDefault(),e.stopPropagation()}calculateValue(e){let r=this.min+(this.max-this.min)*e/this._rail.getBoundingClientRect().width,i=this.min+Math.round((r-this.min)/this._step)*this._step;this.value=i}getPositionFromEvent(e){let r;if(e.type=="touchstart"||e.type=="touchmove"||e.type=="touchend"||e.type=="touchcancel"){let i=typeof e.originalEvent=="undefined"?e:e.originalEvent,o=i.touches[0]||i.changedTouches[0];r={x:o.pageX,y:o.pageY}}else(e.type=="mousedown"||e.type=="mouseup"||e.type=="mousemove"||e.type=="mouseover"||e.type=="mouseout"||e.type=="mouseenter"||e.type=="mouseleave")&&(r={x:e.clientX,y:e.clientY});return r}};M.styles=[b``],l([Ke("#knob")],M.prototype,"_knob",2),l([Ke("#rail")],M.prototype,"_rail",2),l([d({type:Number})],M.prototype,"value",2),l([d({type:Boolean,attribute:"step-label"})],M.prototype,"stepLabel",2),l([d({type:Boolean})],M.prototype,"reverse",2),l([d({type:Number,attribute:"lower-bound"})],M.prototype,"min",1),l([d({type:Number,attribute:"upper-bound"})],M.prototype,"max",1),l([d({type:Number,attribute:"step"})],M.prototype,"step",1),l([S("disabled",{waitUntilFirstUpdate:!0})],M.prototype,"_handleDisabledChange",2),l([S("readonly",{waitUntilFirstUpdate:!0})],M.prototype,"_handleReadonlyChange",2),M=l([m("qti-slider-interaction")],M);var ut=class extends u{render(){return h`<slot @slotchange=${this.handleSlotChange}></slot>`}handleSlotChange(t){var r,i,o;let e=Array.from((i=(r=this.firstElementChild)==null?void 0:r.childNodes)!=null?i:[]).find(n=>n.nodeType===Node.COMMENT_NODE);try{this.operatorFunction=new Function("context","fn","item",(o=e.textContent)!=null?o:"")}catch(n){console.error("custom-operator contains invalid javascript code",n)}}calculate(){let t={variable:r=>{var i,o,n;return(n=(o=(i=this._context)==null?void 0:i.variables.find(a=>a.identifier===r))==null?void 0:o.value)!=null?n:""},correct:r=>{var i,o,n;return(n=(o=(i=this._context)==null?void 0:i.variables.find(a=>a.identifier===r))==null?void 0:o.correctResponse)!=null?n:""}},e={getVariable:r=>{var i;return(i=this._context)==null?void 0:i.variables.find(o=>o.identifier===r)},updateOutcomeVariable:(r,i)=>{this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:r,value:i}}))},updateResponseVariable:(r,i)=>{this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:r,response:i}}))}};return this.operatorFunction(this._context,t,e)}};l([J({context:O,subscribe:!0}),q()],ut.prototype,"_context",2),ut=l([m("qti-custom-operator")],ut);var gt=class extends u{connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-hotspot",{bubbles:!0,cancelable:!1,composed:!0}))}render(){return h` <slot name="qti-gap-img"></slot> `}};gt.styles=b`
|
|
502
588
|
:host {
|
|
589
|
+
display: flex;
|
|
590
|
+
user-select: none;
|
|
503
591
|
position: absolute;
|
|
504
592
|
}
|
|
505
|
-
`,
|
|
593
|
+
`,gt=l([m("qti-associable-hotspot")],gt);var He=class extends u{constructor(){super(...arguments);this.tabindex=0}render(){return h` <slot name="qti-gap-text"></slot>`}};He.styles=b`
|
|
594
|
+
:host {
|
|
595
|
+
display: flex;
|
|
596
|
+
user-select: none;
|
|
597
|
+
}
|
|
598
|
+
`,l([d({type:Number,reflect:!0})],He.prototype,"tabindex",2),He=l([m("qti-gap")],He);var Pe=class extends u{constructor(){super(...arguments);this.tabindex=0}connectedCallback(){this.setAttribute("slot","qti-gap-img")}};Pe.styles=b`
|
|
599
|
+
:host {
|
|
600
|
+
display: flex;
|
|
601
|
+
user-select: none;
|
|
602
|
+
}
|
|
603
|
+
`,l([d({type:Number,reflect:!0})],Pe.prototype,"tabindex",2),Pe=l([m("qti-gap-img")],Pe);var Ne=class extends U(u,"qti-gap-text"){constructor(){super(...arguments);this.tabindex=0}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-gap-text")}render(){return h`<slot></slot>`}};Ne.styles=b`
|
|
604
|
+
:host {
|
|
605
|
+
display: inline-flex;
|
|
606
|
+
user-select: none;
|
|
607
|
+
}
|
|
608
|
+
`,l([d({type:Number,reflect:!0})],Ne.prototype,"tabindex",2),Ne=l([m("qti-gap-text")],Ne);var Ve=class extends U(u,"qti-hotspot-choice"){};Ve.styles=b`
|
|
506
609
|
:host {
|
|
610
|
+
display: flex;
|
|
611
|
+
user-select: none;
|
|
507
612
|
position: absolute;
|
|
508
613
|
}
|
|
509
|
-
`,l([d({attribute:"aria-ordervalue",type:Number,reflect:!0})],
|
|
510
|
-
<slot></slot> `}};
|
|
614
|
+
`,l([d({attribute:"aria-ordervalue",type:Number,reflect:!0})],Ve.prototype,"order",2),Ve=l([m("qti-hotspot-choice")],Ve);var ft=class extends U(u,"qti-hottext"){render(){return h`<div part="ch"><div part="cha"></div></div>
|
|
615
|
+
<slot></slot> `}};ft.styles=b`
|
|
616
|
+
:host {
|
|
617
|
+
display: flex;
|
|
618
|
+
user-select: none;
|
|
619
|
+
}
|
|
620
|
+
`,ft=l([m("qti-hottext")],ft);var bt=class extends u{static get styles(){return[b`
|
|
621
|
+
:host {
|
|
622
|
+
display: block;
|
|
623
|
+
cursor: pointer;
|
|
624
|
+
}
|
|
625
|
+
`]}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._onSelectInlineChoice),this.dispatchEvent(new CustomEvent("qti-inline-choice-register",{bubbles:!0,cancelable:!1,composed:!0}))}disconnectedCallback(){this.removeEventListener("click",this._onSelectInlineChoice)}render(){return h` <slot></slot> `}_onSelectInlineChoice(){this.dispatchEvent(new CustomEvent("qti-inline-choice-select",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier}}))}};l([d({type:String})],bt.prototype,"identifier",2),bt=l([m("qti-inline-choice")],bt);var Ie=class extends U(u,"qti-simple-choice"){render(){return h`<div part="ch">
|
|
511
626
|
<div part="cha"></div>
|
|
512
627
|
</div>
|
|
513
|
-
${this.marker?
|
|
514
|
-
<slot part="slot"></slot> `}};
|
|
628
|
+
${this.marker?h`<div id="label">${this.marker}</div>`:E}
|
|
629
|
+
<slot part="slot"></slot> `}};Ie.styles=b`
|
|
515
630
|
:host {
|
|
516
631
|
display: flex;
|
|
632
|
+
user-select: none;
|
|
517
633
|
}
|
|
518
634
|
slot {
|
|
519
635
|
width: 100%;
|
|
520
|
-
display:
|
|
636
|
+
display: flex;
|
|
637
|
+
align-items: center;
|
|
521
638
|
}
|
|
522
|
-
|
|
639
|
+
[part='ch'] {
|
|
640
|
+
display: flex;
|
|
641
|
+
flex-shrink: 0;
|
|
642
|
+
align-items: center;
|
|
643
|
+
justify-content: center;
|
|
644
|
+
}
|
|
645
|
+
`,l([d({type:String,attribute:!1})],Ie.prototype,"marker",2),Ie=l([m("qti-simple-choice")],Ie);console.log("%cC\xBFTO%cLab%c: qti-components loaded","font-weight:bold; color:green",'font-family: "PT Sans", font-weight:bold; color:green; font-size: smaller;vertical-align: sub',"font-weight:unset");var Xi=`@layer qti-base, qti-components, qti-utilities, qti-variants, qti-extended;
|
|
646
|
+
|
|
647
|
+
:root,
|
|
648
|
+
:host {
|
|
649
|
+
/* Primary colors */
|
|
650
|
+
--qti-primary-light: #ffeaea;
|
|
651
|
+
--qti-primary: #f86d70;
|
|
652
|
+
--qti-primary-dark: #a1616a;
|
|
653
|
+
|
|
654
|
+
/* Secondary colors */
|
|
655
|
+
--qti-secondary-light: #bed4ff;
|
|
656
|
+
--qti-secondary: #6daef8;
|
|
657
|
+
--qti-secondary-dark: #3a449d;
|
|
658
|
+
|
|
659
|
+
/* Background colors */
|
|
660
|
+
--qti-bg-gray-50: #f9fafb;
|
|
661
|
+
--qti-bg-gray-100: #f3f4f6;
|
|
662
|
+
--qti-bg-white: white;
|
|
663
|
+
--qti-bg-primary: var(--qti-primary);
|
|
664
|
+
|
|
665
|
+
/* Text colors */
|
|
666
|
+
--qti-text-gray-500: #6b7280;
|
|
667
|
+
--qti-text-white: white;
|
|
668
|
+
|
|
669
|
+
/* Border properties */
|
|
670
|
+
--qti-border-thickness: 1.5px;
|
|
671
|
+
--qti-border-style: solid;
|
|
672
|
+
--qti-border-color-gray: #c6cad0; /* Corresponding to border-gray-400 */
|
|
673
|
+
--qti-border-radius-md: 0.375rem;
|
|
674
|
+
--qti-border-radius-lg: 0.5rem;
|
|
675
|
+
--qti-border-radius-full: 9999px;
|
|
676
|
+
|
|
677
|
+
/* Padding */
|
|
678
|
+
--qti-padding-sm: 0.125rem; /* py-0.5 */
|
|
679
|
+
--qti-padding-md: 0.5rem; /* py-2 */
|
|
680
|
+
--qti-padding-lg: 0.75rem; /* p-3 */
|
|
681
|
+
--qti-padding-xl: 1rem; /* pl-4 */
|
|
682
|
+
|
|
683
|
+
/* Form & layout */
|
|
684
|
+
--qti-form-size: 1rem;
|
|
685
|
+
--qti-gap-size: 0.5rem;
|
|
686
|
+
|
|
687
|
+
/* Typography */
|
|
688
|
+
--qti-font-weight-semibold: 600;
|
|
689
|
+
--qti-line-height: 2.5;
|
|
690
|
+
|
|
691
|
+
/* Focus & active states */
|
|
692
|
+
--qti-active: blue;
|
|
693
|
+
--qti-focus-color: #bddcff7e;
|
|
694
|
+
--qti-focus-border-width: 5px;
|
|
695
|
+
|
|
696
|
+
/* Correct/Incorrect feedback */
|
|
697
|
+
--qti-correct: rgb(74 222 128);
|
|
698
|
+
--qti-correct-light: rgb(220 252 231);
|
|
699
|
+
--qti-incorrect: rgb(248 113 113);
|
|
700
|
+
--qti-incorrect-light: rgb(254 226 226);
|
|
701
|
+
|
|
702
|
+
/* ---- */
|
|
703
|
+
--box-shadow: 0 0.125rem 0.25rem rgb(0 0 0 / 7.5%);
|
|
704
|
+
--box-shadow-lg: 0 0.5rem 1rem rgb(0 0 0 / 15%);
|
|
705
|
+
--table-border-color: var(--qti-border-color-gray);
|
|
706
|
+
--foreground: var(--qti-bg-gray-50);
|
|
707
|
+
--well-bg: var(--qti-bg-gray-50);
|
|
708
|
+
--well-border: var(--qti-border-color-gray);
|
|
709
|
+
--well-box-shadow: var(--box-shadow);
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
.chevron {
|
|
713
|
+
background: url("data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E")
|
|
714
|
+
no-repeat center right 6px;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
.handle {
|
|
718
|
+
background-image: radial-gradient(
|
|
719
|
+
circle at center,
|
|
720
|
+
rgb(0 0 0 / 10%) 0,
|
|
721
|
+
rgb(0 0 0 / 20%) 2px,
|
|
722
|
+
rgb(255 255 255 / 0%) 2px,
|
|
723
|
+
rgb(255 255 255 / 0%) 100%
|
|
724
|
+
);
|
|
725
|
+
background-repeat: repeat-y;
|
|
726
|
+
background-position: left center;
|
|
727
|
+
background-size: 14px 8px;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
.check-mask {
|
|
731
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
|
|
732
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
.bordered {
|
|
736
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
737
|
+
outline: none;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
.borderinvisible {
|
|
741
|
+
border-color: transparent;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
.form {
|
|
745
|
+
|
|
746
|
+
width: var(--qti-form-size);
|
|
747
|
+
height: var(--qti-form-size);
|
|
748
|
+
align-self: 1;
|
|
749
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
750
|
+
outline: none;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
.p-lg {
|
|
754
|
+
padding: var(--qti-padding-md) var(--qti-padding-lg) var(--qti-padding-md) var(--qti-padding-xl); /* Padding shorthand */
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
.button {
|
|
758
|
+
|
|
759
|
+
border-radius: var(--qti-border-radius-md);
|
|
760
|
+
padding: var(--qti-padding-md) var(--qti-padding-md);
|
|
761
|
+
font-weight: var(--qti-font-weight-semibold);
|
|
762
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
763
|
+
outline: none;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
.select {
|
|
767
|
+
|
|
768
|
+
border-radius: var(--qti-border-radius-md);
|
|
769
|
+
position: relative;
|
|
770
|
+
-webkit-appearance: none;
|
|
771
|
+
-moz-appearance: none;
|
|
772
|
+
appearance: none;
|
|
773
|
+
padding: var(--qti-padding-md) 1.75rem var(--qti-padding-md) var(--qti-padding-lg); /* Padding shorthand */ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray); outline: none; background: url("data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E")
|
|
774
|
+
no-repeat center right 6px;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
.text {
|
|
778
|
+
|
|
779
|
+
border-radius: 0;
|
|
780
|
+
cursor: text;
|
|
781
|
+
padding: var(--qti-padding-lg); /* Equal padding on all sides */
|
|
782
|
+
background: unset;
|
|
783
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
784
|
+
outline: none;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
.spot {
|
|
788
|
+
|
|
789
|
+
width: 100%;
|
|
790
|
+
height: 100%;
|
|
791
|
+
background-color: transparent;
|
|
792
|
+
padding: 0;
|
|
793
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
794
|
+
outline: none;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
/* qti-select-point-interaction */
|
|
798
|
+
|
|
799
|
+
.point {
|
|
800
|
+
|
|
801
|
+
border-radius: var(--qti-border-radius-full);
|
|
802
|
+
width: 1.5rem; /* w-6 */
|
|
803
|
+
height: 1.5rem;
|
|
804
|
+
background-color: transparent;
|
|
805
|
+
padding: 0;
|
|
806
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
807
|
+
outline: none;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
.drag {
|
|
811
|
+
|
|
812
|
+
transition:
|
|
813
|
+
transform 200ms ease-out,
|
|
814
|
+
box-shadow 200ms ease-out,
|
|
815
|
+
rotate 200ms ease-out;
|
|
816
|
+
padding: var(--qti-padding-md) var(--qti-padding-lg) var(--qti-padding-md) var(--qti-padding-xl); /* Padding shorthand */
|
|
817
|
+
border-radius: var(--qti-border-radius-md);
|
|
818
|
+
cursor: grab;
|
|
819
|
+
background-color: white;
|
|
820
|
+
font-weight: var(--qti-font-weight-semibold);
|
|
821
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
822
|
+
outline: none;
|
|
823
|
+
background-image: radial-gradient(
|
|
824
|
+
circle at center,
|
|
825
|
+
rgb(0 0 0 / 10%) 0,
|
|
826
|
+
rgb(0 0 0 / 20%) 2px,
|
|
827
|
+
rgb(255 255 255 / 0%) 2px,
|
|
828
|
+
rgb(255 255 255 / 0%) 100%
|
|
829
|
+
);
|
|
830
|
+
background-repeat: repeat-y;
|
|
831
|
+
background-position: left center;
|
|
832
|
+
background-size: 14px 8px;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
.dragging {
|
|
836
|
+
pointer-events: none;
|
|
837
|
+
rotate: -2deg;
|
|
838
|
+
box-shadow:
|
|
839
|
+
0 8px 12px rgb(0 0 0 / 20%),
|
|
840
|
+
0 4px 8px rgb(0 0 0 / 10%);
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
.drop {
|
|
844
|
+
|
|
845
|
+
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="7" stroke="%23CCCCCC" stroke-width="1" fill="transparent" /></svg>')
|
|
846
|
+
center no-repeat;
|
|
847
|
+
border-radius: var(--qti-border-radius-lg);
|
|
848
|
+
position: relative;
|
|
849
|
+
background-color: var(--qti-bg-white);
|
|
850
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
851
|
+
outline: none;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
.dropping {
|
|
855
|
+
background-color: var(--qti-primary-light);
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
.order {
|
|
859
|
+
background-color: var(--qti-bg-primary);
|
|
860
|
+
border-radius: var(--qti-border-radius-full);
|
|
861
|
+
width: 1.5rem; /* w-6 */
|
|
862
|
+
height: 1.5rem;
|
|
863
|
+
color: var(--qti-text-white);
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
.check-size {
|
|
867
|
+
width: calc(var(--qti-form-size) - 4px);
|
|
868
|
+
height: calc(var(--qti-form-size) - 4px);
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
.check {
|
|
872
|
+
/* display: flex; */
|
|
873
|
+
|
|
874
|
+
/* align-items: center; */
|
|
875
|
+
gap: 0.5rem;
|
|
876
|
+
padding: var(--qti-padding-md) var(--qti-padding-md); /* Padding shorthand */
|
|
877
|
+
outline: none;
|
|
878
|
+
border-radius: var(--qti-border-radius-md);
|
|
879
|
+
cursor: pointer;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
.check-radio {
|
|
883
|
+
|
|
884
|
+
border-radius: var(--qti-border-radius-full);
|
|
885
|
+
|
|
886
|
+
width: var(--qti-form-size);
|
|
887
|
+
|
|
888
|
+
height: var(--qti-form-size);
|
|
889
|
+
|
|
890
|
+
align-self: 1;
|
|
891
|
+
|
|
892
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
893
|
+
|
|
894
|
+
outline: none;
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
.check-radio-checked {
|
|
898
|
+
background-color: var(--qti-bg-primary);
|
|
899
|
+
border-radius: var(--qti-border-radius-full);
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
.check-checkbox {
|
|
903
|
+
|
|
904
|
+
border-radius: var(--qti-border-radius-md);
|
|
905
|
+
|
|
906
|
+
width: var(--qti-form-size);
|
|
907
|
+
|
|
908
|
+
height: var(--qti-form-size);
|
|
909
|
+
|
|
910
|
+
align-self: 1;
|
|
911
|
+
|
|
912
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
913
|
+
|
|
914
|
+
outline: none;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
.check-checkbox-checked {
|
|
918
|
+
|
|
919
|
+
background-color: var(--qti-bg-primary);
|
|
920
|
+
-webkit-mask-image: var(--check-mask);
|
|
921
|
+
mask-image: var(--check-mask); /* check-mask */ -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E"); mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
.hov {
|
|
925
|
+
/* background-color: var(--qti-bg-gray-50); */
|
|
926
|
+
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
.foc {
|
|
930
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
.act {
|
|
934
|
+
border-color: var(--qti-bg-primary); /* border-primary */
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
.rdo {
|
|
938
|
+
cursor: pointer;
|
|
939
|
+
background-color: white;
|
|
940
|
+
outline: 0;
|
|
941
|
+
border: none;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
.dis {
|
|
945
|
+
cursor: not-allowed;
|
|
946
|
+
background-color: var(--qti-bg-gray-100);
|
|
947
|
+
color: var(--qti-text-gray-500);
|
|
948
|
+
border-color: var(--qti-border-color-gray);
|
|
949
|
+
|
|
950
|
+
/* outline: 2px solid var(--qti-bg-gray-100); */
|
|
951
|
+
|
|
952
|
+
/* outline-color: var(--qti-text-gray-50); */
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
/* base */
|
|
956
|
+
|
|
957
|
+
/* ============================
|
|
958
|
+
QTI 3 shared css
|
|
959
|
+
1. Display
|
|
960
|
+
2. Special Flex styles
|
|
961
|
+
3. Margin
|
|
962
|
+
4. Padding
|
|
963
|
+
5. Horizontal Alignment styles
|
|
964
|
+
6. Vertical Alignment styles
|
|
965
|
+
7. Height
|
|
966
|
+
8. Width
|
|
967
|
+
9. Text-Indent
|
|
968
|
+
10. List Style
|
|
969
|
+
11. Layout
|
|
970
|
+
12. Other QTI 3 presentation utilities
|
|
971
|
+
============================ */
|
|
972
|
+
|
|
973
|
+
/* ==========
|
|
974
|
+
Display css
|
|
975
|
+
=========== */
|
|
976
|
+
|
|
977
|
+
.qti-display-inline {
|
|
978
|
+
display: inline;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
.qti-display-inline-block {
|
|
982
|
+
display: inline-block;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
.qti-display-block {
|
|
986
|
+
display: block;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
.qti-display-flex {
|
|
990
|
+
display: flexbox;
|
|
991
|
+
display: flex;
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
.qti-display-inline-flex {
|
|
995
|
+
display: inline-flex;
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
.qti-display-grid {
|
|
999
|
+
display: grid;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
.qti-display-inline-grid {
|
|
1003
|
+
display: inline-grid;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
.qti-display-table {
|
|
1007
|
+
display: table;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
.qti-display-table-cell {
|
|
1011
|
+
display: table-cell;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
.qti-display-table-row {
|
|
1015
|
+
display: table-row;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
.qti-display-list-item {
|
|
1019
|
+
display: list-item;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
.qti-display-inherit {
|
|
1023
|
+
display: inherit;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
/*
|
|
1027
|
+
* hidden to screen readers and sighted
|
|
1028
|
+
*/
|
|
1029
|
+
|
|
1030
|
+
.qti-hidden {
|
|
1031
|
+
display: none;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
/*
|
|
1035
|
+
* visible to screen readers, hidden to sighted
|
|
1036
|
+
*/
|
|
1037
|
+
|
|
1038
|
+
.qti-visually-hidden {
|
|
1039
|
+
position: fixed !important;
|
|
1040
|
+
overflow: hidden;
|
|
1041
|
+
clip: rect(1px 1px 1px 1px);
|
|
1042
|
+
height: 1px;
|
|
1043
|
+
width: 1px;
|
|
1044
|
+
border: 0;
|
|
1045
|
+
margin: -1px;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
/* =============================
|
|
1049
|
+
Special flex styles
|
|
1050
|
+
============================= */
|
|
1051
|
+
|
|
1052
|
+
.qti-flex-direction-column {
|
|
1053
|
+
flex-direction: column;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
.qti-flex-direction-row {
|
|
1057
|
+
flex-direction: row;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
.qti-flex-grow-1 {
|
|
1061
|
+
flex-grow: 1;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
.qti-flex-grow-0 {
|
|
1065
|
+
flex-grow: 0;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
/* =========
|
|
1069
|
+
Margin css
|
|
1070
|
+
========== */
|
|
1071
|
+
|
|
1072
|
+
/**
|
|
1073
|
+
* For margin Top and Bottom and Left and Right
|
|
1074
|
+
*/
|
|
1075
|
+
|
|
1076
|
+
.qti-margin-0 {
|
|
1077
|
+
margin: 0 !important;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
.qti-margin-1 {
|
|
1081
|
+
margin: 0.25rem !important;
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
.qti-margin-2 {
|
|
1085
|
+
margin: 0.5rem !important;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
.qti-margin-3 {
|
|
1089
|
+
margin: 1rem !important;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
.qti-margin-4 {
|
|
1093
|
+
margin: 1.5rem !important;
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
.qti-margin-5 {
|
|
1097
|
+
margin: 3rem !important;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
.qti-margin-auto {
|
|
1101
|
+
margin: auto !important;
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
/*
|
|
1105
|
+
For margin Left and Right
|
|
1106
|
+
*/
|
|
1107
|
+
|
|
1108
|
+
.qti-margin-x-0 {
|
|
1109
|
+
margin-right: 0 !important;
|
|
1110
|
+
margin-left: 0 !important;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
.qti-margin-x-1 {
|
|
1114
|
+
margin-right: 0.25rem !important;
|
|
1115
|
+
margin-left: 0.25rem !important;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
.qti-margin-x-2 {
|
|
1119
|
+
margin-right: 0.5rem !important;
|
|
1120
|
+
margin-left: 0.5rem !important;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
.qti-margin-x-3 {
|
|
1124
|
+
margin-right: 1rem !important;
|
|
1125
|
+
margin-left: 1rem !important;
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
.qti-margin-x-4 {
|
|
1129
|
+
margin-right: 1.5rem !important;
|
|
1130
|
+
margin-left: 1.5rem !important;
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
.qti-margin-x-5 {
|
|
1134
|
+
margin-right: 3rem !important;
|
|
1135
|
+
margin-left: 3rem !important;
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
.qti-margin-x-auto {
|
|
1139
|
+
margin-right: auto !important;
|
|
1140
|
+
margin-left: auto !important;
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
/*
|
|
1144
|
+
For margin Top and Bottom
|
|
1145
|
+
*/
|
|
1146
|
+
|
|
1147
|
+
.qti-margin-y-0 {
|
|
1148
|
+
margin-top: 0 !important;
|
|
1149
|
+
margin-bottom: 0 !important;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
.qti-margin-y-1 {
|
|
1153
|
+
margin-top: 0.25rem !important;
|
|
1154
|
+
margin-bottom: 0.25rem !important;
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
.qti-margin-y-2 {
|
|
1158
|
+
margin-top: 0.5rem !important;
|
|
1159
|
+
margin-bottom: 0.5rem !important;
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
.qti-margin-y-3 {
|
|
1163
|
+
margin-top: 1rem !important;
|
|
1164
|
+
margin-bottom: 1rem !important;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
.qti-margin-y-4 {
|
|
1168
|
+
margin-top: 1.5rem !important;
|
|
1169
|
+
margin-bottom: 1.5rem !important;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
.qti-margin-y-5 {
|
|
1173
|
+
margin-top: 3rem !important;
|
|
1174
|
+
margin-bottom: 3rem !important;
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
.qti-margin-y-auto {
|
|
1178
|
+
margin-top: auto !important;
|
|
1179
|
+
margin-bottom: auto !important;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
/*
|
|
1183
|
+
For margin Top
|
|
1184
|
+
*/
|
|
1185
|
+
|
|
1186
|
+
.qti-margin-t-0 {
|
|
1187
|
+
margin-top: 0 !important;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
.qti-margin-t-1 {
|
|
1191
|
+
margin-top: 0.25rem !important;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
.qti-margin-t-2 {
|
|
1195
|
+
margin-top: 0.5rem !important;
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
.qti-margin-t-3 {
|
|
1199
|
+
margin-top: 1rem !important;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
.qti-margin-t-4 {
|
|
1203
|
+
margin-top: 1.5rem !important;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
.qti-margin-t-5 {
|
|
1207
|
+
margin-top: 3rem !important;
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
.qti-margin-t-auto {
|
|
1211
|
+
margin-top: auto !important;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
/*
|
|
1215
|
+
For margin Bottom
|
|
1216
|
+
*/
|
|
1217
|
+
|
|
1218
|
+
.qti-margin-b-0 {
|
|
1219
|
+
margin-bottom: 0 !important;
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
.qti-margin-b-1 {
|
|
1223
|
+
margin-bottom: 0.25rem !important;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
.qti-margin-b-2 {
|
|
1227
|
+
margin-bottom: 0.5rem !important;
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
.qti-margin-b-3 {
|
|
1231
|
+
margin-bottom: 1rem !important;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
.qti-margin-b-4 {
|
|
1235
|
+
margin-bottom: 1.5rem !important;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
.qti-margin-b-5 {
|
|
1239
|
+
margin-bottom: 3rem !important;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
.qti-margin-b-auto {
|
|
1243
|
+
margin-bottom: auto !important;
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
/*
|
|
1247
|
+
For margin Start LTR
|
|
1248
|
+
*/
|
|
1249
|
+
|
|
1250
|
+
.qti-margin-s-0 {
|
|
1251
|
+
margin-left: 0 !important;
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
.qti-margin-s-1 {
|
|
1255
|
+
margin-left: 0.25rem !important;
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
.qti-margin-s-2 {
|
|
1259
|
+
margin-left: 0.5rem !important;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
.qti-margin-s-3 {
|
|
1263
|
+
margin-left: 1rem !important;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
.qti-margin-s-4 {
|
|
1267
|
+
margin-left: 1.5rem !important;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
.qti-margin-s-5 {
|
|
1271
|
+
margin-left: 3rem !important;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
.qti-margin-s-auto {
|
|
1275
|
+
margin-left: auto !important;
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
/*
|
|
1279
|
+
For margin End LTR
|
|
1280
|
+
*/
|
|
1281
|
+
|
|
1282
|
+
.qti-margin-e-0 {
|
|
1283
|
+
margin-right: 0 !important;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
.qti-margin-e-1 {
|
|
1287
|
+
margin-right: 0.25rem !important;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
.qti-margin-e-2 {
|
|
1291
|
+
margin-right: 0.5rem !important;
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
.qti-margin-e-3 {
|
|
1295
|
+
margin-right: 1rem !important;
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
.qti-margin-e-4 {
|
|
1299
|
+
margin-right: 1.5rem !important;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
.qti-margin-e-5 {
|
|
1303
|
+
margin-right: 3rem !important;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
.qti-margin-e-auto {
|
|
1307
|
+
margin-right: auto !important;
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
/* =========
|
|
1311
|
+
Padding css
|
|
1312
|
+
========== */
|
|
1313
|
+
|
|
1314
|
+
/*
|
|
1315
|
+
For padding Top and Bottom and Left and Right
|
|
1316
|
+
*/
|
|
1317
|
+
|
|
1318
|
+
.qti-padding-0 {
|
|
1319
|
+
padding: 0 !important;
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
.qti-padding-1 {
|
|
1323
|
+
padding: 0.25rem !important;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
.qti-padding-2 {
|
|
1327
|
+
padding: 0.5rem !important;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
.qti-padding-3 {
|
|
1331
|
+
padding: 1rem !important;
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
.qti-padding-4 {
|
|
1335
|
+
padding: 1.5rem !important;
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
.qti-padding-5 {
|
|
1339
|
+
padding: 3rem !important;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
/*
|
|
1343
|
+
For padding Left and Right
|
|
1344
|
+
*/
|
|
1345
|
+
|
|
1346
|
+
.qti-padding-x-0 {
|
|
1347
|
+
padding-right: 0 !important;
|
|
1348
|
+
padding-left: 0 !important;
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
.qti-padding-x-1 {
|
|
1352
|
+
padding-right: 0.25rem !important;
|
|
1353
|
+
padding-left: 0.25rem !important;
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
.qti-padding-x-2 {
|
|
1357
|
+
padding-right: 0.5rem !important;
|
|
1358
|
+
padding-left: 0.5rem !important;
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
.qti-padding-x-3 {
|
|
1362
|
+
padding-right: 1rem !important;
|
|
1363
|
+
padding-left: 1rem !important;
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
.qti-padding-x-4 {
|
|
1367
|
+
padding-right: 1.5rem !important;
|
|
1368
|
+
padding-left: 1.5rem !important;
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
.qti-padding-x-5 {
|
|
1372
|
+
padding-right: 3rem !important;
|
|
1373
|
+
padding-left: 3rem !important;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
/*
|
|
1377
|
+
For padding Top and Bottom
|
|
1378
|
+
*/
|
|
1379
|
+
|
|
1380
|
+
.qti-padding-y-0 {
|
|
1381
|
+
padding-top: 0 !important;
|
|
1382
|
+
padding-bottom: 0 !important;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
.qti-padding-y-1 {
|
|
1386
|
+
padding-top: 0.25rem !important;
|
|
1387
|
+
padding-bottom: 0.25rem !important;
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
.qti-padding-y-2 {
|
|
1391
|
+
padding-top: 0.5rem !important;
|
|
1392
|
+
padding-bottom: 0.5rem !important;
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
.qti-padding-y-3 {
|
|
1396
|
+
padding-top: 1rem !important;
|
|
1397
|
+
padding-bottom: 1rem !important;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
.qti-padding-y-4 {
|
|
1401
|
+
padding-top: 1.5rem !important;
|
|
1402
|
+
padding-bottom: 1.5rem !important;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
.qti-padding-y-5 {
|
|
1406
|
+
padding-top: 3rem !important;
|
|
1407
|
+
padding-bottom: 3rem !important;
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
/*
|
|
1411
|
+
For padding Top
|
|
1412
|
+
*/
|
|
1413
|
+
|
|
1414
|
+
.qti-padding-t-0 {
|
|
1415
|
+
padding-top: 0 !important;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
.qti-padding-t-1 {
|
|
1419
|
+
padding-top: 0.25rem !important;
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
.qti-padding-t-2 {
|
|
1423
|
+
padding-top: 0.5rem !important;
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
.qti-padding-t-3 {
|
|
1427
|
+
padding-top: 1rem !important;
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
.qti-padding-t-4 {
|
|
1431
|
+
padding-top: 1.5rem !important;
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
.qti-padding-t-5 {
|
|
1435
|
+
padding-top: 3rem !important;
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
/*
|
|
1439
|
+
For padding Bottom
|
|
1440
|
+
*/
|
|
1441
|
+
|
|
1442
|
+
.qti-padding-b-0 {
|
|
1443
|
+
padding-bottom: 0 !important;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
.qti-padding-b-1 {
|
|
1447
|
+
padding-bottom: 0.25rem !important;
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
.qti-padding-b-2 {
|
|
1451
|
+
padding-bottom: 0.5rem !important;
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
.qti-padding-b-3 {
|
|
1455
|
+
padding-bottom: 1rem !important;
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
.qti-padding-b-4 {
|
|
1459
|
+
padding-bottom: 1.5rem !important;
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
.qti-padding-b-5 {
|
|
1463
|
+
padding-bottom: 3rem !important;
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
/*
|
|
1467
|
+
For padding Start LTR
|
|
1468
|
+
*/
|
|
1469
|
+
|
|
1470
|
+
.qti-padding-s-0 {
|
|
1471
|
+
padding-left: 0 !important;
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
.qti-padding-s-1 {
|
|
1475
|
+
padding-left: 0.25rem !important;
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
.qti-padding-s-2 {
|
|
1479
|
+
padding-left: 0.5rem !important;
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
.qti-padding-s-3 {
|
|
1483
|
+
padding-left: 1rem !important;
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
.qti-padding-s-4 {
|
|
1487
|
+
padding-left: 1.5rem !important;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
.qti-padding-s-5 {
|
|
1491
|
+
padding-left: 3rem !important;
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
/*
|
|
1495
|
+
For padding End LTR
|
|
1496
|
+
*/
|
|
1497
|
+
|
|
1498
|
+
.qti-padding-e-0 {
|
|
1499
|
+
padding-right: 0 !important;
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
.qti-padding-e-1 {
|
|
1503
|
+
padding-right: 0.25rem !important;
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
.qti-padding-e-2 {
|
|
1507
|
+
padding-right: 0.5rem !important;
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
.qti-padding-e-3 {
|
|
1511
|
+
padding-right: 1rem !important;
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
.qti-padding-e-4 {
|
|
1515
|
+
padding-right: 1.5rem !important;
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
.qti-padding-e-5 {
|
|
1519
|
+
padding-right: 3rem !important;
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
/* ====================
|
|
1523
|
+
Horizontal alignment
|
|
1524
|
+
==================== */
|
|
1525
|
+
|
|
1526
|
+
.qti-align-left {
|
|
1527
|
+
text-align: left;
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
.qti-align-center {
|
|
1531
|
+
text-align: center;
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
.qti-align-right {
|
|
1535
|
+
text-align: right;
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
/* ==================
|
|
1539
|
+
Vertical alignment
|
|
1540
|
+
================== */
|
|
1541
|
+
|
|
1542
|
+
.qti-valign-top {
|
|
1543
|
+
vertical-align: top;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
.qti-valign-middle {
|
|
1547
|
+
vertical-align: middle;
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
.qti-valign-baseline {
|
|
1551
|
+
vertical-align: baseline;
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
.qti-valign-bottom {
|
|
1555
|
+
vertical-align: bottom;
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
/* =============
|
|
1559
|
+
Height styles
|
|
1560
|
+
============= */
|
|
1561
|
+
|
|
1562
|
+
.qti-height-0 {
|
|
1563
|
+
height: 0;
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
.qti-height-px {
|
|
1567
|
+
height: 1px;
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
.qti-height-0p5 {
|
|
1571
|
+
height: 0.125rem;
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
.qti-height-1 {
|
|
1575
|
+
height: 0.25rem;
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
.qti-height-1p5 {
|
|
1579
|
+
height: 0.375rem;
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
.qti-height-2 {
|
|
1583
|
+
height: 0.5rem;
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
.qti-height-2p5 {
|
|
1587
|
+
height: 0.625rem;
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
.qti-height-3 {
|
|
1591
|
+
height: 0.75rem;
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
.qti-height-3p5 {
|
|
1595
|
+
height: 0.875rem;
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
.qti-height-4 {
|
|
1599
|
+
height: 1rem;
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
.qti-height-5 {
|
|
1603
|
+
height: 1.25rem;
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
.qti-height-6 {
|
|
1607
|
+
height: 1.5rem;
|
|
1608
|
+
}
|
|
1609
|
+
|
|
1610
|
+
.qti-height-7 {
|
|
1611
|
+
height: 1.75rem;
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
.qti-height-8 {
|
|
1615
|
+
height: 2rem;
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
.qti-height-9 {
|
|
1619
|
+
height: 2.25rem;
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
.qti-height-10 {
|
|
1623
|
+
height: 2.5rem;
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
.qti-height-11 {
|
|
1627
|
+
height: 2.75rem;
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
.qti-height-12 {
|
|
1631
|
+
height: 3rem;
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
.qti-height-14 {
|
|
1635
|
+
height: 3.5rem;
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
.qti-height-16 {
|
|
1639
|
+
height: 4rem;
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
.qti-height-20 {
|
|
1643
|
+
height: 5rem;
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
.qti-height-24 {
|
|
1647
|
+
height: 6rem;
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
.qti-height-28 {
|
|
1651
|
+
height: 7rem;
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
.qti-height-32 {
|
|
1655
|
+
height: 8rem;
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
.qti-height-36 {
|
|
1659
|
+
height: 9rem;
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
.qti-height-40 {
|
|
1663
|
+
height: 10rem;
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
.qti-height-44 {
|
|
1667
|
+
height: 11rem;
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
.qti-height-48 {
|
|
1671
|
+
height: 12rem;
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
.qti-height-52 {
|
|
1675
|
+
height: 13rem;
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
.qti-height-56 {
|
|
1679
|
+
height: 14rem;
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
.qti-height-60 {
|
|
1683
|
+
height: 15rem;
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
.qti-height-64 {
|
|
1687
|
+
height: 16rem;
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
.qti-height-72 {
|
|
1691
|
+
height: 18rem;
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
.qti-height-80 {
|
|
1695
|
+
height: 20rem;
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
.qti-height-96 {
|
|
1699
|
+
height: 24rem;
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
.qti-height-1-2 {
|
|
1703
|
+
height: 50%;
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
.qti-height-1-3 {
|
|
1707
|
+
height: 33.333333%;
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
.qti-height-2-3 {
|
|
1711
|
+
height: 66.666667%;
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
.qti-height-1-4 {
|
|
1715
|
+
height: 25%;
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
.qti-height-2-4 {
|
|
1719
|
+
height: 50%;
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
.qti-height-3-4 {
|
|
1723
|
+
height: 75%;
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
.qti-height-1-5 {
|
|
1727
|
+
height: 20%;
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
.qti-height-2-5 {
|
|
1731
|
+
height: 40%;
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
.qti-height-3-5 {
|
|
1735
|
+
height: 60%;
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1738
|
+
.qti-height-4-5 {
|
|
1739
|
+
height: 80%;
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
.qti-height-1-6 {
|
|
1743
|
+
height: 16.666667%;
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
.qti-height-2-6 {
|
|
1747
|
+
height: 33.333333%;
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
.qti-height-3-6 {
|
|
1751
|
+
height: 50%;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
.qti-height-4-6 {
|
|
1755
|
+
height: 66.666667%;
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
.qti-height-5-6 {
|
|
1759
|
+
height: 83.333333%;
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
.qti-height-auto {
|
|
1763
|
+
height: auto;
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
.qti-height-full {
|
|
1767
|
+
height: 100%;
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
/* ============
|
|
1771
|
+
Width styles
|
|
1772
|
+
============ */
|
|
1773
|
+
|
|
1774
|
+
.qti-width-0 {
|
|
1775
|
+
width: 0;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
.qti-width-px {
|
|
1779
|
+
width: 1px;
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
.qti-width-0p5 {
|
|
1783
|
+
width: 0.125rem;
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
.qti-width-1 {
|
|
1787
|
+
width: 0.25rem;
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
.qti-width-1p5 {
|
|
1791
|
+
width: 0.375rem;
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
.qti-width-2 {
|
|
1795
|
+
width: 0.5rem;
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
.qti-width-2p5 {
|
|
1799
|
+
width: 0.625rem;
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
.qti-width-3 {
|
|
1803
|
+
width: 0.75rem;
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
.qti-width-3p5 {
|
|
1807
|
+
width: 0.875rem;
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
.qti-width-4 {
|
|
1811
|
+
width: 1rem;
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
.qti-width-5 {
|
|
1815
|
+
width: 1.25rem;
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
.qti-width-6 {
|
|
1819
|
+
width: 1.5rem;
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
.qti-width-7 {
|
|
1823
|
+
width: 1.75rem;
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
.qti-width-8 {
|
|
1827
|
+
width: 2rem;
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
.qti-width-9 {
|
|
1831
|
+
width: 2.25rem;
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
.qti-width-10 {
|
|
1835
|
+
width: 2.5rem;
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
.qti-width-11 {
|
|
1839
|
+
width: 2.75rem;
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1842
|
+
.qti-width-12 {
|
|
1843
|
+
width: 3rem;
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
.qti-width-14 {
|
|
1847
|
+
width: 3.5rem;
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
.qti-width-16 {
|
|
1851
|
+
width: 4rem;
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
.qti-width-20 {
|
|
1855
|
+
width: 5rem;
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
.qti-width-24 {
|
|
1859
|
+
width: 6rem;
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
.qti-width-28 {
|
|
1863
|
+
width: 7rem;
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1866
|
+
.qti-width-32 {
|
|
1867
|
+
width: 8rem;
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
.qti-width-36 {
|
|
1871
|
+
width: 9rem;
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
.qti-width-40 {
|
|
1875
|
+
width: 10rem;
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1878
|
+
.qti-width-44 {
|
|
1879
|
+
width: 11rem;
|
|
1880
|
+
}
|
|
1881
|
+
|
|
1882
|
+
.qti-width-48 {
|
|
1883
|
+
width: 12rem;
|
|
1884
|
+
}
|
|
1885
|
+
|
|
1886
|
+
.qti-width-52 {
|
|
1887
|
+
width: 13rem;
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
.qti-width-56 {
|
|
1891
|
+
width: 14rem;
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
.qti-width-60 {
|
|
1895
|
+
width: 15rem;
|
|
1896
|
+
}
|
|
1897
|
+
|
|
1898
|
+
.qti-width-64 {
|
|
1899
|
+
width: 16rem;
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
.qti-width-72 {
|
|
1903
|
+
width: 18rem;
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
.qti-width-80 {
|
|
1907
|
+
width: 20rem;
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
.qti-width-96 {
|
|
1911
|
+
width: 24rem;
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
.qti-width-auto {
|
|
1915
|
+
width: auto;
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
.qti-width-1-2 {
|
|
1919
|
+
width: 50%;
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
.qti-width-1-3 {
|
|
1923
|
+
width: 33.333333%;
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
.qti-width-2-3 {
|
|
1927
|
+
width: 66.666667%;
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
.qti-width-1-4 {
|
|
1931
|
+
width: 25%;
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1934
|
+
.qti-width-2-4 {
|
|
1935
|
+
width: 50%;
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
.qti-width-3-4 {
|
|
1939
|
+
width: 75%;
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
.qti-width-1-5 {
|
|
1943
|
+
width: 20%;
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
.qti-width-2-5 {
|
|
1947
|
+
width: 40%;
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
.qti-width-3-5 {
|
|
1951
|
+
width: 60%;
|
|
1952
|
+
}
|
|
1953
|
+
|
|
1954
|
+
.qti-width-4-5 {
|
|
1955
|
+
width: 80%;
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
.qti-width-1-6 {
|
|
1959
|
+
width: 16.666667%;
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
.qti-width-2-6 {
|
|
1963
|
+
width: 33.333333%;
|
|
1964
|
+
}
|
|
1965
|
+
|
|
1966
|
+
.qti-width-3-6 {
|
|
1967
|
+
width: 50%;
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1970
|
+
.qti-width-4-6 {
|
|
1971
|
+
width: 66.666667%;
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
.qti-width-5-6 {
|
|
1975
|
+
width: 83.333333%;
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1978
|
+
.qti-width-1-12 {
|
|
1979
|
+
width: 8.333333%;
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
.qti-width-2-12 {
|
|
1983
|
+
width: 16.666667%;
|
|
1984
|
+
}
|
|
1985
|
+
|
|
1986
|
+
.qti-width-3-12 {
|
|
1987
|
+
width: 25%;
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1990
|
+
.qti-width-4-12 {
|
|
1991
|
+
width: 33.333333%;
|
|
1992
|
+
}
|
|
1993
|
+
|
|
1994
|
+
.qti-width-5-12 {
|
|
1995
|
+
width: 41.666667%;
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
.qti-width-6-12 {
|
|
1999
|
+
width: 50%;
|
|
2000
|
+
}
|
|
2001
|
+
|
|
2002
|
+
.qti-width-7-12 {
|
|
2003
|
+
width: 58.333333%;
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
.qti-width-8-12 {
|
|
2007
|
+
width: 66.666667%;
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
.qti-width-9-12 {
|
|
2011
|
+
width: 75%;
|
|
2012
|
+
}
|
|
2013
|
+
|
|
2014
|
+
.qti-width-10-12 {
|
|
2015
|
+
width: 83.333333%;
|
|
2016
|
+
}
|
|
2017
|
+
|
|
2018
|
+
.qti-width-11-12 {
|
|
2019
|
+
width: 91.666667%;
|
|
2020
|
+
}
|
|
2021
|
+
|
|
2022
|
+
.qti-width-full,
|
|
2023
|
+
.qti-fullwidth {
|
|
2024
|
+
width: 100%;
|
|
2025
|
+
}
|
|
2026
|
+
|
|
2027
|
+
/* ==================
|
|
2028
|
+
Text Indent styles
|
|
2029
|
+
================== */
|
|
2030
|
+
|
|
2031
|
+
.qti-text-indent-0 {
|
|
2032
|
+
text-indent: 0;
|
|
2033
|
+
}
|
|
2034
|
+
|
|
2035
|
+
.qti-text-indent-px {
|
|
2036
|
+
text-indent: 1px;
|
|
2037
|
+
}
|
|
2038
|
+
|
|
2039
|
+
.qti-text-indent-0p5 {
|
|
2040
|
+
text-indent: 0.125rem;
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2043
|
+
.qti-text-indent-1 {
|
|
2044
|
+
text-indent: 0.25rem;
|
|
2045
|
+
}
|
|
2046
|
+
|
|
2047
|
+
.qti-text-indent-1p5 {
|
|
2048
|
+
text-indent: 0.375rem;
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
.qti-text-indent-2 {
|
|
2052
|
+
text-indent: 0.5rem;
|
|
2053
|
+
}
|
|
2054
|
+
|
|
2055
|
+
.qti-text-indent-2p5 {
|
|
2056
|
+
text-indent: 0.625rem;
|
|
2057
|
+
}
|
|
2058
|
+
|
|
2059
|
+
.qti-text-indent-3 {
|
|
2060
|
+
text-indent: 0.75rem;
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
.qti-text-indent-3p5 {
|
|
2064
|
+
text-indent: 0.875rem;
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
.qti-text-indent-4 {
|
|
2068
|
+
text-indent: 1rem;
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2071
|
+
.qti-text-indent-5 {
|
|
2072
|
+
text-indent: 1.25rem;
|
|
2073
|
+
}
|
|
2074
|
+
|
|
2075
|
+
.qti-text-indent-6 {
|
|
2076
|
+
text-indent: 1.5rem;
|
|
2077
|
+
}
|
|
2078
|
+
|
|
2079
|
+
.qti-text-indent-7 {
|
|
2080
|
+
text-indent: 1.75rem;
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
.qti-text-indent-8 {
|
|
2084
|
+
text-indent: 2rem;
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
.qti-text-indent-12 {
|
|
2088
|
+
text-indent: 3rem;
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
.qti-text-indent-16 {
|
|
2092
|
+
text-indent: 4rem;
|
|
2093
|
+
}
|
|
2094
|
+
|
|
2095
|
+
.qti-text-indent-20 {
|
|
2096
|
+
text-indent: 5rem;
|
|
2097
|
+
}
|
|
2098
|
+
|
|
2099
|
+
.qti-text-indent-24 {
|
|
2100
|
+
text-indent: 6rem;
|
|
2101
|
+
}
|
|
2102
|
+
|
|
2103
|
+
.qti-text-indent-28 {
|
|
2104
|
+
text-indent: 7rem;
|
|
2105
|
+
}
|
|
2106
|
+
|
|
2107
|
+
.qti-text-indent-32 {
|
|
2108
|
+
text-indent: 8rem;
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
/* =================
|
|
2112
|
+
List Style styles
|
|
2113
|
+
================= */
|
|
2114
|
+
|
|
2115
|
+
.qti-list-style-type-none {
|
|
2116
|
+
list-style-type: none;
|
|
2117
|
+
}
|
|
2118
|
+
|
|
2119
|
+
.qti-list-style-type-disc {
|
|
2120
|
+
list-style-type: disc;
|
|
2121
|
+
}
|
|
2122
|
+
|
|
2123
|
+
.qti-list-style-type-circle {
|
|
2124
|
+
list-style-type: circle;
|
|
2125
|
+
}
|
|
2126
|
+
|
|
2127
|
+
.qti-list-style-type-square {
|
|
2128
|
+
list-style-type: square;
|
|
2129
|
+
}
|
|
2130
|
+
|
|
2131
|
+
.qti-list-style-type-decimal {
|
|
2132
|
+
list-style-type: decimal;
|
|
2133
|
+
}
|
|
2134
|
+
|
|
2135
|
+
.qti-list-style-type-decimal-leading-zero {
|
|
2136
|
+
list-style-type: decimal-leading-zero;
|
|
2137
|
+
}
|
|
2138
|
+
|
|
2139
|
+
.qti-list-style-type-lower-alpha {
|
|
2140
|
+
list-style-type: lower-alpha;
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2143
|
+
.qti-list-style-type-upper-alpha {
|
|
2144
|
+
list-style-type: upper-alpha;
|
|
2145
|
+
}
|
|
2146
|
+
|
|
2147
|
+
.qti-list-style-type-lower-roman {
|
|
2148
|
+
list-style-type: lower-roman;
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
.qti-list-style-type-upper-roman {
|
|
2152
|
+
list-style-type: upper-roman;
|
|
2153
|
+
}
|
|
2154
|
+
|
|
2155
|
+
.qti-list-style-type-lower-latin {
|
|
2156
|
+
list-style-type: lower-latin;
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
.qti-list-style-type-upper-latin {
|
|
2160
|
+
list-style-type: upper-latin;
|
|
2161
|
+
}
|
|
2162
|
+
|
|
2163
|
+
.qti-list-style-type-lower-greek {
|
|
2164
|
+
list-style-type: lower-greek;
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2167
|
+
.qti-list-style-type-arabic-indic {
|
|
2168
|
+
list-style-type: arabic-indic;
|
|
2169
|
+
}
|
|
2170
|
+
|
|
2171
|
+
.qti-list-style-type-armenian {
|
|
2172
|
+
list-style-type: armenian;
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
.qti-list-style-type-lower-armenian {
|
|
2176
|
+
list-style-type: lower-armenian;
|
|
2177
|
+
}
|
|
2178
|
+
|
|
2179
|
+
.qti-list-style-type-upper-armenian {
|
|
2180
|
+
list-style-type: upper-armenian;
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
.qti-list-style-type-bengali {
|
|
2184
|
+
list-style-type: bengali;
|
|
2185
|
+
}
|
|
2186
|
+
|
|
2187
|
+
.qti-list-style-type-cambodian {
|
|
2188
|
+
list-style-type: cambodian;
|
|
2189
|
+
}
|
|
2190
|
+
|
|
2191
|
+
.qti-list-style-type-simp-chinese-formal {
|
|
2192
|
+
list-style-type: simp-chinese-formal;
|
|
2193
|
+
}
|
|
2194
|
+
|
|
2195
|
+
.qti-list-style-type-simp-chinese-informal {
|
|
2196
|
+
list-style-type: simp-chinese-informal;
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
.qti-list-style-type-trad-chinese-formal {
|
|
2200
|
+
list-style-type: trad-chinese-formal;
|
|
2201
|
+
}
|
|
2202
|
+
|
|
2203
|
+
.qti-list-style-type-trad-chinese-informal {
|
|
2204
|
+
list-style-type: trad-chinese-informal;
|
|
2205
|
+
}
|
|
2206
|
+
|
|
2207
|
+
.qti-list-style-type-cjk-ideographic {
|
|
2208
|
+
list-style-type: cjk-ideographic;
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2211
|
+
.qti-list-style-type-cjk-heavenly-stem {
|
|
2212
|
+
list-style-type: cjk-heavenly-stem;
|
|
2213
|
+
}
|
|
2214
|
+
|
|
2215
|
+
.qti-list-style-type-cjk-earthly-branch {
|
|
2216
|
+
list-style-type: cjk-earthly-branch;
|
|
2217
|
+
}
|
|
2218
|
+
|
|
2219
|
+
.qti-list-style-type-devanagari {
|
|
2220
|
+
list-style-type: devanagari;
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
.qti-list-style-type-ethiopic-halehame-ti-er {
|
|
2224
|
+
list-style-type: ethiopic-halehame-ti-er;
|
|
2225
|
+
}
|
|
2226
|
+
|
|
2227
|
+
.qti-list-style-type-ethiopic-halehame-ti-et {
|
|
2228
|
+
list-style-type: ethiopic-halehame-ti-et;
|
|
2229
|
+
}
|
|
2230
|
+
|
|
2231
|
+
.qti-list-style-type-ethiopic-halehame-am {
|
|
2232
|
+
list-style-type: ethiopic-halehame-am;
|
|
2233
|
+
}
|
|
2234
|
+
|
|
2235
|
+
.qti-list-style-type-ethiopic-halehame {
|
|
2236
|
+
list-style-type: ethiopic-halehame;
|
|
2237
|
+
}
|
|
2238
|
+
|
|
2239
|
+
.qti-list-style-type-georgian {
|
|
2240
|
+
list-style-type: georgian;
|
|
2241
|
+
}
|
|
2242
|
+
|
|
2243
|
+
.qti-list-style-type-gujarati {
|
|
2244
|
+
list-style-type: gujarati;
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2247
|
+
.qti-list-style-type-gurmukhi {
|
|
2248
|
+
list-style-type: gurmukhi;
|
|
2249
|
+
}
|
|
2250
|
+
|
|
2251
|
+
.qti-list-style-type-hangul {
|
|
2252
|
+
list-style-type: hangul;
|
|
2253
|
+
}
|
|
2254
|
+
|
|
2255
|
+
.qti-list-style-type-hangul-consonant {
|
|
2256
|
+
list-style-type: hangul-consonant;
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2259
|
+
.qti-list-style-type-hebrew {
|
|
2260
|
+
list-style-type: hebrew;
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
.qti-list-style-type-hiragana {
|
|
2264
|
+
list-style-type: hiragana;
|
|
2265
|
+
}
|
|
2266
|
+
|
|
2267
|
+
.qti-list-style-type-hiragana-iroha {
|
|
2268
|
+
list-style-type: hiragana-iroha;
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
.qti-list-style-type-khmer {
|
|
2272
|
+
list-style-type: khmer;
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
.qti-list-style-type-korean-hangul-formal {
|
|
2276
|
+
list-style-type: korean-hangul-formal;
|
|
2277
|
+
}
|
|
2278
|
+
|
|
2279
|
+
.qti-list-style-type-korean-hanja-formal {
|
|
2280
|
+
list-style-type: korean-hanja-formal;
|
|
2281
|
+
}
|
|
2282
|
+
|
|
2283
|
+
.qti-list-style-type-korean-hanja-informal {
|
|
2284
|
+
list-style-type: korean-hanja-informal;
|
|
2285
|
+
}
|
|
2286
|
+
|
|
2287
|
+
.qti-list-style-type-lao {
|
|
2288
|
+
list-style-type: lao;
|
|
2289
|
+
}
|
|
2290
|
+
|
|
2291
|
+
.qti-list-style-type-malayalam {
|
|
2292
|
+
list-style-type: malayalam;
|
|
2293
|
+
}
|
|
2294
|
+
|
|
2295
|
+
.qti-list-style-type-mongolian {
|
|
2296
|
+
list-style-type: mongolian;
|
|
2297
|
+
}
|
|
2298
|
+
|
|
2299
|
+
.qti-list-style-type-myanmar {
|
|
2300
|
+
list-style-type: myanmar;
|
|
2301
|
+
}
|
|
2302
|
+
|
|
2303
|
+
.qti-list-style-type-oriya {
|
|
2304
|
+
list-style-type: oriya;
|
|
2305
|
+
}
|
|
2306
|
+
|
|
2307
|
+
.qti-list-style-type-persian {
|
|
2308
|
+
list-style-type: persian;
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
.qti-list-style-type-thai {
|
|
2312
|
+
list-style-type: thai;
|
|
2313
|
+
}
|
|
2314
|
+
|
|
2315
|
+
.qti-list-style-type-tibetan {
|
|
2316
|
+
list-style-type: tibetan;
|
|
2317
|
+
}
|
|
2318
|
+
|
|
2319
|
+
.qti-list-style-type-telugu {
|
|
2320
|
+
list-style-type: telugu;
|
|
2321
|
+
}
|
|
2322
|
+
|
|
2323
|
+
.qti-list-style-type-urdu {
|
|
2324
|
+
list-style-type: urdu;
|
|
2325
|
+
}
|
|
2326
|
+
|
|
2327
|
+
/* =========================
|
|
2328
|
+
Other QTI 3 Presentation Utilities
|
|
2329
|
+
========================= */
|
|
2330
|
+
|
|
2331
|
+
.qti-bordered {
|
|
2332
|
+
border: 1px solid var(--table-border-color);
|
|
2333
|
+
}
|
|
2334
|
+
|
|
2335
|
+
.qti-underline {
|
|
2336
|
+
text-decoration: underline;
|
|
2337
|
+
text-decoration-color: var(--foreground);
|
|
2338
|
+
}
|
|
2339
|
+
|
|
2340
|
+
.qti-italic {
|
|
2341
|
+
font-style: italic;
|
|
2342
|
+
}
|
|
2343
|
+
|
|
2344
|
+
.qti-well {
|
|
2345
|
+
min-height: 20px;
|
|
2346
|
+
padding: 19px;
|
|
2347
|
+
margin-bottom: 20px;
|
|
2348
|
+
background-color: var(--well-bg);
|
|
2349
|
+
border: var(--well-border);
|
|
2350
|
+
border-radius: 4px;
|
|
2351
|
+
box-shadow: var(--well-box-shadow);
|
|
2352
|
+
}
|
|
2353
|
+
|
|
2354
|
+
/* Set writing-mode to vertical-rl
|
|
2355
|
+
Typical for CJK vertical text */
|
|
2356
|
+
|
|
2357
|
+
.qti-writing-mode-vertical-rl {
|
|
2358
|
+
writing-mode: vertical-rl;
|
|
2359
|
+
}
|
|
2360
|
+
|
|
2361
|
+
/* Set writing-mode to vertical-lr
|
|
2362
|
+
Typical for Mongolian vertical text */
|
|
2363
|
+
|
|
2364
|
+
.qti-writing-mode-vertical-lr {
|
|
2365
|
+
writing-mode: vertical-lr;
|
|
2366
|
+
}
|
|
2367
|
+
|
|
2368
|
+
/* Set writing-mode to horizontal-tb
|
|
2369
|
+
Browser default */
|
|
2370
|
+
|
|
2371
|
+
.qti-writing-mode-horizontal-tb {
|
|
2372
|
+
writing-mode: horizontal-tb;
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
/* Float an element left */
|
|
2376
|
+
|
|
2377
|
+
.qti-float-left {
|
|
2378
|
+
float: left;
|
|
2379
|
+
}
|
|
2380
|
+
|
|
2381
|
+
/* Float an element right */
|
|
2382
|
+
|
|
2383
|
+
.qti-float-right {
|
|
2384
|
+
float: right;
|
|
2385
|
+
}
|
|
2386
|
+
|
|
2387
|
+
/* Remove a float */
|
|
2388
|
+
|
|
2389
|
+
.qti-float-none {
|
|
2390
|
+
float: none;
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
/* Clearfix Hack to apply to a container of
|
|
2394
|
+
floated content that overflows the container. */
|
|
2395
|
+
|
|
2396
|
+
.qti-float-clearfix::after {
|
|
2397
|
+
content: '';
|
|
2398
|
+
clear: both;
|
|
2399
|
+
display: table;
|
|
2400
|
+
}
|
|
2401
|
+
|
|
2402
|
+
.qti-float-clear-left
|
|
2403
|
+
.qti-float-clear-right
|
|
2404
|
+
.qti-float-clear-both
|
|
2405
|
+
|
|
2406
|
+
/* Set text-orientation to upright */
|
|
2407
|
+
.qti-text-orientation-upright {
|
|
2408
|
+
text-orientation: upright;
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2411
|
+
@layer qti-base {
|
|
2412
|
+
.qti-layout-row {
|
|
2413
|
+
display: flex;
|
|
2414
|
+
flex-wrap: wrap;
|
|
2415
|
+
width: 100%;
|
|
2416
|
+
gap: 2.1276595745%;
|
|
2417
|
+
}
|
|
2418
|
+
|
|
2419
|
+
.qti-layout-row [class*='qti-layout-col'] {
|
|
2420
|
+
box-sizing: border-box;
|
|
2421
|
+
}
|
|
2422
|
+
|
|
2423
|
+
.qti-layout-col1 {
|
|
2424
|
+
width: 6.3829787234%;
|
|
2425
|
+
}
|
|
2426
|
+
|
|
2427
|
+
.qti-layout-col2 {
|
|
2428
|
+
width: 14.8936170213%;
|
|
2429
|
+
}
|
|
2430
|
+
|
|
2431
|
+
.qti-layout-col3 {
|
|
2432
|
+
width: 23.4042553191%;
|
|
2433
|
+
}
|
|
2434
|
+
|
|
2435
|
+
.qti-layout-col4 {
|
|
2436
|
+
width: 31.914893617%;
|
|
2437
|
+
}
|
|
2438
|
+
|
|
2439
|
+
.qti-layout-col5 {
|
|
2440
|
+
width: 40.4255319149%;
|
|
2441
|
+
}
|
|
2442
|
+
|
|
2443
|
+
.qti-layout-col6 {
|
|
2444
|
+
width: 48.9361702128%;
|
|
2445
|
+
}
|
|
2446
|
+
|
|
2447
|
+
.qti-layout-col7 {
|
|
2448
|
+
width: 57.4468085106%;
|
|
2449
|
+
}
|
|
2450
|
+
|
|
2451
|
+
.qti-layout-col8 {
|
|
2452
|
+
width: 65.9574468085%;
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2455
|
+
.qti-layout-col9 {
|
|
2456
|
+
width: 74.4680851064%;
|
|
2457
|
+
}
|
|
2458
|
+
|
|
2459
|
+
.qti-layout-col10 {
|
|
2460
|
+
width: 82.9787234043%;
|
|
2461
|
+
}
|
|
2462
|
+
|
|
2463
|
+
.qti-layout-col11 {
|
|
2464
|
+
width: 91.4893617021%;
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
.qti-layout-col12 {
|
|
2468
|
+
width: 100%;
|
|
2469
|
+
}
|
|
2470
|
+
|
|
2471
|
+
.qti-layout-offset1 {
|
|
2472
|
+
margin-left: 8.5106382979%;
|
|
2473
|
+
}
|
|
2474
|
+
|
|
2475
|
+
.qti-layout-offset2 {
|
|
2476
|
+
margin-left: 17.0212765957%;
|
|
2477
|
+
}
|
|
2478
|
+
|
|
2479
|
+
.qti-layout-offset3 {
|
|
2480
|
+
margin-left: 25.5319148936%;
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2483
|
+
.qti-layout-offset4 {
|
|
2484
|
+
margin-left: 34.0425531915%;
|
|
2485
|
+
}
|
|
2486
|
+
|
|
2487
|
+
.qti-layout-offset5 {
|
|
2488
|
+
margin-left: 42.5531914894%;
|
|
2489
|
+
}
|
|
2490
|
+
|
|
2491
|
+
.qti-layout-offset6 {
|
|
2492
|
+
margin-left: 51.0638297872%;
|
|
2493
|
+
}
|
|
2494
|
+
|
|
2495
|
+
.qti-layout-offset7 {
|
|
2496
|
+
margin-left: 59.5744680851%;
|
|
2497
|
+
}
|
|
2498
|
+
|
|
2499
|
+
.qti-layout-offset8 {
|
|
2500
|
+
margin-left: 68.085106383%;
|
|
2501
|
+
}
|
|
2502
|
+
|
|
2503
|
+
.qti-layout-offset9 {
|
|
2504
|
+
margin-left: 76.5957446809%;
|
|
2505
|
+
}
|
|
2506
|
+
|
|
2507
|
+
.qti-layout-offset10 {
|
|
2508
|
+
margin-left: 85.1063829787%;
|
|
2509
|
+
}
|
|
2510
|
+
|
|
2511
|
+
.qti-layout-offset11 {
|
|
2512
|
+
margin-left: 93.6170212766%;
|
|
2513
|
+
}
|
|
2514
|
+
|
|
2515
|
+
.qti-layout-offset12 {
|
|
2516
|
+
margin-left: 102.1276595745%;
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
@media (width <= 767px) {
|
|
2520
|
+
[class*='qti-layout-col'] {
|
|
2521
|
+
width: 100%;
|
|
2522
|
+
}
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2526
|
+
[view],
|
|
2527
|
+
qti-outcome-declaration,
|
|
2528
|
+
qti-response-declaration {
|
|
2529
|
+
display: none;
|
|
2530
|
+
}
|
|
2531
|
+
|
|
2532
|
+
[view].show {
|
|
2533
|
+
display: block;
|
|
2534
|
+
}
|
|
2535
|
+
|
|
2536
|
+
:host {
|
|
2537
|
+
box-sizing: border-box;
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2540
|
+
*,
|
|
2541
|
+
*::before,
|
|
2542
|
+
*::after {
|
|
2543
|
+
box-sizing: inherit;
|
|
2544
|
+
}
|
|
2545
|
+
|
|
2546
|
+
[popover] {
|
|
2547
|
+
position: fixed;
|
|
2548
|
+
inset: 0;
|
|
2549
|
+
margin: auto;
|
|
2550
|
+
border: solid;
|
|
2551
|
+
padding: 0.25em;
|
|
2552
|
+
overflow: auto;
|
|
2553
|
+
color: CanvasText;
|
|
2554
|
+
background-color: Canvas;
|
|
2555
|
+
}
|
|
2556
|
+
|
|
2557
|
+
[popovertarget] {
|
|
2558
|
+
all: unset;
|
|
2559
|
+
cursor: pointer;
|
|
2560
|
+
}
|
|
2561
|
+
|
|
2562
|
+
/* components */
|
|
2563
|
+
|
|
2564
|
+
@layer qti-components {
|
|
2565
|
+
qti-choice-interaction {
|
|
2566
|
+
&.qti-input-control-hidden {
|
|
2567
|
+
& qti-simple-choice {
|
|
2568
|
+
|
|
2569
|
+
&:hover {
|
|
2570
|
+
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
&:focus {
|
|
2574
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
2575
|
+
}
|
|
2576
|
+
|
|
2577
|
+
&::part(ch) {
|
|
2578
|
+
display: none;
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2581
|
+
&[aria-checked='true'] {
|
|
2582
|
+
border-color: var(--qti-bg-primary);
|
|
2583
|
+
}
|
|
2584
|
+
|
|
2585
|
+
&[aria-readonly='true'] {
|
|
2586
|
+
cursor: pointer;
|
|
2587
|
+
background-color: white;
|
|
2588
|
+
outline: 0;
|
|
2589
|
+
border: none;
|
|
2590
|
+
}
|
|
2591
|
+
|
|
2592
|
+
&[aria-disabled='true'] {
|
|
2593
|
+
cursor: not-allowed;
|
|
2594
|
+
background-color: var(--qti-bg-gray-100);
|
|
2595
|
+
color: var(--qti-text-gray-500);
|
|
2596
|
+
border-color: var(--qti-border-color-gray);
|
|
2597
|
+
}
|
|
2598
|
+
|
|
2599
|
+
border-radius: var(--qti-border-radius-md);
|
|
2600
|
+
|
|
2601
|
+
padding: var(--qti-padding-md) var(--qti-padding-md);
|
|
2602
|
+
|
|
2603
|
+
font-weight: var(--qti-font-weight-semibold);
|
|
2604
|
+
|
|
2605
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
2606
|
+
|
|
2607
|
+
outline: none
|
|
2608
|
+
}
|
|
2609
|
+
}
|
|
2610
|
+
|
|
2611
|
+
&:not(.qti-input-control-hidden) {
|
|
2612
|
+
& qti-simple-choice {
|
|
2613
|
+
|
|
2614
|
+
&:not([aria-disabled='true'], [aria-readonly='true']):hover {
|
|
2615
|
+
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
|
|
2616
|
+
}
|
|
2617
|
+
|
|
2618
|
+
&:focus {
|
|
2619
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
2620
|
+
}
|
|
2621
|
+
|
|
2622
|
+
&[aria-checked='true'] {
|
|
2623
|
+
border-color: var(--qti-bg-primary);
|
|
2624
|
+
}
|
|
2625
|
+
|
|
2626
|
+
&[aria-readonly='true'] {
|
|
2627
|
+
cursor: pointer;
|
|
2628
|
+
background-color: white;
|
|
2629
|
+
outline: 0;
|
|
2630
|
+
border: none;
|
|
2631
|
+
}
|
|
2632
|
+
|
|
2633
|
+
&[aria-disabled='true'] {
|
|
2634
|
+
cursor: not-allowed;
|
|
2635
|
+
background-color: var(--qti-bg-gray-100);
|
|
2636
|
+
color: var(--qti-text-gray-500);
|
|
2637
|
+
border-color: var(--qti-border-color-gray);
|
|
2638
|
+
}
|
|
2639
|
+
|
|
2640
|
+
&::part(cha) {
|
|
2641
|
+
width: calc(var(--qti-form-size) - 4px);
|
|
2642
|
+
height: calc(var(--qti-form-size) - 4px);
|
|
2643
|
+
}
|
|
2644
|
+
|
|
2645
|
+
&[role='radio']::part(ch) {
|
|
2646
|
+
border-radius: var(--qti-border-radius-full);
|
|
2647
|
+
width: var(--qti-form-size);
|
|
2648
|
+
height: var(--qti-form-size);
|
|
2649
|
+
align-self: 1;
|
|
2650
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
2651
|
+
outline: none;
|
|
2652
|
+
}
|
|
2653
|
+
|
|
2654
|
+
&[role='radio'][aria-checked='true']::part(cha) {
|
|
2655
|
+
background-color: var(--qti-bg-primary);
|
|
2656
|
+
border-radius: var(--qti-border-radius-full);
|
|
2657
|
+
}
|
|
2658
|
+
|
|
2659
|
+
&[role='checkbox']::part(ch) {
|
|
2660
|
+
border-radius: var(--qti-border-radius-md);
|
|
2661
|
+
width: var(--qti-form-size);
|
|
2662
|
+
height: var(--qti-form-size);
|
|
2663
|
+
align-self: 1;
|
|
2664
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
2665
|
+
outline: none;
|
|
2666
|
+
}
|
|
2667
|
+
|
|
2668
|
+
&[role='checkbox'][aria-checked='true']::part(cha) {
|
|
2669
|
+
background-color: var(--qti-bg-primary);
|
|
2670
|
+
-webkit-mask-image: var(--check-mask);
|
|
2671
|
+
mask-image: var(--check-mask);
|
|
2672
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
|
|
2673
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
|
|
2674
|
+
}
|
|
2675
|
+
|
|
2676
|
+
gap: 0.5rem;
|
|
2677
|
+
|
|
2678
|
+
padding: var(--qti-padding-md) var(--qti-padding-md);
|
|
2679
|
+
|
|
2680
|
+
outline: none;
|
|
2681
|
+
|
|
2682
|
+
border-radius: var(--qti-border-radius-md);
|
|
2683
|
+
|
|
2684
|
+
cursor: pointer
|
|
2685
|
+
}
|
|
2686
|
+
}
|
|
2687
|
+
|
|
2688
|
+
& qti-simple-choice {
|
|
2689
|
+
&[data-correct-response='true'] {
|
|
2690
|
+
&::after {
|
|
2691
|
+
content: '\\02714';
|
|
2692
|
+
color: #16a34a; /* text-green-600 */
|
|
2693
|
+
}
|
|
2694
|
+
}
|
|
2695
|
+
}
|
|
2696
|
+
|
|
2697
|
+
& qti-simple-choice > p {
|
|
2698
|
+
margin: 0;
|
|
2699
|
+
padding: 0;
|
|
2700
|
+
}
|
|
2701
|
+
}
|
|
2702
|
+
|
|
2703
|
+
qti-text-entry-interaction {
|
|
2704
|
+
&:hover {
|
|
2705
|
+
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
|
|
2706
|
+
}
|
|
2707
|
+
|
|
2708
|
+
&:focus-within {
|
|
2709
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2712
|
+
&::part(input) {
|
|
2713
|
+
border-radius: 0;
|
|
2714
|
+
cursor: text;
|
|
2715
|
+
padding: var(--qti-padding-lg);
|
|
2716
|
+
background: unset;
|
|
2717
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
2718
|
+
outline: none;
|
|
2719
|
+
}
|
|
2720
|
+
}
|
|
2721
|
+
|
|
2722
|
+
qti-extended-text-interaction {
|
|
2723
|
+
&::part(textarea) {
|
|
2724
|
+
border-radius: 0;
|
|
2725
|
+
cursor: text;
|
|
2726
|
+
padding: var(--qti-padding-lg);
|
|
2727
|
+
background: unset;
|
|
2728
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
2729
|
+
outline: none;
|
|
2730
|
+
}
|
|
2731
|
+
|
|
2732
|
+
&:hover {
|
|
2733
|
+
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
|
|
2734
|
+
}
|
|
2735
|
+
|
|
2736
|
+
&:focus-within {
|
|
2737
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
2738
|
+
}
|
|
2739
|
+
}
|
|
2740
|
+
|
|
2741
|
+
qti-gap-match-interaction {
|
|
2742
|
+
& qti-gap-text {
|
|
2743
|
+
|
|
2744
|
+
&:hover {
|
|
2745
|
+
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
|
|
2746
|
+
}
|
|
2747
|
+
|
|
2748
|
+
&:focus {
|
|
2749
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
2750
|
+
}
|
|
2751
|
+
|
|
2752
|
+
transition: transform 200ms ease-out,
|
|
2753
|
+
box-shadow 200ms ease-out,
|
|
2754
|
+
rotate 200ms ease-out;
|
|
2755
|
+
|
|
2756
|
+
padding: var(--qti-padding-md) var(--qti-padding-lg) var(--qti-padding-md) var(--qti-padding-xl);
|
|
2757
|
+
|
|
2758
|
+
border-radius: var(--qti-border-radius-md);
|
|
2759
|
+
|
|
2760
|
+
cursor: grab;
|
|
2761
|
+
|
|
2762
|
+
background-color: white;
|
|
2763
|
+
|
|
2764
|
+
font-weight: var(--qti-font-weight-semibold);
|
|
2765
|
+
|
|
2766
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
2767
|
+
|
|
2768
|
+
outline: none;
|
|
2769
|
+
|
|
2770
|
+
background-image: radial-gradient(
|
|
2771
|
+
circle at center,
|
|
2772
|
+
rgb(0 0 0 / 10%) 0,
|
|
2773
|
+
rgb(0 0 0 / 20%) 2px,
|
|
2774
|
+
rgb(255 255 255 / 0%) 2px,
|
|
2775
|
+
rgb(255 255 255 / 0%) 100%
|
|
2776
|
+
);
|
|
2777
|
+
|
|
2778
|
+
background-repeat: repeat-y;
|
|
2779
|
+
|
|
2780
|
+
background-position: left center;
|
|
2781
|
+
|
|
2782
|
+
background-size: 14px 8px
|
|
2783
|
+
}
|
|
2784
|
+
|
|
2785
|
+
& qti-gap {
|
|
2786
|
+
|
|
2787
|
+
display: inline-flex;
|
|
2788
|
+
width: 8rem; /* w-32 */
|
|
2789
|
+
&:empty::after {
|
|
2790
|
+
padding: var(--qti-padding-md) var(--qti-padding-lg); /* Padding shorthand */
|
|
2791
|
+
content: '\\0000a0'; /* when empty, put a space in it */
|
|
2792
|
+
}
|
|
2793
|
+
|
|
2794
|
+
&:not(:empty) {
|
|
2795
|
+
display: inline-flex;
|
|
2796
|
+
padding: 0;
|
|
2797
|
+
width: auto;
|
|
2798
|
+
}
|
|
2799
|
+
|
|
2800
|
+
&:not(:empty) > * {
|
|
2801
|
+
flex: 1;
|
|
2802
|
+
transform: rotate(0); /* rotate-0 */
|
|
2803
|
+
box-shadow: 0 0 0 1px #e5e7eb; /* ring-gray-200 */
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2806
|
+
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="7" stroke="%23CCCCCC" stroke-width="1" fill="transparent" /></svg>')
|
|
2807
|
+
center no-repeat;
|
|
2808
|
+
|
|
2809
|
+
border-radius: var(--qti-border-radius-lg);
|
|
2810
|
+
|
|
2811
|
+
position: relative;
|
|
2812
|
+
|
|
2813
|
+
background-color: var(--qti-bg-white);
|
|
2814
|
+
|
|
2815
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
2816
|
+
|
|
2817
|
+
outline: none
|
|
2818
|
+
}
|
|
2819
|
+
}
|
|
2820
|
+
|
|
2821
|
+
qti-hotspot-interaction {
|
|
2822
|
+
& qti-hotspot-choice {
|
|
2823
|
+
&[shape='circle'] {
|
|
2824
|
+
|
|
2825
|
+
&:hover {
|
|
2826
|
+
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
|
|
2827
|
+
}
|
|
2828
|
+
|
|
2829
|
+
&:focus {
|
|
2830
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
2831
|
+
}
|
|
2832
|
+
|
|
2833
|
+
&[aria-checked='true'] {
|
|
2834
|
+
border-color: var(--qti-bg-primary);
|
|
2835
|
+
}
|
|
2836
|
+
|
|
2837
|
+
&[aria-readonly='true'] {
|
|
2838
|
+
cursor: pointer;
|
|
2839
|
+
background-color: white;
|
|
2840
|
+
outline: 0;
|
|
2841
|
+
border: none;
|
|
2842
|
+
}
|
|
2843
|
+
|
|
2844
|
+
&[aria-disabled='true'] {
|
|
2845
|
+
cursor: not-allowed;
|
|
2846
|
+
background-color: var(--qti-bg-gray-100);
|
|
2847
|
+
color: var(--qti-text-gray-500);
|
|
2848
|
+
border-color: var(--qti-border-color-gray);
|
|
2849
|
+
}
|
|
2850
|
+
|
|
2851
|
+
width: 100%;
|
|
2852
|
+
|
|
2853
|
+
height: 100%;
|
|
2854
|
+
|
|
2855
|
+
background-color: transparent;
|
|
2856
|
+
|
|
2857
|
+
padding: 0;
|
|
2858
|
+
|
|
2859
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
2860
|
+
|
|
2861
|
+
outline: none
|
|
2862
|
+
}
|
|
2863
|
+
|
|
2864
|
+
&[shape='rect'] {
|
|
2865
|
+
|
|
2866
|
+
&:hover {
|
|
2867
|
+
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2870
|
+
&:focus {
|
|
2871
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
2872
|
+
}
|
|
2873
|
+
|
|
2874
|
+
&[aria-checked='true'] {
|
|
2875
|
+
border-color: var(--qti-bg-primary);
|
|
2876
|
+
}
|
|
2877
|
+
|
|
2878
|
+
&[aria-readonly='true'] {
|
|
2879
|
+
cursor: pointer;
|
|
2880
|
+
background-color: white;
|
|
2881
|
+
outline: 0;
|
|
2882
|
+
border: none;
|
|
2883
|
+
}
|
|
2884
|
+
|
|
2885
|
+
&[aria-disabled='true'] {
|
|
2886
|
+
cursor: not-allowed;
|
|
2887
|
+
background-color: var(--qti-bg-gray-100);
|
|
2888
|
+
color: var(--qti-text-gray-500);
|
|
2889
|
+
border-color: var(--qti-border-color-gray);
|
|
2890
|
+
}
|
|
2891
|
+
|
|
2892
|
+
width: 100%;
|
|
2893
|
+
|
|
2894
|
+
height: 100%;
|
|
2895
|
+
|
|
2896
|
+
background-color: transparent;
|
|
2897
|
+
|
|
2898
|
+
padding: 0;
|
|
2899
|
+
|
|
2900
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
2901
|
+
|
|
2902
|
+
outline: none
|
|
2903
|
+
}
|
|
2904
|
+
|
|
2905
|
+
&[shape='poly'] {
|
|
2906
|
+
&:hover::after {
|
|
2907
|
+
|
|
2908
|
+
content: '';
|
|
2909
|
+
width: 100%;
|
|
2910
|
+
height: 100%;
|
|
2911
|
+
background: repeating-linear-gradient(
|
|
2912
|
+
45deg,
|
|
2913
|
+
var(--qti-primary),
|
|
2914
|
+
var(--qti-primary) 5px,
|
|
2915
|
+
transparent 5px,
|
|
2916
|
+
transparent 10px
|
|
2917
|
+
);
|
|
2918
|
+
display: block;
|
|
2919
|
+
border-color: var(--qti-bg-primary);
|
|
2920
|
+
}
|
|
2921
|
+
|
|
2922
|
+
&[aria-checked='true']::after {
|
|
2923
|
+
|
|
2924
|
+
content: '';
|
|
2925
|
+
width: 100%;
|
|
2926
|
+
height: 100%;
|
|
2927
|
+
background: repeating-linear-gradient(
|
|
2928
|
+
45deg,
|
|
2929
|
+
transparent,
|
|
2930
|
+
transparent 5px,
|
|
2931
|
+
var(--qti-primary) 5px,
|
|
2932
|
+
var(--qti-primary) 10px
|
|
2933
|
+
);
|
|
2934
|
+
display: block;
|
|
2935
|
+
border-color: var(--qti-bg-primary);
|
|
2936
|
+
}
|
|
2937
|
+
|
|
2938
|
+
&[aria-checked='true'] {
|
|
2939
|
+
border-color: var(--qti-bg-primary);
|
|
2940
|
+
}
|
|
2941
|
+
|
|
2942
|
+
&[aria-readonly='true'] {
|
|
2943
|
+
cursor: pointer;
|
|
2944
|
+
background-color: white;
|
|
2945
|
+
outline: 0;
|
|
2946
|
+
border: none;
|
|
2947
|
+
}
|
|
2948
|
+
|
|
2949
|
+
&[aria-disabled='true'] {
|
|
2950
|
+
cursor: not-allowed;
|
|
2951
|
+
background-color: var(--qti-bg-gray-100);
|
|
2952
|
+
color: var(--qti-text-gray-500);
|
|
2953
|
+
border-color: var(--qti-border-color-gray);
|
|
2954
|
+
}
|
|
2955
|
+
}
|
|
2956
|
+
}
|
|
2957
|
+
}
|
|
2958
|
+
|
|
2959
|
+
qti-hottext-interaction {
|
|
2960
|
+
/* &:not(.qti-input-control-hidden),
|
|
2961
|
+
&:not(.qti-unselected-hidden) { */
|
|
2962
|
+
qti-hottext {
|
|
2963
|
+
display: inline-flex;
|
|
2964
|
+
align-items: center;
|
|
2965
|
+
|
|
2966
|
+
&:hover {
|
|
2967
|
+
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
|
|
2968
|
+
}
|
|
2969
|
+
|
|
2970
|
+
&:focus {
|
|
2971
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
2972
|
+
}
|
|
2973
|
+
|
|
2974
|
+
&::part(cha) {
|
|
2975
|
+
width: calc(var(--qti-form-size) - 4px);
|
|
2976
|
+
height: calc(var(--qti-form-size) - 4px);
|
|
2977
|
+
}
|
|
2978
|
+
|
|
2979
|
+
&[role='radio']::part(ch) {
|
|
2980
|
+
border-radius: var(--qti-border-radius-full);
|
|
2981
|
+
width: var(--qti-form-size);
|
|
2982
|
+
height: var(--qti-form-size);
|
|
2983
|
+
align-self: 1;
|
|
2984
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
2985
|
+
outline: none;
|
|
2986
|
+
}
|
|
2987
|
+
|
|
2988
|
+
&[role='radio'][aria-checked='true']::part(cha) {
|
|
2989
|
+
background-color: var(--qti-bg-primary);
|
|
2990
|
+
border-radius: var(--qti-border-radius-full);
|
|
2991
|
+
}
|
|
2992
|
+
|
|
2993
|
+
&[role='checkbox']::part(ch) {
|
|
2994
|
+
border-radius: var(--qti-border-radius-md);
|
|
2995
|
+
width: var(--qti-form-size);
|
|
2996
|
+
height: var(--qti-form-size);
|
|
2997
|
+
align-self: 1;
|
|
2998
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
2999
|
+
outline: none;
|
|
3000
|
+
}
|
|
3001
|
+
|
|
3002
|
+
&[role='checkbox'][aria-checked='true']::part(cha) {
|
|
3003
|
+
background-color: var(--qti-bg-primary);
|
|
3004
|
+
-webkit-mask-image: var(--check-mask);
|
|
3005
|
+
mask-image: var(--check-mask);
|
|
3006
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
|
|
3007
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
|
|
3008
|
+
}
|
|
3009
|
+
|
|
3010
|
+
gap: 0.5rem;
|
|
3011
|
+
|
|
3012
|
+
padding: var(--qti-padding-md) var(--qti-padding-md);
|
|
3013
|
+
|
|
3014
|
+
outline: none;
|
|
3015
|
+
|
|
3016
|
+
border-radius: var(--qti-border-radius-md);
|
|
3017
|
+
|
|
3018
|
+
cursor: pointer
|
|
3019
|
+
}
|
|
3020
|
+
|
|
3021
|
+
/* } */
|
|
3022
|
+
|
|
3023
|
+
&.qti-input-control-hidden {
|
|
3024
|
+
qti-hottext {
|
|
3025
|
+
/* --qti-padding-md: 0.1rem;
|
|
3026
|
+
--qti-padding-lg: 0.2rem;
|
|
3027
|
+
--qti-border-radius-md: 0.3rem;
|
|
3028
|
+
--qti-border-thickness: 1px;
|
|
3029
|
+
--qti-font-weight-semibold: 400; */
|
|
3030
|
+
|
|
3031
|
+
&:hover {
|
|
3032
|
+
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
|
|
3033
|
+
}
|
|
3034
|
+
|
|
3035
|
+
&:focus {
|
|
3036
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
3037
|
+
}
|
|
3038
|
+
|
|
3039
|
+
/* @layer qti-variants { */
|
|
3040
|
+
&::part(ch) {
|
|
3041
|
+
display: none;
|
|
3042
|
+
}
|
|
3043
|
+
|
|
3044
|
+
&[aria-checked='true'] {
|
|
3045
|
+
border-color: var(--qti-bg-primary);
|
|
3046
|
+
}
|
|
3047
|
+
|
|
3048
|
+
&[aria-readonly='true'] {
|
|
3049
|
+
cursor: pointer;
|
|
3050
|
+
background-color: white;
|
|
3051
|
+
outline: 0;
|
|
3052
|
+
border: none;
|
|
3053
|
+
}
|
|
3054
|
+
|
|
3055
|
+
&[aria-disabled='true'] {
|
|
3056
|
+
cursor: not-allowed;
|
|
3057
|
+
background-color: var(--qti-bg-gray-100);
|
|
3058
|
+
color: var(--qti-text-gray-500);
|
|
3059
|
+
border-color: var(--qti-border-color-gray);
|
|
3060
|
+
}
|
|
3061
|
+
|
|
3062
|
+
border-radius: var(--qti-border-radius-md);
|
|
3063
|
+
|
|
3064
|
+
padding: var(--qti-padding-md) var(--qti-padding-md);
|
|
3065
|
+
|
|
3066
|
+
font-weight: var(--qti-font-weight-semibold);
|
|
3067
|
+
|
|
3068
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
3069
|
+
|
|
3070
|
+
outline: none
|
|
3071
|
+
}
|
|
3072
|
+
|
|
3073
|
+
/* } */
|
|
3074
|
+
}
|
|
3075
|
+
|
|
3076
|
+
&.qti-unselected-hidden {
|
|
3077
|
+
qti-hottext {
|
|
3078
|
+
&:hover {
|
|
3079
|
+
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
|
|
3080
|
+
}
|
|
3081
|
+
|
|
3082
|
+
&:focus {
|
|
3083
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
3084
|
+
}
|
|
3085
|
+
|
|
3086
|
+
cursor: pointer;
|
|
3087
|
+
|
|
3088
|
+
&::part(ch) {
|
|
3089
|
+
display: none;
|
|
3090
|
+
}
|
|
3091
|
+
|
|
3092
|
+
&[aria-checked='true'] {
|
|
3093
|
+
background-color: var(--qti-primary-light); /* bg-blue-200 */
|
|
3094
|
+
}
|
|
3095
|
+
|
|
3096
|
+
&[aria-readonly='true'] {
|
|
3097
|
+
cursor: pointer;
|
|
3098
|
+
background-color: white;
|
|
3099
|
+
outline: 0;
|
|
3100
|
+
border: none;
|
|
3101
|
+
}
|
|
3102
|
+
|
|
3103
|
+
&[aria-disabled='true'] {
|
|
3104
|
+
cursor: not-allowed;
|
|
3105
|
+
background-color: var(--qti-bg-gray-100);
|
|
3106
|
+
color: var(--qti-text-gray-500);
|
|
3107
|
+
border-color: var(--qti-border-color-gray);
|
|
3108
|
+
}
|
|
3109
|
+
}
|
|
3110
|
+
}
|
|
3111
|
+
}
|
|
3112
|
+
|
|
3113
|
+
qti-inline-choice-interaction {
|
|
3114
|
+
&::part(select) {
|
|
3115
|
+
|
|
3116
|
+
&:hover {
|
|
3117
|
+
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
|
|
3118
|
+
}
|
|
3119
|
+
|
|
3120
|
+
&:focus {
|
|
3121
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
3122
|
+
}
|
|
3123
|
+
|
|
3124
|
+
border-radius: var(--qti-border-radius-md);
|
|
3125
|
+
|
|
3126
|
+
position: relative;
|
|
3127
|
+
|
|
3128
|
+
-webkit-appearance: none;
|
|
3129
|
+
|
|
3130
|
+
-moz-appearance: none;
|
|
3131
|
+
|
|
3132
|
+
appearance: none;
|
|
3133
|
+
|
|
3134
|
+
padding: var(--qti-padding-md) 1.75rem var(--qti-padding-md) var(--qti-padding-lg);
|
|
3135
|
+
|
|
3136
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
3137
|
+
|
|
3138
|
+
outline: none;
|
|
3139
|
+
|
|
3140
|
+
background: url("data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E")
|
|
3141
|
+
no-repeat center right 6px
|
|
3142
|
+
}
|
|
3143
|
+
}
|
|
3144
|
+
|
|
3145
|
+
qti-match-interaction:not(.qti-match-tabular) {
|
|
3146
|
+
/* The draggables */
|
|
3147
|
+
& qti-simple-match-set:first-of-type {
|
|
3148
|
+
display: flex;
|
|
3149
|
+
flex-wrap: wrap;
|
|
3150
|
+
align-items: flex-start; /* Prevents children from stretching */
|
|
3151
|
+
gap: var(--qti-gap-size);
|
|
3152
|
+
|
|
3153
|
+
& qti-simple-associable-choice {
|
|
3154
|
+
|
|
3155
|
+
&[dragging] {
|
|
3156
|
+
pointer-events: none;
|
|
3157
|
+
rotate: -2deg;
|
|
3158
|
+
box-shadow: 0 8px 12px rgb(0 0 0 / 20%),
|
|
3159
|
+
0 4px 8px rgb(0 0 0 / 10%);
|
|
3160
|
+
}
|
|
3161
|
+
|
|
3162
|
+
&:hover {
|
|
3163
|
+
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
|
|
3164
|
+
}
|
|
3165
|
+
|
|
3166
|
+
&:focus {
|
|
3167
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
3168
|
+
}
|
|
3169
|
+
|
|
3170
|
+
transition: transform 200ms ease-out,
|
|
3171
|
+
box-shadow 200ms ease-out,
|
|
3172
|
+
rotate 200ms ease-out;
|
|
3173
|
+
|
|
3174
|
+
padding: var(--qti-padding-md) var(--qti-padding-lg) var(--qti-padding-md) var(--qti-padding-xl);
|
|
3175
|
+
|
|
3176
|
+
border-radius: var(--qti-border-radius-md);
|
|
3177
|
+
|
|
3178
|
+
cursor: grab;
|
|
3179
|
+
|
|
3180
|
+
background-color: white;
|
|
3181
|
+
|
|
3182
|
+
font-weight: var(--qti-font-weight-semibold);
|
|
3183
|
+
|
|
3184
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
3185
|
+
|
|
3186
|
+
outline: none;
|
|
3187
|
+
|
|
3188
|
+
background-image: radial-gradient(
|
|
3189
|
+
circle at center,
|
|
3190
|
+
rgb(0 0 0 / 10%) 0,
|
|
3191
|
+
rgb(0 0 0 / 20%) 2px,
|
|
3192
|
+
rgb(255 255 255 / 0%) 2px,
|
|
3193
|
+
rgb(255 255 255 / 0%) 100%
|
|
3194
|
+
);
|
|
3195
|
+
|
|
3196
|
+
background-repeat: repeat-y;
|
|
3197
|
+
|
|
3198
|
+
background-position: left center;
|
|
3199
|
+
|
|
3200
|
+
background-size: 14px 8px
|
|
3201
|
+
}
|
|
3202
|
+
}
|
|
3203
|
+
|
|
3204
|
+
/* The droppables */
|
|
3205
|
+
& qti-simple-match-set:last-of-type {
|
|
3206
|
+
display: grid;
|
|
3207
|
+
grid-auto-columns: 1fr; /* auto-cols-fr */
|
|
3208
|
+
grid-auto-flow: column; /* grid-flow-col */
|
|
3209
|
+
gap: var(--qti-gap-size); /* gap-2 */
|
|
3210
|
+
width: 100%; /* w-full */
|
|
3211
|
+
|
|
3212
|
+
& qti-simple-associable-choice {
|
|
3213
|
+
display: flex;
|
|
3214
|
+
flex-direction: column;
|
|
3215
|
+
}
|
|
3216
|
+
|
|
3217
|
+
& > qti-simple-associable-choice {
|
|
3218
|
+
/* a droppable qti-simple-associable-choice */
|
|
3219
|
+
box-sizing: border-box;
|
|
3220
|
+
display: grid;
|
|
3221
|
+
grid-row: 2 / 4;
|
|
3222
|
+
grid-template-rows: subgrid;
|
|
3223
|
+
|
|
3224
|
+
& img {
|
|
3225
|
+
max-width: 100%;
|
|
3226
|
+
height: auto;
|
|
3227
|
+
}
|
|
3228
|
+
|
|
3229
|
+
&[enabled] {
|
|
3230
|
+
&::part(dropslot) {
|
|
3231
|
+
background-color: var(--qti-primary-light);
|
|
3232
|
+
}
|
|
3233
|
+
}
|
|
3234
|
+
|
|
3235
|
+
&[disabled] {
|
|
3236
|
+
&::part(dropslot) {
|
|
3237
|
+
background-color: red;
|
|
3238
|
+
}
|
|
3239
|
+
}
|
|
3240
|
+
|
|
3241
|
+
&[active] {
|
|
3242
|
+
&::part(dropslot) {
|
|
3243
|
+
border-color: var(--qti-bg-primary);
|
|
3244
|
+
}
|
|
3245
|
+
}
|
|
3246
|
+
|
|
3247
|
+
&::part(dropslot) {
|
|
3248
|
+
|
|
3249
|
+
&[dragging] {
|
|
3250
|
+
pointer-events: none;
|
|
3251
|
+
rotate: -2deg;
|
|
3252
|
+
box-shadow: 0 8px 12px rgb(0 0 0 / 20%),
|
|
3253
|
+
0 4px 8px rgb(0 0 0 / 10%);
|
|
3254
|
+
}
|
|
3255
|
+
|
|
3256
|
+
&:focus {
|
|
3257
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
3258
|
+
}
|
|
3259
|
+
|
|
3260
|
+
min-height: 6rem;
|
|
3261
|
+
gap: var(--qti-gap-size);
|
|
3262
|
+
box-sizing: border-box;
|
|
3263
|
+
display: flex;
|
|
3264
|
+
justify-content: center;
|
|
3265
|
+
align-items: center;
|
|
3266
|
+
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="7" stroke="%23CCCCCC" stroke-width="1" fill="transparent" /></svg>')
|
|
3267
|
+
center no-repeat;
|
|
3268
|
+
border-radius: var(--qti-border-radius-lg);
|
|
3269
|
+
position: relative;
|
|
3270
|
+
background-color: var(--qti-bg-white);
|
|
3271
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
3272
|
+
outline: none;
|
|
3273
|
+
}
|
|
3274
|
+
|
|
3275
|
+
& > *:not(qti-simple-associable-choice) {
|
|
3276
|
+
pointer-events: none;
|
|
3277
|
+
}
|
|
3278
|
+
|
|
3279
|
+
& > qti-simple-associable-choice {
|
|
3280
|
+
|
|
3281
|
+
&::part(dropslot) {
|
|
3282
|
+
display: none;
|
|
3283
|
+
}
|
|
3284
|
+
|
|
3285
|
+
&:hover {
|
|
3286
|
+
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
|
|
3287
|
+
}
|
|
3288
|
+
|
|
3289
|
+
&:focus {
|
|
3290
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
3291
|
+
}
|
|
3292
|
+
|
|
3293
|
+
flex-basis: fit-content;
|
|
3294
|
+
|
|
3295
|
+
transition: transform 200ms ease-out,
|
|
3296
|
+
box-shadow 200ms ease-out,
|
|
3297
|
+
rotate 200ms ease-out;
|
|
3298
|
+
|
|
3299
|
+
padding: var(--qti-padding-md) var(--qti-padding-lg) var(--qti-padding-md) var(--qti-padding-xl);
|
|
3300
|
+
|
|
3301
|
+
border-radius: var(--qti-border-radius-md);
|
|
3302
|
+
|
|
3303
|
+
cursor: grab;
|
|
3304
|
+
|
|
3305
|
+
background-color: white;
|
|
3306
|
+
|
|
3307
|
+
font-weight: var(--qti-font-weight-semibold);
|
|
3308
|
+
|
|
3309
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
3310
|
+
|
|
3311
|
+
outline: none;
|
|
3312
|
+
|
|
3313
|
+
background-image: radial-gradient(
|
|
3314
|
+
circle at center,
|
|
3315
|
+
rgb(0 0 0 / 10%) 0,
|
|
3316
|
+
rgb(0 0 0 / 20%) 2px,
|
|
3317
|
+
rgb(255 255 255 / 0%) 2px,
|
|
3318
|
+
rgb(255 255 255 / 0%) 100%
|
|
3319
|
+
);
|
|
3320
|
+
|
|
3321
|
+
background-repeat: repeat-y;
|
|
3322
|
+
|
|
3323
|
+
background-position: left center;
|
|
3324
|
+
|
|
3325
|
+
background-size: 14px 8px;
|
|
3326
|
+
}
|
|
3327
|
+
}
|
|
3328
|
+
}
|
|
3329
|
+
}
|
|
3330
|
+
|
|
3331
|
+
qti-order-interaction {
|
|
3332
|
+
&::part(qti-simple-choice),
|
|
3333
|
+
& qti-simple-choice {
|
|
3334
|
+
|
|
3335
|
+
&:hover {
|
|
3336
|
+
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
|
|
3337
|
+
}
|
|
3338
|
+
|
|
3339
|
+
&:focus {
|
|
3340
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
3341
|
+
}
|
|
3342
|
+
|
|
3343
|
+
transition: transform 200ms ease-out,
|
|
3344
|
+
box-shadow 200ms ease-out,
|
|
3345
|
+
rotate 200ms ease-out;
|
|
3346
|
+
|
|
3347
|
+
padding: var(--qti-padding-md) var(--qti-padding-lg) var(--qti-padding-md) var(--qti-padding-xl);
|
|
3348
|
+
|
|
3349
|
+
border-radius: var(--qti-border-radius-md);
|
|
3350
|
+
|
|
3351
|
+
cursor: grab;
|
|
3352
|
+
|
|
3353
|
+
background-color: white;
|
|
3354
|
+
|
|
3355
|
+
font-weight: var(--qti-font-weight-semibold);
|
|
3356
|
+
|
|
3357
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
3358
|
+
|
|
3359
|
+
outline: none;
|
|
3360
|
+
|
|
3361
|
+
background-image: radial-gradient(
|
|
3362
|
+
circle at center,
|
|
3363
|
+
rgb(0 0 0 / 10%) 0,
|
|
3364
|
+
rgb(0 0 0 / 20%) 2px,
|
|
3365
|
+
rgb(255 255 255 / 0%) 2px,
|
|
3366
|
+
rgb(255 255 255 / 0%) 100%
|
|
3367
|
+
);
|
|
3368
|
+
|
|
3369
|
+
background-repeat: repeat-y;
|
|
3370
|
+
|
|
3371
|
+
background-position: left center;
|
|
3372
|
+
|
|
3373
|
+
background-size: 14px 8px
|
|
3374
|
+
}
|
|
3375
|
+
|
|
3376
|
+
&::part(qti-simple-choice) {
|
|
3377
|
+
display: flex;
|
|
3378
|
+
overflow: hidden;
|
|
3379
|
+
align-items: center;
|
|
3380
|
+
width: 100%;
|
|
3381
|
+
text-overflow: ellipsis;
|
|
3382
|
+
}
|
|
3383
|
+
|
|
3384
|
+
&::part(drops) {
|
|
3385
|
+
gap: 0.5rem; /* gap-2 */
|
|
3386
|
+
}
|
|
3387
|
+
|
|
3388
|
+
&::part(drags) {
|
|
3389
|
+
gap: 0.5rem; /* gap-2 */
|
|
3390
|
+
}
|
|
3391
|
+
|
|
3392
|
+
&::part(drop-list) {
|
|
3393
|
+
|
|
3394
|
+
&:hover {
|
|
3395
|
+
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
|
|
3396
|
+
}
|
|
3397
|
+
|
|
3398
|
+
&:focus {
|
|
3399
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
3400
|
+
}
|
|
3401
|
+
|
|
3402
|
+
display: flex;
|
|
3403
|
+
min-height: 4rem;
|
|
3404
|
+
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="7" stroke="%23CCCCCC" stroke-width="1" fill="transparent" /></svg>')
|
|
3405
|
+
center no-repeat;
|
|
3406
|
+
border-radius: var(--qti-border-radius-lg);
|
|
3407
|
+
position: relative;
|
|
3408
|
+
background-color: var(--qti-bg-white);
|
|
3409
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
3410
|
+
outline: none;
|
|
3411
|
+
}
|
|
3412
|
+
|
|
3413
|
+
&::part(active) {
|
|
3414
|
+
border-color: var(--qti-bg-primary);
|
|
3415
|
+
}
|
|
3416
|
+
}
|
|
3417
|
+
|
|
3418
|
+
qti-associate-interaction {
|
|
3419
|
+
& qti-simple-associable-choice, /* drags when in lightdom */
|
|
3420
|
+
&::part(qti-simple-associable-choice) /* drags when in shadowdom */ {
|
|
3421
|
+
|
|
3422
|
+
&:hover {
|
|
3423
|
+
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
|
|
3424
|
+
}
|
|
3425
|
+
|
|
3426
|
+
&:focus {
|
|
3427
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
3428
|
+
}
|
|
3429
|
+
|
|
3430
|
+
&[dragging] {
|
|
3431
|
+
pointer-events: none;
|
|
3432
|
+
rotate: -2deg;
|
|
3433
|
+
box-shadow: 0 8px 12px rgb(0 0 0 / 20%),
|
|
3434
|
+
0 4px 8px rgb(0 0 0 / 10%);
|
|
3435
|
+
}
|
|
3436
|
+
|
|
3437
|
+
transition: transform 200ms ease-out,
|
|
3438
|
+
box-shadow 200ms ease-out,
|
|
3439
|
+
rotate 200ms ease-out;
|
|
3440
|
+
|
|
3441
|
+
padding: var(--qti-padding-md) var(--qti-padding-lg) var(--qti-padding-md) var(--qti-padding-xl);
|
|
3442
|
+
|
|
3443
|
+
border-radius: var(--qti-border-radius-md);
|
|
3444
|
+
|
|
3445
|
+
cursor: grab;
|
|
3446
|
+
|
|
3447
|
+
background-color: white;
|
|
3448
|
+
|
|
3449
|
+
font-weight: var(--qti-font-weight-semibold);
|
|
3450
|
+
|
|
3451
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
3452
|
+
|
|
3453
|
+
outline: none;
|
|
3454
|
+
|
|
3455
|
+
background-image: radial-gradient(
|
|
3456
|
+
circle at center,
|
|
3457
|
+
rgb(0 0 0 / 10%) 0,
|
|
3458
|
+
rgb(0 0 0 / 20%) 2px,
|
|
3459
|
+
rgb(255 255 255 / 0%) 2px,
|
|
3460
|
+
rgb(255 255 255 / 0%) 100%
|
|
3461
|
+
);
|
|
3462
|
+
|
|
3463
|
+
background-repeat: repeat-y;
|
|
3464
|
+
|
|
3465
|
+
background-position: left center;
|
|
3466
|
+
|
|
3467
|
+
background-size: 14px 8px
|
|
3468
|
+
}
|
|
3469
|
+
|
|
3470
|
+
/* display: flex;
|
|
3471
|
+
overflow: hidden;
|
|
3472
|
+
align-items: center; */
|
|
3473
|
+
|
|
3474
|
+
/* &::part(drop-container) {
|
|
3475
|
+
display: flex;
|
|
3476
|
+
flex-direction: column;
|
|
3477
|
+
gap: var(--qti-gap-size);
|
|
3478
|
+
} */
|
|
3479
|
+
|
|
3480
|
+
&::part(drop-list) {
|
|
3481
|
+
|
|
3482
|
+
display: grid;
|
|
3483
|
+
height: 3rem;
|
|
3484
|
+
min-width: 10rem;
|
|
3485
|
+
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="7" stroke="%23CCCCCC" stroke-width="1" fill="transparent" /></svg>')
|
|
3486
|
+
center no-repeat;
|
|
3487
|
+
border-radius: var(--qti-border-radius-lg);
|
|
3488
|
+
position: relative;
|
|
3489
|
+
background-color: var(--qti-bg-white);
|
|
3490
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
3491
|
+
outline: none;
|
|
3492
|
+
}
|
|
3493
|
+
|
|
3494
|
+
&::part(drop-list):focus {
|
|
3495
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
3496
|
+
}
|
|
3497
|
+
|
|
3498
|
+
&::part(drop-list)[dragging] {
|
|
3499
|
+
border-color: var(--qti-bg-primary);
|
|
3500
|
+
}
|
|
3501
|
+
|
|
3502
|
+
/* &::part(drop-list) {
|
|
3503
|
+
@apply act;
|
|
3504
|
+
} */
|
|
3505
|
+
}
|
|
3506
|
+
|
|
3507
|
+
qti-graphic-order-interaction {
|
|
3508
|
+
& qti-hotspot-choice {
|
|
3509
|
+
|
|
3510
|
+
&:hover {
|
|
3511
|
+
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
|
|
3512
|
+
}
|
|
3513
|
+
|
|
3514
|
+
&:focus {
|
|
3515
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
3516
|
+
}
|
|
3517
|
+
|
|
3518
|
+
&[aria-checked='true'] {
|
|
3519
|
+
border-color: var(--qti-bg-primary);
|
|
3520
|
+
}
|
|
3521
|
+
|
|
3522
|
+
&[aria-readonly='true'] {
|
|
3523
|
+
cursor: pointer;
|
|
3524
|
+
background-color: white;
|
|
3525
|
+
outline: 0;
|
|
3526
|
+
border: none;
|
|
3527
|
+
}
|
|
3528
|
+
|
|
3529
|
+
&[aria-disabled='true'] {
|
|
3530
|
+
cursor: not-allowed;
|
|
3531
|
+
background-color: var(--qti-bg-gray-100);
|
|
3532
|
+
color: var(--qti-text-gray-500);
|
|
3533
|
+
border-color: var(--qti-border-color-gray);
|
|
3534
|
+
}
|
|
3535
|
+
|
|
3536
|
+
&[aria-ordervalue] {
|
|
3537
|
+
|
|
3538
|
+
display: flex;
|
|
3539
|
+
justify-content: center;
|
|
3540
|
+
align-items: center;
|
|
3541
|
+
background-color: var(--qti-bg-primary);
|
|
3542
|
+
border-radius: var(--qti-border-radius-full);
|
|
3543
|
+
width: 1.5rem;
|
|
3544
|
+
height: 1.5rem;
|
|
3545
|
+
color: var(--qti-text-white);
|
|
3546
|
+
}
|
|
3547
|
+
|
|
3548
|
+
&[aria-ordervalue]::after {
|
|
3549
|
+
content: attr(aria-ordervalue) !important;
|
|
3550
|
+
}
|
|
3551
|
+
|
|
3552
|
+
width: 100%;
|
|
3553
|
+
|
|
3554
|
+
height: 100%;
|
|
3555
|
+
|
|
3556
|
+
background-color: transparent;
|
|
3557
|
+
|
|
3558
|
+
padding: 0;
|
|
3559
|
+
|
|
3560
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
3561
|
+
|
|
3562
|
+
outline: none
|
|
3563
|
+
}
|
|
3564
|
+
}
|
|
3565
|
+
|
|
3566
|
+
qti-graphic-associate-interaction {
|
|
3567
|
+
position: relative;
|
|
3568
|
+
display: block;
|
|
3569
|
+
|
|
3570
|
+
& qti-associable-hotspot {
|
|
3571
|
+
&[shape='circle'] {
|
|
3572
|
+
|
|
3573
|
+
&:hover {
|
|
3574
|
+
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
|
|
3575
|
+
}
|
|
3576
|
+
|
|
3577
|
+
&:focus {
|
|
3578
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
3579
|
+
}
|
|
3580
|
+
|
|
3581
|
+
&[aria-checked='true'] {
|
|
3582
|
+
border-color: var(--qti-bg-primary);
|
|
3583
|
+
}
|
|
3584
|
+
|
|
3585
|
+
&[aria-readonly='true'] {
|
|
3586
|
+
cursor: pointer;
|
|
3587
|
+
background-color: white;
|
|
3588
|
+
outline: 0;
|
|
3589
|
+
border: none;
|
|
3590
|
+
}
|
|
3591
|
+
|
|
3592
|
+
&[aria-disabled='true'] {
|
|
3593
|
+
cursor: not-allowed;
|
|
3594
|
+
background-color: var(--qti-bg-gray-100);
|
|
3595
|
+
color: var(--qti-text-gray-500);
|
|
3596
|
+
border-color: var(--qti-border-color-gray);
|
|
3597
|
+
}
|
|
3598
|
+
|
|
3599
|
+
width: 100%;
|
|
3600
|
+
|
|
3601
|
+
height: 100%;
|
|
3602
|
+
|
|
3603
|
+
background-color: transparent;
|
|
3604
|
+
|
|
3605
|
+
padding: 0;
|
|
3606
|
+
|
|
3607
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
3608
|
+
|
|
3609
|
+
outline: none
|
|
3610
|
+
}
|
|
3611
|
+
|
|
3612
|
+
&[shape='square'] {
|
|
3613
|
+
|
|
3614
|
+
&:hover {
|
|
3615
|
+
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
|
|
3616
|
+
}
|
|
3617
|
+
|
|
3618
|
+
&:focus {
|
|
3619
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
3620
|
+
}
|
|
3621
|
+
|
|
3622
|
+
&[aria-checked='true'] {
|
|
3623
|
+
border-color: var(--qti-bg-primary);
|
|
3624
|
+
}
|
|
3625
|
+
|
|
3626
|
+
&[aria-readonly='true'] {
|
|
3627
|
+
cursor: pointer;
|
|
3628
|
+
background-color: white;
|
|
3629
|
+
outline: 0;
|
|
3630
|
+
border: none;
|
|
3631
|
+
}
|
|
3632
|
+
|
|
3633
|
+
&[aria-disabled='true'] {
|
|
3634
|
+
cursor: not-allowed;
|
|
3635
|
+
background-color: var(--qti-bg-gray-100);
|
|
3636
|
+
color: var(--qti-text-gray-500);
|
|
3637
|
+
border-color: var(--qti-border-color-gray);
|
|
3638
|
+
}
|
|
3639
|
+
|
|
3640
|
+
width: 100%;
|
|
3641
|
+
|
|
3642
|
+
height: 100%;
|
|
3643
|
+
|
|
3644
|
+
background-color: transparent;
|
|
3645
|
+
|
|
3646
|
+
padding: 0;
|
|
3647
|
+
|
|
3648
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
3649
|
+
|
|
3650
|
+
outline: none
|
|
3651
|
+
}
|
|
3652
|
+
}
|
|
3653
|
+
}
|
|
3654
|
+
|
|
3655
|
+
qti-graphic-gap-match-interaction {
|
|
3656
|
+
position: relative;
|
|
3657
|
+
|
|
3658
|
+
& img {
|
|
3659
|
+
margin: 0;
|
|
3660
|
+
padding: 0;
|
|
3661
|
+
}
|
|
3662
|
+
}
|
|
3663
|
+
|
|
3664
|
+
qti-slider-interaction {
|
|
3665
|
+
display: block;
|
|
3666
|
+
|
|
3667
|
+
--qti-tick-color: rgb(229 231 235 / 100%);
|
|
3668
|
+
--qti-tick-width: 1px;
|
|
3669
|
+
|
|
3670
|
+
&::part(slider) {
|
|
3671
|
+
margin-left: 2rem; /* mx-8 */
|
|
3672
|
+
margin-right: 2rem;
|
|
3673
|
+
padding-bottom: 1rem; /* pb-4 */
|
|
3674
|
+
padding-top: 1.25rem; /* pt-5 */
|
|
3675
|
+
}
|
|
3676
|
+
|
|
3677
|
+
--show-bounds: true;
|
|
3678
|
+
|
|
3679
|
+
&::part(bounds) {
|
|
3680
|
+
display: flex;
|
|
3681
|
+
width: 100%;
|
|
3682
|
+
justify-content: space-between;
|
|
3683
|
+
margin-bottom: 0.5rem; /* mb-2 */
|
|
3684
|
+
}
|
|
3685
|
+
|
|
3686
|
+
--show-ticks: true;
|
|
3687
|
+
|
|
3688
|
+
&::part(ticks) {
|
|
3689
|
+
margin-left: 0.125rem; /* mx-0.5 */
|
|
3690
|
+
margin-right: 0.125rem;
|
|
3691
|
+
margin-bottom: 0.25rem; /* mb-1 */
|
|
3692
|
+
height: 0.5rem; /* h-2 */
|
|
3693
|
+
background-position: 0 center;
|
|
3694
|
+
background: linear-gradient(to right, var(--qti-tick-color) var(--qti-tick-width), transparent 1px) repeat-x;
|
|
3695
|
+
background-size: calc(calc(100% - var(--qti-tick-width)) / ((var(--max) - var(--min)) / var(--step))) 100%;
|
|
3696
|
+
}
|
|
3697
|
+
|
|
3698
|
+
&::part(rail) {
|
|
3699
|
+
display: flex;
|
|
3700
|
+
align-items: center;
|
|
3701
|
+
box-sizing: border-box;
|
|
3702
|
+
height: 0.375rem; /* h-1.5 */
|
|
3703
|
+
width: 100%;
|
|
3704
|
+
cursor: pointer;
|
|
3705
|
+
border-radius: 9999px; /* rounded-full */
|
|
3706
|
+
border: 1px solid #d1d5db; /* border-gray-300 */
|
|
3707
|
+
background-color: #e5e7eb; /* bg-gray-200 */
|
|
3708
|
+
}
|
|
3709
|
+
|
|
3710
|
+
&::part(knob) {
|
|
3711
|
+
background-color: var(--qti-primary);
|
|
3712
|
+
position: relative;
|
|
3713
|
+
height: 1rem; /* h-4 */
|
|
3714
|
+
width: 1rem; /* w-4 */
|
|
3715
|
+
transform-origin: center;
|
|
3716
|
+
transform: translateX(-50%);
|
|
3717
|
+
cursor: pointer;
|
|
3718
|
+
border-radius: 9999px; /* rounded-full */
|
|
3719
|
+
left: var(--value-percentage);
|
|
3720
|
+
}
|
|
3721
|
+
|
|
3722
|
+
--show-value: true;
|
|
3723
|
+
|
|
3724
|
+
&::part(value) {
|
|
3725
|
+
position: absolute;
|
|
3726
|
+
bottom: 2rem; /* bottom-8 */
|
|
3727
|
+
left: 0.5rem; /* left-2 */
|
|
3728
|
+
transform: translateX(-50%);
|
|
3729
|
+
cursor: pointer;
|
|
3730
|
+
border-radius: 0.25rem; /* rounded */
|
|
3731
|
+
background-color: #f3f4f6; /* bg-gray-100 */
|
|
3732
|
+
padding: 0.25rem 0.5rem; /* px-2 py-1 */
|
|
3733
|
+
text-align: center;
|
|
3734
|
+
color: #6b7280; /* text-gray-500 */
|
|
3735
|
+
}
|
|
3736
|
+
}
|
|
3737
|
+
|
|
3738
|
+
qti-select-point-interaction {
|
|
3739
|
+
&::part(point) {
|
|
3740
|
+
&:hover {
|
|
3741
|
+
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
|
|
3742
|
+
}
|
|
3743
|
+
|
|
3744
|
+
&:focus {
|
|
3745
|
+
outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
|
|
3746
|
+
}
|
|
3747
|
+
|
|
3748
|
+
border-radius: var(--qti-border-radius-full);
|
|
3749
|
+
|
|
3750
|
+
width: 1.5rem;
|
|
3751
|
+
|
|
3752
|
+
height: 1.5rem;
|
|
3753
|
+
|
|
3754
|
+
background-color: transparent;
|
|
3755
|
+
|
|
3756
|
+
padding: 0;
|
|
3757
|
+
|
|
3758
|
+
border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
|
|
3759
|
+
|
|
3760
|
+
outline: none;
|
|
3761
|
+
}
|
|
3762
|
+
}
|
|
3763
|
+
|
|
3764
|
+
qti-position-object-stage {
|
|
3765
|
+
& qti-position-object-interaction {
|
|
3766
|
+
/* no styles necessary, only layout styles, defined in the component */
|
|
3767
|
+
}
|
|
3768
|
+
}
|
|
3769
|
+
|
|
3770
|
+
qti-prompt {
|
|
3771
|
+
margin: 0.5rem 0; /* my-2 */
|
|
3772
|
+
display: block;
|
|
3773
|
+
width: 100%;
|
|
3774
|
+
}
|
|
3775
|
+
}
|
|
3776
|
+
|
|
3777
|
+
/* utilities */
|
|
3778
|
+
|
|
3779
|
+
/* @import './styles/qti-utilities/qti-styles'; */
|
|
3780
|
+
|
|
3781
|
+
/* variants */
|
|
3782
|
+
|
|
3783
|
+
/* @import './styles/qti-variants/qti-input-width'; */
|
|
3784
|
+
|
|
3785
|
+
/* @import './styles/qti-variants/qti-interactions'; */
|
|
3786
|
+
`;var V,qe,vt,yt,zr=class extends HTMLElement{constructor(){super(...arguments);qt(this,qe);qt(this,V,null);qt(this,yt,e=>{e.stopImmediatePropagation(),e.stopPropagation(),this.dispatchEvent(new CustomEvent("qti-item-variables-changed",{bubbles:!1,detail:{variables:R(this,qe,vt).variables}}))})}set xmlDoc(e){if(!R(this,V)){Wr(this,V,this.attachShadow({mode:"open"}));let r=new CSSStyleSheet;r.replaceSync(Xi),R(this,V).adoptedStyleSheets=[r],R(this,V).innerHTML="",R(this,V).addEventListener("qti-interaction-changed",R(this,yt)),R(this,V).addEventListener("qti-outcome-changed",R(this,yt))}R(this,V).innerHTML="",R(this,V).appendChild(e.cloneNode(!0))}processResponse(){var e,r;(r=(e=R(this,qe,vt))==null?void 0:e.variables)!=null&&r.processResponse()||console.warn("No qti-assessment-item found")}get variables(){var e;return((e=R(this,qe,vt))==null?void 0:e.variables)||console.warn("No qti-assessment-item found")}set variables(e){R(this,qe,vt).variables=e}attributeChangedCallback(e,r,i){switch(e){case"view":break;default:r!==i&&(this[e]=i);break}}};V=new WeakMap,qe=new WeakSet,vt=function(){return R(this,V).querySelector("qti-assessment-item")||console.warn("No qti-assessment-item found")},yt=new WeakMap;customElements.define("qti-item",zr);var Yi=s=>s.endsWith("/")?s:`${s}/`,jf=async(s,t,e=!0)=>{let r=Yi(s),i=await ur().load(`${r}imsmanifest.xml`).then(c=>c.assessmentTest()),o=await $t().load(`${r}${i.href}`).then(c=>c.items()),n=`${r}${i.href.substring(0,i.href.lastIndexOf("/"))}/${o[t].href}`,a=await Ze().load(n,e).then(c=>c.path(n.substring(0,n.lastIndexOf("/"))).stripStyleSheets());return{itemHTMLDoc:a.htmldoc(),itemHTML:a.html(),items:o}},Xf=async s=>{let t=Yi(s),e=await ur().load(`${t}imsmanifest.xml`).then(c=>c.assessmentTest()),r=await $t().load(`${t}${e.href}`).then(c=>c.htmldoc()),i=await $t().load(`${t}${e.href}`).then(c=>c.items()),n=`${t.substring(0,t.lastIndexOf("/"))}/${e.href.substring(0,e.href.lastIndexOf("/"))}`,a=`${n}/${i[0].href.substring(0,i[0].href.lastIndexOf("/"))}`;return{assessmentXML:r,itemLocation:a,assessmentLocation:n,items:i,testIdentifier:e.identifier}},Yf=async(s,t=!0)=>Ze().load(s,t).then(e=>e.path(s.substring(0,s.lastIndexOf("/"))).stripStyleSheets().html());export{U as ActiveElementMixin,T as Interaction,at as QtPrintedVariable,jt as QtiAnd,$ as QtiAssessmentItem,Ae as QtiAssessmentStimulusRef,gt as QtiAssociableHotspot,Le as QtiAssociateInteraction,Xt as QtiBaseValue,Re as QtiChoiceInteraction,Pt as QtiCompanionMaterialsInfo,P as QtiConditionExpression,kr as QtiContains,Nt as QtiContentBody,Tr as QtiCorrect,K as QtiCustomInteraction,ut as QtiCustomOperator,$e as QtiEndAttemptInteraction,Wt as QtiEqual,Yt as QtiEqualRounded,x as QtiExpression,X as QtiExtendedTextInteraction,Qe as QtiFeedbackBlock,et as QtiFeedbackInline,He as QtiGap,Pe as QtiGapImg,lt as QtiGapMatchInteraction,Ne as QtiGapText,Z as QtiGraphicAssociateInteraction,ct as QtiGraphicGapMatchInteraction,dt as QtiGraphicOrderInteraction,Ar as QtiGt,_r as QtiGte,Ve as QtiHotspotChoice,pt as QtiHotspotInteraction,ft as QtiHottext,zt as QtiHottextInteraction,bt as QtiInlineChoice,de as QtiInlineChoiceInteraction,Sr as QtiIsNull,Bt as QtiLookupOutcomeValue,Rr as QtiLt,Mr as QtiLte,Kt as QtiMapResponse,Me as QtiMapping,Lr as QtiMatch,me as QtiMatchInteraction,ht as QtiMediaInteraction,$r as QtiMember,tt as QtiModalFeedback,Dr as QtiMultiple,Hr as QtiNot,Pr as QtiOr,re as QtiOrderInteraction,Nr as QtiOrdered,z as QtiOutcomeDeclaration,st as QtiOutcomeProcessing,xr as QtiOutcomeProcessingProcessor,pe as QtiPortableCustomInteraction,mt as QtiPositionObjectStage,Vr as QtiProduct,Dt as QtiPrompt,qr as QtiResponseCondition,ee as QtiResponseDeclaration,ot as QtiResponseElse,Cr as QtiResponseElseIf,nt as QtiResponseIf,xe as QtiResponseProcessing,F as QtiRubricBlock,Y as QtiRule,Qt as QtiSPositionObjectInteraction,ue as QtiSelectPointInteraction,wr as QtiSetOutcomeValue,Er as QtiSetOutcomeValueRule,he as QtiSimpleAssociableChoice,Ie as QtiSimpleChoice,M as QtiSliderInteraction,Zt as QtiStringMatch,Ht as QtiStylesheet,Ir as QtiSum,Or as QtiSumExpression,H as QtiTextEntryInteraction,Ur as QtiVariable,Xf as getAssessmentData,jf as getItemByIndex,Yf as getItemByUri,O as itemContext,Ci as itemContextVariables,_s as qtiAndMixin,Ze as qtiTransformItem,ur as qtiTransformManifest,$t as qtiTransformTest};
|
|
523
3787
|
/*! Bundled license information:
|
|
524
3788
|
|
|
525
3789
|
@lit/context/lib/context-request-event.js:
|