-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
304 lines (301 loc) · 12.3 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
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
<!DOCTYPE html>
<html>
<head>
<title>Tester</title>
<link rel="icon" href="./assets/img/favicon.png" type="image/png" />
<link rel="stylesheet" href="./assets/css/index.css" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.8.1/font/bootstrap-icons.min.css"
/>
</head>
<body>
<noscript class="above-container">
<img
width="64px"
src="./assets/img/icons/nojs.png"
alt="No JavaScript"
/>
<u>JavaScript is required to use Tester.</u>
<p>Please enable JavaScript in your browser's settings.</p>
</noscript>
<div class="above-container" id="cc-2024-notice">
<img
width="64px"
src="./assets/img/icons/bhms.png"
alt="BHMS Logo"
/>
<p>
<u>Looking for the Constitutional Challenge cards?</u
><br /><br />
All cards are available in the View Presets menu. Select the
test by clicking it in the preset menu.
</p>
</div>
<div class="container">
<div id="div-buttons">
<button
class="div-button"
style="margin-right: auto"
onclick="displayDiv('settings-modal')"
>
<i class="bi bi-gear"></i>
</button>
<div style="display: flex">
<button
class="div-button"
onclick="displayDiv('info-modal')"
>
<i class="bi bi-info-circle"></i>
</button>
<button
class="div-button"
onclick="displayDiv('help-modal')"
>
<i class="bi bi-question-circle"></i>
</button>
</div>
</div>
<header id="header">
<h1>Tester</h1>
<p>Created by Bobby Elmore</p>
</header>
<hr class="main-content-divider" />
<div id="main-content">
<div id="start">
<h1>Select Test</h1>
<div class="custom-file-input">
<input type="file" id="json-input" accept=".json" />
<label for="json-input">Choose File</label>
<span id="file-name">No file selected.</span>
</div>
<div id="main-buttons">
<button
class="main-button"
id="start-button"
onclick="initiateTest()"
>
Start Test
</button>
<button
class="main-button side-main-button"
id="preset-button"
onclick="presetDisplayDiv()"
>
View Presets
</button>
</div>
</div>
</div>
<hr class="main-content-divider" />
<footer id="footer">
<div id="copyright-notice">
<p id="copyright"></p>
<p>
<a href="https://github.com/dacoder101/tester/"
>Open source</a
>
under the
<a
href="https://creativecommons.org/publicdomain/zero/1.0/"
>CC0 1.0 universal license.</a
>
</p>
</div>
</footer>
</div>
<div class="modal" id="settings-modal" style="display: none">
<div class="modal-content">
<button
class="close-button"
onclick="displayDiv('settings-modal')"
>
×
</button>
<h1>Settings</h1>
<hr />
<p>
Coming soon. Will include settings outlined on the
<a href="https://github.com/dacoder101/tester/"
>GitHub repository</a
>
when created.
</p>
</div>
</div>
<div class="modal" id="info-modal" style="display: none">
<div class="modal-content">
<button class="close-button" onclick="displayDiv('info-modal')">
×
</button>
<h1>Info</h1>
<hr />
<h2>Thanks for using Tester!</h2>
<p>
Tester is a simple tool for testing yourself via JSON
configuration files. It was created by Bobby Elmore in 2024
in about a month, using HTML, CSS, and JavaScript.
</p>
<h2>Why was tester created?</h2>
<p>
8th grade year of BHMS comes with a lot of tests, one being
the Consitutional Challenge. Instead of trying to write down
almost 250 flashcards, I decided it was easier to create a
website that tests digitally. This originally started as a
Python script, but decided it would be more beneficial to
create an online version.
</p>
<p>
I created Tester as a way to help study for exams; it was a
very easy replacement for flashcards, as AI tools could
easily generate JSON files I could plug in to this tool.
</p>
<h2>Tester is open source!</h2>
<p>
Tester is open source under the CC0 1.0 universal license.
You can view the source code on GitHub
<a href="https://github.com/dacoder101/tester/">here!</a>
</p>
<p>
If you would like to contribute, please feel free to fork
the repository and submit a pull request. All contributions
are greatly appreciated.
</p>
</div>
</div>
<div class="modal" id="help-modal" style="display: none">
<div class="modal-content">
<button class="close-button" onclick="displayDiv('help-modal')">
×
</button>
<h1>Help</h1>
<hr />
<h2>How can I use Tester?</h2>
<p>
Tester requires a preexisting JSON file to be imported. To
make your own test, please see "Creating a JSON file" below.
You can also use preset tests available on the main page!
</p>
<h2>How do I import a JSON file?</h2>
<p>
To import a JSON file, click the "Choose File" button and
select the JSON file you would like to import. Once you have
selected the file, click the "Start Test" button to begin.
</p>
<h2>Creating a JSON file</h2>
<p>
All JSON tests require the following keys. Please see the
examples on my
<a href="https://github.com/dacoder101/tester/"
>GitHub repository</a
>
for more information.
</p>
<ul>
<li>
<code>title</code> - The title of the test. Should be of
type <code>string</code>.
</li>
<li>
<code>label</code> - The label of the test, primarily
used when selecting multiple tests at once. Should be of
type <code>string</code>.
</li>
<li>
<code>blankText</code> - Replaces all instances of
<code>{blank}</code> in the keys of the question object
with a value, usually underscores. Should be of type
<code>string</code>.
</li>
<li>
<code>questions</code> - An
<code>object</code> containing the questions along with
their answers.
</li>
</ul>
</div>
</div>
<div class="modal" id="preset-modal" style="display: none">
<div class="modal-content">
<button
class="close-button"
onclick="displayDiv('preset-modal')"
>
×
</button>
<h1>Preset Tests</h1>
<hr />
<p>
Select a preset test, then click "Start Test" on the main
page to begin.
</p>
<div id="preset-tests">
<button
class="preset-button"
onclick="loadPreset('./assets/presets/preconstitution-cards.json')"
>
Preconstitution Cards
</button>
<button
class="preset-button"
onclick="loadPreset('./assets/presets/article-one.json')"
>
Article One Cards (Legislative Branch)
</button>
<button
class="preset-button"
onclick="loadPreset('./assets/presets/article-two.json')"
>
Article Two Cards (Executive Branch)
</button>
<button
class="preset-button"
onclick="loadPreset('./assets/presets/article-three.json')"
>
Article Three Cards (Judicial Branch)
</button>
<button
class="preset-button"
onclick="loadPreset('./assets/presets/amendment-article.json')"
>
Amendment/Article Cards
</button>
</div>
</div>
</div>
<div class="modal" id="local-preset-modal" style="display: none">
<div class="modal-content">
<button
class="close-button"
onclick="displayDiv('local-preset-modal')"
>
×
</button>
<h1>Presets Unsupported</h1>
<hr />
<p>
Due to a technical limitation, you cannot load presets when
locally viewing Tester. Please visit
<a href="https://dacoder101.github.io/tester"
>the online version of Tester</a
>, or upload the preset test directly from
<code>./assets/presets/</code>.
</p>
</div>
</div>
<div class="modal" id="test-modal" style="display: none">
<div class="modal-content">
<button class="close-button" onclick="displayDiv('test-modal')">
×
</button>
<div id="test-content"></div>
<div id="test-answers"></div>
</div>
</div>
<script src="./assets/js/errors.js"></script>
<script src="./assets/js/func.js"></script>
<script src="./assets/js/test.js"></script>
<script src="./assets/js/validateJSON.js"></script>
<script src="./assets/js/index.js"></script>
</body>
</html>