diff --git a/src/app/group-monitor/test-view/test-view.component.html b/src/app/group-monitor/test-view/test-view.component.html index 29bfad9100560e582654a26c5b4e3241ddd4d6b6..209691bcb30eed270eef634eaf4707dd148879a2 100644 --- a/src/app/group-monitor/test-view/test-view.component.html +++ b/src/app/group-monitor/test-view/test-view.component.html @@ -142,8 +142,8 @@ <h1>{{unitContext.parent.label || 'Aktueller Abschnitt'}}</h1> <mat-icon class="unit-badge" - *ngIf="maxTimeLeft && (maxTimeLeft[unitContext.parent.id] !== undefined)" - matBadge="{{maxTimeLeft[unitContext.parent.id].toString()}}" + *ngIf="testletsTimeleft && (testletsTimeleft[unitContext.parent.id] !== undefined)" + matBadge="{{testletsTimeleft[unitContext.parent.id].toString()}}" matBadgeColor="accent" matTooltip="Verbleibende Zeit" >alarm @@ -185,7 +185,7 @@ matTooltip="Freigabewort: {{codeToEnter.code.toUpperCase()}}" matTooltipPosition="above" > - <mat-icon>sms</mat-icon> + <mat-icon>{{testletsClearedCode && (testletsClearedCode.indexOf(testlet.id) > -1) ? 'lock_open' : 'lock'}}</mat-icon> </span> <ng-container *ngFor="let testletOrUnit of testlet.children; trackBy: trackUnits" [ngSwitch]="getTestletType(testletOrUnit)"> diff --git a/src/app/group-monitor/test-view/test-view.component.ts b/src/app/group-monitor/test-view/test-view.component.ts index 246e5be12188446702fd08124ed74f55c4a8adac..f8945a62ae239920b9e987461edf97b17aeef095 100644 --- a/src/app/group-monitor/test-view/test-view.component.ts +++ b/src/app/group-monitor/test-view/test-view.component.ts @@ -38,7 +38,8 @@ export class TestViewComponent implements OnInit, OnChanges, OnDestroy { public booklet$: Observable<Booklet|BookletError>; public featuredUnit$: Observable<UnitContext|null>; - public maxTimeLeft: object|null; // TODO make observable maybe + public testletsTimeleft: object|null; // TODO make observable maybe + public testletsClearedCode: object | null; private bookletSubscription: Subscription; @@ -77,7 +78,8 @@ export class TestViewComponent implements OnInit, OnChanges, OnDestroy { ngOnChanges(changes: {[propertyName: string]: SimpleChange}) { if (typeof changes['testSession'] !== 'undefined') { this.testSession$.next(this.testSession); - this.maxTimeLeft = this.parseJsonState(this.testSession.testState, 'TESTLETS_TIMELEFT'); + this.testletsTimeleft = this.parseJsonState(this.testSession.testState, 'TESTLETS_TIMELEFT'); + this.testletsClearedCode = this.parseJsonState(this.testSession.testState, 'TESTLETS_CLEARED_CODE'); } }