"use strict";(self.webpackChunkWebComponents=self.webpackChunkWebComponents||[]).push([[964],{8152:(e,t,r)=>{r.d(t,{s:()=>s});class s{constructor(e){const t=new DOMParser;this.doc=t.parseFromString(e,"text/html");const r=this.doc.querySelector("parsererror");if(r)throw new Error("XML parse error: "+r.textContent)}getStatement(){const e=this.doc.querySelector("statement");return e?e.innerHTML.trim():""}getFeedback(){const e=this.doc.querySelector("feedback");return e?e.innerHTML.trim():""}itemsFrom(e){return Array.from(this.doc.querySelectorAll(e)).map((e=>{const t=e.querySelector("id"),r=e.querySelector("label");return{id:t?t.textContent.trim():"",label:r?r.innerHTML.trim():""}}))}correctAnswers(){throw new Error("correctAnswers() must be implemented by a subclass of QuestionXmlConverter")}toJson(){return{statement:this.getStatement(),feedback:this.getFeedback(),left:this.itemsFrom("premise"),right:this.itemsFrom("response"),correctAnswers:this.correctAnswers()}}}}}]);
//# sourceMappingURL=964.55f4f071af7d959f.js.map