fixed Attendance to generate random IDs and cleaned up some queries