mirrored from git://git.moodle.org/moodle.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-9070 forum: Show timed post display period
This adds the following changes when viewing a list of discussions and forum_enabletimedposts is turned on. * Discussions a student wouldnt see right now are dimmed (timestart in future or timeend in the past). * A icon appears next to the discussion subject, the tooltip for this icon displays the display start and/or end time. This only appears for the user that made the discussion or has permission to viewhiddentimedposts. These two changes achieve a couple of important things, namely, teachers will not mistakenly think their students can see a discussion when viewing the list if they've later forgot that they set a time limit on it (or indeed if someone else put it on their discussion without them realising). Additionally it makes it easy to see from the list when different discussions are set to be released without having to go in and edit them to find out. Change-Id: Ia1818b33c00adae0dad72df8e170a078fb66cd76
- Loading branch information
Showing
5 changed files
with
112 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
@mod @mod_forum | ||
Feature: Users can choose to set start and end time for display of their discussions | ||
In order to see timed forum discussions | ||
As a user | ||
I need to view the page within the window | ||
As a user with viewhiddentimedposts | ||
I need to see the timed discussion tooltips | ||
|
||
Background: | ||
Given the following "users" exist: | ||
| username | firstname | lastname | email | | ||
| student1 | Student | 1 | student1@example.com | | ||
And the following "courses" exist: | ||
| fullname | shortname | category | | ||
| Course 1 | C1 | 0 | | ||
And the following "course enrolments" exist: | ||
| user | course | role | | ||
| student1 | C1 | student | | ||
And I log in as "admin" | ||
And the following config values are set as admin: | ||
| forum_enabletimedposts | 1 | | ||
And I am on site homepage | ||
And I follow "Course 1" | ||
And I turn editing mode on | ||
And I add a "Forum" to section "1" and I fill the form with: | ||
| Forum name | Test forum name | | ||
| Description | Test forum description | | ||
And I add a new discussion to "Test forum name" forum with: | ||
| Subject | Discussion 1 | | ||
| Message | Discussion contents 1, first message | | ||
And I add a new discussion to "Test forum name" forum with: | ||
| Subject | Discussion 2 timed not visible | | ||
| Message | Discussion contents 2, first message | | ||
| timeend[enabled] | 1 | | ||
| timeend[year] | 2014 | | ||
And I add a new discussion to "Test forum name" forum with: | ||
| Subject | Discussion 3 timed visible now | | ||
| Message | Discussion contents 3, first message | | ||
| timestart[enabled] | 1 | | ||
|
||
|
||
Scenario: Creator of the discussion should see the tooltip | ||
Given I am on site homepage | ||
And I follow "Course 1" | ||
And I follow "Test forum name" | ||
Then I should see "Discussion 2 timed" | ||
And I should see "Discussion 3 timed" | ||
And ".timedpost" "css_element" should exist | ||
|
||
Scenario: Student should not see the tooltip or the discussion | ||
Given I log out | ||
And I log in as "student1" | ||
And I follow "Course 1" | ||
Given I follow "Test forum name" | ||
And I should see "Discussion 1" | ||
Then I should not see "Discussion 2 timed" | ||
And ".timedpost" "css_element" should not exist | ||
But I should see "Discussion 3 timed" |