Users Modules

As Entities

Modules themselves are not specific to any particular academic year, they in effect last forever. A record in the modules table holds information such as module code, title, school, etc.

Note: The modules_staff and modules_student linking tables join using the primary key ID of the modules table. Do not confuse this number with the module code which is sometimes referred to as ID (e.g. A11CLS).

Staff

Staff are placed on modules to form editing teams. The table modules_staff is used as a linking table between staff in the users table and module IDs in the modules table.

Useful Functions

Generic (userutils.class.php):

add_staff_to_module_by_modulecodeAdd a member of staff onto a team by module code.
clear_staff_modules_by_moduleIDClear all users (staff) from a team.
list_staff_modules_by_userIDLists the teams a user ID is on (uses the user object for the curent users use this if we are not dealing with the logged in user)
clear_staff_modules_by_userIDClear a user (staff) from all teams.
get_staff_modules_list_by_modIDGet a list of members of a team (using Module ID).
get_staff_modules_list_by_nameGet a list of members of a team (using Module Code).

Current user (userobject.class.php):

get_staff_modulesGet a list of modules the current member of staff is on.
is_staff_user_on_moduleReturns true or false if the current member of staff is on a module(s).
get_staff_accessable_modulesReturns a list of modules the current member of staff can access. With Admin role this can be larger than the modules the current use is actually a member of.

Students

Students are enrolled on particular modules in specific academic years. The table modules_student is used as a linking table between students in the users table and module IDs in the modules table. One difference to the staff modules (see above) is the inclusion of the calendar_year field which holds which academic year the module pertains to.

Useful Functions

Generic (userutils.class.php):

add_student_to_module_by_nameEnrole a student on a module (by Module Code).
add_student_to_moduleEnrole a student on a module (by Module ID).
clear_student_modules_by_userIDClear a user (student) from all modules for that session and attempt.
is_user_on_module_by_nameTest to see if a student is on a module by module code.
is_user_on_moduleTest to see if a student is on a module (by Module ID).