original_string: public function apply_forced_settings() {
          global $CFG;
  
          $updated = false;
  
          foreach ($this->forceable as $property) {
  
              if (isset($CFG->{"grade_$property"}) and isset($CFG->{"grade_{$property}_flag"}) and
                                                      ((int) $CFG->{"grade_{$property}_flag"} & 1)) {
  
                  if ($CFG->{"grade_$property"} == -1) {
                      continue; //temporary bc before version bump
                  }
                  $this->$property = $CFG->{"grade_$property"};
                  $updated = true;
              }
          }
  
          return $updated;
      }
code: public function apply_forced_settings() {
          global $CFG;
  
          $updated = false;
  
          foreach ($this->forceable as $property) {
  
              if (isset($CFG->{"grade_$property"}) and isset($CFG->{"grade_{$property}_flag"}) and
                                                      ((int) $CFG->{"grade_{$property}_flag"} & 1)) {
  
                  if ($CFG->{"grade_$property"} == -1) {
                      continue; //temporary bc before version bump
                  }
                  $this->$property = $CFG->{"grade_$property"};
                  $updated = true;
              }
          }
  
          return $updated;
      }
code_tokens: public function apply_forced_settings ( ) { global $ CFG ; $ updated = false ; foreach ( $ this -> forceable as $ property ) { if ( isset ( $ CFG -> { "grade_$property" } ) and isset ( $ CFG -> { "grade_{$property}_flag" } ) and ( ( int ) $ CFG -> { "grade_{$property}_flag" } & 1 ) ) { if ( $ CFG -> { "grade_$property" } == - 1 ) { continue ; //temporary bc before version bump } $ this -> $ property = $ CFG -> { "grade_$property" } ; $ updated = true ; } } return $ updated ; }
docstring: Applies forced settings on this category
  
  @return bool True if anything changed
docstring_tokens: Applies forced settings on this category