Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.2
    • Component/s: Administration, Groups
    • Labels:
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      1/ create user upload csv file with cohort1, cohort2, ... column
      2/ add user row with nun-numeric cohort idnumber string
      3/ add user row with numeric cohort id integer
      4/ verify cohorts were uploaded properly

      Show
      1/ create user upload csv file with cohort1, cohort2, ... column 2/ add user row with nun-numeric cohort idnumber string 3/ add user row with numeric cohort id integer 4/ verify cohorts were uploaded properly
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w27_MDL-26965_m22_cohortuploaduser
    • Rank:
      17905

      Description

      Allocating users to a cohort looks very manual and intensive atm - unless I've missed something. Can the ability to add to a cohort for new and existing users be added to the upload user options?

        Issue Links

          Activity

          Hide
          Ray Lawrence added a comment -

          Added Helen, Carl and Petr as watchers

          Show
          Ray Lawrence added a comment - Added Helen, Carl and Petr as watchers
          Hide
          Helen Foster added a comment -

          Ray, thanks for your suggested improvement. I'm definitely voting for it!

          Show
          Helen Foster added a comment - Ray, thanks for your suggested improvement. I'm definitely voting for it!
          Hide
          Kimberly Park added a comment -

          Agreed, just voted for it, hope we can get some more votes!

          Show
          Kimberly Park added a comment - Agreed, just voted for it, hope we can get some more votes!
          Hide
          Alex Büchner added a comment -

          And while we are at it, can we also add batch upload to the user context, so schools don't have to assign 2000 parent roles for 1000 pupils manually?

          Show
          Alex Büchner added a comment - And while we are at it, can we also add batch upload to the user context, so schools don't have to assign 2000 parent roles for 1000 pupils manually?
          Hide
          Mary Cooch added a comment -

          +1 for Alex's comment above!

          Show
          Mary Cooch added a comment - +1 for Alex's comment above!
          Hide
          Ray Lawrence added a comment -

          Bump. Any thoughts on this. 25 votes.

          Show
          Ray Lawrence added a comment - Bump. Any thoughts on this. 25 votes.
          Hide
          Ben Reynolds added a comment -

          Alex asks for the long awaited. Is there a tracker issue for that request? I'll vote for it every day

          Show
          Ben Reynolds added a comment - Alex asks for the long awaited. Is there a tracker issue for that request? I'll vote for it every day
          Hide
          Mary Evans added a comment -

          All you need now is some wiz-kid to get this implemented!

          Show
          Mary Evans added a comment - All you need now is some wiz-kid to get this implemented!
          Hide
          B Johnson added a comment -

          +1. Cohort is generally lacking support in the Moodle UI, despite it being a powerful and important feature (i.e., only way to create site-wide groups of users).

          Related needed features: filtering Configurable Reports by Cohort and filtering Bulk User Actions by Cohort, plus discussion at MDL-26612.

          BTW - looks like this issue is duplicated by [MDL-22405 http://tracker.moodle.org/browse/MDL-22405] - probably merge? The comments seem to indicate this is slated for fixing in v2.0.4.

          Show
          B Johnson added a comment - +1. Cohort is generally lacking support in the Moodle UI , despite it being a powerful and important feature (i.e., only way to create site-wide groups of users). Related needed features: filtering Configurable Reports by Cohort and filtering Bulk User Actions by Cohort , plus discussion at MDL-26612 . BTW - looks like this issue is duplicated by [MDL-22405 http://tracker.moodle.org/browse/MDL-22405] - probably merge? The comments seem to indicate this is slated for fixing in v2.0.4.
          Hide
          Petr Škoda added a comment - - edited

          Note to integrators - I wish we already moved to separate admin/tool plugins with own lang packs because I do not like polluting error and admin lang packs.

          Edit: I have moved the strings to cohort pack.

          Show
          Petr Škoda added a comment - - edited Note to integrators - I wish we already moved to separate admin/tool plugins with own lang packs because I do not like polluting error and admin lang packs. Edit: I have moved the strings to cohort pack.
          Hide
          Ray Lawrence added a comment -

          Does the arbitrary upload limit of 5 apply here too? (As with courses, if so why?)
          There is no mention of a cohort short name in testing instructions.
          Would it be better to have a cohort unique shortname for the upload and retain the ID field for external references so that cohort enrolments can be made from an external database that has another reference.

          Show
          Ray Lawrence added a comment - Does the arbitrary upload limit of 5 apply here too? (As with courses, if so why?) There is no mention of a cohort short name in testing instructions. Would it be better to have a cohort unique shortname for the upload and retain the ID field for external references so that cohort enrolments can be made from an external database that has another reference.
          Hide
          Petr Škoda added a comment -

          what kind of limit is that? Do you know issue number for that?

          Show
          Petr Škoda added a comment - what kind of limit is that? Do you know issue number for that?
          Hide
          Petr Škoda added a comment -

          Having both unique shortname and idnumber is problematic because you then do not know which one to sync - everybody thinks we should use something different. I wish we used only idnumbers for that everywhere.

          Show
          Petr Škoda added a comment - Having both unique shortname and idnumber is problematic because you then do not know which one to sync - everybody thinks we should use something different. I wish we used only idnumbers for that everywhere.
          Hide
          Ray Lawrence added a comment -

          1. "what kind of limit is that? Do you know issue number for that?" There has been a long-standing limit of:
          Max. 5 course enrolments per upload.
          Max. 1 group per course.

          Have these been removed?

          2. There's a well established principle of shortnames being unique in moodle e.g. courses, profile field. ID number fields don't require a (Moodle) unique entry iirc (but should probably be unique in the referencing system).

          3. If there is only an ID field this could be unique in Moodle and serve as a suitable reference for this new upload facility. But having an ID field only that must use a Moodle unique reference breaks the existing convention established in courses i.e. shortname and optional ID field.

          Show
          Ray Lawrence added a comment - 1. "what kind of limit is that? Do you know issue number for that?" There has been a long-standing limit of: Max. 5 course enrolments per upload. Max. 1 group per course. Have these been removed? 2. There's a well established principle of shortnames being unique in moodle e.g. courses, profile field. ID number fields don't require a (Moodle) unique entry iirc (but should probably be unique in the referencing system). 3. If there is only an ID field this could be unique in Moodle and serve as a suitable reference for this new upload facility. But having an ID field only that must use a Moodle unique reference breaks the existing convention established in courses i.e. shortname and optional ID field.
          Hide
          Petr Škoda added a comment - - edited

          1. one group/role per course is expected limit because it is using the ending numbers to match groups to courses, I doubt this can be changed; the course limit should not be there though, please file new issue for that

          2. I do not think this breaks consistency because there is nothing like that in the rest of our codebase - the most related thing are groups but they do not have any short names or idnumbers. In fact 'unique' group names in mysql sometimes create big headaches for non-english languages such as Czech, if we decide to change something we should probably make groups look more like cohorts instead of the opposite. Anyway feel free to discuss it elsewhere, my opinion is not the final decision. Oh, there is one major difference between groups and cohorts - you can mostly force course unique group names because they are inside one course only, but in case of cohorts you might want to create the same cohort names in different course categories - we do not require them to be unique in moodle internals because we use their ids - the idnumber is used when interacting with external systems which is exactly the case of csv upload...

          Edit: sorry for the confusions, I meant cohorts instead of groupings, I have fixed it above

          Show
          Petr Škoda added a comment - - edited 1. one group/role per course is expected limit because it is using the ending numbers to match groups to courses, I doubt this can be changed; the course limit should not be there though, please file new issue for that 2. I do not think this breaks consistency because there is nothing like that in the rest of our codebase - the most related thing are groups but they do not have any short names or idnumbers. In fact 'unique' group names in mysql sometimes create big headaches for non-english languages such as Czech, if we decide to change something we should probably make groups look more like cohorts instead of the opposite. Anyway feel free to discuss it elsewhere, my opinion is not the final decision. Oh, there is one major difference between groups and cohorts - you can mostly force course unique group names because they are inside one course only, but in case of cohorts you might want to create the same cohort names in different course categories - we do not require them to be unique in moodle internals because we use their ids - the idnumber is used when interacting with external systems which is exactly the case of csv upload... Edit: sorry for the confusions, I meant cohorts instead of groupings, I have fixed it above
          Hide
          Ray Lawrence added a comment -

          1. Group/role. Agreed. Course limit issue coming up - removal of this will make a big difference.

          2. Groupings: Not needed as they are a collection of course groups.

          3. Where this breaks consistency is with courses (IMO). Courses have a unique internal name (shortname). Courses have an ID field, that is not mandatory, that facilitates the linking of a course with a separate identifier in another system. This is useful for external enrolments.

          Cohorts are supposed to be a mechanism to support course enrolments. The same approach just seems make sense here too i.e. with cohorts.

          Show
          Ray Lawrence added a comment - 1. Group/role. Agreed. Course limit issue coming up - removal of this will make a big difference. 2. Groupings: Not needed as they are a collection of course groups. 3. Where this breaks consistency is with courses (IMO). Courses have a unique internal name (shortname). Courses have an ID field, that is not mandatory, that facilitates the linking of a course with a separate identifier in another system. This is useful for external enrolments. Cohorts are supposed to be a mechanism to support course enrolments. The same approach just seems make sense here too i.e. with cohorts.
          Hide
          Sam Hemelryk added a comment -

          Thanks Petr, this has been integrated now.
          Also gave it a quick test while I was reviewing it and all worked perfectly

          Cheers
          Sam

          Show
          Sam Hemelryk added a comment - Thanks Petr, this has been integrated now. Also gave it a quick test while I was reviewing it and all worked perfectly Cheers Sam
          Hide
          Ray Lawrence added a comment -

          Ref. edited post above.

          Regarding using the same ID for more than on cohort. So the upload could populate for 2 categories on the site?

          Not good as there could be Managers working independently on the site who, unknown to each other, use the same cohort ID.

          Manager A makes an upload that gives all of the users access to courses synced to an identical cohort ID elsewhere on the site. Big privacy issues, not good.

          A unique identifier is required.

          Show
          Ray Lawrence added a comment - Ref. edited post above. Regarding using the same ID for more than on cohort. So the upload could populate for 2 categories on the site? Not good as there could be Managers working independently on the site who, unknown to each other, use the same cohort ID. Manager A makes an upload that gives all of the users access to courses synced to an identical cohort ID elsewhere on the site. Big privacy issues, not good. A unique identifier is required.
          Hide
          Petr Škoda added a comment -

          There is no privacy issue - the upload users is supposed to be executed by admin that has access to everything, there is no feature that would allow you to separate users from course categories for administrative purposes. The cohort "id number" must be unique site-wide.

          This does not seem to be a good place to discuss these issues, I suppose some sort of cohort specific partner meeting might be better.

          Show
          Petr Škoda added a comment - There is no privacy issue - the upload users is supposed to be executed by admin that has access to everything, there is no feature that would allow you to separate users from course categories for administrative purposes. The cohort "id number" must be unique site-wide. This does not seem to be a good place to discuss these issues, I suppose some sort of cohort specific partner meeting might be better.
          Hide
          Ray Lawrence added a comment -

          OK. Well, if the cohort ID is unique site wide that addresses this issue.

          FYI, user management is often a task that is not undertaken by an administrator (who can change site configuration). On many sites there is a bespoke role that has user upload permissions.

          Show
          Ray Lawrence added a comment - OK. Well, if the cohort ID is unique site wide that addresses this issue. FYI, user management is often a task that is not undertaken by an administrator (who can change site configuration). On many sites there is a bespoke role that has user upload permissions.
          Hide
          Petr Škoda added a comment -

          Moodle is not designed for fine grained user account control, it was always all or nothing. The easiest solution for large organisations is to use external system (ldap, db) and synchronise Moodle user accounts/enrolments with it. The csv user upload script is a complex tool for advanced users that are fully trusted, I would personally recommend to do a full db backup before any use.

          Show
          Petr Škoda added a comment - Moodle is not designed for fine grained user account control, it was always all or nothing. The easiest solution for large organisations is to use external system (ldap, db) and synchronise Moodle user accounts/enrolments with it. The csv user upload script is a complex tool for advanced users that are fully trusted, I would personally recommend to do a full db backup before any use.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Tried with some new and existing users, correct and incorrect cohorts, all seems ok. Passing.

          Show
          Eloy Lafuente (stronk7) added a comment - Tried with some new and existing users, correct and incorrect cohorts, all seems ok. Passing.
          Hide
          Sam Hemelryk added a comment -

          Congratulations - this fix has just been released in the weeklies.

          Show
          Sam Hemelryk added a comment - Congratulations - this fix has just been released in the weeklies.
          Hide
          Ray Lawrence added a comment -

          Sam, when is this available? This week or in 2.2 (as indicate din fix version)?

          Show
          Ray Lawrence added a comment - Sam, when is this available? This week or in 2.2 (as indicate din fix version)?
          Hide
          Petr Škoda added a comment -

          This is already available in the master branch (aka 2.2dev), you can see the details when you click on the "Source" tab above.

          Show
          Petr Škoda added a comment - This is already available in the master branch (aka 2.2dev), you can see the details when you click on the "Source" tab above.
          Hide
          Ray Lawrence added a comment -

          Thanks. Is that the same as the weekly for 2.1 .i.e. 20th July?

          Show
          Ray Lawrence added a comment - Thanks. Is that the same as the weekly for 2.1 .i.e. 20th July?
          Hide
          Petr Škoda added a comment -

          It is a different git branch, weekly is MOODLE_21_STABLE.

          Show
          Petr Škoda added a comment - It is a different git branch, weekly is MOODLE_21_STABLE.
          Hide
          vikram solia added a comment -

          Thanks Sam and Petr!

          It would be great if this could be backported to Moodle 2.1 and 2.0 as well.

          Show
          vikram solia added a comment - Thanks Sam and Petr! It would be great if this could be backported to Moodle 2.1 and 2.0 as well.
          Hide
          Helen Foster added a comment -

          I'd like to write a QA test for this new feature, however I don't quite understand the testing instructions.

          Please could anyone provide a sample csv file for testing and clarify whether the cohorts must exist before the csv file is uploaded or whether new cohorts are created automatically.

          Show
          Helen Foster added a comment - I'd like to write a QA test for this new feature, however I don't quite understand the testing instructions. Please could anyone provide a sample csv file for testing and clarify whether the cohorts must exist before the csv file is uploaded or whether new cohorts are created automatically.
          Hide
          gavin henrick added a comment -

          I have tested and if the cohort does not exist, it says : Unknown cohort (year3)!

          Here is text for sample csv:

          username,password,firstname,lastname,email, cohort1
          tomjones,Pass1234*,Tom,Jones,tomjones@example.com, year3
          marysmith,Pass1234*,Mary,Smith,marysmith@example.com, year4
          bobjones,Pass1234*,Bob,Jones,bobjones@example.com, year3
          alicesmith,Pass1234*,Alice,Smith,alicesmith@example.com, year4

          Show
          gavin henrick added a comment - I have tested and if the cohort does not exist, it says : Unknown cohort (year3)! Here is text for sample csv: username,password,firstname,lastname,email, cohort1 tomjones,Pass1234*,Tom,Jones,tomjones@example.com, year3 marysmith,Pass1234*,Mary,Smith,marysmith@example.com, year4 bobjones,Pass1234*,Bob,Jones,bobjones@example.com, year3 alicesmith,Pass1234*,Alice,Smith,alicesmith@example.com, year4
          Hide
          Petr Škoda added a comment -

          Yes, you need to create the cohorts first.

          Show
          Petr Škoda added a comment - Yes, you need to create the cohorts first.
          Hide
          Helen Foster added a comment -

          Thanks Gavin and Petr, I've created MDLQA-1446 (plus test master copy) using the suggested sample csv file.

          Show
          Helen Foster added a comment - Thanks Gavin and Petr, I've created MDLQA-1446 (plus test master copy) using the suggested sample csv file.

            People

            • Votes:
              55 Vote for this issue
              Watchers:
              37 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: