Merge pull request #2616 from crazyserver/MOBILE-3523

MOBILE-3523 workshop: Fix go to own assessment button
main
Dani Palou 2020-11-23 16:26:12 +01:00 committed by GitHub
commit 2698cf51c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 7 deletions

View File

@ -23,7 +23,7 @@
[maxSubmissions]="workshop.overallfeedbackfiles" [component]="component" [componentId]="componentId" [allowOffline]="true"></core-attachments>
<ion-item *ngIf="edit && access && access.canallocate">
<ion-label stacked [core-mark-required]="true">{{ 'addon.mod_workshop.assessmentweight' | translate }}</ion-label>
<ion-select [(ngModel)]="weight" interface="action-sheet">
<ion-select [(ngModel)]="weight" interface="action-sheet" name="weight">
<ion-option *ngFor="let w of weights" [value]="w">{{w}}</ion-option>
</ion-select>
</ion-item>

View File

@ -1,5 +1,5 @@
<core-loading [hideUntil]="loaded">
<a ion-item *ngIf="summary" text-wrap [attr.detail-none]="canViewAssessment && !canSelfAssess? null : true" (click)="gotoAssessment()">
<ion-item *ngIf="summary" text-wrap [attr.detail-none]="canViewAssessment && !canSelfAssess? null : true" (click)="gotoAssessment($event)">
<ion-avatar core-user-avatar [user]="profile" item-start [courseId]="courseId" [userId]="profile && profile.id"></ion-avatar>
<h2 *ngIf="profile && profile.fullname">{{profile.fullname}}</h2>
@ -16,10 +16,10 @@
{{ 'addon.mod_workshop.weightinfo' | translate:{$a: assessment.weight } }}
</p>
<ion-badge *ngIf="!assessment.grade" color="danger">{{ 'addon.mod_workshop.notassessed' | translate }}</ion-badge>
<button ion-button block *ngIf="canSelfAssess && !showGrade(assessment.grade)" (click)="gotoOwnAssessment()">{{ 'addon.mod_workshop.assess' | translate }}</button>
<button ion-button block *ngIf="canSelfAssess && showGrade(assessment.grade)" (click)="gotoOwnAssessment()">{{ 'addon.mod_workshop.reassess' | translate }}</button>
<button ion-button block *ngIf="canSelfAssess && !showGrade(assessment.grade)" (click)="gotoOwnAssessment($event)">{{ 'addon.mod_workshop.assess' | translate }}</button>
<button ion-button block *ngIf="canSelfAssess && showGrade(assessment.grade)" (click)="gotoOwnAssessment($event)">{{ 'addon.mod_workshop.reassess' | translate }}</button>
<ion-note item-end *ngIf="offline">
<ion-icon name="time"></ion-icon>{{ 'core.notsent' | translate }}
</ion-note>
</a>
</ion-item>
</core-loading>

View File

@ -99,8 +99,11 @@ export class AddonModWorkshopAssessmentComponent implements OnInit {
/**
* Navigate to the assessment.
*/
gotoAssessment(): void {
gotoAssessment(event: Event): void {
if (!this.canSelfAssess && this.canViewAssessment) {
event.preventDefault();
event.stopPropagation();
const params = {
assessment: this.assessment,
submission: this.submission,
@ -131,8 +134,11 @@ export class AddonModWorkshopAssessmentComponent implements OnInit {
/**
* Navigate to my own assessment.
*/
gotoOwnAssessment(): void {
gotoOwnAssessment(event: Event): void {
if (this.canSelfAssess) {
event.preventDefault();
event.stopPropagation();
const params = {
module: this.module,
workshop: this.workshop,