Skip to content
Snippets Groups Projects
Commit f5904909 authored by paf's avatar paf
Browse files

display if code was cleared

parent 4d012d98
No related branches found
No related tags found
No related merge requests found
......@@ -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)">
......
......@@ -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');
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment