所以我有一个表单,其中包含类型自由字段(文本)、多项选择(复选框)、单项选择(收音机)的问题。
我检查了按钮的值,并为每个用户保存在数据库中,但我想要做的是像这样更改这个值:
data-point "2" = 10 points,
data-point "3" = 7 points,
data-point "4" = 4 points,
data-point "5" = 2 points,
然后使用这些值我必须进行计算并根据结果定义配置文件..我该怎么做?SQL 请求?在循环?欢迎提供一点帮助..这里是我的小枝在子问题上循环。
<div class=" col-6 d-flex">
<div class="label-div1">
<label for="subscale{{subQuestion.id}}for{{i}}>
<img src="{{asset('images/survey/humeur/'~ i ~'.jpg')}}">
</label>
<input type="radio" class="radio-pict" name="{{subQuestion.id}}" id="subscale{{i}}" data-point="{{i}}"value="{{i}}">
</div>
在这里我的树枝在管理员上显示结果..
{% if answer.question == "Sub_question_choice" or
answer.question == "Sub_question_scale" or
answer.question == "Sub_question_free" %}
{% if answer == "choice" %}
{% for choice in answer.choices %}
<p>{{choice.name}}</p>
{% endfor %}
{% elseif answer == "free" %}
<p>{{answer.freeAswere}}</p>
{% elseif answer == "scale" %}
<p> {{answer.scale}}</p>
{% endif %}
哆啦的时光机