Survey App -I need to send multiple data


#1

hello I need Help to Build Survey App .
so i have multiple Data From DataBase like Question And Answer (CheckBox,or Radio, or Text).
my problem with Send All Answer From One Page With Same type And name

 <ion-card *ngFor="let one of allQuotation; let i = index" color="">
    <div [ngSwitch]="one.question_type">

      <ion-list *ngSwitchCase="'radio'">

        <ion-badge color="light">{{ i + 1 }}: {{one.title}}</ion-badge>
        <ion-list radio-group [(ngModel)]="answer">
          <ion-item *ngFor="let lab of one.option_name">
            <ion-label>{{lab}}</ion-label>
            <ion-radio value="{{one.id}}[{{lab}}]"></ion-radio>
            <!--<input type="radio" name="{{one.id}}lab" value="{{lab}}"> {{lab}}<br>-->

            <!--<input name="{{ one.id }}[answer]" type="radio" id="{{ lab }}" />-->
          </ion-item>
        </ion-list>
      </ion-list>

      <ion-list *ngSwitchCase="'checkbox'">
        <ion-label>{{ i + 1 }}: {{one.title}}</ion-label>
        <ion-item *ngFor="let onC of one.option_name">
          <br>
          <ion-label>{{onC}}</ion-label>
          <ion-checkbox [(ngModel)]="cb_value" (ionChange)="updateCbValue()"></ion-checkbox>
        </ion-item>
      </ion-list>


      <ion-list *ngSwitchCase="'textarea'">
        <!--<ion-item *ngFor="let item of attributes; let i = index">-->
        <ion-label>{{ i + 1 }}: {{one.title}}</ion-label>
        <ion-input [(ngModel)]="values[i]" (input)="valChange($event.target.value, i)" type="text"></ion-input>

        <!--</ion-item>-->
        <!--<ion-badge color="light">{{one.title}}</ion-badge>-->
        <!--<ion-input type="text" [(ngModel)]="one.idanswer" maxlength=50 minlength=2 required text-right></ion-input>-->
      </ion-list>

    </div>

  </ion-card>

  <ion-card>
    <button ion-button (click)="sendAnswers()">ارسال</button>
  </ion-card>

my Json

{
    "data": [
        {
            "id": 1,
            "survey_id": 1,
            "user_id": 1,
            "title": "Gender",
            "question_type": "radio",
            "option_name": [
                "Male",
                "Female"
            ],
            "created_at": "2018-04-23 16:47:19",
            "updated_at": "2018-04-23 16:47:19"
        },
        {
            "id": 2,
            "survey_id": 1,
            "user_id": 1,
            "title": "Your Know leg about Php",
            "question_type": "radio",
            "option_name": [
                "Good",
                "less"
            ],
            "created_at": "2018-04-23 16:49:43",
            "updated_at": "2018-04-23 16:49:43"
        },
      
        {
            "id": 4,
            "survey_id": 1,
            "user_id": 1,
            "title": "talk about favorite Framework",
            "question_type": "textarea",
            "option_name": null,
            "created_at": "2018-04-23 16:52:56",
            "updated_at": "2018-04-23 16:52:56"
        }
    ]
}```

:slight_smile: