Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/langindex.json
Original file line number Diff line number Diff line change
Expand Up @@ -1622,6 +1622,7 @@
"core.course.confirmpartialdownloadsize": "local_moodlemobileapp",
"core.course.couldnotloadsectioncontent": "local_moodlemobileapp",
"core.course.couldnotloadsections": "local_moodlemobileapp",
"core.course.course:viewoverview": "role",
"core.course.courseindex": "courseformat",
"core.course.coursesummary": "moodle",
"core.course.done": "completion",
Expand Down
125 changes: 125 additions & 0 deletions src/addons/mod/bigbluebuttonbn/tests/behat/overview.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
@addon_mod_bigbluebuttonbn @app @mod @mod_bigbluebuttonbn @javascript @lms_from5.1
Feature: Activities overview for bigbluebuttonbn activity

Background:
Given the Moodle site is compatible with this feature
And a BigBlueButton mock server is configured
And I enable "bigbluebuttonbn" "mod" plugin
And the following "users" exist:
| username | firstname | lastname |
| student1 | Username | 1 |
| student2 | Username | 2 |
| student3 | Username | 3 |
| student4 | Username | 4 |
| student5 | Username | 5 |
| student6 | Username | 6 |
| student7 | Username | 7 |
| student8 | Username | 8 |
| teacher1 | Teacher | T |
| editingteacher1 | EditingTeacher | T |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role | firstname | lastname |
| student1 | C1 | student | Username | 1 |
| student2 | C1 | student | Username | 2 |
| student3 | C1 | student | Username | 3 |
| teacher1 | C1 | teacher | Username | T |
| editingteacher1 | C1 | editingteacher | Username | ET |
And the following "activities" exist:
| activity | name | intro | course | idnumber | type | recordings_imported | openingtime | closingtime | grade | moderators |
| bigbluebuttonbn | RoomRecordings | Test Room Recording description | C1 | bigbluebuttonbn1 | 0 | 0 | 1 January 2024 | | 100 | role:editingteacher |
| bigbluebuttonbn | RoomOnly | Test Room Recording with visible groups | C1 | bigbluebuttonbn2 | 1 | 0 | | 1 January 2040 | 100 | role:editingteacher |
| bigbluebuttonbn | RecordingOnly | Test Room Recording with visible groups | C1 | bigbluebuttonbn3 | 2 | 0 | | | 0 | role:editingteacher |
| bigbluebuttonbn | RoomRecordingsNoUser | Test Room Recording with visible groups | C1 | bigbluebuttonbn4 | 0 | 0 | 1 January 2024 | 1 January 2040 | 0 | role:editingteacher |
| bigbluebuttonbn | RoomRecordingsNoModerator | Test Room Recording with visible groups | C1 | bigbluebuttonbn5 | 0 | 0 | 1 January 2024 | 1 January 2040 | 0 | |
And the following "mod_bigbluebuttonbn > meeting" exists:
| activity | RoomRecordings |
And the following "mod_bigbluebuttonbn > recordings" exist:
| bigbluebuttonbn | name | description | status |
| RoomRecordings | Recording 1 | Description 1 | 2 |
| RoomRecordings | Recording 2 | Description 2 | 2 |
| RoomRecordings | Recording 3 | Description 3 | 2 |
| RoomRecordings | Recording 4 | Description 4 | 0 |
And I am on the "Course 1" "grades > Grader report > View" page logged in as "editingteacher1"
And I turn editing mode on
And I give the grade "90.00" to the user "Username 1" for the grade item "RoomRecordings"
And I give the grade "100.00" to the user "Username 2" for the grade item "RoomOnly"
And I click on "Save changes" "button"
And I log out

Scenario: Teachers can see relevant columns in the bigbluebuttonbn overview
Given I entered the course "Course 1" as "editingteacher1" in the app
When I press "Activities" in the app
And I press "BigBlueButton" in the app
And I press "RoomRecordings" "ion-item" in the app
Then I should find "Monday, 1 January 2024, 12:00 AM" within "Opens" "ion-item" in the app
And I should find "-" within "Closes" "ion-item" in the app
And I should find "Room with recordings" within "Instance type" "ion-item" in the app
And I should find "3" within "Recordings" "ion-item.core-course-overview-item-recordings" in the app
And I should find "View" within "Actions" "ion-item" in the app
But I should not find "Grade" within "BigBlueButton" "ion-accordion" in the app

When I press "View" within "Actions" "ion-item" in the app
Then the header should be "RoomRecordings" in the app

When I go back in the app
And I press "RoomOnly" "ion-item" in the app
Then I should find "-" within "Opens" "ion-item" in the app
And I should find "Sunday, 1 January 2040, 12:00 AM" within "Closes" "ion-item" in the app
And I should find "Room only" within "Instance type" "ion-item" in the app
And I should find "-" within "Recordings" "ion-item.core-course-overview-item-recordings" in the app
And I should find "View" within "Actions" "ion-item" in the app

