If you want your teacher role assigned only in specific courses, just assign the teacher role at course level. To do that create a course first, then manually enroll the user you want with teacher role as you would do for any other manual course enrollment, making sure you select the teacher role when manually enrolling instead of student role (which should be the default).
Teacher role by default can be assigned at course level, so you should have no problem in selecting that role during manual enrollments in course contexts.
Roles and permissions
Cant assign teacher role to any user
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.