I'm attaching some screenshots and will add another reply with your template with another action added to your rule on course ID.
This is what the XPath for the filter looks like - User from the secondary data source is equal to user from the primary data source:
../d:User = xdXDocument:get-DOM()/my:myFields/my:User
I'm not 100% confident that this is correct - I would think that what you want to know is if the user is registered for this particular course - but it looks like you may be querying for just this course's data, so this may be just fine.