Security fix to stop students being able to see the attendance records of other students.
Security fix changed to use mod/attendance:viewreports capability.

Refactored the code.
changed to use require
Merge pull request #8 from NeillM/view-security-fix

Security fix for unprivileged access to attendance records