Hi Zohra,
There is a good introduction to using calculations in this section of the Rapid Course.
Of course the exact solution depends on your domain model, but in general you would want to retrieve a list of objects and then select to aggregate (eg count, avg) or use operations (eg filter, equals).
The first you should be able to retrieve the associated student registrations (expecting you would store passed/failed there) from a training course and filter the list only to show the passed (or use an xpath in the retrieve to only return the the 'passed' objects.
For the second I would think you would want to count the number of registrations related to a student (similar logic to the Rapid Course section) and use that value to show/hide a 'add registration' button.
There are other solutions, I could think of, but these should be pretty easy to implement.