diff --git a/src/app/app-root/login/login.component.html b/src/app/app-root/login/login.component.html index 1ee158540dab642b1774aaff7d9e0eada3cea3de..8b55f4d83f2221ea1d45722125e67990d29a85f7 100644 --- a/src/app/app-root/login/login.component.html +++ b/src/app/app-root/login/login.component.html @@ -1,6 +1,6 @@ <div fxLayout="row wrap" fxLayoutAlign="center stretch"> <mat-card fxFlex="0 0 400px"> - <form [formGroup]="loginForm" (ngSubmit)="login()"> + <form [formGroup]="loginForm" (ngSubmit)="login()" *ngIf="mds.isApiValid"> <mat-card-title>Anmelden</mat-card-title> <mat-card-content fxLayout="column"> <mat-form-field> @@ -9,12 +9,12 @@ <mat-form-field> <input matInput #pw type="password" formControlName="pw" placeholder="Kennwort"> </mat-form-field> - <p style="color: chocolate"><b>{{ problemText }}</b></p> </mat-card-content> <mat-card-actions> <button mat-raised-button type="submit" [disabled]="loginForm.invalid" color="primary">Weiter</button> </mat-card-actions> </form> + <p style="color: chocolate" *ngIf="!mds.isApiValid"><b>Die Verbindung mit dem Server ist nicht möglich.</b></p> </mat-card> <mat-card fxFlex="0 0 400px" class="mat-card-gray"> diff --git a/src/app/app.component.html b/src/app/app.component.html index fc32adb348692125459823e31c94a27caa094bed..d671eb9cbd85ce6986f553f251839e5f88ae332c 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -3,9 +3,9 @@ <img src="assets/IQB-LogoA.png" matTooltip="Zur Startseite" alt="IQB-logo"/> </a> </div> -<div class="error-msg" *ngIf="showError" [matTooltip]="(mds.appError$ | async)?.description" fxLayout="row" fxLayoutAlign="space-between center"> +<div class="error-msg" *ngIf="showError" [matTooltip]="errorData?.description" fxLayout="row" fxLayoutAlign="space-between center"> <mat-icon>error</mat-icon> - {{ (mds.appError$ | async)?.label }} + {{ errorData?.label }} <button mat-button (click)="closeErrorBox()" matTooltip="Fehlernachricht ausblenden" fxFlex="none"> <mat-icon>clear</mat-icon> </button> diff --git a/src/app/app.component.ts b/src/app/app.component.ts index ace842f35a200fe00b768e1cbd64cebc230a5111..b1d9dc6479123a7491e97f7bd2df004c1ada0b2c 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -3,6 +3,7 @@ import {Component, Inject, OnDestroy, OnInit} from '@angular/core'; import { BackendService } from './backend.service'; import {CustomtextService} from 'iqb-components'; import {Subscription} from "rxjs"; +import {AppError} from "./app.interfaces"; @Component({ selector: 'tc-root', @@ -13,6 +14,7 @@ import {Subscription} from "rxjs"; export class AppComponent implements OnInit, OnDestroy { private appErrorSubscription: Subscription = null; showError = false; + errorData: AppError; constructor ( public mds: MainDataService, @@ -61,6 +63,7 @@ export class AppComponent implements OnInit, OnDestroy { this.appErrorSubscription = this.mds.appError$.subscribe(err => { if (err && !this.mds.errorReportingSilent) { + this.errorData = err; this.showError = true; } }); @@ -82,8 +85,8 @@ export class AppComponent implements OnInit, OnDestroy { if (authData) { this.cts.addCustomTexts(authData.customTexts); } - this.mds.isApiVersionValid = AppComponent.isValidVersion(this.expectedApiVersion, sc.version); - if (!this.mds.isApiVersionValid) { + this.mds.isApiValid = AppComponent.isValidVersion(this.expectedApiVersion, sc.version); + if (!this.mds.isApiValid) { this.mds.appError$.next({ label: "Server-Problem: API-Version ungültig", description: "erwartet: " + this.expectedApiVersion + ", gefunden: " + sc.version, @@ -95,12 +98,7 @@ export class AppComponent implements OnInit, OnDestroy { } this.mds.setTestConfig(sc.testConfig); } else { - this.mds.isApiVersionValid = false; - this.mds.appError$.next({ - label: "Allgemeines Server-Problem", - description: "getSysConfig lieferte null", - category: "FATAL" - }); + this.mds.isApiValid = false; } }); diff --git a/src/app/app.interceptor.ts b/src/app/app.interceptor.ts index c0679ae84fcf02753a93aee6091ddbbbd2455a2f..d3de6b8fd585964144abf121e752a8ebdb724cf6 100644 --- a/src/app/app.interceptor.ts +++ b/src/app/app.interceptor.ts @@ -16,7 +16,7 @@ export class AuthInterceptor implements HttpInterceptor { private router: Router) {} intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { - if (!this.mds.isApiVersionValid) { + if (!this.mds.isApiValid) { this.mds.appError$.next({ label: "Server-Problem: API-Version ungültig", description: "Keine weiteren Server-Aufrufe erlaubt", diff --git a/src/app/maindata.service.ts b/src/app/maindata.service.ts index e079d9364fd2844b5d8043654412cb41b30ac6d0..9dea8b3a51d6e7c97e9105a04a8676fcf12e49a0 100644 --- a/src/app/maindata.service.ts +++ b/src/app/maindata.service.ts @@ -20,7 +20,7 @@ export class MainDataService { public errorReportingSilent = false; public isSpinnerOn$ = new BehaviorSubject<boolean>(false); public progressVisualEnabled = true; - public isApiVersionValid = true; + public isApiValid = true; public appConfig: AppConfig = null; public sysCheckAvailable = false; diff --git a/src/app/test-controller/backend.service.ts b/src/app/test-controller/backend.service.ts index d0d5ef7b6457aece1b361db7b83148e1be166e95..5bc6f8cdf7e0b669072b1eb2eaf3ed4d308ccc63 100644 --- a/src/app/test-controller/backend.service.ts +++ b/src/app/test-controller/backend.service.ts @@ -42,7 +42,6 @@ export class BackendService { } getTestData(testId: string): Observable<TestData | boolean> { - console.log('3 ### >' + testId + '<'); return this.http .get<TestData>(this.serverUrl + 'test/' + testId) .pipe( diff --git a/src/app/test-controller/review-dialog/review-dialog.component.html b/src/app/test-controller/review-dialog/review-dialog.component.html index ef9694085da4ab63cb74188f1e1081da19f595c8..98542936c938c71e4304a55d56a7f32795dd3376 100644 --- a/src/app/test-controller/review-dialog/review-dialog.component.html +++ b/src/app/test-controller/review-dialog/review-dialog.component.html @@ -24,11 +24,11 @@ <mat-checkbox formControlName="design">Gestaltung</mat-checkbox> </div> <mat-form-field> - <textarea matInput formControlName="entry" placeholder="Kommentar" rows="15"></textarea> - <mat-icon matSuffix>mode_edit</mat-icon> + <input matInput formControlName="sender" placeholder="Mein Name"> </mat-form-field> <mat-form-field> - <input matInput formControlName="sender" placeholder="Mein Name"> + <textarea matInput formControlName="entry" placeholder="Kommentar" rows="15"></textarea> + <mat-icon matSuffix>mode_edit</mat-icon> </mat-form-field> </mat-dialog-content> diff --git a/src/app/test-controller/test-config.ts b/src/app/test-controller/test-config.ts index 7db90b275fe264e2417fe3925588b854e23415fc..db0716782ce222929138a45807fc1b68f1f96de7 100644 --- a/src/app/test-controller/test-config.ts +++ b/src/app/test-controller/test-config.ts @@ -76,6 +76,7 @@ export class TestConfig { for (let childIndex = 0; childIndex < bookletConfigs.length; childIndex++) { const configParameter = bookletConfigs[childIndex].getAttribute('parameter'); + // TODO remove old version switch (bookletConfigs[childIndex].nodeName) { // ---------------------- case 'NavPolicy': @@ -121,6 +122,35 @@ export class TestConfig { } } break; + case 'Config': + const configKey = bookletConfigs[childIndex].getAttribute('key'); + const configValue = bookletConfigs[childIndex].textContent; + if (configKey) { + switch (configKey) { + case 'loading_mode': + this.loading_mode = configValue; + break; + case 'log_mode': + this.log_mode = configValue; + break; + case 'page_navibuttons': + this.page_navibuttons = configValue; + break; + case 'unit_navibuttons': + this.unit_navibuttons = configValue; + break; + case 'unit_menu': + this.unit_menu = configValue; + break; + case 'force_presentation_complete': + this.force_presentation_complete = configValue; + break; + case 'force_responses_complete': + this.force_responses_complete = configValue; + break; + } + } + break; } } } diff --git a/src/app/test-controller/test-controller.classes.ts b/src/app/test-controller/test-controller.classes.ts index b43d45327da76164e887a3946384fb6e793a6faa..af8eea06bdfb2ee2b708186af6df498dcf6815f9 100644 --- a/src/app/test-controller/test-controller.classes.ts +++ b/src/app/test-controller/test-controller.classes.ts @@ -191,8 +191,12 @@ export class Testlet extends TestletContentElement { if (this.maxTimeLeft > 0) { myreturn.maxTimerRequiringTestlet = this; } - if (this.title && !isEntryPoint) { - myreturn.testletLabel = this.title + if (!isEntryPoint) { + const label = this.title.trim(); + if (label) { + myreturn.testletLabel = label + } + } } return myreturn; diff --git a/src/app/test-controller/test-controller.component.ts b/src/app/test-controller/test-controller.component.ts index 74b5e0a2dabe177b0dd76da8e32784a717bf5969..c61ed655a1ee46f324178ef486a10f63dd72bfe5 100644 --- a/src/app/test-controller/test-controller.component.ts +++ b/src/app/test-controller/test-controller.component.ts @@ -144,9 +144,8 @@ export class TestControllerComponent implements OnInit, OnDestroy { this.lastTestletIndex += 1; } let testletLabel: string = childElements[childIndex].getAttribute('label'); - if ((typeof testletLabel !== 'undefined') && (testletLabel !== null)) { - testletLabel = testletId; - } + testletLabel = testletLabel ? testletLabel.trim() : ''; + console.log('+ >' + testletLabel + '<'); this.addTestletContentFromBookletXml(targetTestlet.addTestlet(testletId, testletLabel), childElements[childIndex]); } diff --git a/src/app/test-controller/test-status/test-status.component.css b/src/app/test-controller/test-status/test-status.component.css index 4d4782a244c324d6b06ae5fa7200bd9fe0353c75..ac64082fc7fdea8b44c077ea1646b7e2da5d7d0c 100644 --- a/src/app/test-controller/test-status/test-status.component.css +++ b/src/app/test-controller/test-status/test-status.component.css @@ -17,11 +17,15 @@ mat-card { .active-unit { background-color: #b2ff59; padding: 4px; + overflow: hidden; + text-overflow: ellipsis; } .non-active-unit { background-color: transparent; padding: 4px; + overflow: hidden; + text-overflow: ellipsis; } .testlet-marker-non { @@ -29,7 +33,7 @@ mat-card { } .testlet-marker-a { - background-color: mediumpurple; + background-color: royalblue; } .testlet-marker-b { diff --git a/src/app/test-controller/test-status/test-status.component.html b/src/app/test-controller/test-status/test-status.component.html index 82fb42db61df1c9d3e9c90590d99b2d24d67b512..c9cebb3caf360b033bda431962cd4876611095bd 100644 --- a/src/app/test-controller/test-status/test-status.component.html +++ b/src/app/test-controller/test-status/test-status.component.html @@ -7,8 +7,8 @@ <div *ngFor="let u of unitMenuButtonList" fxLayout="column" fxLayoutAlign="center stretch"> <div fxLayout="row" fxLayoutAlign="space-between stretch"> <div [class]="u.testletMarker" [matTooltip]="u.testletLabel" fxFlex="0 0 10px"></div> - <div [class]="u.isCurrent ? 'active-unit' : 'non-active-unit'" fxFlex fxLayout="column" fxLayoutAlign="center stretch"> - <button mat-raised-button (click)="tcs.setUnitNavigationRequest(u.sequenceId.toString())"> + <div [class]="u.isCurrent ? 'active-unit' : 'non-active-unit'" fxFlex fxLayout="column"> + <button mat-flat-button (click)="tcs.setUnitNavigationRequest(u.sequenceId.toString())"> {{u.label}} </button> </div> @@ -32,7 +32,7 @@ </p> </mat-card-content> <mat-card-actions> - <button mat-raised-button color="primary" (click)="terminateTest()">{{ 'Test beenden' | customtext:'login_testEndButtonLabel':cts.updateCount}}}</button> + <button mat-raised-button color="primary" (click)="terminateTest()">{{ 'Test beenden' | customtext:'login_testEndButtonLabel':cts.updateCount}}</button> </mat-card-actions> </mat-card> </div> diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 16eec199b871c1fe3182e67c436d9a8d2de51d5e..bde86f2ad3323ff0b68125495aad384315466ac6 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -2,9 +2,9 @@ export const environment = { production: true, - testcenterUrl: '/', + testcenterUrl: '/api/', appName: 'IQB-Testcenter', appPublisher: 'IQB - Institut zur Qualitätsentwicklung im Bildungswesen', - appVersion: '1.5.3 - 20.2.2020', + appVersion: '2.0.0-beta.1 - 27.4.2020', apiVersionExpected: '2.0.0' };