diff --git a/src/app/components/shared/_dialogs/statistic-help/statistic-help.component.html b/src/app/components/shared/_dialogs/statistic-help/statistic-help.component.html index 9d180a3939d4611c060157ab9e99cfc2bdbfeb06..ff4d00fb49094999c260034d1ec66e00f7f704d3 100644 --- a/src/app/components/shared/_dialogs/statistic-help/statistic-help.component.html +++ b/src/app/components/shared/_dialogs/statistic-help/statistic-help.component.html @@ -11,7 +11,7 @@ <mat-chip class="okayC"> Okay </mat-chip> - <h3> > 50 % </h3> + <h3> >= 50 % </h3> </div> <div fxLayout="row" fxLayoutAlign="center center" fxLayoutGap="20px"> <mat-chip class="negativeC"> diff --git a/src/app/components/shared/content-groups/content-groups.component.scss b/src/app/components/shared/content-groups/content-groups.component.scss index 090b94dc2c9930de5935bcaba2d1e814c3c09eea..4d3c7ce2830ac92e6fae567a70b8593a9508bdd1 100644 --- a/src/app/components/shared/content-groups/content-groups.component.scss +++ b/src/app/components/shared/content-groups/content-groups.component.scss @@ -17,7 +17,8 @@ background-color: mat-color($arsnova-primary, 200); transform: translateZ(20px); transform: translateY(-5px); - transform: scaleY(1.2); + transform: scaleY(1.1); + transform: scaleX(1.01); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2); } } diff --git a/src/app/components/shared/room-join/room-join.component.html b/src/app/components/shared/room-join/room-join.component.html index 0d3297e0ef613174bb69fefc7506fe35a76b5eea..b2294fc7696b44b82c4774da4cef7cf73536dad0 100644 --- a/src/app/components/shared/room-join/room-join.component.html +++ b/src/app/components/shared/room-join/room-join.component.html @@ -2,9 +2,9 @@ <form (ngSubmit)="joinRoom(roomId.value)"> <div fxLayout="row" fxLayoutAlign="center" fxLayoutGap="10px"> <mat-form-field> - <input matInput #roomId type="text" inputmode="numeric" min="00000000" max="99999999" + <input matInput #roomId type="text" pattern="[0-9]*" inputmode="numeric" min="00000000" max="99999999" onkeydown="if(this.value.length - (this.value.split(' ').length -1) === 8 && event.keyCode != 8) return false; - if(this.value.length === 4 && event.keyCode != 8) this.value = this.value + ' ';" + if(this.value.length === 4 && event.keyCode != 8) this.value = this.value + ' ';" placeholder="Session-Id" [formControl]="roomFormControl" [errorStateMatcher]="matcher"/> <mat-hint align="end">{{ roomId.value.length - (roomId.value.split(' ').length -1) }} / 8</mat-hint> <mat-error *ngIf="roomFormControl.hasError('required')">{{ 'home-page.please-enter' | translate}}</mat-error> diff --git a/src/app/components/shared/room-join/room-join.component.ts b/src/app/components/shared/room-join/room-join.component.ts index 07ca5cd82a638f3387c10b3da078fe9e1308855b..274b05edc2bd1fbbe50d7217b2afd4443d20075f 100644 --- a/src/app/components/shared/room-join/room-join.component.ts +++ b/src/app/components/shared/room-join/room-join.component.ts @@ -10,7 +10,6 @@ import { TranslateService } from '@ngx-translate/core'; import { AuthenticationService } from '../../../services/http/authentication.service'; import { UserRole } from '../../../models/user-roles.enum'; import { User } from '../../../models/user'; -import { log } from 'util'; export class JoinErrorStateMatcher implements ErrorStateMatcher { isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean { @@ -64,13 +63,12 @@ export class RoomJoinComponent implements OnInit { }); } else { if (!this.user) { - this.authenticationService.guestLogin(UserRole.PARTICIPANT).subscribe(loggedIn => { - if (loggedIn === 'true') { - this.addAndNavigate(); - } - }); + this.guestLogin(); } else { - this.addAndNavigate(); + if (this.user.role === UserRole.CREATOR) { + this.authenticationService.logout(); + this.guestLogin(); + } } } }); @@ -83,6 +81,14 @@ export class RoomJoinComponent implements OnInit { } } + guestLogin() { + this.authenticationService.guestLogin(UserRole.PARTICIPANT).subscribe(loggedIn => { + if (loggedIn === 'true') { + this.addAndNavigate(); + } + }); + } + addAndNavigate() { this.roomService.addToHistory(this.room.id); this.router.navigate([`/participant/room/${this.room.shortId}`]); diff --git a/src/app/components/shared/statistics-page/statistics-page.component.html b/src/app/components/shared/statistics-page/statistics-page.component.html index 7bda11622e03fcd706e558b2f3c49ec55ca57a1c..7ec10b1de45c754910bb6f471ef30563cc339490 100644 --- a/src/app/components/shared/statistics-page/statistics-page.component.html +++ b/src/app/components/shared/statistics-page/statistics-page.component.html @@ -2,7 +2,7 @@ <div fxLayout="row" fxLayoutAlign="center"> <mat-card> <mat-card-header> - <h2>{{'statistic.learning-status' | translate}}</h2> + <h2>{{'statistic.answer-statistic' | translate}}</h2> <span class="fill-remaining-space"></span> <button mat-icon-button (click)="showHelp()"><mat-icon color="primary">help</mat-icon></button> </mat-card-header> diff --git a/src/app/components/shared/statistics-page/statistics-page.component.ts b/src/app/components/shared/statistics-page/statistics-page.component.ts index c5180511562878f74df929b0b6ebec16044082aa..07eb8be7645e4c131d25d60e2b62f6ff3c480ab9 100644 --- a/src/app/components/shared/statistics-page/statistics-page.component.ts +++ b/src/app/components/shared/statistics-page/statistics-page.component.ts @@ -34,7 +34,10 @@ export class StatisticsPageComponent implements OnInit { } ngOnInit(): void { - this.currentCG = sessionStorage.getItem('contentGroup'); + if (sessionStorage.getItem('contentGroup')) { + console.log('in if'); + this.currentCG = sessionStorage.getItem('contentGroup'); + } this.getRoom(localStorage.getItem('roomId')); this.tabGroup.selectedIndex = 1; } @@ -44,9 +47,11 @@ export class StatisticsPageComponent implements OnInit { this.roomService.getRoom(id).subscribe(room => { this.contentGroups = room.contentGroups; if (this.contentGroups) { - for (let i = 0; i < this.contentGroups.length; i++) { - if (this.currentCG.includes(this.contentGroups[i].name)) { - this.tabGroup.selectedIndex = i; + if( this.currentCG) { + for (let i = 0; i < this.contentGroups.length; i++) { + if (this.currentCG.includes(this.contentGroups[i].name)) { + this.tabGroup.selectedIndex = i; + } } } } else { diff --git a/src/assets/i18n/creator/de.json b/src/assets/i18n/creator/de.json index cd827ca55f1b65d0869ccd5a7dd78a604b9bb9f3..e845fe6f2a03479fac713c8cd2a34d311833e4de 100644 --- a/src/assets/i18n/creator/de.json +++ b/src/assets/i18n/creator/de.json @@ -66,7 +66,7 @@ }, "statistic": { "content": "Frage", - "learning-status": "Lernstand", + "answer-statistic": "Antwortstatistik", "answers": "Antworten", "percentage": "Prozent", "abstentions": "Enthaltungen" diff --git a/src/assets/i18n/creator/en.json b/src/assets/i18n/creator/en.json index 3ea05b1504422cdcfb232ac952a2d11cfb8d1435..dd10fc18fcbf6d7351fdaf0fed45ddfa2c67ff85 100644 --- a/src/assets/i18n/creator/en.json +++ b/src/assets/i18n/creator/en.json @@ -66,7 +66,7 @@ }, "statistic": { "content": "Content", - "learning-status": "Learning status", + "answer-statistic": "Answer statistic", "answers": "Answers", "percentage": "Percentage", "abstentions": "Abstentions" diff --git a/src/assets/i18n/participant/de.json b/src/assets/i18n/participant/de.json index 51b8e72be48f8b583968af1e693dc50b3a6c9cae..2b1bac6265121bcc17af076aef82d473ff0b5a8a 100644 --- a/src/assets/i18n/participant/de.json +++ b/src/assets/i18n/participant/de.json @@ -31,7 +31,7 @@ }, "statistic": { "content": "Frage", - "learning-status": "Lernstand", + "answer-statistic": "Antwortstatistik", "answers": "Antworten", "percentage": "Prozent", "abstentions": "Enthaltungen" diff --git a/src/assets/i18n/participant/en.json b/src/assets/i18n/participant/en.json index 712c7e5ace1aaaf02f5ae5b895354274734169ff..a82a698e3da06bd6514da32959e99a37076948df 100644 --- a/src/assets/i18n/participant/en.json +++ b/src/assets/i18n/participant/en.json @@ -31,7 +31,7 @@ }, "statistic": { "content": "Content", - "learning-status": "Learning status", + "answer-statistic": "Answer statistic", "answers": "Answers", "percentage": "Percentage", "abstentions": "Abstentions"