- In the distance learning projects, the Universidade Federal de Santa Catarina offer courses to students all over the country, and they are grouped in "poles", that are places (schools and other government buildings) where they go to get presencial help from tutors and take exams
- The students from all poles must be enrolled in various disciplines, creating classes. Each of these classes have 300 to 500 students. To facilitate the process of take care of students, we create a group for each pole in each course, and enroll the students and tutors, so it's easier to teachers or tutors to interact with students of a specific pole.
what we have:
- There is the institutional database, we call it CAGR (from portuguese Controle Academico da GRaduação). It is a big and slow sybase database. In this database are the oficial records of students, classes, poles, courses, etc.
- There is the moodle installation, let's call it moodle. It is in a fast and robust MySQL server.
what we do:
- Fetch students,teachers and tutors from CAGR and create them as users.
- Fetch courses,disciplines,poles and relation between them. We create institutional courses as categories, disciplines as moodle courses, and poles as groups
- We fetch the relations between people an their roles in disciplines or courses and role_assign them at course or category level
- We fetch the relations between people and poles, and group_add_member them.
The enrollments in courses,categories and groups are ok, we can join with the need tables, and iterate over the registers that is not in the moodle.
The unenrollments from courses and categories are as easy, we do a left join and iterate over the registers that are in moodle and are not in CAGR, but the "enrol" field of "role_assignment" is the one defined by our script.
The problem is to remove users from groups. There is some users that phisically move from one pole to another, and so must be removed from the first group and added to the second. We cannot just remove users from all groups and add to the new one, because there are some groups that are manually created, and also, the teacher can manually add people to these groups (both automatic or manually created), and these manual enrollments must be preserved.
So, to make the process as easy as the unenroll from courses, we have added the field "enrol" to groups_members table.