import{QuestionElement as e}from"./QuestionElement.js";class TrueFalseQuestion extends e{static get tag(){return"true-false-question"}constructor(){super(),this._tfanswer=null,this.singleOption=!0}static get haxProperties(){return new URL(`./${this.tag}.haxProperties.json`,import.meta.url).href}static get properties(){return{...super.properties,_tfanswer:{type:String}}}updated(e){if(super.updated(e),e.has("_tfanswer")){if(this.answers.length>0&&null===this._tfanswer){let e=this.answers.findIndex((e=>!0===e.correct));0===e?this._tfanswer="true":1===e&&(this._tfanswer="false")}null!==this._tfanswer&&("true"===this._tfanswer?(this.answers[0].correct=!0,this.answers[1].correct=!1):"false"===this._tfanswer&&(this.answers[0].correct=!1,this.answers[1].correct=!0))}}}globalThis.customElements.define(TrueFalseQuestion.tag,TrueFalseQuestion);export{TrueFalseQuestion};