You could use the ‘ShowByCondition’ widget. The widget allows you to hide a parent container by returning true or false from a nano- or microflow.
Link: https://appstore.home.mendix.com/link/app/2539/
If you don’t want to rely on a widget you could use a dataview with a Nanoflow datasource where you retrieve the registration that is associated to the current user and the course. Inside the dataview you can use the expression ‘$currentObject = empty’ to show content when the registration does not exist.