-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathmy_progress.html
More file actions
540 lines (471 loc) · 22.3 KB
/
Copy pathmy_progress.html
File metadata and controls
540 lines (471 loc) · 22.3 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
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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My Progress - LearnSphere</title>
<link rel="stylesheet" href="variables.css">
<script src="theme.js"></script>
<link rel="stylesheet" href="styles.css" />
<link rel="stylesheet" href="badges.css" />
<link rel="manifest" href="manifest.json">
<meta name="theme-color" content="#0f1115">
<style>
.progress-wrap {
max-width: 980px;
margin: 24px auto;
padding: 0 16px;
}
.grid-2 {
display: grid;
grid-template-columns: 1.2fr 0.8fr;
gap: 16px;
}
.card {
background: #0f1115;
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 12px;
padding: 16px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.muted { color: rgba(255,255,255,0.72); }
.kpi {
display: flex;
gap: 16px;
flex-wrap: wrap;
margin-bottom: 12px;
}
.kpi .item {
min-width: 170px;
background: rgba(255,255,255,0.04);
border: 1px solid rgba(255,255,255,0.08);
border-radius: 12px;
padding: 12px;
}
canvas { width: 100%; height: 240px; }
.topic-list {
display: grid;
grid-template-columns: 1fr;
gap: 10px;
margin-top: 8px;
}
.topic-row {
display: flex;
gap: 12px;
align-items: center;
justify-content: space-between;
padding: 10px 12px;
border-radius: 10px;
background: rgba(255,255,255,0.03);
border: 1px solid rgba(255,255,255,0.06);
}
.bar {
flex: 1;
height: 10px;
background: rgba(255,255,255,0.08);
border-radius: 999px;
overflow: hidden;
margin: 0 10px;
}
.bar > i {
display: block;
height: 100%;
width: 0%;
background: #66fcf1;
}
.recommend-chip {
display: inline-block;
padding: 7px 10px;
border-radius: 999px;
background: rgba(102, 252, 241, 0.12);
border: 1px solid rgba(102, 252, 241, 0.35);
cursor: default;
margin-right: 8px;
margin-top: 8px;
font-size: 13px;
}
.streak {
font-size: 13px;
margin-top: 6px;
}
/* ── Snapshot banner (read-only view) ── */
.snapshot-banner {
background: linear-gradient(135deg, rgba(102, 252, 241, 0.12), rgba(69, 162, 158, 0.10));
border: 1px solid rgba(102, 252, 241, 0.35);
border-radius: 12px;
padding: 14px 18px;
margin-bottom: 18px;
display: flex;
align-items: center;
gap: 12px;
font-size: 14px;
color: #66fcf1;
animation: bannerFadeIn 0.4s ease;
}
.snapshot-banner .badge {
background: rgba(102, 252, 241, 0.18);
border: 1px solid rgba(102, 252, 241, 0.45);
border-radius: 6px;
padding: 4px 10px;
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.5px;
white-space: nowrap;
}
.snapshot-banner .info { flex: 1; color: rgba(255,255,255,0.82); }
.snapshot-banner .close-banner {
background: none; border: none; color: rgba(255,255,255,0.5);
cursor: pointer; font-size: 18px; line-height: 1; padding: 4px;
transition: color 0.2s;
}
.snapshot-banner .close-banner:hover { color: #fff; }
@keyframes bannerFadeIn {
from { opacity: 0; transform: translateY(-8px); }
to { opacity: 1; transform: translateY(0); }
}
/* ── Share link modal ── */
.share-modal-overlay {
position: fixed; inset: 0;
background: rgba(0, 0, 0, 0.65);
backdrop-filter: blur(6px);
z-index: 9000;
display: flex; align-items: center; justify-content: center;
animation: modalOverlayIn 0.25s ease;
}
.share-modal {
background: #141820;
border: 1px solid rgba(255, 255, 255, 0.12);
border-radius: 16px;
padding: 28px 24px;
max-width: 520px; width: 90%;
box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
animation: modalSlideUp 0.3s ease;
}
.share-modal h3 { margin: 0 0 6px; font-size: 1.15rem; color: #fff; }
.share-modal .sub { font-size: 13px; color: rgba(255,255,255,0.6); margin-bottom: 16px; }
.share-modal .url-box { display: flex; gap: 8px; align-items: stretch; }
.share-modal .url-box input {
flex: 1; background: rgba(0,0,0,0.35);
border: 1px solid rgba(255,255,255,0.12); border-radius: 8px;
color: #a9b7c6; font-family: monospace; font-size: 12px;
padding: 10px 12px; outline: none; transition: border-color 0.2s;
}
.share-modal .url-box input:focus { border-color: rgba(102, 252, 241, 0.5); }
.share-modal .copy-btn {
background: linear-gradient(135deg, #66fcf1, #45a29e);
color: #0f1115; border: none; border-radius: 8px;
padding: 10px 16px; font-weight: 700; font-size: 13px;
cursor: pointer; white-space: nowrap;
transition: opacity 0.2s, transform 0.15s;
}
.share-modal .copy-btn:hover { opacity: 0.88; transform: scale(1.02); }
.share-modal .copy-btn:active { transform: scale(0.97); }
.share-modal .modal-footer { display: flex; justify-content: flex-end; margin-top: 16px; }
.share-modal .close-modal-btn {
background: rgba(255,255,255,0.06);
border: 1px solid rgba(255,255,255,0.12); border-radius: 8px;
color: rgba(255,255,255,0.7); padding: 8px 16px; font-size: 13px;
cursor: pointer; transition: background 0.2s;
}
.share-modal .close-modal-btn:hover { background: rgba(255,255,255,0.1); }
/* ── Snapshot history ── */
.snapshot-history-list { max-height: 200px; overflow-y: auto; margin-top: 12px; }
.snapshot-history-item {
display: flex; align-items: center; justify-content: space-between;
gap: 10px; padding: 8px 12px; border-radius: 8px;
background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06);
margin-bottom: 6px; font-size: 12px; color: rgba(255,255,255,0.75);
transition: background 0.15s;
}
.snapshot-history-item:hover { background: rgba(255,255,255,0.05); }
.snapshot-history-item .snap-actions { display: flex; gap: 6px; }
.snapshot-history-item .snap-actions button {
background: rgba(102, 252, 241, 0.08); border: 1px solid rgba(102, 252, 241, 0.3);
color: #66fcf1; border-radius: 6px; padding: 4px 8px;
font-size: 11px; cursor: pointer; transition: all 0.15s;
}
.snapshot-history-item .snap-actions button:hover { background: #66fcf1; color: #0f1115; }
.snapshot-history-item .snap-actions button.snap-delete {
background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.3); color: #ef4444;
}
.snapshot-history-item .snap-actions button.snap-delete:hover { background: #ef4444; color: #fff; }
@keyframes modalOverlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalSlideUp {
from { opacity: 0; transform: translateY(16px) scale(0.97); }
to { opacity: 1; transform: translateY(0) scale(1); }
}
</style>
</head>
<body>
<!-- Snapshot read-only banner (shown when ?snapshot=... is in URL) -->
<div id="snapshotBanner" class="snapshot-banner" style="display:none; margin: 12px auto; max-width: 980px;">
<span class="badge">📸 Snapshot</span>
<span class="info" id="snapshotBannerInfo">You are viewing a read-only progress snapshot.</span>
<button class="close-banner" id="closeSnapshotBanner" aria-label="Close banner">×</button>
</div>
<header class="navbar" role="banner">
<div class="logo"><a href="index.html" aria-label="LearnSphere Home">LearnSphere</a></div>
<!-- Hamburger button — visible only on mobile -->
<button
class="hamburger"
id="hamburgerBtn"
aria-label="Toggle navigation menu"
aria-expanded="false"
aria-controls="navMenu"
>
<span></span>
<span></span>
<span></span>
</button>
<nav id="navMenu" role="navigation" aria-label="Main navigation">
<ul>
<li><a href="explore.html">Explore</a></li>
<li><a href="courses.html">Courses</a></li>
<li><a href="review.html">Review Queue</a></li>
<li><a href="resources.html">Resources</a></li>
<li><a href="community.html">Community</a></li>
</ul>
</nav>
<button id="themeToggleBtn" class="theme-btn" aria-label="Toggle theme"></button>
<!-- Accessibility controls (keyboard accessible, persistent via accessibility.js) -->
<div class="buttons" role="group" aria-label="Accessibility options" style="margin-right:10px;">
<button
type="button"
id="reducedMotionToggle"
class="a11y-btn"
aria-pressed="false"
aria-label="Toggle reduced motion"
>Reduced motion: Off</button>
<button
type="button"
id="fontSizeToggle"
class="a11y-btn"
aria-pressed="true"
aria-label="Toggle larger text"
>Larger text</button>
</div>
<div class="buttons">
<button class="login"><a href="log/login.html">Log in</a></button>
<button class="signup"><a href="log/register.html">Sign up</a></button>
</div>
</header>
<div class="progress-wrap">
<h1>My Progress</h1>
<p class="muted">Track quiz performance, accuracy trends, streaks & milestone achievements.</p>
<div class="kpi">
<div class="item">
<div class="muted">Current Streak</div>
<div id="streakValue" style="font-size:26px; margin-top:6px;">—</div>
<div class="streak muted" id="streakMeta">—</div>
</div>
<div class="item">
<div class="muted">Overall Accuracy</div>
<div id="overallAccuracyValue" style="font-size:26px; margin-top:6px;">—</div>
<div class="streak muted" id="overallAccuracyMeta">—</div>
</div>
<div class="item">
<div class="muted">Daily Goal</div>
<div id="dailyGoalValue" style="font-size:26px; margin-top:6px;">—</div>
<div class="streak muted" id="dailyGoalMeta">—</div>
</div>
</div>
<div class="grid-2">
<div class="card">
<h2 style="margin-top:0">Accuracy over time</h2>
<canvas id="accuracyChart"></canvas>
<div class="muted" style="font-size:13px; margin-top:8px">
Based on the last 14 days of quiz attempts.
</div>
</div>
<div class="card">
<h2 style="margin-top:0">Recommended next</h2>
<div id="recommendedTopics" style="margin-top:8px"></div>
<div class="muted" style="font-size:13px; margin-top:14px">
Recommendations focus on weaker or less-attempted topics.
</div>
</div>
<div class="card">
<h2 style="margin-top:0">Next steps</h2>
<div id="adaptiveNextQuizPlanner" style="margin-top:8px"></div>
<div class="muted" style="font-size:13px; margin-top:14px">
Adaptive plan estimates readiness using your last attempts and skill weakness.
</div>
</div>
<!-- New Section: Personalized Mastery Dashboard -->
<div class="card" style="margin-top:16px">
<h2 style="margin-top:0; display:flex; align-items:center; gap:8px;">
🎯 Personalized Mastery Dashboard
</h2>
<p class="muted" style="margin-bottom:16px;">Track your mastery levels per specific sub-skill/concept. Recommendations adapt to your weakest areas.</p>
<div class="grid-2" style="grid-template-columns: 1.1fr 0.9fr;">
<div>
<h3 style="margin-top:0; font-size:1.1rem; color: var(--accent-color);">Concept Mastery Details</h3>
<div id="masterySkillsList" class="topic-list">
<div class="muted">No mastery data recorded yet. Complete quizzes to see concept-wise stats!</div>
</div>
</div>
<div style="border-left: 1px solid rgba(255, 255, 255, 0.08); padding-left: 20px;">
<h3 style="margin-top:0; font-size:1.1rem; color: #ff5e5e;">Top Weak Concepts & Practice</h3>
<div id="weakSkillsRecommendations" style="display:flex; flex-direction:column; gap:12px; margin-top:12px;">
<div class="muted">No weak concepts identified yet.</div>
</div>
</div>
</div>
</div>
<div class="card" style="margin-top:16px">
<h2 style="margin-top:0">Topic-wise performance</h2>
<div id="topicStats" class="topic-list"></div>
<div class="muted" style="font-size:13px; margin-top:8px">
Shows accuracy and attempts per topic.
</div>
</div>
<div class="card" style="margin-top:16px">
<h2 style="margin-top:0">Export Progress</h2>
<p class="muted" style="font-size:13px; margin-top:6px;">
Generate a report for parents/teachers. Export is local (no backend calls).
</p>
<div class="export-actions" style="display:flex; gap:12px; flex-wrap:wrap; justify-content:flex-start; margin-top:14px;">
<button id="generateSnapshotBtn" class="export-btn" type="button">Generate Snapshot</button>
<button id="previewExportBtn" class="export-btn" type="button">Preview Export</button>
<button id="downloadProgressJsonBtn" class="export-btn" type="button">Download JSON</button>
<button id="downloadProgressCsvBtn" class="export-btn" type="button" style="background: linear-gradient(135deg, rgba(102, 252, 241, 0.10), rgba(69, 162, 158, 0.08)); border: 1px solid rgba(102, 252, 241, 0.35); color: #66fcf1;">📊 Download CSV</button>
<button id="createShareableLinkBtn" class="export-btn" type="button" style="background: linear-gradient(135deg, rgba(168, 85, 247, 0.10), rgba(139, 92, 246, 0.08)); border: 1px solid rgba(168, 85, 247, 0.35); color: #a855f7;">🔗 Create Shareable Link</button>
<button id="printProgressBtn" class="export-btn" type="button">Print / Save as PDF</button>
</div>
<!-- Snapshot History -->
<div id="snapshotHistorySection" style="display:none; margin-top:16px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; padding: 14px 16px; background: rgba(255, 255, 255, 0.02);">
<h3 style="margin-top:0; font-size: 0.95rem; color: rgba(255,255,255,0.85); display: flex; justify-content: space-between; align-items: center;">
<span>📸 Saved Snapshots</span>
<button id="closeSnapshotHistory" style="background: none; border: none; color: rgba(255,255,255,0.5); cursor: pointer; font-size: 1.1rem; line-height: 1;" aria-label="Close snapshot history">×</button>
</h3>
<div id="snapshotHistoryList" class="snapshot-history-list"></div>
</div>
<!-- Export Preview Container -->
<div id="exportPreviewContainer" style="display:none; margin-top:16px; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 12px; padding: 16px; background: rgba(255, 255, 255, 0.02);">
<h3 style="margin-top:0; color: var(--accent-color); font-size: 1.1rem; display: flex; justify-content: space-between; align-items: center;">
<span>📋 Export Data Preview</span>
<button id="closePreviewBtn" style="background: none; border: none; color: rgba(255,255,255,0.6); cursor: pointer; font-size: 1.2rem; line-height: 1;" aria-label="Close preview">×</button>
</h3>
<div id="exportPreviewWarning" style="display:none; margin-bottom:12px; padding: 10px 14px; background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.35); border-radius: 8px; color: #f59e0b; font-size: 13px; font-weight: 500;"></div>
<div id="exportPreviewContent" style="max-height: 300px; overflow-y: auto; font-family: monospace; font-size: 12px; background: rgba(0,0,0,0.3); padding: 12px; border-radius: 8px; color: #a9b7c6; border: 1px solid rgba(255,255,255,0.06); white-space: pre-wrap; text-align: left;"></div>
</div>
</div>
<!-- Print-only report container -->
<div id="printReport" class="print-report" style="display:none; margin-top:18px; text-align:left;">
<div style="display:flex; justify-content:space-between; gap:16px; align-items:flex-start; border-bottom:1px solid rgba(255,255,255,0.12); padding-bottom:12px;">
<div>
<div style="font-size:16px; font-weight:800;">LearnSphere — Progress Report</div>
<div class="muted" style="font-size:12px; margin-top:4px;">Generated for Parents/Teachers</div>
</div>
<div class="muted" style="font-size:12px;">{{generatedAt}}</div>
</div>
<div style="display:grid; grid-template-columns: 1fr 1fr; gap:12px; margin-top:14px;">
<div style="border:1px solid rgba(255,255,255,0.12); border-radius:12px; padding:12px;">
<div class="muted" style="font-size:12px;">Current Streak</div>
<div style="font-size:22px; font-weight:800; margin-top:6px;" id="printStreakValue">—</div>
<div class="muted" style="font-size:12px; margin-top:4px;" id="printStreakMeta">—</div>
</div>
<div style="border:1px solid rgba(255,255,255,0.12); border-radius:12px; padding:12px;">
<div class="muted" style="font-size:12px;">Overall Accuracy</div>
<div style="font-size:22px; font-weight:800; margin-top:6px;" id="printOverallAccuracyValue">—</div>
<div class="muted" style="font-size:12px; margin-top:4px;" id="printOverallAccuracyMeta">—</div>
</div>
</div>
<div style="border:1px solid rgba(255,255,255,0.12); border-radius:12px; padding:12px; margin-top:12px;">
<div style="font-size:14px; font-weight:800;">Accuracy Trend (Last 14 days)</div>
<div class="muted" style="font-size:12px; margin-top:4px;">See the plotted line chart from this page.</div>
<div style="margin-top:10px;">
<canvas id="printAccuracyChart" width="760" height="240"></canvas>
</div>
</div>
<div style="border:1px solid rgba(255,255,255,0.12); border-radius:12px; padding:12px; margin-top:12px;">
<div style="font-size:14px; font-weight:800;">Weak Concepts (Top 3)</div>
<div id="printWeakSkills" style="margin-top:10px; display:flex; flex-direction:column; gap:8px;"></div>
</div>
<div style="border:1px solid rgba(255,255,255,0.12); border-radius:12px; padding:12px; margin-top:12px;">
<div style="font-size:14px; font-weight:800;">Topic-wise Performance</div>
<div id="printTopicStats" style="margin-top:10px; display:flex; flex-direction:column; gap:8px;"></div>
</div>
<div style="margin-top:14px;">
<div class="muted" style="font-size:12px;">Export note: This report is generated from local stats stored in your browser.</div>
</div>
</div>
<div class="muted" style="font-size:13px; margin-top:10px">
Tip: Use Print to generate a PDF. Export formats (JSON + PDF) are compatible with backend ingestion later.
</div>
</div>
<!-- ── Streaks & Milestones Timeline Card ── -->
<div class="card" style="margin-top:16px" id="streaksMilestonesCard">
<h2 style="margin-top:0; display:flex; align-items:center; gap:10px;">
🔥 Streaks & Milestones
<span style="font-size:0.7rem; font-weight:600; text-transform:uppercase; letter-spacing:0.6px; color:rgba(255,255,255,0.4); margin-left:4px;">Timeline</span>
</h2>
<p class="muted" style="font-size:13px; margin-bottom:18px;">
Track your daily learning streak and celebrate quiz completion milestones.
</p>
<div id="streakTimelineContainer"></div>
</div>
<!-- ── Achievements & Badges Card ── -->
<div class="card" style="margin-top:16px">
<h2 style="margin-top:0">🏅 Achievements & Badges</h2>
<div id="badgesContainerMyProgress"></div>
<div class="muted" style="font-size:13px; margin-top:10px">
Unlock milestones based on quiz attempts, streak, and accuracy.
</div>
</div>
<!-- ── Notification Center Card ── -->
<div class="card" style="margin-top:16px" id="notificationCenterCard">
<h2 style="margin-top:0; display:flex; align-items:center; gap:10px;">
🔔 Notification Center
<span id="nc-unread-badge" style="display:none; background:#ff4500; color:#fff; border-radius:999px; padding:2px 8px; font-size:11px; font-weight:900;"></span>
</h2>
<p class="muted" style="font-size:13px; margin-bottom:16px;">
All your notifications in one place — filter by category, mark read, or clear.
</p>
<div id="notifCenterContainer"></div>
</div>
<div class="card" style="margin-top:16px">
<h2 style="margin-top:0">🗓️ Review queue</h2>
<div id="reviewQueueWidget" class="muted" style="font-size:14px; margin-top:6px;">Loading…</div>
</div>
</div>
<script src="progress.js"></script>
<script src="quizProgress.js"></script>
<script src="exportProgress.js"></script>
<script src="badges.js"></script>
<script src="my_progress.js"></script>
<script src="notifications.js"></script>
<script src="navbar.js"></script>
<script src="accessibility.js" defer></script>
<script>
(function () {
if (!('serviceWorker' in navigator)) return;
window.addEventListener('load', function () {
if (window.achievements?.renderStreakTimeline) {
window.achievements.renderStreakTimeline("streakTimelineContainer");
}
// Notification Center inline card
if (window.notifications?.renderNotificationCenter) {
window.notifications.renderNotificationCenter("notifCenterContainer");
}
// Update inline unread badge in the NC card header
(function updateNCBadge() {
const badge = document.getElementById("nc-unread-badge");
if (!badge) return;
const unread = window.notifications?.getUnread?.() || [];
if (unread.length > 0) {
badge.textContent = `${unread.length} unread`;
badge.style.display = "inline";
} else {
badge.style.display = "none";
}
})();
navigator.serviceWorker.register('/sw.js').catch(function (err) {
console.warn('LearnSphere: Service Worker registration failed:', err);
});
});
})();
</script>
</body>
</html>