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

Add the ability to lock discussions manually

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.7
    • Fix Version/s: 3.7
    • Component/s: Forum
    • Testing Instructions:
      Hide

      Behat and unit tests provided

      Prerequisites:

      1. Create a course with a student and teacher enrolled.
      2. Create a forum activity in the course.
      3. Create 2 discussions named Discussion1 and Discussion2
      4. For both discussions, post a reply.

       Manual testing:

      Case 1

      1. Login as a teacher
      2. For both discussions created, confirm you can see the 'Lock' link
      3. With Discussion1, confirm on click of the 'Lock' link, it reloads the page and the link changes to 'Locked'
      4. Confirm you can see the following message: 'This discussion has been locked so you can no longer reply to it.'
      5. With Discussion2, confirm you do not see the message in #4.
      6. Login as a student and go to the course and forum activity.
      7. In Discussion1, confirm Step #4
      8. Confirm you cannot reply to any of the posts
      9. Repeat Step #5
      10. Confirm, you can reply to any of the posts in the discussion.

      Case 2 (requires 2 browsers)

      1. In browser 1, login as a teacher
      2. Goto Discussion1 and set/reset the state to 'Unlocked'
      3. In browser 2, login as a student
      4. Goto Discussion1
      5. As the teacher, lock the discussion
      6. As the student, click on the reply button
      7. Confirm you get thrown an exception stating "Sorry, you are not allowed to post to this forum"
      8. In the "In line reply", click on "Advanced". confirm you are redirected to the same page and you see the following message 'T_his discussion has been locked so you can no longer reply to it.'_'

      Case 3 - Time locked discussions

      1. As a teacher, create another forum.
      2. Under "Discussion locking", set "Lock discussions after period of inactivity" to 1 day.
      3. Create a discussion.
      4. Open your favourite DB browser (e.g. phppgadmin) and find the discussion that you created in the "mdl_forum_discussions" table.
      5. Edit the value for the "timemodified" field of that discussion to an earlier date (e.g. 1555718400, which is equivalent to 20 April 2019)
      6. Refresh the discussion page.
      7. Confirm that you see the notification message that the discussion has been locked.
      8. Confirm that you don't see the icon and link to manually lock/unlock the discussion.
      Show
      Behat and unit tests provided Prerequisites: Create a course with a student and teacher enrolled. Create a forum activity in the course. Create 2 discussions named Discussion1 and Discussion2 For both discussions, post a reply.  Manual testing: Case 1 Login as a teacher For both discussions created, confirm you can see the 'Lock' link With Discussion1, confirm on click of the 'Lock' link, it reloads the page and the link changes to 'Locked' Confirm you can see the following message: ' This discussion has been locked so you can no longer reply to it.' With Discussion2, confirm you do not see the message in #4. Login as a student and go to the course and forum activity. In Discussion1, confirm Step #4 Confirm you cannot reply to any of the posts Repeat Step #5 Confirm , you can reply to any of the posts in the discussion. Case 2 (requires 2 browsers) In browser 1, login as a teacher Goto Discussion1 and set/reset the state to 'Unlocked' In browser 2, login as a student Goto Discussion1 As the teacher, lock the discussion As the student, click on the reply button Confirm you get thrown an exception stating " Sorry, you are not allowed to post to this forum " In the "In line reply", click on "Advanced". confirm you are redirected to the same page and you see the following message 'T_his discussion has been locked so you can no longer reply to it.'_' Case 3 - Time locked discussions As a teacher, create another forum. Under " Discussion locking ", set " Lock discussions after period of inactivity " to 1 day. Create a discussion. Open your favourite DB browser (e.g. phppgadmin) and find the discussion that you created in the " mdl_forum_discussions " table. Edit the value for the " timemodified " field of that discussion to an earlier date (e.g. 1555718400, which is equivalent to 20 April 2019) Refresh the discussion page. Confirm that you see the notification message that the discussion has been locked. Confirm that you don't see the icon and link to manually lock/unlock the discussion.
    • Affected Branches:
      MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE
    • Epic Link:
    • Pull from Repository:
    • Pull Master Branch:
      MDL-65032-master

      Description

      Note: This issue deliberately duplicates older issues in order to make project milestones easier to follow and track.

        Attachments

        1. 1.png
          1.png
          81 kB
        2. 2.png
          2.png
          34 kB
        3. 3.png
          3.png
          17 kB
        4. CASE2_Step 7_ERROR.PNG
          CASE2_Step 7_ERROR.PNG
          47 kB
        5. image-2019-04-02-14-02-51-571.png
          image-2019-04-02-14-02-51-571.png
          35 kB

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  20/May/19

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days, 3 hours, 27 minutes
                  2d 3h 27m