When I press "RecordingOnly" "ion-item" in the app
Then I should find "-" within "Opens" "ion-item" in the app
And I should find "-" within "Closes" "ion-item" in the app
And I should find "Recordings only" within "Instance type" "ion-item" in the app
And I should find "0" within "Recordings" "ion-item.core-course-overview-item-recordings" in the app
And I should find "View" within "Actions" "ion-item" in the app

When I press "RoomRecordingsNoUser" "ion-item" in the app
Then I should find "Monday, 1 January 2024, 12:00 AM" within "Opens" "ion-item" in the app
And I should find "Sunday, 1 January 2040, 12:00 AM" within "Closes" "ion-item" in the app
And I should find "Room with recordings" within "Instance type" "ion-item" in the app
And I should find "0" within "Recordings" "ion-item.core-course-overview-item-recordings" in the app
And I should find "View" within "Actions" "ion-item" in the app

When I press "RoomRecordingsNoModerator" "ion-item" in the app
Then I should find "Monday, 1 January 2024, 12:00 AM" within "Opens" "ion-item" in the app
And I should find "Sunday, 1 January 2040, 12:00 AM" within "Closes" "ion-item" in the app
And I should find "-" within "Instance type" "ion-item" in the app
And I should find "-" within "Recordings" "ion-item.core-course-overview-item-recordings" in the app
And I should find "-" within "Actions" "ion-item" in the app

Scenario: Students can see relevant columns in the bigbluebuttonbn overview
Given I entered the course "Course 1" as "student1" in the app
When I press "Activities" in the app
And I press "BigBlueButton" in the app
And I press "RoomRecordings" "ion-item" in the app
Then I should find "Monday, 1 January 2024, 12:00 AM" within "Opens" "ion-item" in the app
And I should find "-" within "Closes" "ion-item" in the app
And I should find "90.00" within "Grade" "ion-item" in the app
But I should not find "Instance type" in the app
And I should not find "Actions" in the app

When I press "RoomOnly" "ion-item" in the app
Then I should find "-" within "Opens" "ion-item" in the app
And I should find "Sunday, 1 January 2040, 12:00 AM" within "Closes" "ion-item" in the app
And I should find "-" within "Grade" "ion-item" in the app

When I press "RecordingOnly" "ion-item" in the app
Then I should find "-" within "Opens" "ion-item" in the app
And I should find "-" within "Closes" "ion-item" in the app
And I should find "-" within "Grade" "ion-item" in the app

When I press "RoomRecordingsNoUser" "ion-item" in the app
Then I should find "Monday, 1 January 2024, 12:00 AM" within "Opens" "ion-item" in the app
And I should find "Sunday, 1 January 2040, 12:00 AM" within "Closes" "ion-item" in the app
And I should find "-" within "Grade" "ion-item" in the app

When I press "RoomRecordingsNoModerator" "ion-item" in the app
Then I should find "Monday, 1 January 2024, 12:00 AM" within "Opens" "ion-item" in the app
And I should find "Sunday, 1 January 2040, 12:00 AM" within "Closes" "ion-item" in the app
And I should find "-" within "Grade" "ion-item" in the app
25 changes: 24 additions & 1 deletion src/addons/mod/forum/services/handlers/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@ import { AddonModForum, AddonModForumTracking } from '../forum';
import { makeSingleton, Translate } from '@singletons';
import { CoreEvents } from '@singletons/events';
import { CoreSites, CoreSitesReadingStrategy } from '@services/sites';
import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@features/course/services/module-delegate';
import {
CoreCourseModuleHandler,
CoreCourseModuleHandlerData,
CoreCourseOverviewItemContent,
} from '@features/course/services/module-delegate';
import { CoreModuleHandlerBase } from '@features/course/classes/module-base-handler';
import { CoreCourseModuleData } from '@features/course/services/course-helper';
import { CoreText } from '@singletons/text';
import { CoreUser } from '@features/user/services/user';
import { ADDON_MOD_FORUM_MARK_READ_EVENT, ADDON_MOD_FORUM_MODNAME, ADDON_MOD_FORUM_PAGE_NAME } from '../../constants';
import { ModFeature, ModPurpose } from '@addons/mod/constants';
import { CoreCourseOverviewActivity, CoreCourseOverviewItem } from '@features/course/services/course-overview';

