-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
107 lines (103 loc) · 4.69 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Health Quiz</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<h1>Health Quiz</h1>
<div id="userInfo">
<h2>Please enter your details:</h2>
<form id="infoForm">
<label for="age">Age:</label>
<input type="number" id="age" required>
<label for="weight">Weight (kg):</label>
<input type="number" id="weight" required>
<label for="height">Height (cm):</label>
<input type="number" id="height" required>
<button type="submit">Start Quiz</button>
</form>
</div>
<div id="quizSection" style="display: none;">
<form id="quizForm">
<!-- Question 1 -->
<div class="question">
<h2>1. How often do you exercise per week?</h2>
<label><input type="radio" name="q1" value="3"> Rarely</label>
<label><input type="radio" name="q1" value="5"> 1-2 times</label>
<label><input type="radio" name="q1" value="7"> 3+ times</label>
</div>
<!-- Question 2 -->
<div class="question">
<h2>2. How many hours of sleep do you get on average?</h2>
<label><input type="radio" name="q2" value="3"> Less than 5</label>
<label><input type="radio" name="q2" value="5"> 5-6 hours</label>
<label><input type="radio" name="q2" value="7"> 7+ hours</label>
</div>
<!-- Question 3 -->
<div class="question">
<h2>3. How often do you eat fruits and vegetables?</h2>
<label><input type="radio" name="q3" value="3"> Rarely</label>
<label><input type="radio" name="q3" value="5"> Sometimes</label>
<label><input type="radio" name="q3" value="7"> Daily</label>
</div>
<!-- Question 4 -->
<div class="question">
<h2>4. How many liters of water do you drink per day?</h2>
<label><input type="radio" name="q4" value="3"> Less than 1L</label>
<label><input type="radio" name="q4" value="5"> 1-2L</label>
<label><input type="radio" name="q4" value="7"> More than 2L</label>
</div>
<!-- Question 5 -->
<div class="question">
<h2>5. How often do you feel stressed?</h2>
<label><input type="radio" name="q5" value="7"> Rarely</label>
<label><input type="radio" name="q5" value="5"> Sometimes</label>
<label><input type="radio" name="q5" value="3"> Frequently</label>
</div>
<!-- Question 6 -->
<div class="question">
<h2>6. How often do you consume sugary or junk food?</h2>
<label><input type="radio" name="q6" value="3"> Daily</label>
<label><input type="radio" name="q6" value="5"> Occasionally</label>
<label><input type="radio" name="q6" value="7"> Rarely</label>
</div>
<!-- Question 7 -->
<div class="question">
<h2>7. How often do you get a medical check-up?</h2>
<label><input type="radio" name="q7" value="3"> Rarely</label>
<label><input type="radio" name="q7" value="5"> Once a year</label>
<label><input type="radio" name="q7" value="7"> Twice or more a year</label>
</div>
<!-- Question 8 -->
<div class="question">
<h2>8. How often do you smoke or consume alcohol?</h2>
<label><input type="radio" name="q8" value="7"> Never</label>
<label><input type="radio" name="q8" value="5"> Occasionally</label>
<label><input type="radio" name="q8" value="3"> Regularly</label>
</div>
<!-- Question 9 -->
<div class="question">
<h2>9. How often do you engage in relaxation activities like meditation?</h2>
<label><input type="radio" name="q9" value="3"> Rarely</label>
<label><input type="radio" name="q9" value="5"> Occasionally</label>
<label><input type="radio" name="q9" value="7"> Regularly</label>
</div>
<!-- Question 10 -->
<div class="question">
<h2>10. How often do you spend time outdoors in nature?</h2>
<label><input type="radio" name="q10" value="3"> Rarely</label>
<label><input type="radio" name="q10" value="5"> Sometimes</label>
<label><input type="radio" name="q10" value="7"> Often</label>
</div>
<button type="button" id="submitQuiz">Submit</button>
</form>
<div id="result"></div>
</div>
</div>
<script src="script.js"></script>
</body>
</html>