Merge pull request #1652 from crazyserver/MOBILE-2784

MOBILE-2784 feedback: Fix analysis summary access checks
main
Juan Leyva 2018-12-10 18:12:37 +01:00 committed by GitHub
commit 476aead1e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -43,7 +43,7 @@
<ng-template #basicInfo>
<ion-list *ngIf="(access.canedititems || access.canviewreports) && !access.isempty">
<ion-list *ngIf="access.canviewanalysis && !access.isempty">
<ion-item text-wrap *ngIf="access.canedititems && (groupInfo.separateGroups || groupInfo.visibleGroups)">
<ion-label id="addon-feedback-groupslabel" *ngIf="groupInfo.separateGroups">{{ 'core.groupsseparate' | translate }}</ion-label>
<ion-label id="addon-feedback-groupslabel" *ngIf="groupInfo.visibleGroups">{{ 'core.groupsvisible' | translate }}</ion-label>
@ -51,14 +51,14 @@
<ion-option *ngFor="let groupOpt of groupInfo.groups" [value]="groupOpt.id">{{groupOpt.name}}</ion-option>
</ion-select>
</ion-item>
<a ion-item text-wrap *ngIf="access.canviewreports || access.canedititems" (click)="access.canviewreports && openFeature('Respondents')" [attr.detail-none]="access.canviewreports ? null : true">
<a ion-item text-wrap (click)="access.canviewreports && feedback.completedCount > 0 && openFeature('Respondents')" [attr.detail-none]="access.canviewreports && feedback.completedCount > 0 ? null : true">
<h2>{{ 'addon.mod_feedback.completed_feedbacks' | translate }}</h2>
<ion-badge item-end>{{feedback.completedCount}}</ion-badge>
</a>
<a ion-item text-wrap *ngIf="!access.isanonymous && access.canviewreports" (click)="openFeature('NonRespondents')" detail-push>
<h2>{{ 'addon.mod_feedback.show_nonrespondents' | translate }}</h2>
</a>
<ion-item text-wrap *ngIf="access.canedititems">
<ion-item text-wrap>
<h2>{{ 'addon.mod_feedback.questions' | translate }}</h2>
<ion-badge item-end>{{feedback.itemsCount}}</ion-badge>
</ion-item>

View File

@ -212,7 +212,8 @@ export class AddonModFeedbackIndexComponent extends CoreCourseModuleMainActivity
this.overview.timeclose = parseInt(this.feedback.timeclose) * 1000 || 0;
this.overview.closeTimeReadable = this.overview.timeclose ?
moment(this.overview.timeclose).format('LLL') : '';
}
if (accessData.canviewanalysis) {
// Get groups (only for teachers).
promises.push(this.fetchGroupInfo(this.feedback.coursemodule));
}