protected function generate_modgrade_subelement_id($subname) {
        $gid = str_replace(array('[', ']'), array('_', ''), $this->getName());
        return clean_param('id_'.$gid.'_'.$subname, PARAM_ALPHANUMEXT);
    }