Show
Pre-requisites and setup
Have a Moodle site with at least one student (student1) enrolled in a course ('course1').
Log in as admin.
Navigate to course1.
Turn editing on, and add a forum activity, with name 'Order Forum' and 'forum type' set to 'Standard forum for general use'. Save the forum to create it.
Log out.
Test 1: Correct 'last post' details and discussion order
Log in as student1.
Navigate to the 'Order Forum' within course1.
Click 'Add a new discussion topic', set 'First' as the subject and message, and click 'Post to forum'.
On the discussions view, CONFIRM the 'last post' for the 'First' discussion is listed as the student1's name, at the current time. Note this time and name down somewhere as "time1" and "name1" (they will be referred to later).
Wait for 1 minute to elapse, so the time is now one minute past what you noted for time1.
Click on the 'First' discussion, to open the discussion.
Click 'Edit' on the post.
Add some additional text to the post 'Message' field, then click 'save changes'.
Navigate back to the forum discussions view for 'Order Forum'.
CONFIRM editing the post has not changed the 'last post' details for 'First' (they are still the same as time1 and name1).
Log out, and log back in as admin.
Navigate back to the forum discussions view for 'Order Forum'.
Click 'Add a new discussion topic', set "Second" as the subject and message, and click 'Post to forum'.
On the discussions view, CONFIRM 'Second' is listed above 'First' in the discussion order.
CONFIRM admin's name is shown for the 'last post' on the 'Second' discussion, and the timestamp is correct. Note the time and name down as 'time2' and 'name2'.
Wait for 1 minute to elapse, so the time is now one minute past what you noted for time2.
Add another discussion topic, with 'Third' as the subject and message.
Click on 'Order Forum' in the page breadcrumbs to navigate back to the Order forum discussions view (or if you have it open in another tab, be sure to hard refresh the page).
CONFIRM there are now 3 discussions, ordered Third, Second, First (from top to bottom). CONFIRM the last post details are correct for 'Third', and note them down as name3 and time3.
Open the discussion named 'First', and click 'Edit'.
CONFIRM the bottom of the message input has an 'edited by' line, with the admin's name, and the timestamp matches time1.
Click 'Save changes'.
Click on 'Order Forum' in the page breadcrumbs to navigate back to the Order forum discussions view (or if you have it open in another tab, be sure to hard refresh the page).
CONFIRM the discussion list is still ordered (from top to bottom) Third, Second, First.
Also CONFIRM Third has name3 and time3 listed under last post, Second has name2 and time2, and First has name1 and time1, ie editing has not changed any details or ordering on the discussion view.
Open the 'Second' discussion, then click the 'Pin' button, to pin the discussion.
Return to the 'Order Forum' discussions view using the page breadcrumbs.
CONFIRM the discussion list is ordered (top to bottom) as Second, Third, First, and all details appear correct (the only change should be that pinned discussion has moved to the top of the list).
Wait until at least 1 minute has elapsed since time3 was recorded (if it hasn't already).
Open the 'First' discussion, and click 'Reply'.
Set the message to 'First reply', and click 'Post to forum'.
Note down the timestamp from the reply as time4.
Return to the 'Order Forum' discussions view using the page breadcrumbs.
CONFIRM the discussion list is ordered (top to bottom) as Second, First Third.
CONFIRM the 'last post' details for the 'First' discussion are now showing the admin's name, and time4.
CONFIRM the other 2 posts still show the correct 'last post' details (name2 and time2 for 'Second', and name3 and time3 for 'Third').
Test 2: Correct subsequent admin edit string
(Note: Stay logged in as admin for this test)
Open the 'First' discussion.
Click 'Edit' on student1's post.
CONFIRM there are now 2 'Edited by' lines in the 'Message' text.
CONFIRM both 'Edited by' lines are identical (ie same username and timestamp have been included in both).