/**
* Handler to support forum modules.
Expand Down Expand Up @@ -157,6 +162,24 @@ export class AddonModForumModuleHandlerService extends CoreModuleHandlerBase imp
}
}

/**
* @inheritdoc
*/
async getOverviewItemContent(
item: CoreCourseOverviewItem,
activity: CoreCourseOverviewActivity,
courseId: number,
): Promise<CoreCourseOverviewItemContent | undefined> {
// Hide the columns that are not supported for now.
if (item.key === 'submitted' || item.key === 'subscribed' || item.key === 'emaildigest') {
return {
content: null,
};
}

return super.getOverviewItemContent(item, activity, courseId);
}

}

export const AddonModForumModuleHandler = makeSingleton(AddonModForumModuleHandlerService);
91 changes: 91 additions & 0 deletions src/addons/mod/forum/tests/behat/overview.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
@addon_mod_forum @app @mod @mod_forum @javascript
Feature: Activities overview for forum activity

Background:
Given the Moodle site is compatible with this feature
And the following "users" exist:
| username | firstname | lastname | trackforums |
| s1 | Username | 1 | 1 |
| s2 | Username | 2 | 0 |
| s3 | Username | 3 | 0 |
| s4 | Username | 4 | 0 |
| t1 | Teacher | T | 1 |
And the following "courses" exist:
| fullname | shortname | groupmode |
| Course 1 | C1 | 1 |
And "4" "course enrolments" exist with the following data:
| user | s[count] |
| course | C1 |
| role | student |
And the following "course enrolments" exist:
| user | course | role |
| t1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | course | idnumber | duedate | type | forcesubscribe | trackingtype |
| forum | Due forum | C1 | forum1 | ##1 Jan 2040 08:00## | qanda | 0 | 0 |
| forum | No discussions | C1 | forum2 | ##tomorrow noon## | eachuser | 2 | 0 |
| forum | Unread posts | C1 | forum3 | | general | 3 | 1 |
And the following "mod_forum > discussions" exist:
| user | forum | name | message |
| t1 | forum3 | Test discussion 1 | Test post message one |
| s1 | forum3 | Test discussion 2 | Test post message two |
| s2 | forum3 | Test discussion 3 | Test post message three |
And the following "mod_forum > posts" exist:
| user | parentsubject | subject | message |
| s1 | Test discussion 1 | Reply 1 to discussion 1 | Discussion contents 1.1 |
| s3 | Test discussion 1 | Reply 2 to discussion 1 | Discussion contents 1.2 |

Scenario: Teachers can see relevant columns in the forum overview
Given I entered the course "Course 1" as "t1" in the app
When I press "Activities" in the app
And I press "Forums" in the app
And I press "Due forum" "ion-item" in the app
Then I should find "Q and A forum" within "Forum type" "ion-item" in the app
And I should find "0" within "Discussions" "ion-item" in the app
And I should find "0" within "Posts" "ion-item" in the app
But I should not find "Track" in the app
And I should not find "Subscribed" in the app
And I should not find "Digest type" in the app

When I press "0" within "Posts" "ion-item" in the app
Then the header should be "Due forum" in the app

When I go back in the app
And I press "No discussions" "ion-item" in the app
Then I should find "Each person posts one discussion" within "Forum type" "ion-item" in the app
And I should find "0" within "Discussions" "ion-item" in the app
And I should find "0" within "Posts" "ion-item" in the app

When I press "Unread posts" "ion-item" in the app
Then I should find "Standard forum for general use" within "Forum type" "ion-item" in the app
And I should find "3" within "Discussions" "ion-item" in the app
And I should find "5" within "Posts" "ion-item" in the app
And I should find "5" "ion-badge" within "Posts" "ion-item" in the app

Scenario: Students can see relevant columns in the forum overview
Given I entered the course "Course 1" as "s1" in the app
When I press "Activities" in the app
And I press "Forums" in the app
And I press "Due forum" "ion-item" in the app
Then I should find "1 January 2040" within "Due date" "ion-item" in the app
And I should find "0" within "Discussions" "ion-item" in the app
And I should find "0" within "Posts" "ion-item" in the app
But I should not find "Forum type" in the app
And I should not find "Track" in the app
And I should not find "Subscribed" in the app
And I should not find "Digest type" in the app

When I press "0" within "Posts" "ion-item" in the app
Then the header should be "Due forum" in the app

When I go back in the app
And I press "No discussions" "ion-item" in the app
Then I should find "Tomorrow" within "Due date" "ion-item" in the app
And I should find "0" within "Discussions" "ion-item" in the app
And I should find "0" within "Posts" "ion-item" in the app

When I press "Unread posts" "ion-item" in the app
Then I should find "-" within "Due date" "ion-item" in the app
And I should find "3" within "Discussions" "ion-item" in the app
And I should find "5" within "Posts" "ion-item" in the app
And I should find "5" "ion-badge" within "Posts" "ion-item" in the app
Loading
Loading