<ion-header>

    <ion-navbar>
        <ion-title>问卷回答</ion-title>
    </ion-navbar>

</ion-header>


<ion-content>
    <ion-list>
        <ion-item>
            <ion-label class="padding-left-16">{{item?.title}}</ion-label>
        </ion-item>
        <ion-item>
            <p>问卷说明：{{item?.explai}}</p>
        </ion-item>
        <div class="question-list">
            <ion-item *ngFor="let item of ansArr;let i = index">
                <div class="item-content">
                    <!--判断题-->
                    <p><span class="color-red" *ngIf="item.isAns == 1">*</span>
                        {{i +1}}、
                        <span *ngIf="item.quesType == 1">(判断)</span>
                        <span *ngIf="item.quesType == 2">(单选)</span>
                        <span *ngIf="item.quesType == 3">(多选)</span>
                        <span *ngIf="item.quesType == 4">(问答)</span>
                        {{item.title}}
                    </p>
                    <div class="padding-0-30">
                        <ng-container *ngIf="item.quesType == 1">
                            <p>
                                <label>
                                    <input [(ngModel)]="item.answerdesc" name="{{item.questionQueId}}" value="0"
                                           type="radio">是
                                    <span class="input-radio"></span>
                                </label>
                            </p>
                            <p>
                                <label>
                                    <input [(ngModel)]="item.answerdesc" name="{{item.questionQueId}}" value="1"
                                           type="radio">否
                                    <span class="input-radio"></span>
                                </label>
                            </p>
                        </ng-container>
                        <!--单选题-->
                        <ng-container *ngIf="item.quesType == 2">
                            <ng-container *ngFor=" let option1 of item.quesDesc;let optIndex = index;">
                                <p>
                                    <label>
                                        <input [(ngModel)]="item.answerdesc" type="radio" value="{{optIndex}}"
                                               name="{{item.questionQueId}}">{{option1.option_title}}
                                        <span class="input-radio"></span>
                                    </label>
                                </p>
                            </ng-container>
                        </ng-container>
                        <!--多选题-->
                        <ng-container *ngIf="item.quesType == 3">
                            <ng-container *ngFor=" let option2 of item.quesDesc;let quesIndex = index;">
                                <p>
                                    <label>
                                        <input type="checkbox" (change)="mutiSelect(i,quesIndex)" value="{{quesIndex}}">{{option2.option_title}}
                                        <span class="input-check"></span>
                                    </label>
                                </p>
                            </ng-container>
                        </ng-container>
                        <!--问答题-->
                        <ng-container *ngIf="item.quesType == 4">
                            <textarea [(ngModel)]="item.answerdesc" class="content-textarea"></textarea>
                        </ng-container>
                    </div>
                </div>
            </ion-item>
        </div>
    </ion-list>
    <p class="text-center" *ngIf="isansName == '是'">
        <label>
            <input type="checkbox" [(ngModel)]="isans">
            <span class="input-check"></span>
            <span>匿名回答</span>
        </label>
    </p>

    <button class="submit-btn submit" (click)="confirm()">提交</button>
</ion-content>
