Moodle
  1. Moodle
  2. MDL-20863

Include "enrol" field to groups_members table to identify enrol plugins that created the record

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.9.6
    • Fix Version/s: None
    • Component/s: Groups
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Rank:
      5661

      Description

      Here at Federal University of Brasil, we are developing an enroll plugin to automatic create users and courses and enroll/unenroll user in courses. Once we have the "enroll" field in role_assignments, we just do a left join with our table and know wich ones was included by our script and need to be removed.
      Now we have to enrol/unenrol user in/from groups, but we don't have that "enrol" field to identify which users were enrolled by our script and which ones was manual.
      So, i suggest (and can upload a trivial patch) to add the field "enrol VARCHAR(20) DEFAULT 'manual' " to the "groups_members" table and add a parameter to groups_add_member() function to specify the enrollment plugin.

        Issue Links

          Activity

          Hide
          Anthony Borrow added a comment -

          Daniel - I am just taking a quick glance at this. Could you give me a little more information about your enrollment plugin and how it compares to the existing options like flatfile, etc. I've not seen how groups may or may not be included in that. I thought that we were able to handle such things in uploading users. In any case, I would like more information about your situation and why it is important to identify which users were enrolled via script and which ones were manual. In short, while I have an idea of what you are trying to do I am not sure I see the utility or need for it in core but I am open to being convinced. Peace - Anthony

          Show
          Anthony Borrow added a comment - Daniel - I am just taking a quick glance at this. Could you give me a little more information about your enrollment plugin and how it compares to the existing options like flatfile, etc. I've not seen how groups may or may not be included in that. I thought that we were able to handle such things in uploading users. In any case, I would like more information about your situation and why it is important to identify which users were enrolled via script and which ones were manual. In short, while I have an idea of what you are trying to do I am not sure I see the utility or need for it in core but I am open to being convinced. Peace - Anthony
          Hide
          Daniel Neis added a comment -

          Hello, Anthony

          our problem:

          • 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.

          Show
          Daniel Neis added a comment - Hello, Anthony our problem: 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.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: