original_string: protected function process_grade_letter($data) {
          global $DB;
  
          $data['contextid'] = $this->task->get_contextid();
          $gradeletter = (object)$data;
  
          // Check if it exists before adding it
          unset($data['id']);
          if (!$DB->record_exists('grade_letters', $data)) {
              $newitemid = $DB->insert_record('grade_letters', $gradeletter);
          }
          // no need to save any grade_letter mapping
      }
code: protected function process_grade_letter($data) {
          global $DB;
  
          $data['contextid'] = $this->task->get_contextid();
          $gradeletter = (object)$data;
  
          // Check if it exists before adding it
          unset($data['id']);
          if (!$DB->record_exists('grade_letters', $data)) {
              $newitemid = $DB->insert_record('grade_letters', $gradeletter);
          }
          // no need to save any grade_letter mapping
      }
code_tokens: protected function process_grade_letter ( $ data ) { global $ DB ; $ data [ 'contextid' ] = $ this -> task -> get_contextid ( ) ; $ gradeletter = ( object ) $ data ; // Check if it exists before adding it unset ( $ data [ 'id' ] ) ; if ( ! $ DB -> record_exists ( 'grade_letters' , $ data ) ) { $ newitemid = $ DB -> insert_record ( 'grade_letters' , $ gradeletter ) ; } // no need to save any grade_letter mapping }
docstring: process activity grade_letters. Note that, while these are possible,
  because grade_letters are contextid based, in practice, only course
  context letters can be defined. So we keep here this method knowing
  it won't be executed ever. gradebook restore will restore course letters.
docstring_tokens: process activity grade_letters . Note that while these are possible because grade_letters are contextid based in practice only course context letters can be defined . So we keep here this method knowing it won t be executed ever . gradebook restore will restore course letters .