AARIFSHABIR commited on
Commit
672cf86
·
verified ·
1 Parent(s): d812f9d

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +647 -19
  3. prompts.txt +0 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Crispr
3
- emoji: 😻
4
- colorFrom: blue
5
- colorTo: yellow
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: crispr
3
+ emoji: 🐳
4
+ colorFrom: pink
5
+ colorTo: pink
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,647 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>PHSSW Watlar - Cognitive Science Assessment (Grades 4-12)</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ .progress-bar {
11
+ height: 10px;
12
+ transition: width 0.3s ease;
13
+ }
14
+ .card-hover:hover {
15
+ transform: translateY(-5px);
16
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
17
+ }
18
+ .fade-in {
19
+ animation: fadeIn 0.5s ease-in;
20
+ }
21
+ @keyframes fadeIn {
22
+ from { opacity: 0; }
23
+ to { opacity: 1; }
24
+ }
25
+ </style>
26
+ </head>
27
+ <body class="bg-gray-50 min-h-screen font-sans">
28
+ <div class="container mx-auto px-4 py-8">
29
+ <!-- Header -->
30
+ <header class="bg-gradient-to-r from-blue-600 to-indigo-800 text-white rounded-xl shadow-lg mb-8 overflow-hidden">
31
+ <div class="flex flex-col md:flex-row items-center justify-between p-6">
32
+ <div class="flex items-center mb-4 md:mb-0">
33
+ <i class="fas fa-flask text-3xl mr-3"></i>
34
+ <div>
35
+ <h1 class="text-2xl font-bold">PHSSW Watlar</h1>
36
+ <p class="text-blue-100">Cognitive Science Assessment</p>
37
+ </div>
38
+ </div>
39
+ <div id="user-info" class="bg-white bg-opacity-20 px-4 py-2 rounded-full flex items-center">
40
+ <i class="fas fa-user-circle mr-2"></i>
41
+ <span id="student-name">Guest Student</span>
42
+ </div>
43
+ </div>
44
+ </header>
45
+
46
+ <!-- Main Content -->
47
+ <main>
48
+ <!-- Welcome Screen -->
49
+ <div id="welcome-screen" class="bg-white rounded-xl shadow-md p-6 mb-8 fade-in">
50
+ <div class="text-center py-8">
51
+ <i class="fas fa-atom text-6xl text-indigo-600 mb-6"></i>
52
+ <h2 class="text-3xl font-bold text-gray-800 mb-4">Science Aptitude Test</h2>
53
+ <p class="text-gray-600 mb-8 max-w-2xl mx-auto">
54
+ This assessment measures your cognitive abilities in science including pattern recognition,
55
+ data interpretation, logical reasoning and conceptual understanding. Appropriate for
56
+ students in grades 4-12. You will have 45 minutes to complete the test.
57
+ </p>
58
+ <div class="flex flex-col sm:flex-row justify-center gap-4 mb-8">
59
+ <button id="start-test" class="bg-indigo-600 hover:bg-indigo-700 text-white font-medium py-3 px-6 rounded-lg transition duration-300 flex items-center">
60
+ <i class="fas fa-play mr-2"></i> Start Test
61
+ </button>
62
+ <button id="instructions-btn" class="bg-white hover:bg-gray-100 text-gray-800 font-medium py-3 px-6 rounded-lg border border-gray-300 transition duration-300 flex items-center">
63
+ <i class="fas fa-info-circle mr-2"></i> Instructions
64
+ </button>
65
+ </div>
66
+ </div>
67
+ </div>
68
+
69
+ <!-- Instructions Modal -->
70
+ <div id="instructions-modal" class="hidden fixed inset-0 bg-black bg-opacity-50 z-50 flex items-center justify-center p-4">
71
+ <div class="bg-white rounded-xl shadow-xl max-w-2xl w-full max-h-[90vh] overflow-y-auto">
72
+ <div class="p-6">
73
+ <div class="flex justify-between items-center mb-4">
74
+ <h3 class="text-2xl font-bold text-indigo-700">Test Instructions</h3>
75
+ <button id="close-instructions" class="text-gray-500 hover:text-gray-700">
76
+ <i class="fas fa-times text-xl"></i>
77
+ </button>
78
+ </div>
79
+ <div class="space-y-4 text-gray-700">
80
+ <div class="flex items-start">
81
+ <i class="fas fa-clock text-indigo-500 mt-1 mr-3"></i>
82
+ <p>The test duration is 30 minutes with 50 multiple-choice questions.</p>
83
+ </div>
84
+ <div class="flex items-start">
85
+ <i class="fas fa-check-circle text-indigo-500 mt-1 mr-3"></i>
86
+ <p>Select the best answer for each question. You cannot go back to previous questions.</p>
87
+ </div>
88
+ <div class="flex items-start">
89
+ <i class="fas fa-calculator text-indigo-500 mt-1 mr-3"></i>
90
+ <p>Some questions may require calculations. Use paper for scratch work.</p>
91
+ </div>
92
+ <div class="flex items-start">
93
+ <i class="fas fa-ban text-indigo-500 mt-1 mr-3"></i>
94
+ <p>Do not refresh the page or use other browser tabs during the test.</p>
95
+ </div>
96
+ <div class="pt-4 border-t border-gray-200 italic text-sm">
97
+ <p>Your answers will be automatically saved. The results will be shown immediately after completion.</p>
98
+ </div>
99
+ </div>
100
+ </div>
101
+ </div>
102
+ </div>
103
+
104
+ <!-- Test Screen (hidden initially) -->
105
+ <div id="test-screen" class="hidden fade-in">
106
+ <!-- Test Header -->
107
+ <div class="bg-white rounded-xl shadow-md p-4 mb-6 sticky top-0 z-10">
108
+ <div class="flex flex-col md:flex-row justify-between items-center">
109
+ <div class="flex items-center mb-3 md:mb-0">
110
+ <div id="timer" class="bg-red-100 text-red-700 px-3 py-1 rounded-full font-bold mr-4">
111
+ <i class="fas fa-clock mr-1"></i>
112
+ <span>30:00</span>
113
+ </div>
114
+ <div id="question-counter" class="text-gray-600">
115
+ Question <span id="current-question">1</span> of <span>50</span>
116
+ </div>
117
+ </div>
118
+ <div class="w-full md:w-auto md:min-w-[200px] flex-grow md:flex-grow-0">
119
+ <div class="h-3 bg-gray-200 rounded-full overflow-hidden">
120
+ <div id="progress-bar" class="progress-bar bg-indigo-600" style="width: 2%"></div>
121
+ </div>
122
+ </div>
123
+ </div>
124
+ </div>
125
+
126
+ <!-- Question Container -->
127
+ <div id="question-container" class="bg-white rounded-xl shadow-md p-6 mb-6">
128
+ <div id="question-text" class="text-lg font-medium mb-6">
129
+ Loading question...
130
+ </div>
131
+ <div id="options-container" class="space-y-3">
132
+ <div class="option-item flex items-center p-4 border border-gray-200 rounded-lg hover:bg-gray-50 cursor-pointer transition card-hover">
133
+ <div class="w-6 h-6 rounded-full border border-gray-300 mr-3 flex-shrink-0"></div>
134
+ <div class="option-text">Loading options...</div>
135
+ </div>
136
+ </div>
137
+ </div>
138
+
139
+ <!-- Navigation Buttons -->
140
+ <div class="flex justify-between">
141
+ <button id="prev-btn" class="bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium py-2 px-6 rounded-lg transition duration-300 opacity-50 cursor-not-allowed" disabled>
142
+ <i class="fas fa-arrow-left mr-2"></i> Previous
143
+ </button>
144
+ <button id="next-btn" class="bg-indigo-600 hover:bg-indigo-700 text-white font-medium py-2 px-6 rounded-lg transition duration-300">
145
+ Next <i class="fas fa-arrow-right ml-2"></i>
146
+ </button>
147
+ </div>
148
+ </div>
149
+
150
+ <!-- Result Screen (hidden initially) -->
151
+ <div id="result-screen" class="hidden bg-white rounded-xl shadow-md p-8 text-center fade-in">
152
+ <div class="max-w-2xl mx-auto">
153
+ <div class="w-24 h-24 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6">
154
+ <i class="fas fa-trophy text-green-500 text-4xl"></i>
155
+ </div>
156
+ <h2 class="text-3xl font-bold text-gray-800 mb-4">Test Completed!</h2>
157
+ <p class="text-gray-600 mb-8">Your assessment results are ready.</p>
158
+
159
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
160
+ <div class="bg-blue-50 p-4 rounded-xl">
161
+ <div class="text-3xl font-bold text-blue-600 mb-2" id="score-display">0</div>
162
+ <div class="text-gray-600">Total Score</div>
163
+ </div>
164
+ <div class="bg-green-50 p-4 rounded-xl">
165
+ <div class="text-3xl font-bold text-green-600 mb-2" id="correct-answers">0</div>
166
+ <div class="text-gray-600">Correct Answers</div>
167
+ </div>
168
+ <div class="bg-orange-50 p-4 rounded-xl">
169
+ <div class="text-3xl font-bold text-orange-600 mb-2" id="time-taken">00:00</div>
170
+ <div class="text-gray-600">Time Taken</div>
171
+ </div>
172
+ </div>
173
+
174
+ <div class="mb-8">
175
+ <h3 class="text-xl font-semibold text-gray-800 mb-4">Aptitude Areas</h3>
176
+ <div class="space-y-4">
177
+ <div>
178
+ <div class="flex justify-between mb-1">
179
+ <span class="text-gray-700">Scientific Reasoning</span>
180
+ <span class="text-gray-700"><span id="reasoning-percent">0</span>%</span>
181
+ </div>
182
+ <div class="w-full bg-gray-200 rounded-full h-2.5">
183
+ <div id="reasoning-bar" class="bg-blue-600 h-2.5 rounded-full" style="width: 0%"></div>
184
+ </div>
185
+ </div>
186
+ <div>
187
+ <div class="flex justify-between mb-1">
188
+ <span class="text-gray-700">Problem Solving</span>
189
+ <span class="text-gray-700"><span id="problem-percent">0</span>%</span>
190
+ </div>
191
+ <div class="w-full bg-gray-200 rounded-full h-2.5">
192
+ <div id="problem-bar" class="bg-green-600 h-2.5 rounded-full" style="width: 0%"></div>
193
+ </div>
194
+ </div>
195
+ <div>
196
+ <div class="flex justify-between mb-1">
197
+ <span class="text-gray-700">Conceptual Understanding</span>
198
+ <span class="text-gray-700"><span id="concept-percent">0</span>%</span>
199
+ </div>
200
+ <div class="w-full bg-gray-200 rounded-full h-2.5">
201
+ <div id="concept-bar" class="bg-indigo-600 h-2.5 rounded-full" style="width: 0%"></div>
202
+ </div>
203
+ </div>
204
+ </div>
205
+ </div>
206
+
207
+ <button id="retake-test" class="bg-indigo-600 hover:bg-indigo-700 text-white font-medium py-2 px-6 rounded-lg transition duration-300 inline-block mr-3">
208
+ <i class="fas fa-redo mr-2"></i> Retake Test
209
+ </button>
210
+ <button id="review-answers" class="bg-white hover:bg-gray-100 text-gray-800 font-medium py-2 px-6 rounded-lg border border-gray-300 transition duration-300 inline-block">
211
+ <i class="fas fa-list-ul mr-2"></i> Review Answers
212
+ </button>
213
+ </div>
214
+ </div>
215
+ </main>
216
+
217
+ <footer class="text-center text-gray-500 text-sm mt-12 pb-6">
218
+ <p>© 2023 PHSSW Watlar Cognitive Assessment</p>
219
+ <p class="mt-1">Free educational resource - Version 2.0</p>
220
+ </footer>
221
+ </div>
222
+
223
+ <script>
224
+ // Constants
225
+ const TOTAL_QUESTIONS = 40; // 10 per grade band (4-6, 7-9, 10-12)
226
+ const TEST_DURATION = 45 * 60; // 45 minutes in seconds
227
+ const AREAS = ['Pattern Recognition', 'Data Interpretation', 'Logical Reasoning', 'Conceptual Understanding'];
228
+
229
+ // DOM Elements
230
+ const welcomeScreen = document.getElementById('welcome-screen');
231
+ const testScreen = document.getElementById('test-screen');
232
+ const resultScreen = document.getElementById('result-screen');
233
+ const instructionsModal = document.getElementById('instructions-modal');
234
+ const questionText = document.getElementById('question-text');
235
+ const optionsContainer = document.getElementById('options-container');
236
+ const progressBar = document.getElementById('progress-bar');
237
+ const questionCounter = document.getElementById('current-question');
238
+ const timerDisplay = document.querySelector('#timer span');
239
+ const scoreDisplay = document.getElementById('score-display');
240
+ const correctAnswersDisplay = document.getElementById('correct-answers');
241
+ const timeTakenDisplay = document.getElementById('time-taken');
242
+ const reasoningPercent = document.getElementById('reasoning-percent');
243
+ const problemPercent = document.getElementById('problem-percent');
244
+ const conceptPercent = document.getElementById('concept-percent');
245
+ const reasoningBar = document.getElementById('reasoning-bar');
246
+ const problemBar = document.getElementById('problem-bar');
247
+ const conceptBar = document.getElementById('concept-bar');
248
+
249
+ // Buttons
250
+ const startTestBtn = document.getElementById('start-test');
251
+ const instructionsBtn = document.getElementById('instructions-btn');
252
+ const closeInstructionsBtn = document.getElementById('close-instructions');
253
+ const prevBtn = document.getElementById('prev-btn');
254
+ const nextBtn = document.getElementById('next-btn');
255
+ const retakeTestBtn = document.getElementById('retake-test');
256
+ const reviewAnswersBtn = document.getElementById('review-answers');
257
+
258
+ // State variables
259
+ let currentQuestion = 1;
260
+ let timer = TEST_DURATION;
261
+ let startTime;
262
+ let answers = [];
263
+ let testQuestions = [];
264
+
265
+ // Generate sample questions (in a real app, these would come from a database)
266
+ function generateQuestions() {
267
+ const questions = [];
268
+
269
+ // Cognitive science questions across difficulty levels (grade 4-12)
270
+ const cognitiveQuestions = [
271
+ // Pattern Recognition
272
+ {
273
+ id: 1,
274
+ text: "What comes next in this pattern: ○□△○□△○□___",
275
+ options: ["△", "○", "□", "▽"],
276
+ correct: 0,
277
+ area: 0,
278
+ difficulty: 'easy'
279
+ },
280
+ {
281
+ id: 2,
282
+ text: "Look at the number sequence: 2, 4, 8, 16, ___ What comes next?",
283
+ options: ["24", "32", "64", "128"],
284
+ correct: 1,
285
+ area: 0,
286
+ difficulty: 'medium'
287
+ },
288
+
289
+ // Data Interpretation
290
+ {
291
+ id: 3,
292
+ text: "A plant grows 2cm each week. How tall will it be after 5 weeks?",
293
+ options: ["7cm", "10cm", "12cm", "15cm"],
294
+ correct: 1,
295
+ area: 1,
296
+ difficulty: 'easy'
297
+ },
298
+ {
299
+ id: 2,
300
+ text: "Which of the following best describes the scientific method?",
301
+ options: [
302
+ "A fixed set of steps that all scientists follow",
303
+ "A process that always proves hypotheses correct",
304
+ "A systematic approach to problem-solving and discovery",
305
+ "A method only used in laboratory settings"
306
+ ],
307
+ correct: 2,
308
+ area: 0,
309
+ difficulty: 'medium'
310
+ },
311
+ {
312
+ id: 3,
313
+ text: "A scientist observes that plants grow taller when given more light. This is an example of:",
314
+ options: [
315
+ "A hypothesis",
316
+ "An independent variable",
317
+ "A conclusion",
318
+ "An observation"
319
+ ],
320
+ correct: 3,
321
+ area: 0,
322
+ difficulty: 'easy'
323
+ },
324
+
325
+ // Problem Solving
326
+ {
327
+ id: 4,
328
+ text: "If an object has a mass of 10 kg and is moving at 5 m/s, what is its kinetic energy? (KE = ½mv²)",
329
+ options: [
330
+ "25 J",
331
+ "50 J",
332
+ "125 J",
333
+ "250 J"
334
+ ],
335
+ correct: 2,
336
+ area: 1,
337
+ difficulty: 'medium'
338
+ },
339
+ {
340
+ id: 5,
341
+ text: "A solution has a pH of 3. How much more acidic is it than a solution with pH 6?",
342
+ options: [
343
+ "2 times",
344
+ "10 times",
345
+ "100 times",
346
+ "1000 times"
347
+ ],
348
+ correct: 3,
349
+ area: 1,
350
+ difficulty: 'hard'
351
+ },
352
+ {
353
+ id: 6,
354
+ text: "How many oxygen atoms are in 2 molecules of H₂SO₄?",
355
+ options: [
356
+ "2",
357
+ "4",
358
+ "6",
359
+ "8"
360
+ ],
361
+ correct: 3,
362
+ area: 1,
363
+ difficulty: 'medium'
364
+ },
365
+
366
+ // Conceptual Understanding
367
+ {
368
+ id: 7,
369
+ text: "Which of these correctly describes Newton's Third Law of Motion?",
370
+ options: [
371
+ "Force equals mass times acceleration",
372
+ "An object in motion stays in motion unless acted upon",
373
+ "For every action there is an equal and opposite reaction",
374
+ "The force of gravity is proportional to mass"
375
+ ],
376
+ correct: 2,
377
+ area: 2,
378
+ difficulty: 'easy'
379
+ },
380
+ {
381
+ id: 8,
382
+ text: "In the periodic table, elements in the same group (column) have:",
383
+ options: [
384
+ "Similar atomic masses",
385
+ "The same number of electron shells",
386
+ "Similar chemical properties",
387
+ "The same number of protons"
388
+ ],
389
+ correct: 2,
390
+ area: 2,
391
+ difficulty: 'medium'
392
+ },
393
+ {
394
+ id: 9,
395
+ text: "Photosynthesis converts:",
396
+ options: [
397
+ "Solar energy to chemical energy",
398
+ "Chemical energy to kinetic energy",
399
+ "Thermal energy to electrical energy",
400
+ "Potential energy to mechanical energy"
401
+ ],
402
+ correct: 0,
403
+ area: 2,
404
+ difficulty: 'easy'
405
+ },
406
+ {
407
+ id: 10,
408
+ text: "Which of these is NOT a characteristic of living organisms?",
409
+ options: [
410
+ "Growth and development",
411
+ "Response to stimuli",
412
+ "Ability to reproduce",
413
+ "Maintenance of constant size"
414
+ ],
415
+ correct: 3,
416
+ area: 2,
417
+ difficulty: 'medium'
418
+ }
419
+ ];
420
+
421
+ // Fill the rest with random questions for demo purposes
422
+ while (questions.length < TOTAL_QUESTIONS) {
423
+ const randomIndex = Math.floor(Math.random() * scienceQuestions.length);
424
+ questions.push({...scienceQuestions[randomIndex], id: questions.length + 1});
425
+ }
426
+
427
+ return questions;
428
+ }
429
+
430
+ // Initialize the test
431
+ function initTest() {
432
+ // Reset state
433
+ currentQuestion = 1;
434
+ timer = TEST_DURATION;
435
+ answers = [];
436
+ testQuestions = generateQuestions();
437
+
438
+ // Set timer
439
+ updateTimerDisplay();
440
+ window.timerInterval = setInterval(updateTimer, 1000);
441
+
442
+ // Show first question
443
+ showQuestion(currentQuestion);
444
+
445
+ // Update progress bar
446
+ updateProgress();
447
+
448
+ // Switch screens
449
+ welcomeScreen.classList.add('hidden');
450
+ testScreen.classList.remove('hidden');
451
+ resultScreen.classList.add('hidden');
452
+
453
+ // Record start time
454
+ startTime = new Date();
455
+ }
456
+
457
+ // Show question
458
+ function showQuestion(questionIndex) {
459
+ // Update question counter
460
+ questionCounter.textContent = questionIndex;
461
+
462
+ // Get current question
463
+ const question = testQuestions[questionIndex - 1];
464
+
465
+ // Set question text
466
+ questionText.textContent = `${questionIndex}. ${question.text}`;
467
+
468
+ // Clear previous options
469
+ optionsContainer.innerHTML = '';
470
+
471
+ // Add new options
472
+ question.options.forEach((option, index) => {
473
+ const optionElement = document.createElement('div');
474
+ optionElement.className = `option-item flex items-center p-4 border border-gray-200 rounded-lg hover:bg-gray-50 cursor-pointer transition card-hover`;
475
+ optionElement.dataset.optionIndex = index;
476
+
477
+ // Check if this option was previously selected
478
+ const userAnswer = answers.find(a => a.questionId === question.id);
479
+ const isSelected = userAnswer && userAnswer.answer === index;
480
+ const isCorrect = index === question.correct;
481
+
482
+ // If viewing results (not implemented fully in this demo)
483
+ if (isSelected) {
484
+ optionElement.classList.add('bg-blue-50', 'border-blue-300');
485
+ }
486
+
487
+ optionElement.innerHTML = `
488
+ <div class="w-6 h-6 rounded-full border-2 ${isSelected ? 'border-blue-500 bg-blue-500 text-white flex items-center justify-center' : 'border-gray-300'} mr-3 flex-shrink-0">
489
+ ${isSelected ? (isCorrect ? '<i class="fas fa-check text-xs"></i>' : '<i class="fas fa-times text-xs"></i>') : ''}
490
+ </div>
491
+ <div class="option-text">${option}</div>
492
+ `;
493
+
494
+ optionElement.addEventListener('click', () => selectOption(questionIndex, index));
495
+ optionsContainer.appendChild(optionElement);
496
+ });
497
+
498
+ // Update nav buttons
499
+ prevBtn.disabled = questionIndex === 1;
500
+ nextBtn.textContent = questionIndex === TOTAL_QUESTIONS ? 'Submit Test' : 'Next';
501
+ }
502
+
503
+ // Select option
504
+ function selectOption(questionIndex, optionIndex) {
505
+ const question = testQuestions[questionIndex - 1];
506
+
507
+ // Remove previous answer if exists
508
+ answers = answers.filter(a => a.questionId !== question.id);
509
+
510
+ // Add new answer
511
+ answers.push({
512
+ questionId: question.id,
513
+ answer: optionIndex,
514
+ correct: optionIndex === question.correct,
515
+ area: question.area
516
+ });
517
+
518
+ // Update UI to show selection
519
+ showQuestion(currentQuestion);
520
+ }
521
+
522
+ // Update progress bar
523
+ function updateProgress() {
524
+ const progress = (currentQuestion / TOTAL_QUESTIONS) * 100;
525
+ progressBar.style.width = `${progress}%`;
526
+ }
527
+
528
+ // Timer functions
529
+ function updateTimer() {
530
+ timer--;
531
+ updateTimerDisplay();
532
+
533
+ if (timer <= 0) {
534
+ clearInterval(window.timerInterval);
535
+ finishTest();
536
+ }
537
+ }
538
+
539
+ function updateTimerDisplay() {
540
+ const minutes = Math.floor(timer / 60);
541
+ const seconds = timer % 60;
542
+ timerDisplay.textContent = `${minutes < 10 ? '0' + minutes : minutes}:${seconds < 10 ? '0' + seconds : seconds}`;
543
+
544
+ // Change color when time is running low
545
+ if (timer <= 300) { // 5 minutes
546
+ document.getElementById('timer').classList.remove('bg-red-100', 'text-red-700');
547
+ document.getElementById('timer').classList.add('bg-red-500', 'text-white');
548
+ }
549
+ }
550
+
551
+ // Calculate time taken
552
+ function getTimeTaken() {
553
+ const endTime = new Date();
554
+ const timeDiffMs = endTime - startTime;
555
+ const minutes = Math.floor(timeDiffMs / 60000);
556
+ const seconds = Math.floor((timeDiffMs % 60000) / 1000);
557
+
558
+ return `${minutes < 10 ? '0' + minutes : minutes}:${seconds < 10 ? '0' + seconds : seconds}`;
559
+ }
560
+
561
+ // Finish test and show results
562
+ function finishTest() {
563
+ clearInterval(window.timerInterval);
564
+
565
+ // Calculate results
566
+ const correctCount = answers.filter(a => a.correct).length;
567
+ const score = Math.round((correctCount / TOTAL_QUESTIONS) * 1000);
568
+
569
+ // Calculate area percentages
570
+ const areaCounts = [0, 0, 0]; // [reasoning, problem, concept]
571
+ const areaCorrect = [0, 0, 0];
572
+
573
+ answers.forEach(answer => {
574
+ areaCounts[answer.area]++;
575
+ if (answer.correct) {
576
+ areaCorrect[answer.area]++;
577
+ }
578
+ });
579
+
580
+ const reasoningPercentValue = areaCounts[0] ? Math.round((areaCorrect[0] / areaCounts[0]) * 100) : 0;
581
+ const problemPercentValue = areaCounts[1] ? Math.round((areaCorrect[1] / areaCounts[1]) * 100) : 0;
582
+ const conceptPercentValue = areaCounts[2] ? Math.round((areaCorrect[2] / areaCounts[2]) * 100) : 0;
583
+
584
+ // Update UI with results
585
+ scoreDisplay.textContent = score;
586
+ correctAnswersDisplay.textContent = correctCount;
587
+ timeTakenDisplay.textContent = getTimeTaken();
588
+
589
+ reasoningPercent.textContent = reasoningPercentValue;
590
+ problemPercent.textContent = problemPercentValue;
591
+ conceptPercent.textContent = conceptPercentValue;
592
+
593
+ reasoningBar.style.width = `${reasoningPercentValue}%`;
594
+ problemBar.style.width = `${problemPercentValue}%`;
595
+ conceptBar.style.width = `${conceptPercentValue}%`;
596
+
597
+ // Show result screen
598
+ testScreen.classList.add('hidden');
599
+ resultScreen.classList.remove('hidden');
600
+ }
601
+
602
+ // Event listeners
603
+ startTestBtn.addEventListener('click', initTest);
604
+
605
+ instructionsBtn.addEventListener('click', () => {
606
+ instructionsModal.classList.remove('hidden');
607
+ });
608
+
609
+ closeInstructionsBtn.addEventListener('click', () => {
610
+ instructionsModal.classList.add('hidden');
611
+ });
612
+
613
+ prevBtn.addEventListener('click', () => {
614
+ if (currentQuestion > 1) {
615
+ currentQuestion--;
616
+ showQuestion(currentQuestion);
617
+ updateProgress();
618
+ }
619
+ });
620
+
621
+ nextBtn.addEventListener('click', () => {
622
+ if (currentQuestion < TOTAL_QUESTIONS) {
623
+ currentQuestion++;
624
+ showQuestion(currentQuestion);
625
+ updateProgress();
626
+ } else {
627
+ finishTest();
628
+ }
629
+ });
630
+
631
+ retakeTestBtn.addEventListener('click', () => {
632
+ initTest();
633
+ });
634
+
635
+ reviewAnswersBtn.addEventListener('click', () => {
636
+ alert('In a full implementation, this would show a detailed review of all questions and answers.');
637
+ });
638
+
639
+ // Close modal when clicking outside
640
+ instructionsModal.addEventListener('click', (e) => {
641
+ if (e.target === instructionsModal) {
642
+ instructionsModal.classList.add('hidden');
643
+ }
644
+ });
645
+ </script>
646
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=AARIFSHABIR/crispr" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
647
+ </html>
prompts.txt ADDED
File without changes