original_string: function write_setting($data) {
          $previous = $this->get_setting();
  
          if ($previous === null) {
              if ($data) {
                  $this->regrade_all();
              }
          } else {
              if ($data != $previous) {
                  $this->regrade_all();
              }
          }
          return ($this->config_write($this->name, $data) ? '' : get_string('errorsetting', 'admin'));
      }
code: function write_setting($data) {
          $previous = $this->get_setting();
  
          if ($previous === null) {
              if ($data) {
                  $this->regrade_all();
              }
          } else {
              if ($data != $previous) {
                  $this->regrade_all();
              }
          }
          return ($this->config_write($this->name, $data) ? '' : get_string('errorsetting', 'admin'));
      }
code_tokens: function write_setting ( $ data ) { $ previous = $ this -> get_setting ( ) ; if ( $ previous === null ) { if ( $ data ) { $ this -> regrade_all ( ) ; } } else { if ( $ data != $ previous ) { $ this -> regrade_all ( ) ; } } return ( $ this -> config_write ( $ this -> name , $ data ) ? '' : get_string ( 'errorsetting' , 'admin' ) ) ; }
docstring: Saves the new settings
  
  @param mixed $data
  @return string empty string or error message
docstring_tokens: Saves the new settings