I have a doubt.
This method, described below, by moodlelib is what resets course data for all students to do again:
reset_course_userdata ($ data)
There would be another method of Moodle where I can send the course id and the user id so that I can reset only the registration information, grade, student mod run of a course, etc. student and specific course, so you can re-enroll without having to create the full range of delete tables in Moodle.
General help
Doubt how to reset a course through the courseid and userid parameters
This discussion has been locked so you can no longer reply to it.