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

New capability to move a section in a course

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3.2
    • 2.4
    • Course
    • MOODLE_23_STABLE
    • MOODLE_24_STABLE
    • MDL-34648-master
    • Hide

      Test pre-requisites

      • Do not upgrade yet, first test require you to test the update
      • A course with topic format
      • Some activities/resources
      • Some sections with other names than defaults
      • Remove the following capabilities from Teacher at Course level
        • moodle/course:movesections
      • Javascript disabled in your browser's settings

      Test #1

      1. Use an outdated Moodle 2.4dev
      2. Navigate to Home ► Site administration ► Users ► Permissions ► Define roles
      3. Create a new role called 'Obi-Wan Kenobi' with archetype student and system/category/course context
      4. Give the capability moodle/course:update to this role
      5. Now update your Moodle so that this patch
      6. Run the upgrade script via Home ► Site administration ► Notifications
      7. Make sure the role 'Obi-Wan Kenobi' has the capability moodle/course:movesections set to allow

      Test #2

      1. As a teacher access the course
      2. Make sure you CAN'T move a section
      3. Enable JavaScript in your browser, and refresh the page
      4. Make sure you CAN'T move a section
      • As an admin, enable moodle/course:movesections for Teacher at Course level
      1. As a teacher access the course
      2. Make sure you CAN now move a section
      3. Disable JavaScript in your browser, and refresh the page
      4. Make sure you CAN now move a section

      Bonus points

      Hack course/format/renderer.php and course/format/topics/renderer.php section_edit_controls() to display the actions, and check that they don't work without the capability with/without JavaScript.

      Show
      Test pre-requisites Do not upgrade yet, first test require you to test the update A course with topic format Some activities/resources Some sections with other names than defaults Remove the following capabilities from Teacher at Course level moodle/course:movesections Javascript disabled in your browser's settings Test #1 Use an outdated Moodle 2.4dev Navigate to Home ► Site administration ► Users ► Permissions ► Define roles Create a new role called 'Obi-Wan Kenobi' with archetype student and system/category/course context Give the capability moodle/course:update to this role Now update your Moodle so that this patch Run the upgrade script via Home ► Site administration ► Notifications Make sure the role 'Obi-Wan Kenobi' has the capability moodle/course:movesections set to allow Test #2 As a teacher access the course Make sure you CAN'T move a section Enable JavaScript in your browser, and refresh the page Make sure you CAN'T move a section As an admin, enable moodle/course:movesections for Teacher at Course level As a teacher access the course Make sure you CAN now move a section Disable JavaScript in your browser, and refresh the page Make sure you CAN now move a section Bonus points Hack course/format/renderer.php and course/format/topics/renderer.php section_edit_controls() to display the actions, and check that they don't work without the capability with/without JavaScript.

    Description

      Create a new capability to control the user permissions to move a section within a course

      Attachments

        Activity

          People

            fred Frédéric Massart
            fred Frédéric Massart
            Rajesh Taneja Rajesh Taneja
            Dan Poltawski Dan Poltawski
            Adrian Greeve Adrian Greeve
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              3/Dec/12