MOBILE-3833 forum: Display Q&A message for students
parent
1eab0204b0
commit
7383dc1974
|
@ -657,6 +657,7 @@
|
||||||
"addon.mod_forum.posttoforum": "forum",
|
"addon.mod_forum.posttoforum": "forum",
|
||||||
"addon.mod_forum.posttomygroups": "forum",
|
"addon.mod_forum.posttomygroups": "forum",
|
||||||
"addon.mod_forum.privatereply": "forum",
|
"addon.mod_forum.privatereply": "forum",
|
||||||
|
"addon.mod_forum.qandanotify": "forum",
|
||||||
"addon.mod_forum.re": "forum",
|
"addon.mod_forum.re": "forum",
|
||||||
"addon.mod_forum.refreshposts": "local_moodlemobileapp",
|
"addon.mod_forum.refreshposts": "local_moodlemobileapp",
|
||||||
"addon.mod_forum.removefromfavourites": "forum",
|
"addon.mod_forum.removefromfavourites": "forum",
|
||||||
|
|
|
@ -31,6 +31,14 @@
|
||||||
</ion-item>
|
</ion-item>
|
||||||
</ion-card>
|
</ion-card>
|
||||||
|
|
||||||
|
<!-- Q&A message. -->
|
||||||
|
<ion-card class="core-info-card" *ngIf="showQAMessage">
|
||||||
|
<ion-item>
|
||||||
|
<ion-icon name="fas-info-circle" slot="start" aria-hidden="true"></ion-icon>
|
||||||
|
<ion-label>{{ 'addon.mod_forum.qandanotify' | translate }}</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
</ion-card>
|
||||||
|
|
||||||
<ng-container *ngIf="forum">
|
<ng-container *ngIf="forum">
|
||||||
<core-empty-box *ngIf="!discussions || discussions.empty" icon="far-comments"
|
<core-empty-box *ngIf="!discussions || discussions.empty" icon="far-comments"
|
||||||
[message]="'addon.mod_forum.forumnodiscussionsyet' | translate">
|
[message]="'addon.mod_forum.forumnodiscussionsyet' | translate">
|
||||||
|
|
|
@ -85,6 +85,7 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom
|
||||||
sortOrders: AddonModForumSortOrder[] = [];
|
sortOrders: AddonModForumSortOrder[] = [];
|
||||||
canPin = false;
|
canPin = false;
|
||||||
hasOfflineRatings = false;
|
hasOfflineRatings = false;
|
||||||
|
showQAMessage = false;
|
||||||
sortOrderSelectorModalOptions: ModalOptions = {
|
sortOrderSelectorModalOptions: ModalOptions = {
|
||||||
component: AddonModForumSortOrderSelectorComponent,
|
component: AddonModForumSortOrderSelectorComponent,
|
||||||
};
|
};
|
||||||
|
@ -404,6 +405,7 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom
|
||||||
const cutoffDateReached = AddonModForumHelper.isCutoffDateReached(forum)
|
const cutoffDateReached = AddonModForumHelper.isCutoffDateReached(forum)
|
||||||
&& !accessInfo.cancanoverridecutoff;
|
&& !accessInfo.cancanoverridecutoff;
|
||||||
this.canAddDiscussion = !!forum.cancreatediscussions && !cutoffDateReached;
|
this.canAddDiscussion = !!forum.cancreatediscussions && !cutoffDateReached;
|
||||||
|
this.showQAMessage = forum.type === 'qanda' && !accessInfo.canviewqandawithoutposting;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -49,6 +49,7 @@
|
||||||
"posttoforum": "Post to forum",
|
"posttoforum": "Post to forum",
|
||||||
"posttomygroups": "Post a copy to all groups",
|
"posttomygroups": "Post a copy to all groups",
|
||||||
"privatereply": "Reply privately",
|
"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:",
|
"re": "Re:",
|
||||||
"refreshposts": "Refresh posts",
|
"refreshposts": "Refresh posts",
|
||||||
"removefromfavourites": "Unstar this discussion",
|
"removefromfavourites": "Unstar this discussion",
|
||||||
|
|
|
@ -84,6 +84,14 @@
|
||||||
</ion-item>
|
</ion-item>
|
||||||
</ion-card>
|
</ion-card>
|
||||||
|
|
||||||
|
<!-- Q&A message. -->
|
||||||
|
<ion-card class="core-info-card" *ngIf="showQAMessage">
|
||||||
|
<ion-item>
|
||||||
|
<ion-icon name="fas-info-circle" slot="start" aria-hidden="true"></ion-icon>
|
||||||
|
<ion-label>{{ 'addon.mod_forum.qandanotify' | translate }}</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
</ion-card>
|
||||||
|
|
||||||
<div *ngIf="startingPost" class="ion-margin-bottom">
|
<div *ngIf="startingPost" class="ion-margin-bottom">
|
||||||
<addon-mod-forum-post [post]="startingPost" [discussion]="discussion" [courseId]="courseId" [highlight]="true"
|
<addon-mod-forum-post [post]="startingPost" [discussion]="discussion" [courseId]="courseId" [highlight]="true"
|
||||||
[discussionId]="discussionId" [component]="component" [componentId]="cmId" [formData]="formData"
|
[discussionId]="discussionId" [component]="component" [componentId]="cmId" [formData]="formData"
|
||||||
|
|
|
@ -105,6 +105,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes
|
||||||
cmId?: number;
|
cmId?: number;
|
||||||
canPin = false;
|
canPin = false;
|
||||||
availabilityMessage: string | null = null;
|
availabilityMessage: string | null = null;
|
||||||
|
showQAMessage = false;
|
||||||
leavingPage = false;
|
leavingPage = false;
|
||||||
|
|
||||||
protected forumId?: number;
|
protected forumId?: number;
|
||||||
|
@ -493,6 +494,11 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show Q&A message if user hasn't posted.
|
||||||
|
const currentUserId = CoreSites.getCurrentSiteUserId();
|
||||||
|
this.showQAMessage = forum.type === 'qanda' && !accessInfo.canviewqandawithoutposting &&
|
||||||
|
!posts.some(post => post.author.id === currentUserId);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue