-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquestion.html
More file actions
205 lines (185 loc) · 8.95 KB
/
question.html
File metadata and controls
205 lines (185 loc) · 8.95 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Question View</title>
<style>
body { font-family: sans-serif; display: flex; margin: 0; min-height: 100vh; flex-direction: column; }
.main-container { display: flex; flex: 1; }
/* Sidebar */
.sidebar {
width: 200px;
border-right: 1px solid #ccc;
padding: 20px;
background: #f9f9f9;
}
.sidebar-item {
padding: 8px;
margin-bottom: 5px;
cursor: pointer;
border: 1px solid transparent;
}
.sidebar-item:hover { background: #eee; }
.sidebar-item.active { background: #007bff; color: white; border-radius: 4px; }
.tick { color: #28a745; font-weight: bold; margin-left: 10px; }
/* Content Area */
.content { flex: 1; padding: 40px; box-sizing: border-box; }
.question-box { margin-bottom: 30px; border: 1px dashed #aaa; padding: 20px; min-height: 100px; font-size: 1.2rem; line-height: 1.6; }
/* Math Formatting Classes */
.math-frac { display: inline-block; vertical-align: middle; text-align: center; padding: 0 5px; }
.math-frac .top { display: block; border-bottom: 1px solid #000; padding: 0 3px; }
.math-frac .bottom { display: block; padding: 0 3px; }
.math-sqrt { border-top: 1px solid #000; padding: 2px 4px; margin-left: 2px; }
.math-sqrt-symbol { font-size: 1.3rem; vertical-align: middle; }
.interaction-zone { margin-top: 20px; }
.input-group { display: flex; gap: 10px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.answer-input { width: 300px; padding: 8px; max-width: 100%; }
/* Responsive Adjustments */
@media (max-width: 768px) {
.main-container { flex-direction: column; }
.sidebar {
width: 100%;
border-right: none;
border-bottom: 1px solid #ccc;
display: flex;
overflow-x: auto;
padding: 10px;
white-space: nowrap;
}
.sidebar h3 { display: none; } /* Hide "Questions" title on mobile to save space */
.sidebar-item {
display: inline-block;
margin-right: 10px;
padding: 10px 15px;
border: 1px solid #ddd;
}
.content { padding: 20px; }
.input-group { flex-direction: column; align-items: flex-start; }
.answer-input, .unit-input { width: 100%; }
}
.hidden { display: none; }
.error-text { color: red; font-weight: bold; margin-top: 10px; }
.success-text { color: green; font-weight: bold; margin-top: 10px; }
/* Math Toolbar */
.math-toolbar {
margin-bottom: 15px;
display: flex;
gap: 5px;
flex-wrap: wrap;
background: #eee;
padding: 10px;
border-radius: 4px;
border: 1px solid #ccc;
}
.math-toolbar button {
font-family: "Times New Roman", serif;
font-size: 1.2rem;
padding: 5px 12px;
min-width: 40px;
}
.solution-image {
max-width: 100%;
margin-top: 20px;
border: 2px solid #007bff;
padding: 10px;
}
/* Standard Retro Button Style */
button {
padding: 5px 15px;
cursor: pointer;
}
.nav-buttons { margin-top: 30px; display: flex; gap: 10px; }
footer {
border-top: 1px solid #000;
padding: 20px;
text-align: center;
width: 100%;
}
.back-nav { margin: 20px; }
</style>
</head>
<body>
<div class="back-nav">
<button id="backToChapterBtn"> < Back to Chapter Questions</button>
</div>
<div class="main-container">
<!-- Sidebar -->
<div class="sidebar" id="sidebar">
<h3>Questions</h3>
<!-- Generated Questions 1-18 -->
</div>
<!-- Main Content -->
<div class="content">
<h1 id="questionTitle">Question 1</h1>
<div class="question-box" id="questionContent">
[Question content will be loaded here]
</div>
<div id="initialButtons">
<button onclick="showInteraction()">Try it myself</button>
<button onclick="showSolution()">See Solution Instead</button>
</div>
<div id="tryItZone" class="interaction-zone hidden">
<div class="math-toolbar">
<button type="button" onclick="insertSymbol('sum')">∑<sub>□</sub><sup>□</sup></button>
<button type="button" onclick="insertSymbol('root')"><sup>□</sup>√<span style="border-top:1px solid; padding-top:1px;">□</span></button>
<button type="button" onclick="insertSymbol('fraction')"><sup>□</sup>⁄<sub>□</sub></button>
<button type="button" onclick="insertSymbol('power')">□<sup>□</sup></button>
<button type="button" onclick="insertSymbol('∫')">∫</button>
<button type="button" onclick="insertSymbol('dx')">dx</button>
<button type="button" onclick="insertSymbol(' + C')">+ C</button>
<button type="button" onclick="insertSymbol('∑')">∑</button>
<button type="button" onclick="insertSymbol('∞')">∞</button>
<button type="button" onclick="insertSymbol('π')">π</button>
<button type="button" onclick="insertSymbol('θ')">θ</button>
<button type="button" onclick="insertSymbol('!')">!</button>
<button type="button" onclick="insertSymbol('|')">| |</button>
<button type="button" onclick="insertSymbol('√')">√</button>
<button type="button" onclick="insertSymbol('^')">^</button>
<button type="button" onclick="insertSymbol('_')">_</button>
<button type="button" onclick="insertSymbol('±')">±</button>
<button type="button" onclick="insertSymbol('→')">→</button>
<button type="button" onclick="insertSymbol('≤')">≤</button>
<button type="button" onclick="insertSymbol('≥')">≥</button>
<button type="button" onclick="insertSymbol('≈')">≈</button>
<button type="button" onclick="insertSymbol('e')">e</button>
<button type="button" onclick="insertSymbol('ln')">ln</button>
<button type="button" onclick="insertSymbol('sin')">sin</button>
<button type="button" onclick="insertSymbol('cos')">cos</button>
<button type="button" onclick="insertSymbol('tan')">tan</button>
<button type="button" onclick="insertSymbol('sec')">sec</button>
<button type="button" onclick="insertSymbol('csc')">csc</button>
<button type="button" onclick="insertSymbol('cot')">cot</button>
<button type="button" onclick="insertSymbol('arcsin')">arcsin</button>
<button type="button" onclick="insertSymbol('arccos')">arccos</button>
<button type="button" onclick="insertSymbol('arctan')">arctan</button>
<button type="button" onclick="insertSymbol('(')">(</button>
<button type="button" onclick="insertSymbol(')')">)</button>
</div>
<div class="input-group" id="inputsArea">
<!-- Dynamic inputs will be injected here -->
</div>
<div style="margin-top: 15px;">
<button onclick="checkAnswer()">➔ Check Answer</button>
</div>
<div id="feedback" class="hidden"></div>
</div>
<div id="solutionZone" class="hidden">
<div id="solutionStatus"></div>
<div class="solution-image">
<p><strong>Official Solution:</strong></p>
<img id="solImg" src="https://via.placeholder.com/600x400?text=Solution+Image+Placeholder" alt="Solution">
</div>
<div class="nav-buttons">
<button id="prevBtn" onclick="changeQuestion(-1)">Previous Question</button>
<button id="nextBtn" onclick="changeQuestion(1)">Next Question</button>
</div>
</div>
</div>
</div>
<footer>
<p>Copyright © 2026 Created by Tasdid Noor</p>
</footer>
<script src="script.js"></script>
</body>
</html>