
<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>
    <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-16">
            <ng-container *ngIf="item.quesType == 1">
              <!--<p class="input-radio"><label for="{{item.id}}0"><input name="{{item.id}}" id="{{item.id}}0" value="0" type="radio">是</label></p>-->
              <p class="input-radio"><input [(ngModel)]="item.answerdesc" name="{{item.questionQueId}}" value="0" type="radio">是</p>
              <p class="input-radio"><input [(ngModel)]="item.answerdesc" name="{{item.questionQueId}}" value="1" type="radio">否</p>
              <!--<p class="input-radio"><label for="{{item.id}}1"><input name="{{item.id}}" id="{{item.id}}1" value="1" type="radio">否</label></p>-->
            </ng-container>
            <!--单选题-->
            <ng-container *ngIf="item.quesType == 2">
              <ng-container *ngFor=" let option1 of item.quesDesc;let optIndex = index;">
                <p><input  [(ngModel)]="item.answerdesc" type="radio" value="{{optIndex}}" name="{{item.questionQueId}}">{{option1.option_title}}</p>
              </ng-container>
            </ng-container>
            <!--多选题-->
            <ng-container *ngIf="item.quesType == 3">
              <ng-container *ngFor=" let option2 of item.quesDesc;let quesIndex = index;">
                <p><input type="checkbox" (change)="mutiSelect(i,quesIndex)"  value="{{quesIndex}}">{{option2.option_title}}</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>

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