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

Reset Course does not clear block data

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Development in progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.9.7, 2.6.1
    • Fix Version/s: None
    • Component/s: Blocks, Course
    • Labels:
    • Environment:
      Any
    • Database:
      Any
    • Testing Instructions:
      Hide

      Preparation:
      0. Download and Install the supervised block. You can find it at the attached archive.
      1. Log in as editing teacher.
      2. Create 3 courses with the next parameters: name - ‘course1’,'course2','course3'.
      3. Enrol 2 users for each courses: ‘user1’, ‘user2’.
      4. Create group within for each courses: ‘group1’.
      5. Add ‘user1’ and ‘user 2’ in ‘group1’ in each courses.
      6. Add block ‘Supervised’ instances for course view pages of 'course1' and 'course2'.
      7. Add classroom in the supervised block.
      8. Start session in the Supervised block in 'course1' and 'course2'.
      9. Finish session in the Supervised block in 'course1' and 'course2'.
      10. Repeat steps 8-9 several times.
      11. Make sure you can see a list of sessions using "Session" link in the supervised block. for 'course1' and 'course2'.

      TEST:
      1. Go to 'course1'
      2. Press “Reset” link in the administration block.
      3. Dont check supervised block check box.
      4. Press button “Reset course”.
      6. Make sure you can see a list of sessions using "Session" link in the supervised block.

      TEST:
      1. Go to 'course2'
      2. Press “Reset” link in the administration block.
      3. Check supervised block check box.
      4. Press button “Reset course”.
      5. Check that the supervised block appeared in the resulting form.
      6. Make sure sessions list is empty for 'course2' using "Session" link in the supervised block; but sessions still exists in 'course1' block.

      TEST:
      1. Go to 'course3'.
      2. Press “Reset” link in the administration block.
      3. Make sure that the supervised block doesnt appear in the reset form.

      Show
      Preparation: 0. Download and Install the supervised block. You can find it at the attached archive. 1. Log in as editing teacher. 2. Create 3 courses with the next parameters: name - ‘course1’,'course2','course3'. 3. Enrol 2 users for each courses: ‘user1’, ‘user2’. 4. Create group within for each courses: ‘group1’. 5. Add ‘user1’ and ‘user 2’ in ‘group1’ in each courses. 6. Add block ‘Supervised’ instances for course view pages of 'course1' and 'course2'. 7. Add classroom in the supervised block. 8. Start session in the Supervised block in 'course1' and 'course2'. 9. Finish session in the Supervised block in 'course1' and 'course2'. 10. Repeat steps 8-9 several times. 11. Make sure you can see a list of sessions using "Session" link in the supervised block. for 'course1' and 'course2'. TEST: 1. Go to 'course1' 2. Press “Reset” link in the administration block. 3. Dont check supervised block check box. 4. Press button “Reset course”. 6. Make sure you can see a list of sessions using "Session" link in the supervised block. TEST: 1. Go to 'course2' 2. Press “Reset” link in the administration block. 3. Check supervised block check box. 4. Press button “Reset course”. 5. Check that the supervised block appeared in the resulting form. 6. Make sure sessions list is empty for 'course2' using "Session" link in the supervised block; but sessions still exists in 'course1' block. TEST: 1. Go to 'course3'. 2. Press “Reset” link in the administration block. 3. Make sure that the supervised block doesnt appear in the reset form.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
       MDL-24359-NEW

      Description

      I've created a custom block that stores user data in the database. I've implemented instance_restore, instance_backup, and instance_delete (which all work fine) but I cannot find a means to delete user data when the course is reset.

      Looking through reset_course_userdata() it appears nothing was ever implemented to handle blocks.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated: