-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathteacher_analytics.html
More file actions
203 lines (189 loc) · 11.9 KB
/
Copy pathteacher_analytics.html
File metadata and controls
203 lines (189 loc) · 11.9 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Teacher Analytics – LearnSphere</title>
<link rel="stylesheet" href="variables.css" />
<script src="theme.js"></script>
<link rel="stylesheet" href="styles.css" />
<link rel="stylesheet" href="teacher_analytics.css" />
</head>
<body>
<header class="navbar" role="banner">
<div class="logo"><a href="index.html" aria-label="LearnSphere Home">LearnSphere</a></div>
<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>
<main class="teacher-analytics-page">
<section class="content teacher-analytics-hero">
<h2>Teacher Analytics Dashboard</h2>
<p style="margin-top:-8px; font-size:13px; color:rgba(255,255,255,0.72)">
Topic/question-type trends (client-side demo from localStorage).
</p>
</section>
<section class="content teacher-analytics-content" style="padding-top:0">
<div class="card" style="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);">
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:flex-end;">
<div style="display:flex;flex-direction:column;gap:6px;min-width:160px;">
<label style="font-size:12px;color:rgba(255,255,255,0.72);font-weight:600;" for="taFromDate">Start date</label>
<input type="date" id="taFromDate" title="Start date" placeholder="YYYY-MM-DD" aria-label="Start date" style="padding:10px;border-radius:8px;border:1px solid rgba(255,255,255,0.12);background:rgba(255,255,255,0.04);color:#fff;outline:none;" />
</div>
<div style="display:flex;flex-direction:column;gap:6px;min-width:160px;">
<label style="font-size:12px;color:rgba(255,255,255,0.72);font-weight:600;" for="taToDate">End date</label>
<input type="date" id="taToDate" style="padding:10px;border-radius:8px;border:1px solid rgba(255,255,255,0.12);background:rgba(255,255,255,0.04);color:#fff;outline:none;" aria-label="End date" />
</div>
<div style="display:flex;flex-direction:column;gap:6px;min-width:220px;">
<label style="font-size:12px;color:rgba(255,255,255,0.72);font-weight:600;" for="taTopicSelect">Topic</label>
<select id="taTopicSelect" style="padding:10px;border-radius:8px;border:1px solid rgba(255,255,255,0.12);background:#0f1115;color:#fff;outline:none;" aria-label="Topic">
<option value="all" selected>All topics</option>
</select>
</div>
<div style="display:flex;flex-direction:column;gap:6px;min-width:220px;">
<label style="font-size:12px;color:rgba(255,255,255,0.72);font-weight:600;" for="taQuestionTypeSelect">Question type</label>
<select id="taQuestionTypeSelect" style="padding:10px;border-radius:8px;border:1px solid rgba(255,255,255,0.12);background:#0f1115;color:#fff;outline:none;" aria-label="Question type" title="Question type">
<option value="all" selected>All types</option>
<option value="unknown">unknown</option>
<option value="mcq">mcq</option>
<option value="short">short</option>
<option value="numeric">numeric</option>
<option value="mixed">mixed</option>
</select>
</div>
<button type="button" id="taApplyBtn" style="background:rgba(102,252,241,0.16);border:1px solid rgba(102,252,241,0.35);color:#66fcf1;padding:10px 14px;border-radius:10px;font-weight:800;cursor:pointer;transition:var(--theme-transition);">
Apply
</button>
</div>
<div style="margin-top:10px;font-size:12px;color:rgba(255,255,255,0.72)">
Reads attempts from localStorage key <code>learnsphere_quiz_progress_v1</code>.
</div>
</div>
<div class="grid-2 teacher-analytics-grid" style="display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:16px;">
<div class="card" style="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)">
<h2 style="margin-top:0">Accuracy trend (Topic)</h2>
<canvas id="taTopicAccuracyChart" style="width:100%;height:240px"></canvas>
<button class="drilldown-btn" data-metric="topic" style="margin-top:8px;background:none;border:none;color:#66fcf1;cursor:pointer;">🔎 Drill‑down</button>
<div style="font-size:13px;margin-top:8px;color:rgba(255,255,255,0.72)">Trend series for the selected topic(s).</div>
</div>
<div class="card" style="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)">
<h2 style="margin-top:0">Accuracy trend (Question type)</h2>
<canvas id="taTypeAccuracyChart" style="width:100%;height:240px"></canvas>
<button class="drilldown-btn" data-metric="type" style="margin-top:8px;background:none;border:none;color:#66fcf1;cursor:pointer;">🔎 Drill‑down</button>
<div style="font-size:13px;margin-top:8px;color:rgba(255,255,255,0.72)">Trend series for the selected question type(s).</div>
</div>
</div>
<div class="card" style="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);margin-top:16px;">
<h2 style="margin-top:0">Improvement over time</h2>
<div id="taImprovementText" style="font-size:13px;color:rgba(255,255,255,0.72)">—</div>
<button class="drilldown-btn" data-metric="improvement" style="margin-top:8px;background:none;border:none;color:#66fcf1;cursor:pointer;">🔎 Drill‑down</button>
</div>
<!-- ══════════════ CLASS MASTERY HEATMAP ══════════════ -->
<div class="card heatmap-card" style="background:#0f1115;border:1px solid rgba(255,255,255,0.08);border-radius:12px;padding:20px;box-shadow:0 10px 30px rgba(0,0,0,0.2);margin-top:16px;">
<div style="display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px;">
<div>
<h2 style="margin:0;display:flex;align-items:center;gap:8px;">
<span style="font-size:1.3rem;">🗺️</span> Class Mastery Heatmap
</h2>
<p style="margin:4px 0 0;font-size:12px;color:rgba(255,255,255,0.6);">Topics vs Students — identify class-wide gaps at a glance.</p>
</div>
<div style="font-size:11px;color:rgba(255,255,255,0.45);background:rgba(255,255,255,0.04);padding:4px 10px;border-radius:6px;border:1px solid rgba(255,255,255,0.06);">Data from localStorage (demo)</div>
</div>
<!-- Heatmap filters -->
<div class="heatmap-filters" style="display:flex;gap:12px;flex-wrap:wrap;align-items:flex-end;margin-top:16px;padding:12px;background:rgba(255,255,255,0.02);border-radius:10px;border:1px solid rgba(255,255,255,0.06);">
<div style="display:flex;flex-direction:column;gap:4px;min-width:140px;">
<label for="heatmapSubjectFilter" style="font-size:11px;color:rgba(255,255,255,0.65);font-weight:600;">Subject</label>
<select id="heatmapSubjectFilter" aria-label="Subject filter" style="padding:8px 10px;border-radius:8px;border:1px solid rgba(255,255,255,0.12);background:#0f1115;color:#fff;outline:none;font-size:13px;">
<option value="all" selected>All subjects</option>
<option value="physics">Physics</option>
<option value="maths">Maths</option>
<option value="chemistry">Chemistry</option>
</select>
</div>
<div style="display:flex;flex-direction:column;gap:4px;min-width:140px;">
<label for="heatmapFromDate" style="font-size:11px;color:rgba(255,255,255,0.65);font-weight:600;">Start date</label>
<input type="date" id="heatmapFromDate" aria-label="Heatmap start date" style="padding:8px 10px;border-radius:8px;border:1px solid rgba(255,255,255,0.12);background:rgba(255,255,255,0.04);color:#fff;outline:none;font-size:13px;" />
</div>
<div style="display:flex;flex-direction:column;gap:4px;min-width:140px;">
<label for="heatmapToDate" style="font-size:11px;color:rgba(255,255,255,0.65);font-weight:600;">End date</label>
<input type="date" id="heatmapToDate" aria-label="Heatmap end date" style="padding:8px 10px;border-radius:8px;border:1px solid rgba(255,255,255,0.12);background:rgba(255,255,255,0.04);color:#fff;outline:none;font-size:13px;" />
</div>
<button type="button" id="heatmapApplyBtn" style="background:rgba(102,252,241,0.16);border:1px solid rgba(102,252,241,0.35);color:#66fcf1;padding:8px 16px;border-radius:8px;font-weight:700;font-size:13px;cursor:pointer;transition:all 0.2s;min-height:38px;">
Apply
</button>
</div>
<!-- Heatmap canvas (scrollable) -->
<div style="overflow-x:auto;margin-top:16px;border:1px solid rgba(255,255,255,0.06);border-radius:10px;padding:12px;background:rgba(0,0,0,0.15);">
<canvas id="heatmapCanvas" aria-label="Class mastery heatmap" role="img"></canvas>
</div>
<!-- Topic Gap Analysis -->
<div style="margin-top:16px;">
<h3 style="margin:0 0 10px;font-size:0.95rem;color:rgba(255,255,255,0.85);display:flex;align-items:center;gap:6px;">
<span>📊</span> Topic Gap Analysis
<span style="font-size:11px;color:rgba(255,255,255,0.4);font-weight:400;margin-left:auto;">Sorted weakest → strongest</span>
</h3>
<div id="heatmapGapList" class="heatmap-gap-list"></div>
</div>
</div>
</section>
</main>
<script src="navbar.js"></script>
<script src="script.js"></script>
<script src="accessibility.js" defer></script>
<script src="progress.js"></script>
<script src="quizProgress.js"></script>
<script src="dashboardProgress.js"></script>
<script type="module" src="./src/main.js" defer></script>
<!-- Drill‑down modal (initially hidden) -->
<div id="drilldownModal" class="modal" style="display:none;">
<div class="modal-content">
<span class="close-btn" id="modalCloseBtn">×</span>
<h3 id="modalTitle" style="margin-top:0;color:#fff;">Detail</h3>
<canvas id="modalChart" style="width:100%;height:200px"></canvas>
<div id="modalExplanation" style="margin-top:12px;color:rgba(255,255,255,0.85);font-size:0.95rem;line-height:1.4"></div>
</div>
</div>
<script src="chart-utils.js"></script>
<script src="classHeatmap.js"></script>
<script src="metricExplain.js"></script>
</body>
</html>