Added Text Input and "required" html tag
This commit is contained in:
@@ -16,6 +16,12 @@
|
||||
{% endif %}
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro required(question) -%}
|
||||
{% if (question["required"] == "true") %}
|
||||
required
|
||||
{% endif %}
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro input(name, value='', type='text', size=20) -%}
|
||||
<input type="{{ type }}" name="{{ name }}" value="{{
|
||||
value|e }}" size="{{ size }}">
|
||||
@@ -47,12 +53,14 @@
|
||||
<div class="likercontainer">
|
||||
<div class="likert">
|
||||
{% for point in questions[question]["points"] %}
|
||||
<label><input name="likertscale" type="radio" value="{{ questions[question]['points'][point]['value'] }}"/><span>{{ questions[question]['points'][point]['text'] }}</span></label>
|
||||
<label><input name="likertscale" type="radio" value="{{ questions[question]['points'][point]['value'] }}" {{required(questions[question])}}/><span>{{ questions[question]['points'][point]['text'] }}</span></label>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% elif (questions[question]["type"] == "textinput") %}
|
||||
<label for="{{ questions[question]['name'] }}">Additional Feedback: </label>
|
||||
<textarea id="{{ questions[question]['name'] }}" name="{{ questions[question]['name'] }}" rows="3" cols="30" maxlength="{{ questions[question]['size'] }}" {{required(questions[question])}}></textarea>
|
||||
{% else %}
|
||||
<p>Error: Block {{config["question 1"]["blocks"][block]["type"]}} could not be loaded!</p>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user