@citolab/qti-components 6.9.1-6 → 6.9.1-7
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/custom-elements.json +56 -56
- package/dist/index.js +2 -2
- package/dist/qti-components/index.js +3 -3
- package/package.json +1 -1
|
@@ -748,6 +748,62 @@
|
|
|
748
748
|
"declarations": [],
|
|
749
749
|
"exports": []
|
|
750
750
|
},
|
|
751
|
+
{
|
|
752
|
+
"kind": "javascript-module",
|
|
753
|
+
"path": "src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts",
|
|
754
|
+
"declarations": [
|
|
755
|
+
{
|
|
756
|
+
"kind": "class",
|
|
757
|
+
"description": "Represents a custom element for referencing an assessment stimulus.",
|
|
758
|
+
"name": "QtiAssessmentStimulusRef",
|
|
759
|
+
"members": [],
|
|
760
|
+
"attributes": [
|
|
761
|
+
{
|
|
762
|
+
"name": "identifier",
|
|
763
|
+
"type": {
|
|
764
|
+
"text": "string"
|
|
765
|
+
},
|
|
766
|
+
"default": "''",
|
|
767
|
+
"description": "The identifier of the stimulus.",
|
|
768
|
+
"fieldName": "identifier"
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
"name": "href",
|
|
772
|
+
"type": {
|
|
773
|
+
"text": "string"
|
|
774
|
+
},
|
|
775
|
+
"default": "''",
|
|
776
|
+
"description": "The href of the stimulus.",
|
|
777
|
+
"fieldName": "href"
|
|
778
|
+
}
|
|
779
|
+
],
|
|
780
|
+
"superclass": {
|
|
781
|
+
"name": "LitElement",
|
|
782
|
+
"package": "lit"
|
|
783
|
+
},
|
|
784
|
+
"tagName": "qti-assessment-stimulus-ref",
|
|
785
|
+
"customElement": true
|
|
786
|
+
}
|
|
787
|
+
],
|
|
788
|
+
"exports": [
|
|
789
|
+
{
|
|
790
|
+
"kind": "js",
|
|
791
|
+
"name": "QtiAssessmentStimulusRef",
|
|
792
|
+
"declaration": {
|
|
793
|
+
"name": "QtiAssessmentStimulusRef",
|
|
794
|
+
"module": "src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts"
|
|
795
|
+
}
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
"kind": "custom-element-definition",
|
|
799
|
+
"name": "qti-assessment-stimulus-ref",
|
|
800
|
+
"declaration": {
|
|
801
|
+
"name": "QtiAssessmentStimulusRef",
|
|
802
|
+
"module": "src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts"
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
]
|
|
806
|
+
},
|
|
751
807
|
{
|
|
752
808
|
"kind": "javascript-module",
|
|
753
809
|
"path": "src/lib/qti-components/qti-assessment-item/item-print-variables.ts",
|
|
@@ -927,62 +983,6 @@
|
|
|
927
983
|
}
|
|
928
984
|
]
|
|
929
985
|
},
|
|
930
|
-
{
|
|
931
|
-
"kind": "javascript-module",
|
|
932
|
-
"path": "src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts",
|
|
933
|
-
"declarations": [
|
|
934
|
-
{
|
|
935
|
-
"kind": "class",
|
|
936
|
-
"description": "Represents a custom element for referencing an assessment stimulus.",
|
|
937
|
-
"name": "QtiAssessmentStimulusRef",
|
|
938
|
-
"members": [],
|
|
939
|
-
"attributes": [
|
|
940
|
-
{
|
|
941
|
-
"name": "identifier",
|
|
942
|
-
"type": {
|
|
943
|
-
"text": "string"
|
|
944
|
-
},
|
|
945
|
-
"default": "''",
|
|
946
|
-
"description": "The identifier of the stimulus.",
|
|
947
|
-
"fieldName": "identifier"
|
|
948
|
-
},
|
|
949
|
-
{
|
|
950
|
-
"name": "href",
|
|
951
|
-
"type": {
|
|
952
|
-
"text": "string"
|
|
953
|
-
},
|
|
954
|
-
"default": "''",
|
|
955
|
-
"description": "The href of the stimulus.",
|
|
956
|
-
"fieldName": "href"
|
|
957
|
-
}
|
|
958
|
-
],
|
|
959
|
-
"superclass": {
|
|
960
|
-
"name": "LitElement",
|
|
961
|
-
"package": "lit"
|
|
962
|
-
},
|
|
963
|
-
"tagName": "qti-assessment-stimulus-ref",
|
|
964
|
-
"customElement": true
|
|
965
|
-
}
|
|
966
|
-
],
|
|
967
|
-
"exports": [
|
|
968
|
-
{
|
|
969
|
-
"kind": "js",
|
|
970
|
-
"name": "QtiAssessmentStimulusRef",
|
|
971
|
-
"declaration": {
|
|
972
|
-
"name": "QtiAssessmentStimulusRef",
|
|
973
|
-
"module": "src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts"
|
|
974
|
-
}
|
|
975
|
-
},
|
|
976
|
-
{
|
|
977
|
-
"kind": "custom-element-definition",
|
|
978
|
-
"name": "qti-assessment-stimulus-ref",
|
|
979
|
-
"declaration": {
|
|
980
|
-
"name": "QtiAssessmentStimulusRef",
|
|
981
|
-
"module": "src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts"
|
|
982
|
-
}
|
|
983
|
-
}
|
|
984
|
-
]
|
|
985
|
-
},
|
|
986
986
|
{
|
|
987
987
|
"kind": "javascript-module",
|
|
988
988
|
"path": "src/lib/qti-components/qti-companion-materials-info/qti-companion-materials-info.ts",
|
package/dist/index.js
CHANGED
|
@@ -93,8 +93,7 @@ var Mr=Object.defineProperty,Rs=Object.defineProperties,ks=Object.getOwnProperty
|
|
|
93
93
|
position: absolute;
|
|
94
94
|
width: 100%;
|
|
95
95
|
}
|
|
96
|
-
`]}set correctResponse(e){this._correctValue=e}render(){return d`
|
|
97
|
-
<div part="correct">${this._correctValue}</div>
|
|
96
|
+
`]}set correctResponse(e){this._correctValue=e}render(){return d`
|
|
98
97
|
<input
|
|
99
98
|
part="input"
|
|
100
99
|
spellcheck="false"
|
|
@@ -110,6 +109,7 @@ var Mr=Object.defineProperty,Rs=Object.defineProperties,ks=Object.getOwnProperty
|
|
|
110
109
|
?disabled="${this.disabled}"
|
|
111
110
|
?readonly="${this.readonly}"
|
|
112
111
|
/>
|
|
112
|
+
<div part="correct">${this._correctValue}</div>
|
|
113
113
|
`}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")}};a([p({type:Number,attribute:"expected-length"})],P.prototype,"expectedLength",2),a([p({type:String,attribute:"pattern-mask"})],P.prototype,"patternMask",2),a([p({type:String,attribute:"placeholder-text"})],P.prototype,"placeholderText",2),a([E()],P.prototype,"_value",2),a([E()],P.prototype,"_correctValue",2),a([E()],P.prototype,"_size",2),a([p({type:String,attribute:"class"})],P.prototype,"classNames",2),a([S("classNames")],P.prototype,"handleclassNamesChange",1),P=a([h("qti-text-entry-interaction")],P);var R=class extends q{constructor(){super();this._choiceElements=[];this.minChoices=0;this.maxChoices=1;this._handleDisabledChange=(e,r)=>this._choiceElements.forEach(s=>s.disabled=r);this._handleReadonlyChange=(e,r)=>this._choiceElements.forEach(s=>s.readonly=r);this._handleMaxChoicesChange=()=>this._determineInputType();this.addEventListener("qti-register-choice",this._registerChoiceElement),this.addEventListener("qti-loose-choice",this._looseChoiceElement)}validate(){return this._choiceElements.reduce((r,s)=>r+(s.checked?1:0),0)>=this.minChoices}set response(e){let r=Array.isArray(e)?e:[e];this._choiceElements.forEach(s=>{s.checked=!!r.find(n=>n===s.identifier)})}set correctResponse(e){let r=Array.isArray(e)?e:[e];if(e==""){this._choiceElements.forEach(s=>{s.removeAttribute("data-correct-response")});return}this._choiceElements.forEach(s=>{s.setAttribute("data-correct-response",r.find(n=>n===s.identifier)?"true":"false")})}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-choice-element-selected",this._choiceElementSelectedHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-choice-element-selected",this._choiceElementSelectedHandler),this.removeEventListener("qti-register-choice",this._registerChoiceElement)}_registerChoiceElement(e){e.stopPropagation();let r=e.target;this._choiceElements.push(r),this._setInputType(r)}_looseChoiceElement(e){e.stopPropagation();let r=e.target;this._choiceElements.push(r),this._choiceElements=this._choiceElements.filter(s=>s!==r)}_determineInputType(){this._choiceElements.forEach(e=>{this._setInputType(e)})}_setInputType(e){this.maxChoices===1?e.setAttribute("role","radio"):e.setAttribute("role","checkbox")}_choiceElementSelectedHandler(e){this.maxChoices===1&&this._choiceElements.filter(r=>r.identifier!==e.detail.identifier).forEach(r=>{r.checked=!1}),this._choiceElementSelected()}_choiceElementSelected(){let e=this._choiceElements.filter(s=>s.checked).map(s=>s.identifier);this.maxChoices>1&&(this.maxChoices===e.length?this._choiceElements.forEach(s=>s.disabled=!s.checked):this._choiceElements.forEach(s=>s.disabled=!1));let r;this.maxChoices===1?r=e.length>0?e[0]:void 0:r=e,this.saveResponse(r)}};a([p({type:Number,attribute:"min-choices"})],R.prototype,"minChoices",2),a([p({type:Number,attribute:"max-choices"})],R.prototype,"maxChoices",2),a([S("disabled",{waitUntilFirstUpdate:!0})],R.prototype,"_handleDisabledChange",2),a([S("readonly",{waitUntilFirstUpdate:!0})],R.prototype,"_handleReadonlyChange",2),a([S("maxChoices",{waitUntilFirstUpdate:!0})],R.prototype,"_handleMaxChoicesChange",2);var Mt=class extends R{constructor(){super(...arguments);this.render=()=>d`<slot></slot>`}connectedCallback(){super.connectedCallback(),this.setAttribute("qti-hottext-interaction","")}};Mt=a([h("qti-hottext-interaction")],Mt);var Ke=class extends j{constructor(t){if(super(t),this.it=A,t.type!==oe.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===A||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:[]}}};Ke.directiveName="unsafeHTML",Ke.resultType=1;var we=ee(Ke);var ne=class extends q{constructor(){super(...arguments);this.options=[];this.correctOption="";this.dataPrompt="select"}static get styles(){return[b`
|
|
114
114
|
:host {
|
|
115
115
|
display: inline-block;
|