original_string: public function instance_config_save($data, $nolongerused = false) {
          global $DB;
          if (empty($data->activitygradeitemid)) {
              // Figure out info about parent module.
              $info = $this->get_owning_activity();
              $data->activitygradeitemid = $info->id;
              if ($info->id < 1) {
                  // No activity was selected.
                  $info->itemmodule = '';
                  $info->iteminstance = '';
              } else {
                  $data->activityparent = $info->itemmodule;
                  $data->activityparentid = $info->iteminstance;
              }
          } else {
              // Lookup info about the parent module (we have the id from mdl_grade_items.
              $info = $DB->get_record('grade_items', array('id' => $data->activitygradeitemid));
              $data->activityparent = $info->itemmodule;
              $data->activityparentid = $info->iteminstance;
          }
          parent::instance_config_save($data);
      }
code: public function instance_config_save($data, $nolongerused = false) {
          global $DB;
          if (empty($data->activitygradeitemid)) {
              // Figure out info about parent module.
              $info = $this->get_owning_activity();
              $data->activitygradeitemid = $info->id;
              if ($info->id < 1) {
                  // No activity was selected.
                  $info->itemmodule = '';
                  $info->iteminstance = '';
              } else {
                  $data->activityparent = $info->itemmodule;
                  $data->activityparentid = $info->iteminstance;
              }
          } else {
              // Lookup info about the parent module (we have the id from mdl_grade_items.
              $info = $DB->get_record('grade_items', array('id' => $data->activitygradeitemid));
              $data->activityparent = $info->itemmodule;
              $data->activityparentid = $info->iteminstance;
          }
          parent::instance_config_save($data);
      }
code_tokens: public function instance_config_save ( $ data , $ nolongerused = false ) { global $ DB ; if ( empty ( $ data -> activitygradeitemid ) ) { // Figure out info about parent module. $ info = $ this -> get_owning_activity ( ) ; $ data -> activitygradeitemid = $ info -> id ; if ( $ info -> id < 1 ) { // No activity was selected. $ info -> itemmodule = '' ; $ info -> iteminstance = '' ; } else { $ data -> activityparent = $ info -> itemmodule ; $ data -> activityparentid = $ info -> iteminstance ; } } else { // Lookup info about the parent module (we have the id from mdl_grade_items. $ info = $ DB -> get_record ( 'grade_items' , array ( 'id' => $ data -> activitygradeitemid ) ) ; $ data -> activityparent = $ info -> itemmodule ; $ data -> activityparentid = $ info -> iteminstance ; } parent :: instance_config_save ( $ data ) ; }
docstring: Used to save the form config data
  @param stdclass $data
  @param bool $nolongerused
docstring_tokens: Used to save the form config data