Answer the question
In order to leave comments, you need to log in
How to properly display the result from the database?
Hi all. There is a test
1) Question
Answer 1
Answer 2
Answer 3
2) Question 2
Answer 1
Answer 2
Answer 3 The
answers are always the same, the test is psychological.
The database is stored like this.
There is a table with questions
I display questions like this:
@foreach($questions as $question)
<li class="qName">{{ $question->question }}</li>
<ul id="b-question_{{ $loop->iteration }}">
<li><label><input name="answer_{{ $loop->iteration }}" type="radio" value="a" required>Постоянно</label></li>
<li><label><input name="answer_{{ $loop->iteration }}" type="radio" value="b" required>Иногда</label></li>
<li><label><input name="answer_{{ $loop->iteration }}" type="radio" value="c" required>Время от времени</label></li>
</ul>
<input type="hidden" name="count" value="{{ $loop->count }}">
@endforeach
[{"question_1":"b"},{"question_2":"a"},{"question_3":"a"},{"question_4":"c"},{"question_5":"b"},{"question_6":"b"},{"question_7":"b"},{"question_8":"c"},{"question_9":"c"},{"question_10":"a"},{"question_11":"a"},{"question_12":"c"},{"question_13":"c"},{"question_14":"b"},{"question_15":"a"},{"question_16":"a"},{"question_17":"b"},{"question_18":"a"},{"question_19":"c"},{"question_20":"a"},{"question_21":"a"},{"question_22":"a"},{"question_23":"c"},{"question_24":"b"},{"question_25":"c"},{"question_26":"a"},{"question_27":"a"},{"question_28":"b"},{"question_29":"b"},{"question_30":"a"},{"question_31":"c"},{"question_32":"c"},{"question_33":"c"},{"question_34":"c"},{"question_35":"b"},{"question_36":"a"},{"question_37":"a"},{"question_38":"c"},{"question_39":"b"},{"question_40":"c"},{"question_41":"b"},{"question_42":"c"},{"question_43":"a"},{"question_44":"b"},{"question_45":"c"},{"question_46":"c"},{"question_47":"a"},{"question_48":"c"},{"question_49":"a"},{"question_50":"c"},{"question_51":"c"},{"question_52":"c"},{"question_53":"b"},{"question_54":"c"},{"question_55":"c"},{"question_56":"a"},{"question_57":"b"},{"question_58":"b"},{"question_59":"a"},{"question_60":"a"},{"question_61":"b"},{"question_62":"a"},{"question_63":"b"},{"question_64":"a"},{"question_65":"b"},{"question_66":"b"},{"question_67":"b"},{"question_68":"a"},{"question_69":"c"},{"question_70":"b"},{"question_71":"c"},{"question_72":"a"},{"question_73":"b"},{"question_74":"a"},{"question_75":"c"},{"question_76":"c"},{"question_77":"b"}]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question