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
    }