original_string: public final function set_config($name, $value) {
          global $DB;
  
          $dbparams = array('assignment'=>$this->assignment->get_instance()->id,
                            'subtype'=>$this->get_subtype(),
                            'plugin'=>$this->get_type(),
                            'name'=>$name);
          $current = $DB->get_record('assign_plugin_config', $dbparams, '*', IGNORE_MISSING);
  
          if ($current) {
              $current->value = $value;
              return $DB->update_record('assign_plugin_config', $current);
          } else {
              $setting = new stdClass();
              $setting->assignment = $this->assignment->get_instance()->id;
              $setting->subtype = $this->get_subtype();
              $setting->plugin = $this->get_type();
              $setting->name = $name;
              $setting->value = $value;
  
              return $DB->insert_record('assign_plugin_config', $setting) > 0;
          }
      }
code: public final function set_config($name, $value) {
          global $DB;
  
          $dbparams = array('assignment'=>$this->assignment->get_instance()->id,
                            'subtype'=>$this->get_subtype(),
                            'plugin'=>$this->get_type(),
                            'name'=>$name);
          $current = $DB->get_record('assign_plugin_config', $dbparams, '*', IGNORE_MISSING);
  
          if ($current) {
              $current->value = $value;
              return $DB->update_record('assign_plugin_config', $current);
          } else {
              $setting = new stdClass();
              $setting->assignment = $this->assignment->get_instance()->id;
              $setting->subtype = $this->get_subtype();
              $setting->plugin = $this->get_type();
              $setting->name = $name;
              $setting->value = $value;
  
              return $DB->insert_record('assign_plugin_config', $setting) > 0;
          }
      }
code_tokens: public final function set_config ( $ name , $ value ) { global $ DB ; $ dbparams = array ( 'assignment' => $ this -> assignment -> get_instance ( ) -> id , 'subtype' => $ this -> get_subtype ( ) , 'plugin' => $ this -> get_type ( ) , 'name' => $ name ) ; $ current = $ DB -> get_record ( 'assign_plugin_config' , $ dbparams , '*' , IGNORE_MISSING ) ; if ( $ current ) { $ current -> value = $ value ; return $ DB -> update_record ( 'assign_plugin_config' , $ current ) ; } else { $ setting = new stdClass ( ) ; $ setting -> assignment = $ this -> assignment -> get_instance ( ) -> id ; $ setting -> subtype = $ this -> get_subtype ( ) ; $ setting -> plugin = $ this -> get_type ( ) ; $ setting -> name = $ name ; $ setting -> value = $ value ; return $ DB -> insert_record ( 'assign_plugin_config' , $ setting ) > 0 ; } }
docstring: Set a configuration value for this plugin
  
  @param string $name The config key
  @param string $value The config value
  @return bool
docstring_tokens: Set a configuration value for this plugin