diff --git a/src/app/add-content/add-content.component.html b/src/app/add-content/add-content.component.html new file mode 100644 index 0000000000000000000000000000000000000000..e550777572e74d629849fbe321e6c6d8dbcf66dd --- /dev/null +++ b/src/app/add-content/add-content.component.html @@ -0,0 +1,16 @@ +<div fxLayout="column" fxLayoutAlign="start" fxLayoutGap="20px" fxFill> + <div fxLayout="row" fxLayoutAlign="center"> + <mat-tab-group> + <mat-tab label="Text"> + <div class="tab-container"> + <app-creator-text-content></app-creator-text-content> + </div> + </mat-tab> + <mat-tab label="Choice"> + <div class="tab-container"> + <app-creator-choice-content></app-creator-choice-content> + </div> + </mat-tab> + </mat-tab-group> + </div> +</div> diff --git a/src/app/add-content/add-content.component.scss b/src/app/add-content/add-content.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..ea9c3d93f767262d835e953d031a031e64ad6f42 --- /dev/null +++ b/src/app/add-content/add-content.component.scss @@ -0,0 +1,8 @@ +mat-tab-group { + width: 100%; + max-width: 800px; +} + +.tab-container { + padding: 20px; +} diff --git a/src/app/add-content/add-content.component.spec.ts b/src/app/add-content/add-content.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..a55d1df87d859a860ca7e784b54decd98dcc8378 --- /dev/null +++ b/src/app/add-content/add-content.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AddContentComponent } from './add-content.component'; + +describe('AddContentComponent', () => { + let component: AddContentComponent; + let fixture: ComponentFixture<AddContentComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AddContentComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AddContentComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/add-content/add-content.component.ts b/src/app/add-content/add-content.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..312fd84c0c426a27f750f11f65acaec3bd3d0ae2 --- /dev/null +++ b/src/app/add-content/add-content.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-add-content', + templateUrl: './add-content.component.html', + styleUrls: ['./add-content.component.scss'] +}) +export class AddContentComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index af4bfcbb79920e3b8b3fbc614de27ad7a8a67e25..23b61440d1d5b4e8b2866c0505f9dc6e8908de08 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -11,38 +11,36 @@ import { ParticipantRoomComponent } from './participant-room/participant-room.co import { CreatorRoomComponent } from './creator-room/creator-room.component'; import { CommentListComponent } from './comment-list/comment-list.component'; import { ContentListComponent } from './content-list/content-list.component'; -import { ContentCreationComponent } from './content-creation/content-creation.component'; import { ContentDetailComponent } from './content-detail/content-detail.component'; import { AnswerStatisticsComponent } from './answer-statistics/answer-statistics.component'; +import { AddContentComponent } from './add-content/add-content.component'; +import { ParticipantContentCarouselPageComponent } from './participant-content-carousel-page/participant-content-carousel-page.component'; const routes: Routes = [ - { path: '', redirectTo: '/home', pathMatch: 'full' }, - { path: 'home', component: LoginScreenComponent }, { - path: 'creator', - component: CreatorHomeScreenComponent, - canActivate: [AuthenticationGuard], - data: { roles: [UserRole.CREATOR] } + path: '', + redirectTo: '/home', + pathMatch: 'full' }, { - path: 'participant', - component: ParticipantHomeScreenComponent, - canActivate: [AuthenticationGuard], - data: { roles: [UserRole.PARTICIPANT] } + path: 'home', + component: LoginScreenComponent }, { - path: 'creator/room/:roomId', - component: CreatorRoomComponent, - canActivate: [AuthenticationGuard] + path: 'creator', + component: CreatorHomeScreenComponent, + canActivate: [AuthenticationGuard], + data: { roles: [UserRole.CREATOR] } }, { path: 'creator/room/:roomId', component: CreatorRoomComponent, - canActivate: [AuthenticationGuard] + canActivate: [AuthenticationGuard], + data: { roles: [UserRole.CREATOR] } }, { - path: 'creator/room/:roomId/comments', - component: CommentListComponent, + path: 'creator/room/:roomId/add-content', + component: AddContentComponent, canActivate: [AuthenticationGuard], data: { roles: [UserRole.CREATOR] } }, @@ -53,25 +51,26 @@ const routes: Routes = [ data: { roles: [UserRole.CREATOR] } }, { - path: 'creator/room/:roomId/content-creation', - component: ContentCreationComponent, + path: 'creator/room/:roomId/comments', + component: CommentListComponent, canActivate: [AuthenticationGuard], data: { roles: [UserRole.CREATOR] } }, { - path: 'creator/room/:roomId/content-list', + path: 'creator/room/:roomId/content', component: ContentListComponent, canActivate: [AuthenticationGuard], data: { roles: [UserRole.CREATOR] } }, { - path: 'creator/room/:roomId/:contentId', + path: 'creator/room/:roomId/content/:contentId', component: ContentDetailComponent, canActivate: [AuthenticationGuard], data: { roles: [UserRole.CREATOR] } }, - { path: 'participant/room/:roomId/create-comment', - component: CreateCommentComponent, + { + path: 'participant', + component: ParticipantHomeScreenComponent, canActivate: [AuthenticationGuard], data: { roles: [UserRole.PARTICIPANT] } }, @@ -81,7 +80,22 @@ const routes: Routes = [ canActivate: [AuthenticationGuard], data: { roles: [UserRole.PARTICIPANT] } }, - { path: '**', component: PageNotFoundComponent } + { + path: 'participant/room/:roomId/create-comment', + component: CreateCommentComponent, + canActivate: [AuthenticationGuard], + data: { roles: [UserRole.PARTICIPANT] } + }, + { + path: 'participant/room/:roomId/questions', + component: ParticipantContentCarouselPageComponent, + canActivate: [AuthenticationGuard], + data: { roles: [UserRole.PARTICIPANT] } + }, + { + path: '**', + component: PageNotFoundComponent + } ]; diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 618e686c611bd200b022e13fa4cceac368bf099c..4a858f65242a5d9f0b5d051bbc546ce0932815f3 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -75,6 +75,12 @@ import { ContentAnswerService } from './content-answer.service'; import { RoomDeletionComponent } from './room-deletion/room-deletion.component'; import { AnswerStatisticsComponent } from './answer-statistics/answer-statistics.component'; import { RoomModificationComponent } from './room-modification/room-modification.component'; +import { ParticipantChoiceContentComponent } from './participant-choice-content/participant-choice-content.component'; +import { CreatorChoiceContentComponent } from './creator-choice-content/creator-choice-content.component'; +import { AddContentComponent } from './add-content/add-content.component'; +import { ParticipantContentCarouselPageComponent } from './participant-content-carousel-page/participant-content-carousel-page.component'; +import { ParticipantTextContentComponent } from './participant-text-content/participant-text-content.component'; +import { CreatorTextContentComponent } from './creator-text-content/creator-text-content.component'; @NgModule({ declarations: [ @@ -103,7 +109,13 @@ import { RoomModificationComponent } from './room-modification/room-modification ContentAnswersListComponent, RoomDeletionComponent, RoomModificationComponent, - AnswerStatisticsComponent + ParticipantChoiceContentComponent, + CreatorChoiceContentComponent, + AddContentComponent, + ParticipantContentCarouselPageComponent, + ParticipantTextContentComponent, + AnswerStatisticsComponent, + CreatorTextContentComponent ], entryComponents: [ RegisterComponent, diff --git a/src/app/content-creation/content-creation.component.ts b/src/app/content-creation/content-creation.component.ts index ccef4b7837311782b85e9b9a9f90150945fdf12c..5c535419a280ba98c8c30f90f83ce07b9da13f42 100644 --- a/src/app/content-creation/content-creation.component.ts +++ b/src/app/content-creation/content-creation.component.ts @@ -19,13 +19,10 @@ export class ContentCreationComponent implements OnInit { constructor(private contentService: ContentService, private router: Router, - private notification: NotificationService, - public dialogRef: MatDialogRef<RoomComponent>, - @Inject(MAT_DIALOG_DATA) public data: any) { + private notification: NotificationService) { } onNoClick(): void { - this.dialogRef.close(); } ngOnInit() { @@ -45,8 +42,7 @@ export class ContentCreationComponent implements OnInit { this.contentService.addContent({ subject: subject, body: body, roomId: this.roomId } as Content) .subscribe(content => { this.notification.show(`Content '${content.subject}' successfully created.`); - this.router.navigate([`/creator/room/${content.roomId}/${content.contentId}`]); - this.dialogRef.close(); + // this.router.navigate([`/creator/room/${content.roomId}/${content.contentId}`]); }); } } diff --git a/src/app/content-list/content-list.component.html b/src/app/content-list/content-list.component.html index ad9cab2ee24959e0d8cd3792b6ca193614cedbb9..fd966e2ad255f8af5c2cb07e0415cd9ea36a7aa7 100644 --- a/src/app/content-list/content-list.component.html +++ b/src/app/content-list/content-list.component.html @@ -1,6 +1,6 @@ <mat-list> <mat-list-item *ngFor="let content of contents"> - <button mat-button routerLink="{{content.contentId}}"> + <button mat-button routerLink="content/{{content.contentId}}"> Content {{content.contentId}}: {{content.subject}} </button> </mat-list-item> diff --git a/src/app/creator-choice-content/creator-choice-content.component.html b/src/app/creator-choice-content/creator-choice-content.component.html new file mode 100644 index 0000000000000000000000000000000000000000..53ae04cfc6d52c08d269093c704e271f094b678c --- /dev/null +++ b/src/app/creator-choice-content/creator-choice-content.component.html @@ -0,0 +1,49 @@ +<form (ngSubmit)="submitContent()"> + <mat-form-field class="input-block"> + <input matInput #subject [(ngModel)]="content.subject" placeholder="Subject" name="subject"> + </mat-form-field> + <mat-form-field class="input-block"> + <textarea matInput #body [(ngModel)]="content.body" placeholder="Body" name="body"></textarea> + </mat-form-field> + <mat-divider></mat-divider> + + <mat-table #table [dataSource]="content.options"> + + <ng-container matColumnDef="label"> + <mat-header-cell *matHeaderCellDef>Answer</mat-header-cell> + <mat-cell *matCellDef="let answer"> + <mat-checkbox color="primary">{{ answer.label }}</mat-checkbox> + </mat-cell> + </ng-container> + + <ng-container matColumnDef="points"> + <mat-header-cell *matHeaderCellDef>Points</mat-header-cell> + <mat-cell *matCellDef="let answer">{{ answer.points }}</mat-cell> + </ng-container> + + <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row> + <mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row> + </mat-table> + + <mat-divider></mat-divider> + + <div fxLayout="row" fxLayoutGap="15px"> + <div fxLayout="column" fxLayoutAlign="center"> + <mat-checkbox #answerIsCorrect color="primary">Is correct</mat-checkbox> + </div> + <mat-form-field class="input-block"> + <input matInput #answerLabel placeholder="Answer" name="answer"> + </mat-form-field> + <mat-form-field class="input-block"> + <input matInput #answerPoints placeholder="Points" name="points"> + </mat-form-field> + <div fxLayout="column" fxLayoutAlign="center"> + <button mat-button type="button" + (click)="addAnswer(answerIsCorrect.value, answerLabel.value, answerPoints.value)"> + Add Answer + </button> + </div> + </div> + + <button mat-raised-button type="submit" color="primary">Submit</button> +</form> diff --git a/src/app/creator-choice-content/creator-choice-content.component.scss b/src/app/creator-choice-content/creator-choice-content.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/app/creator-choice-content/creator-choice-content.component.spec.ts b/src/app/creator-choice-content/creator-choice-content.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..95fff0fceb9d82e8168773fa181741d7ca108cf8 --- /dev/null +++ b/src/app/creator-choice-content/creator-choice-content.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CreatorChoiceContentComponent } from './creator-choice-content.component'; + +describe('CreatorChoiceContentComponent', () => { + let component: CreatorChoiceContentComponent; + let fixture: ComponentFixture<CreatorChoiceContentComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CreatorChoiceContentComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CreatorChoiceContentComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/creator-choice-content/creator-choice-content.component.ts b/src/app/creator-choice-content/creator-choice-content.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..c8c96da294715e66826f915a60609c5cf573c25f --- /dev/null +++ b/src/app/creator-choice-content/creator-choice-content.component.ts @@ -0,0 +1,40 @@ +import { Component, OnInit } from '@angular/core'; +import { AnswerOption } from '../answer-option'; +import { ChoiceContent } from '../choice-content'; + +@Component({ + selector: 'app-creator-choice-content', + templateUrl: './creator-choice-content.component.html', + styleUrls: ['./creator-choice-content.component.scss'] +}) +export class CreatorChoiceContentComponent implements OnInit { + + content: ChoiceContent = new ChoiceContent('2', + '1', + '1', + 'Choice Content 1', + 'This is the body of Choice Content 1', + 1, + [ + new AnswerOption('Option 1', '0'), + new AnswerOption('Option 2', '10'), + new AnswerOption('Option 3', '20'), + new AnswerOption('Option 4', '30') + ], + [1, 2, 3], + true); + + displayedColumns = ['label', 'points']; + + constructor() { + } + + ngOnInit() { + } + + submitContent() { + } + + addAnswer(isCorrect: boolean, label: string, points: number) { + } +} diff --git a/src/app/creator-room/creator-room.component.html b/src/app/creator-room/creator-room.component.html index bbcbe08ce0404917bb765cac7d21a9f94cc4890a..08d77e307961a56f875b253bcd2e04a64df65c3a 100644 --- a/src/app/creator-room/creator-room.component.html +++ b/src/app/creator-room/creator-room.component.html @@ -21,7 +21,8 @@ <app-content-list></app-content-list> <mat-divider></mat-divider> <mat-card-actions> - <button mat-button color="primary" matTooltip="Create new content" (click)="createContentDialog()"> + <button mat-button color="primary" matTooltip="Create new content" + routerLink="/creator/room/{{room.id}}/add-content"> Create content </button> <button mat-button color="primary" matTooltip="See room comments" routerLink="/creator/room/{{room.id}}/comments"> diff --git a/src/app/creator-text-content/creator-text-content.component.html b/src/app/creator-text-content/creator-text-content.component.html new file mode 100644 index 0000000000000000000000000000000000000000..c1e54b5fc10ef64770e4a33c14e6d698a323607c --- /dev/null +++ b/src/app/creator-text-content/creator-text-content.component.html @@ -0,0 +1,9 @@ +<form (ngSubmit)="submitContent()"> + <mat-form-field class="input-block"> + <input matInput #subject [(ngModel)]="content.subject" placeholder="Subject" name="subject"> + </mat-form-field> + <mat-form-field class="input-block"> + <textarea matInput #body [(ngModel)]="content.body" placeholder="Body" name="body"></textarea> + </mat-form-field> + <button mat-raised-button type="submit" color="primary">Submit</button> +</form> diff --git a/src/app/creator-text-content/creator-text-content.component.scss b/src/app/creator-text-content/creator-text-content.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/app/creator-text-content/creator-text-content.component.spec.ts b/src/app/creator-text-content/creator-text-content.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..db3414a06b5ad042093e8fa2ba7d23968c1ede75 --- /dev/null +++ b/src/app/creator-text-content/creator-text-content.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CreatorTextContentComponent } from './creator-text-content.component'; + +describe('CreatorTextContentComponent', () => { + let component: CreatorTextContentComponent; + let fixture: ComponentFixture<CreatorTextContentComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CreatorTextContentComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CreatorTextContentComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/creator-text-content/creator-text-content.component.ts b/src/app/creator-text-content/creator-text-content.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..0e65839c428ef64df950b27e5e33c319115ae5e9 --- /dev/null +++ b/src/app/creator-text-content/creator-text-content.component.ts @@ -0,0 +1,28 @@ +import { Component, OnInit } from '@angular/core'; +import { TextContent } from '../text-content'; + +@Component({ + selector: 'app-creator-text-content', + templateUrl: './creator-text-content.component.html', + styleUrls: ['./creator-text-content.component.scss'] +}) +export class CreatorTextContentComponent implements OnInit { + + content: TextContent = new TextContent('1', + '1', + '1', + 'Text Content 1', + 'This is the body of Text Content 1', + 1); + + constructor() { + } + + ngOnInit() { + } + + submitContent() { + + } + +} diff --git a/src/app/participant-choice-content/participant-choice-content.component.html b/src/app/participant-choice-content/participant-choice-content.component.html new file mode 100644 index 0000000000000000000000000000000000000000..295ef1677c000df77920fe4efbce34c1301661c7 --- /dev/null +++ b/src/app/participant-choice-content/participant-choice-content.component.html @@ -0,0 +1,11 @@ +<form> + <h1 class="mat-headline">{{ content.subject }}</h1> + <p>{{ content.body }}</p> + <mat-divider></mat-divider> + <mat-list> + <mat-list-item *ngFor="let answer of content.options"> + <mat-checkbox color="primary">{{ answer.label }}</mat-checkbox> + </mat-list-item> + </mat-list> + <button mat-raised-button color="primary">Send answer</button> +</form> diff --git a/src/app/participant-choice-content/participant-choice-content.component.scss b/src/app/participant-choice-content/participant-choice-content.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/app/participant-choice-content/participant-choice-content.component.spec.ts b/src/app/participant-choice-content/participant-choice-content.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..bb07ae23f1829cb57da2adf0ed8b7a46f5cb07bd --- /dev/null +++ b/src/app/participant-choice-content/participant-choice-content.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ParticipantChoiceContentComponent } from './participant-choice-content.component'; + +describe('ParticipantChoiceContentComponent', () => { + let component: ParticipantChoiceContentComponent; + let fixture: ComponentFixture<ParticipantChoiceContentComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ParticipantChoiceContentComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ParticipantChoiceContentComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/participant-choice-content/participant-choice-content.component.ts b/src/app/participant-choice-content/participant-choice-content.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..365adb1b47b028a581eaadd4489098d2ffb5395c --- /dev/null +++ b/src/app/participant-choice-content/participant-choice-content.component.ts @@ -0,0 +1,31 @@ +import { Component, OnInit } from '@angular/core'; +import { ChoiceContent } from '../choice-content'; +import { AnswerOption } from '../answer-option'; + +@Component({ + selector: 'app-participant-choice-content', + templateUrl: './participant-choice-content.component.html', + styleUrls: ['./participant-choice-content.component.scss'] +}) +export class ParticipantChoiceContentComponent implements OnInit { + content: ChoiceContent = new ChoiceContent('2', + '1', + '1', + 'Choice Content 1', + 'This is the body of Choice Content 1', + 1, + [ + new AnswerOption('Option 1', '0'), + new AnswerOption('Option 2', '10'), + new AnswerOption('Option 3', '20'), + new AnswerOption('Option 4', '30') + ], + [2, 3, 4], + true); + + constructor() { + } + + ngOnInit() { + } +} diff --git a/src/app/participant-content-carousel-page/participant-content-carousel-page.component.html b/src/app/participant-content-carousel-page/participant-content-carousel-page.component.html new file mode 100644 index 0000000000000000000000000000000000000000..1f06185f62dab02dfafadaa2b9374b76cec714b2 --- /dev/null +++ b/src/app/participant-content-carousel-page/participant-content-carousel-page.component.html @@ -0,0 +1,22 @@ +<div fxLayout="column" fxLayoutAlign="start" fxLayoutGap="20px" fxFill> + <div fxLayout="row" fxLayoutAlign="center"> + <mat-tab-group> + <!-- + <mat-tab *ngFor="let content of contents"> + <app-participant-choice-content *ngIf="content.format === ContentType.CHOICE"></app-participant-choice-content> + <app-participant-text-content *ngIf="content.format === ContentType.TEXT"></app-participant-text-content> + </mat-tab> + --> + <mat-tab label="Text"> + <div class="tab-container"> + <app-participant-text-content></app-participant-text-content> + </div> + </mat-tab> + <mat-tab label="Choice"> + <div class="tab-container"> + <app-participant-choice-content></app-participant-choice-content> + </div> + </mat-tab> + </mat-tab-group> + </div> +</div> diff --git a/src/app/participant-content-carousel-page/participant-content-carousel-page.component.scss b/src/app/participant-content-carousel-page/participant-content-carousel-page.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..ea9c3d93f767262d835e953d031a031e64ad6f42 --- /dev/null +++ b/src/app/participant-content-carousel-page/participant-content-carousel-page.component.scss @@ -0,0 +1,8 @@ +mat-tab-group { + width: 100%; + max-width: 800px; +} + +.tab-container { + padding: 20px; +} diff --git a/src/app/participant-content-carousel-page/participant-content-carousel-page.component.spec.ts b/src/app/participant-content-carousel-page/participant-content-carousel-page.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..6719ec8eee8066dd6204c31b0e0484af2d4dd197 --- /dev/null +++ b/src/app/participant-content-carousel-page/participant-content-carousel-page.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ParticipantContentCarouselPageComponent } from './participant-content-carousel-page.component'; + +describe('ParticipantContentCarouselPageComponent', () => { + let component: ParticipantContentCarouselPageComponent; + let fixture: ComponentFixture<ParticipantContentCarouselPageComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ParticipantContentCarouselPageComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ParticipantContentCarouselPageComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/participant-content-carousel-page/participant-content-carousel-page.component.ts b/src/app/participant-content-carousel-page/participant-content-carousel-page.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..b1ae4172be012dc11ec11ca1ebc9499d55c0bb35 --- /dev/null +++ b/src/app/participant-content-carousel-page/participant-content-carousel-page.component.ts @@ -0,0 +1,20 @@ +import { Component, OnInit } from '@angular/core'; +import { Content } from '../content'; +import { ContentType } from '../content-type'; + +@Component({ + selector: 'app-participant-content-carousel-page', + templateUrl: './participant-content-carousel-page.component.html', + styleUrls: ['./participant-content-carousel-page.component.scss'] +}) +export class ParticipantContentCarouselPageComponent implements OnInit { + ContentType: ContentType; + + contents: Content[]; + + constructor() { + } + + ngOnInit() { + } +} diff --git a/src/app/participant-room/participant-room.component.html b/src/app/participant-room/participant-room.component.html index 2e01bed8e0feb47bcd7e182e2a144a7778031ec9..0341c622ab9588b8fcda3f2e95f1a69189a352a3 100644 --- a/src/app/participant-room/participant-room.component.html +++ b/src/app/participant-room/participant-room.component.html @@ -20,7 +20,7 @@ <button mat-icon-button color="primary" matTooltip="Give feedback"> <mat-icon>feedback</mat-icon> </button> - <button mat-button color="primary" matTooltip="Join question round"> + <button mat-button color="primary" matTooltip="Join question round" routerLink="/participant/room/{{ room.id }}/questions"> Questions </button> <button mat-button color="primary" matTooltip="Start personal question round"> diff --git a/src/app/participant-text-content/participant-text-content.component.html b/src/app/participant-text-content/participant-text-content.component.html new file mode 100644 index 0000000000000000000000000000000000000000..3bc09c4017b6af5b081b43fd92a4a7b0cead1a72 --- /dev/null +++ b/src/app/participant-text-content/participant-text-content.component.html @@ -0,0 +1,9 @@ +<form (ngSubmit)="submit(answer.value)"> + <h1 class="mat-headline">{{ content.subject }}</h1> + <p>{{ content.body }}</p> + <mat-divider></mat-divider> + <mat-form-field class="input-block"> + <textarea matInput #answer placeholder="Your answer"></textarea> + </mat-form-field> + <button mat-raised-button type="submit" color="primary">Submit</button> +</form> diff --git a/src/app/participant-text-content/participant-text-content.component.scss b/src/app/participant-text-content/participant-text-content.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/app/participant-text-content/participant-text-content.component.spec.ts b/src/app/participant-text-content/participant-text-content.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..b1855b0d1641f97fd5bc391e0ec509c755389bad --- /dev/null +++ b/src/app/participant-text-content/participant-text-content.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ParticipantTextContentComponent } from './participant-text-content.component'; + +describe('ParticipantTextContentComponent', () => { + let component: ParticipantTextContentComponent; + let fixture: ComponentFixture<ParticipantTextContentComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ParticipantTextContentComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ParticipantTextContentComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/participant-text-content/participant-text-content.component.ts b/src/app/participant-text-content/participant-text-content.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..efb0260069f5db2c077b3f761eef3156df76610f --- /dev/null +++ b/src/app/participant-text-content/participant-text-content.component.ts @@ -0,0 +1,25 @@ +import { Component, OnInit } from '@angular/core'; +import { TextContent } from '../text-content'; + +@Component({ + selector: 'app-participant-text-content', + templateUrl: './participant-text-content.component.html', + styleUrls: ['./participant-text-content.component.scss'] +}) +export class ParticipantTextContentComponent implements OnInit { + content: TextContent = new TextContent('1', + '1', + '1', + 'Text Content 1', + 'This is the body of Text Content 1', + 1); + + constructor() { + } + + ngOnInit() { + } + + submit(answer: string) { + } +}