diff --git a/client/src/app/core/repositories/assignments/assignment-poll-repository.service.ts b/client/src/app/core/repositories/assignments/assignment-poll-repository.service.ts index 81bfe5389..4708fb2aa 100644 --- a/client/src/app/core/repositories/assignments/assignment-poll-repository.service.ts +++ b/client/src/app/core/repositories/assignments/assignment-poll-repository.service.ts @@ -116,6 +116,7 @@ export class AssignmentPollRepositoryService extends BasePollRepositoryService< return this.translate.instant(plural ? 'Polls' : 'Poll'); }; + // TODO: data must not be any public vote(data: any, poll_id: number): Promise { return this.http.post(`/rest/assignments/assignment-poll/${poll_id}/vote/`, data); } diff --git a/client/src/app/shared/models/poll/base-poll.ts b/client/src/app/shared/models/poll/base-poll.ts index 0c059cb02..be5b062f0 100644 --- a/client/src/app/shared/models/poll/base-poll.ts +++ b/client/src/app/shared/models/poll/base-poll.ts @@ -51,19 +51,19 @@ export abstract class BasePoll = any> extends public onehundred_percent_base: PercentBase; public user_has_voted: boolean; - public get isStateCreated(): boolean { + public get isCreated(): boolean { return this.state === PollState.Created; } - public get isStateStarted(): boolean { + public get isStarted(): boolean { return this.state === PollState.Started; } - public get isStateFinished(): boolean { + public get isFinished(): boolean { return this.state === PollState.Finished; } - public get isStatePublished(): boolean { + public get isPublished(): boolean { return this.state === PollState.Published; } @@ -71,20 +71,6 @@ export abstract class BasePoll = any> extends return this.onehundred_percent_base === PercentBase.Valid || this.onehundred_percent_base === PercentBase.Cast; } - /** - * If the state is finished. - */ - public get isFinished(): boolean { - return this.state === PollState.Finished; - } - - /** - * If the state is published. - */ - public get isPublished(): boolean { - return this.state === PollState.Published; - } - /** * Determine if the state is finished or published */ diff --git a/client/src/app/shared/shared.module.ts b/client/src/app/shared/shared.module.ts index be7c92fd9..8f2ec7e08 100644 --- a/client/src/app/shared/shared.module.ts +++ b/client/src/app/shared/shared.module.ts @@ -6,7 +6,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'; // MaterialUI modules import { MatBadgeModule } from '@angular/material/badge'; import { MatBottomSheetModule } from '@angular/material/bottom-sheet'; -import { MatButtonModule } from '@angular/material/button'; +import { MatButtonModule, MatAnchor } from '@angular/material/button'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MatCardModule } from '@angular/material/card'; import { MatCheckboxModule } from '@angular/material/checkbox'; diff --git a/client/src/app/site/assignments/components/assignment-poll-detail/assignment-poll-detail.component.html b/client/src/app/site/assignments/components/assignment-poll-detail/assignment-poll-detail.component.html index 9744ef218..ce6ea2261 100644 --- a/client/src/app/site/assignments/components/assignment-poll-detail/assignment-poll-detail.component.html +++ b/client/src/app/site/assignments/components/assignment-poll-detail/assignment-poll-detail.component.html @@ -1,16 +1,9 @@ - +

{{ poll.title }}

-