(Student result / out of how many marks) * 100 : This will give you the percentage of what the student got.
If percentage is above certain limit { pass } else { fail }.

Controller for entities...