Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-77387

Copy course UI - enrol a user such as editingteacher in the copied course

XMLWordPrintable

    • MOODLE_311_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE
    • MOODLE_402_STABLE
    • MDL-77387_master
    • Hide

      Setup

      1. Ensure the setting $CFG->creatornewroleid has the default value editingteacher
      2. Go to "Site administration > Permissions > Define roles" and grant the role editingteacher the capabilities moodle/backup:backupcourse, moodle/restore:restorecourse, moodle/course:create to enable the course copy UI for this role. In particular, make sure the capability moodle/course:view is not anymore set to allowed, this is important!
      3. Make sure that the capabilities moodle/restore:createuser, moodle/backup:userinfo, restore:userinfo are not enabled for the role editingteacher.
      4. Create a course and enrol a teacher user with the editingteacher role and, at least, one student.

      Testing scenario 1: No user data (as editingteacher)

      1. Login as an editing teacher.
      2. Navigate to Course reuse.
      3. Confirm the Copy course option is displayed in the action list.
      4. Select Copy course and make a copy of the course (there will be no options to include user data and role enrolments).
      5. Confirm that the course was copied.
      6. Confirm that there is exactly one user enrolled in the course, the teacher who started the copying process.

      Testing scenario 2: User data (as editingteacher)

      1. Make sure that the capabilities moodle/restore:createuser, moodle/backup:userinfo, restore:userinfo are enabled for the role editingteacher.
      2. Login as an editing teacher.
      3. Navigate to Course reuse > Copy course and make a copy of the course.
      4. Confirm the "Include user data" and "Include role enrolment" options are displayed now.
      5. Select the "Teacher" and "Student" checkboxes for the "Include role enrolments" field.
      6. Confirm that the course was copied.
      7. Confirm that there are exactly the same users enrolled with the Teacher and Student roles as in the original course.

      Testing scenario 3: User data (as manager)

      1. Login as a manager and go to the course.
      2. Navigate to Course reuse > Copy course and make a copy of the course. Don't include the role enrolments or the user data.
      3. Confirm that the course was copied.
      4. Confirm that there is no user enrolled in the course.

      Testing scenario 4: User data (as manager)

      1. Login as a manager and go to the course.
      2. Navigate to Course reuse > Copy course and make a copy of the course. Include the role enrolments too.
      3. Confirm that the course was copied.
      4. Confirm the manager user hasn't been enrolled on the course.
      5. Confirm that there are exactly the same users enrolled with the Teacher and Student roles as in the original course.
      Show
      Setup Ensure the setting $CFG->creatornewroleid has the default value editingteacher Go to "Site administration > Permissions > Define roles" and grant the role editingteacher the capabilities moodle/backup:backupcourse, moodle/restore:restorecourse, moodle/course:create to enable the course copy UI for this role. In particular, make sure the capability moodle/course:view is not anymore set to allowed , this is important! Make sure that the capabilities moodle/restore:createuser, moodle/backup:userinfo, restore:userinfo are not enabled for the role editingteacher . Create a course and enrol a teacher user with the editingteacher role and, at least, one student. Testing scenario 1: No user data (as editingteacher) Login as an editing teacher. Navigate to Course reuse. Confirm the Copy course option is displayed in the action list. Select Copy course and make a copy of the course (there will be no options to include user data and role enrolments). Confirm that the course was copied. Confirm that there is exactly one user enrolled in the course, the teacher who started the copying process. Testing scenario 2: User data (as editingteacher) Make sure that the capabilities moodle/restore:createuser, moodle/backup:userinfo, restore:userinfo are enabled for the role editingteacher . Login as an editing teacher. Navigate to Course reuse > Copy course and make a copy of the course. Confirm the "Include user data" and "Include role enrolment" options are displayed now. Select the "Teacher" and "Student" checkboxes for the "Include role enrolments" field. Confirm that the course was copied. Confirm that there are exactly the same users enrolled with the Teacher and Student roles as in the original course. Testing scenario 3: User data (as manager) Login as a manager and go to the course. Navigate to Course reuse > Copy course and make a copy of the course. Don't include the role enrolments or the user data. Confirm that the course was copied. Confirm  that there is no user enrolled in the course. Testing scenario 4: User data (as manager) Login as a manager and go to the course. Navigate to Course reuse > Copy course and make a copy of the course. Include the role enrolments too. Confirm that the course was copied. Confirm the manager user hasn't been enrolled on the course. Confirm that there are exactly the same users enrolled with the Teacher and Student roles as in the original course.

      The UI to copy a course introduced with MDL-64843 is a welcome improvement.
      If I grant a teacher (role editingteacher for example) the capabilities moodle/course:create, moodle/backup:backupcourse and moodle/restore:restorecourse this user can already duplicate courses in the traditional way, so it is only natural to give them also the ability to use the copy course UI.

      Nevertheless presently I need to add the capability course:view to enable the copy course UI.

      I would like to propose to remove this last requirement.
      This would have the benefit, that teachers copying their own course are also automatically enrolled with the manual enrolment in their copied course (with the role defined in $CFG->creatornewroleid which defaults to editingteacher), exactly like when they create a new course (having the capability moodle/course:create set to allowed).

      A manager or administrator would still (as expected) not be enrolled, since they do normally have the capability moodle/course:view (see function define_execution of restore_fix_restorer_access_step).

      I do know that teachers coping their courses are still able to reach the course per link and enrol themselves, but this is inconvenient and fiddly. And for privacy reasons I might not want to grant teachers the other capabilities to preserve enrolments when copying. Why though avoid enrolling them as teachers?

        1. test scenario 3.gif
          test scenario 3.gif
          1.08 MB
        2. Test Scenario 2.gif
          Test Scenario 2.gif
          1.34 MB
        3. test scenario 1.gif
          test scenario 1.gif
          1.95 MB
        4. test scenario 4.gif
          test scenario 4.gif
          1.47 MB

            ManeggiaP Paola Maneggia
            ManeggiaP Paola Maneggia
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Andrew Lyons Andrew Lyons
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            4 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 59 minutes
                1h 59m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.