import { _decorator, Component, Label, Node, Toggle } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('question_item')
export class question_item extends Component {
    @property(Node) lab_question_item:Node;
    @property(Node) check_box:Node;
    @property(Node) btn_check:Node;
    private m_isRight = false;
    public initView(item_title:string,is_right,call_back){
        this.m_isRight = is_right;
        this.lab_question_item.getComponent(Label).string = item_title;
        this.check_box.getComponent(Toggle).isChecked = false;
        this.btn_check.on(Node.EventType.TOUCH_END,()=>{
            this.check_box.getComponent(Toggle).isChecked = true;
            call_back(this.m_isRight)
        })
    }
}


