30 lines
1.1 KiB
HTML

<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ scale.title }}</title>
<link rel="stylesheet" href="/static/styles.css">
</head>
<body>
<h1>{{ scale.title }}</h1>
<p>{{ scale.instructions }}</p>
<form action="{{ url_for('result', scale_id=scale_id) }}" method="post">
{% for question in scale.questions %}
<label for="{{ question.id }}">{{ question.text }}</label>
<div class="scale-button">
<!-- 将下拉菜单替换为单选按钮 -->
{% for option in range(question.range[0], question.range[1]+1) %}
<input type="radio" id="{{ question.id }}_{{ option }}" name="{{ question.id }}" value="{{ option }}" {% if
not ( 'optional' in question and question.optional) %}required{% endif %}>
<label for="{{ question.id }}_{{ option }}">{{ option }}</label>
{% endfor %}
</div>
{% endfor %}
<input type="submit" value="提交">
</form>
</body>
</html>