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

As a user, I am able to sort the list of discussions.

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Log in as Admin.
      2. Create a Course.
      3. Enrol a Student in the Course.
      4. Create a Forum activity in the Course.
      5. Go to the Forum.
      6. Create several Discussions.
      7. Create several replies for some of the Discussions.

      General sorting

      1. Go back to the Forum
        • make sure that the discussions are sorted by default by last post created date in descending order.
      2. Try to sort the discussions by 'replies', 'last post' and 'created' by clicking on links in the column header.
        • make sure discussions are properly sorted in ascending and descending order for each sorting method.**

      Sorting pinned discussions

      1. Go back to the Forum.
      2. Pin one or more Discussions.
      3. Go back to forum.
      4. Try to sort the discussions by 'replies', 'last post' and 'created' by clicking on links in the column header.
        • make sure the pinned discussions are always displayed on top, then the starred ones, and then the rest of the discussions and make sure the sorting works properly each sorting method.

      Sorting timed discussions

      1. Go to one of the Discussions.
      2. Edit the Discussion's first post.
      3. Set the display period:
        • start date = past date
        • end date = future date
      4. Go back to forum.
      5. Try to sort the discussions by 'last post' by clicking on links in the column header.
        • make sure all discussions are sorted by their last post date in ascending and descending.
      6. Go to the Discussion.
      7. Edit the Discussion's first post.
      8. Set the display period:
        • start date = future date
        • end date = future date
      9. Try to sort the discussions by 'last post' by clicking on links in the column header.
        • make sure the discussions which have a 'Display period' where the start date > last post date are sorted properly in asc and desc order by their 'Display period' start date and not the last post date (The start date of the Discussion in this case should be prioritised before the last post date).

      Testing the webservice

      1. Enable web services (Site administration > Advanced features).
      2. Create a token for a user which is enrolled in the forum's course (Site administration > Plugins > Web services > Manage tokens)
      3. Call the mod_forum_get_forum_discussions web service (MOODLEINSTANCE/webservice/rest/server.php?wsfunction=mod_forum_get_forum_discussions&wstoken=XXXX&forumid=XX&sortorder=XX) through a HTTP client for testing web services (ex. Postman) where:
        wstoken => the token created for the user; 
        forumid => the forum's instance id;
        sortorder => the preferred sort order;
      4. Test the sorting order by passing a different value for the sortorder parameter
        ( 1 => sort by last post created date in descending order
          2 => sort by last post created date in ascending order
          3 => sort by created date in descending order
          4 => sort by created date in ascending order
          5 => sort by number of replies in descending order
          6 => sort by number of replies in ascending order )
        • make sure the returned data is sorted properly (also respecting pinned discussions and starred discussions)

       

      Show
      Log in as Admin. Create a Course. Enrol a Student in the Course. Create a Forum activity in the Course. Go to the Forum. Create several Discussions. Create several replies for some of the Discussions. General sorting Go back to the Forum make sure that the discussions are sorted by default by last post created date in descending order. Try to sort the discussions by ' replies ', ' last post ' and ' created ' by clicking on links in the column header. make sure discussions are properly sorted in ascending and descending order for each sorting method. ** Sorting pinned discussions Go back to the Forum. Pin one or more Discussions. Go back to forum. Try to sort the discussions by ' replies ', ' last post ' and ' created ' by clicking on links in the column header. make sure the pinned discussions are always displayed on top, then the starred ones, and then the rest of the discussions and make sure the sorting works properly each sorting method. Sorting timed discussions Go to one of the Discussions. Edit the Discussion's first post. Set the display period: start date = past date end date = future date Go back to forum. Try to sort the discussions by ' last post ' by clicking on links in the column header. make sure all discussions are sorted by their last post date in ascending and descending. Go to the Discussion. Edit the Discussion's first post. Set the display period: start date = future date end date = future date Try to sort the discussions by ' last post ' by clicking on links in the column header. make sure the discussions which have a 'Display period' where the start date > last post date are sorted properly in asc and desc order by their 'Display period' start date and not the last post date (The start date of the Discussion in this case should be prioritised before the last post date). Testing the webservice Enable web services (Site administration > Advanced features). Create a token for a user which is enrolled in the forum's course (Site administration > Plugins > Web services > Manage tokens) Call the mod_forum_get_forum_discussions web service (MOODLEINSTANCE/webservice/rest/server.php?wsfunction=mod_forum_get_forum_discussions&wstoken=XXXX&forumid=XX&sortorder=XX) through a HTTP client for testing web services (ex. Postman) where: wstoken => the token created for the user;  forumid => the forum's instance id; sortorder => the preferred sort order; Test the sorting order by passing a different value for the sortorder parameter ( 1 => sort by last post created date in descending order   2 => sort by last post created date in ascending order   3 => sort by created date in descending order   4 => sort by created date in ascending order   5 => sort by number of replies in descending order   6 => sort by number of replies in ascending order ) make sure the returned data is sorted   properly (also respecting pinned discussions and starred discussions)  
    • Affected Branches:
      MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE
    • Epic Link:
    • Pull Master Branch:
      MDL-65071-master-new

      Description

      Acceptance criteria from spec:

      • It is possible to sort the list of discussions placing the newest discussions at the top of the list.
      • It is possible to sort the list of discussions placing the oldest discussions at the top of the list.
      • It is possible to sort the list of discussions placing discussions with the most replies at the top of the list.
      • Regardless of the sort-order chosen, discussions which have been pinned are at the top of the list.

      Additionally:

      • It would be nice if Moodle remembered the sort order as a user preference for each time the user visits the page.

        Attachments

        1. 1.png
          1.png
          202 kB
        2. 2.png
          2.png
          271 kB
        3. 3.png
          3.png
          351 kB
        4. down_arrow.png
          down_arrow.png
          0.4 kB

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                12 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 - 1 week, 3 hours, 25 minutes
                  1w 3h 25m