File
Implements
Index
Properties
|
|
Methods
|
|
Inputs
|
|
isFeedBackSurvey
|
Type : any
|
|
questionNumber
|
Type : any
|
|
Methods
getAllResponse
|
getAllResponse()
|
|
|
import { Component, Input, OnInit } from '@angular/core';
import { SurveyProviderService } from '@app/app/manage-learn/core/services/survey-provider.service';
@Component({
selector: 'reports-text',
templateUrl: './reports-text.component.html',
styleUrls: ['./reports-text.component.scss'],
})
export class ReportsTextComponent implements OnInit {
@Input() data;
@Input() questionNumber;
@Input() isFeedBackSurvey;
@Input() solutionId;
completedDate: any; // for pagination purpose in survey answers if more then 10 ans
constructor(private surveyProvider:SurveyProviderService) {}
ngOnInit() {
this.completedDate = this.data.completedDate;
}
getAllResponse() {
let questionExternalId = this.data.order;
let completedDate = this.completedDate;
let solutionId = this.solutionId;
let Obj = { questionExternalId, completedDate, solutionId };
this.surveyProvider
.viewAllAns(Obj)
.then((res: any) => {
this.data.answers = [...this.data.answers, ...res.answers];
this.completedDate = res.completedDate ? res.completedDate : this.completedDate;
})
.catch();
}
}
<ion-item-group class="text-container" text-wrap>
<ion-item-divider color="light">
<h4 *ngIf="questionNumber">{{ questionNumber+' )'}} {{data?.question}}</h4>
<h4 *ngIf="!questionNumber">Responses</h4>
</ion-item-divider>
<ion-item *ngFor="let answer of data?.answers"> {{ (data?.resposeType === 'date' && answer) ? (answer|
date:'medium':'IST') : answer}}</ion-item>
<!-- to show all answer in feedback survey report -->
<div *ngIf="isFeedBackSurvey">
<ion-col *ngIf="data?.count>10&& data?.answers?.length<data?.count">
<small padding class="pull-right sb-color-red-400" (click)="getAllResponse(data)">{{'FRMELEMNTS_BTN_VIEW_ALL_RESPONSES' |
translate}}</small>
</ion-col>
</div>
</ion-item-group>
Legend
Html element with directive