original_string: 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;
              }
          }
      }
code: 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;
              }
          }
      }
code_tokens: 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 ; } } }
docstring: Set the fields of this object from the form data.
  @param object $fromform The data from $mform->get_data() from the settings form.
docstring_tokens: Set the fields of this object from the form data .