const { ccclass, property } = cc._decorator;

@ccclass
export default class InputQuestionItem extends cc.Component {

    @property(cc.Label)
    labelIndex: cc.Label = null;

    @property(cc.Label)
    labelQuestion: cc.Label = null;

    @property(cc.EditBox)
    customInput: cc.EditBox = null;

    private questionID: number = 0;
    // LIFE-CYCLE CALLBACKS:

    onLoad() {

    }

    start() {

    }

    loadData(index, data) {
        this.questionID = Number(data.id)
        this.labelIndex.string = "" + index
        this.labelQuestion.string = data.question
    }

    getResult() {
        return { id: this.questionID, input: this.customInput.string }
    }

    reset() {
        this.customInput.string = ""
    }
    // update (dt) {}
}
