diff --git a/scripts/langindex.json b/scripts/langindex.json index b245d6a4e..70cc0b1cc 100644 --- a/scripts/langindex.json +++ b/scripts/langindex.json @@ -657,6 +657,7 @@ "addon.mod_forum.posttoforum": "forum", "addon.mod_forum.posttomygroups": "forum", "addon.mod_forum.privatereply": "forum", + "addon.mod_forum.qandanotify": "forum", "addon.mod_forum.re": "forum", "addon.mod_forum.refreshposts": "local_moodlemobileapp", "addon.mod_forum.removefromfavourites": "forum", diff --git a/src/addons/mod/assign/components/index/addon-mod-assign-index.html b/src/addons/mod/assign/components/index/addon-mod-assign-index.html index 599a85136..028cec0b9 100644 --- a/src/addons/mod/assign/components/index/addon-mod-assign-index.html +++ b/src/addons/mod/assign/components/index/addon-mod-assign-index.html @@ -127,6 +127,11 @@ {{ 'addon.mod_assign.'+summary.warnofungroupedusers | translate }} + +
+ + +
diff --git a/src/addons/mod/forum/components/index/index.html b/src/addons/mod/forum/components/index/index.html index 34c075f39..5ddd4c954 100644 --- a/src/addons/mod/forum/components/index/index.html +++ b/src/addons/mod/forum/components/index/index.html @@ -31,12 +31,20 @@ + + + + + {{ 'addon.mod_forum.qandanotify' | translate }} + + + - -
+
diff --git a/src/addons/mod/forum/components/index/index.ts b/src/addons/mod/forum/components/index/index.ts index 849453c42..a9c6fc7e8 100644 --- a/src/addons/mod/forum/components/index/index.ts +++ b/src/addons/mod/forum/components/index/index.ts @@ -85,6 +85,7 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom sortOrders: AddonModForumSortOrder[] = []; canPin = false; hasOfflineRatings = false; + showQAMessage = false; sortOrderSelectorModalOptions: ModalOptions = { component: AddonModForumSortOrderSelectorComponent, }; @@ -345,8 +346,9 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom } const forum = this.forum; + const showDueDateMessage = !CoreSites.getCurrentSite()?.isVersionGreaterEqualThan('3.11'); this.description = forum.intro || this.description; - this.availabilityMessage = AddonModForumHelper.getAvailabilityMessage(forum); + this.availabilityMessage = AddonModForumHelper.getAvailabilityMessage(forum, showDueDateMessage); this.descriptionNote = Translate.instant('addon.mod_forum.numdiscussions', { numdiscussions: forum.numdiscussions, }); @@ -403,6 +405,7 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom const cutoffDateReached = AddonModForumHelper.isCutoffDateReached(forum) && !accessInfo.cancanoverridecutoff; this.canAddDiscussion = !!forum.cancreatediscussions && !cutoffDateReached; + this.showQAMessage = forum.type === 'qanda' && !accessInfo.canviewqandawithoutposting; return; }), @@ -702,4 +705,16 @@ class AddonModForumDiscussionsManager extends CoreListItemsManager !source.isNewDiscussionForm(item)); + } + } diff --git a/src/addons/mod/forum/lang.json b/src/addons/mod/forum/lang.json index 86e48abf7..1c30bcf6a 100644 --- a/src/addons/mod/forum/lang.json +++ b/src/addons/mod/forum/lang.json @@ -49,6 +49,7 @@ "posttoforum": "Post to forum", "posttomygroups": "Post a copy to all groups", "privatereply": "Reply privately", + "qandanotify": "This is a question and answer forum. In order to see other responses to these questions, you must first post your answer", "re": "Re:", "refreshposts": "Refresh posts", "removefromfavourites": "Unstar this discussion", diff --git a/src/addons/mod/forum/pages/discussion/discussion.html b/src/addons/mod/forum/pages/discussion/discussion.html index 44a517136..1c5b8d781 100644 --- a/src/addons/mod/forum/pages/discussion/discussion.html +++ b/src/addons/mod/forum/pages/discussion/discussion.html @@ -84,6 +84,14 @@ + + + + + {{ 'addon.mod_forum.qandanotify' | translate }} + + +
post.author.id === currentUserId); + return; }), ); diff --git a/src/addons/mod/forum/services/forum-helper.ts b/src/addons/mod/forum/services/forum-helper.ts index 47c2bd0cc..a9c26c9f5 100644 --- a/src/addons/mod/forum/services/forum-helper.ts +++ b/src/addons/mod/forum/services/forum-helper.ts @@ -278,23 +278,26 @@ export class AddonModForumHelperProvider { * Returns the availability message of the given forum. * * @param forum Forum instance. + * @param getDueDateMessage Whether to get due date message. If false, only cutoff date message will be returned. * @return Message or null if the forum has no cut-off or due date. */ - getAvailabilityMessage(forum: AddonModForumData): string | null { + getAvailabilityMessage(forum: AddonModForumData, getDueDateMessage = true): string | null { if (this.isCutoffDateReached(forum)) { return Translate.instant('addon.mod_forum.cutoffdatereached'); } - if (this.isDueDateReached(forum)) { - const dueDate = CoreTimeUtils.userDate(forum.duedate * 1000); + if (getDueDateMessage) { + if (this.isDueDateReached(forum)) { + const dueDate = CoreTimeUtils.userDate(forum.duedate * 1000); - return Translate.instant('addon.mod_forum.thisforumisdue', { $a: dueDate }); - } + return Translate.instant('addon.mod_forum.thisforumisdue', { $a: dueDate }); + } - if ((forum.duedate ?? 0) > 0) { - const dueDate = CoreTimeUtils.userDate(forum.duedate! * 1000); + if (forum.duedate && forum.duedate > 0) { + const dueDate = CoreTimeUtils.userDate(forum.duedate * 1000); - return Translate.instant('addon.mod_forum.thisforumhasduedate', { $a: dueDate }); + return Translate.instant('addon.mod_forum.thisforumhasduedate', { $a: dueDate }); + } } return null; diff --git a/src/addons/mod/glossary/components/index/addon-mod-glossary-index.html b/src/addons/mod/glossary/components/index/addon-mod-glossary-index.html index 788686a95..69824078c 100644 --- a/src/addons/mod/glossary/components/index/addon-mod-glossary-index.html +++ b/src/addons/mod/glossary/components/index/addon-mod-glossary-index.html @@ -65,7 +65,7 @@ - diff --git a/src/addons/mod/glossary/components/index/index.ts b/src/addons/mod/glossary/components/index/index.ts index 8c3bbd65a..e0d559580 100644 --- a/src/addons/mod/glossary/components/index/index.ts +++ b/src/addons/mod/glossary/components/index/index.ts @@ -472,4 +472,13 @@ class AddonModGlossaryEntriesManager extends CoreListItemsManager 0 || this.getSource().offlineEntries.length > 0; + } + } diff --git a/src/core/features/course/components/module-info/core-course-module-info.html b/src/core/features/course/components/module-info/core-course-module-info.html index 62ccf0e34..f01531b83 100644 --- a/src/core/features/course/components/module-info/core-course-module-info.html +++ b/src/core/features/course/components/module-info/core-course-module-info.html @@ -34,7 +34,7 @@
-
+