public function setup_from_form_data($fromform) {
        $this->attempts   = $fromform->attempts;
        $this->group      = groups_get_activity_group($this->cm, true);
        $this->onlygraded = !empty($fromform->onlygraded);
        $this->pagesize   = $fromform->pagesize;

        $this->states = array();
        foreach (self::$statefields as $field => $state) {
            if (!empty($fromform->$field)) {
                $this->states[] = $state;
            }
        }
    }
public function setup_from_form_data($fromform) {
        $this->attempts   = $fromform->attempts;
        $this->group      = groups_get_activity_group($this->cm, true);
        $this->onlygraded = !empty($fromform->onlygraded);
        $this->pagesize   = $fromform->pagesize;

        $this->states = array();
        foreach (self::$statefields as $field => $state) {
            if (!empty($fromform->$field)) {
                $this->states[] = $state;
            }
        }
    }
public function setup_from_form_data ( $ fromform ) { $ this -> attempts = $ fromform -> attempts ; $ this -> group = groups_get_activity_group ( $ this -> cm , true ) ; $ this -> onlygraded = ! empty ( $ fromform -> onlygraded ) ; $ this -> pagesize = $ fromform -> pagesize ; $ this -> states = array ( ) ; foreach ( self :: $ statefields as $ field => $ state ) { if ( ! empty ( $ fromform -> $ field ) ) { $ this -> states [ ] = $ state ; } } }
Set the fields of this object from the form data.
@param object $fromform The data from $mform->get_data() from the settings form.
Set the fields of this object from the form data .