0
私のコントローラのコード:foreachループの各ラジオボタンの値を取得します
$model = customer::all(); return View::make('admin.test.startTest') ->with('title','Question and answer') ->with('data',$model);
この私の見解コード:
foreach($data as $value) { ?> <p>{{ $value-> Qid }}) {{ $value-> opt }} </p> <?php if(($value ->QuestionType) == "MCQ") {?> <ul> <li><b>A: </b>{{$value->opt1}}</li> <li><b>B: </b>{{$value->opt2}}</li> <li><b>C: </b>{{$value->opt3}}</li> <li><b>D: </b>{{$value->opt4}}</li> </ul> Select one of the following options:<br> <input type="radio" name="answers[{{ $value-> opt }}]" value="A" ">{{ $value->opt1}}<br> <input type="radio" name="answers[{{ $value-> opt }}]" value="B" ">{{ $value->opt2}}<br> <input type="radio" name="answers[{{ $value-> opt }}]" value="C" ">{{ $value->opt3}}<br> <input type="radio" name="answers[{{ $value-> opt }}]" value="D" ">{{ $value->opt4}}<br> <?php } elseif(($value ->QuestionType) == "truefalse") {?> Select one of the following options:<br> <input type="radio" name="answers[{{ $value-> opt }}]" value="true" ">True<br> <input type="radio" name="answers[{{ $value-> opt }}]" value="false" ">False<br> <?php } else {?> <input type="radio" name="answers[{{ $value-> opt }}]" value="ok" ">OK<br> <input type="radio" name="answers[{{ $value-> opt }}]" value="agree" ">Agree<br>
- 私はlaravelに使用している
- は、私はすべての値が
- は、どのように私は、入力フィールドの値を取得することができ、結果との比較に取得したいのデータベースからデータを取得
- forループの入力フィールドa
入力フィールドの値はどこで入手できますか?
問題は、私は 値が表示され、各ループのためのラジオボタンを置くしかし、あなたはラジオの名前を持つボタンといくつかを印刷する必要があり、選択した値