hydro-ai-helper 1.20.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +130 -99
- package/dist/handlers/batchSummaryHandler.js +734 -0
- package/dist/handlers/batchSummaryHandler.js.map +1 -0
- package/dist/handlers/teachingSummaryHandler.js +338 -0
- package/dist/handlers/teachingSummaryHandler.js.map +1 -0
- package/dist/index.js +60 -0
- package/dist/index.js.map +1 -1
- package/dist/models/batchSummaryJob.js +113 -0
- package/dist/models/batchSummaryJob.js.map +1 -0
- package/dist/models/studentHistory.js +30 -0
- package/dist/models/studentHistory.js.map +1 -0
- package/dist/models/studentSummary.js +128 -0
- package/dist/models/studentSummary.js.map +1 -0
- package/dist/models/teachingSummary.js +120 -0
- package/dist/models/teachingSummary.js.map +1 -0
- package/dist/services/analyzers/classSizeStrategy.js +44 -0
- package/dist/services/analyzers/classSizeStrategy.js.map +1 -0
- package/dist/services/analyzers/codeSelectionService.js +95 -0
- package/dist/services/analyzers/codeSelectionService.js.map +1 -0
- package/dist/services/analyzers/correlationAnalyzer.js +243 -0
- package/dist/services/analyzers/correlationAnalyzer.js.map +1 -0
- package/dist/services/analyzers/errorClusterAnalyzer.js +100 -0
- package/dist/services/analyzers/errorClusterAnalyzer.js.map +1 -0
- package/dist/services/analyzers/temporalPatternAnalyzer.js +251 -0
- package/dist/services/analyzers/temporalPatternAnalyzer.js.map +1 -0
- package/dist/services/batchSummaryService.js +421 -0
- package/dist/services/batchSummaryService.js.map +1 -0
- package/dist/services/submissionSampler.js +248 -0
- package/dist/services/submissionSampler.js.map +1 -0
- package/dist/services/teachingAnalysisService.js +600 -0
- package/dist/services/teachingAnalysisService.js.map +1 -0
- package/dist/services/teachingSuggestionService.js +231 -0
- package/dist/services/teachingSuggestionService.js.map +1 -0
- package/frontend/batchSummary/BatchSummaryPanel.tsx +556 -0
- package/frontend/batchSummary/StudentSummaryView.tsx +139 -0
- package/frontend/batchSummary/SummaryCard.tsx +268 -0
- package/frontend/batchSummary/useBatchSummary.ts +550 -0
- package/frontend/batch_summary_scoreboard.page.tsx +6 -0
- package/frontend/components/AIHelperDashboard.tsx +7 -2
- package/frontend/components/ScoreboardTabContainer.tsx +300 -0
- package/frontend/scoreboard_integration.page.tsx +109 -0
- package/frontend/teachingSummary/TeachingReviewPanel.tsx +252 -0
- package/frontend/teachingSummary/TeachingSummaryPanel.tsx +667 -0
- package/frontend/teachingSummary/teachingSummary.page.tsx +5 -0
- package/frontend/teachingSummary/useTeachingReview.ts +50 -0
- package/frontend/teachingSummary/useTeachingSummary.ts +228 -0
- package/frontend/teaching_summary_scoreboard.page.tsx +6 -0
- package/frontend/utils/styles.ts +47 -14
- package/locales/en.yaml +70 -0
- package/locales/zh.yaml +70 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,67 +11,79 @@
|
|
|
11
11
|

|
|
12
12
|

|
|
13
13
|

|
|
14
|
-

|
|
15
14
|

|
|
16
15
|
|
|
17
16
|
</div>
|
|
18
17
|
|
|
19
|
-
A teaching-first AI tutoring plugin for [HydroOJ](https://github.com/hydro-dev/Hydro)
|
|
18
|
+
A teaching-first AI tutoring plugin for [HydroOJ](https://github.com/hydro-dev/Hydro) — guided hints and thought-provoking questions, never complete solutions. Supports English and Chinese (i18n).
|
|
20
19
|
|
|
21
20
|
## Screenshots
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
<img src="assets/screenshots/1.png" alt="Student panel - AI chat" width="800">
|
|
24
23
|
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
<img src="assets/screenshots/2.png" alt="Student panel - narrow screen" width="400">
|
|
28
|
-
|
|
29
|
-
**Admin dashboard:**
|
|
24
|
+
<details>
|
|
25
|
+
<summary><b>Batch AI Learning Summary</b></summary>
|
|
30
26
|
|
|
31
|
-
<img src="assets/screenshots/
|
|
27
|
+
<img src="assets/screenshots/8.png" alt="Batch summary - scoreboard integration" width="800">
|
|
32
28
|
|
|
33
|
-
<img src="assets/screenshots/
|
|
29
|
+
<img src="assets/screenshots/9.png" alt="Batch summary - generated results" width="800">
|
|
34
30
|
|
|
35
|
-
|
|
31
|
+
</details>
|
|
36
32
|
|
|
37
|
-
<
|
|
33
|
+
<details>
|
|
34
|
+
<summary><b>Admin screenshots</b></summary>
|
|
38
35
|
|
|
39
|
-
<img src="assets/screenshots/
|
|
36
|
+
<img src="assets/screenshots/4.png" alt="Admin - conversation records" width="800">
|
|
40
37
|
|
|
41
|
-
|
|
38
|
+
<img src="assets/screenshots/5.png" alt="Admin - usage analytics" width="800">
|
|
42
39
|
|
|
43
|
-
|
|
40
|
+
<img src="assets/screenshots/6.png" alt="Admin - AI configuration" width="800">
|
|
44
41
|
|
|
45
|
-
|
|
46
|
-
- **Differentiated question types** — choose "Understand the Problem", "Organize Approach", "Debug Errors", or "Code Optimization" (AC-only) for tailored guidance
|
|
47
|
-
- **Multi-turn conversations** — ask follow-ups within the same conversation; history persists across page refreshes
|
|
48
|
-
- **"I Don't Understand"** — select confusing text in an AI reply for a concise, targeted explanation
|
|
49
|
-
- **Real-time streaming** — AI responses appear character-by-character via SSE
|
|
50
|
-
- **LaTeX rendering** — math formulas in AI responses are rendered automatically
|
|
51
|
-
- **Responsive UI** — LeetCode-style three-column layout on wide screens; floating panel on narrow screens
|
|
42
|
+
<img src="assets/screenshots/7.png" alt="Admin - cost dashboard" width="500">
|
|
52
43
|
|
|
53
|
-
|
|
44
|
+
</details>
|
|
54
45
|
|
|
55
|
-
|
|
56
|
-
- **Usage analytics** — multi-dimensional stats with sortable tables and question-type distribution
|
|
57
|
-
- **Data export** — CSV export with optional anonymization
|
|
46
|
+
## Features
|
|
58
47
|
|
|
59
|
-
###
|
|
48
|
+
### Students
|
|
60
49
|
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
|
|
50
|
+
- AI chat panel on problem pages with real-time streaming (SSE) and LaTeX rendering
|
|
51
|
+
- Choose question type: **Understand** / **Approach** / **Debug** / **Optimize** (AC-only)
|
|
52
|
+
- Multi-turn conversations with history; select confusing text for instant clarification
|
|
53
|
+
- View personalized AI learning summaries on scoreboard pages
|
|
54
|
+
|
|
55
|
+
### Teachers
|
|
56
|
+
|
|
57
|
+
- **Teaching Analysis** — class-level insights from collective submission data, helping teachers discover teaching problems and take action
|
|
58
|
+
- 8-dimension rule-engine analysis: common errors, comprehension gaps, learning strategies, at-risk students, difficulty anomalies, progress trends, cognitive paths, AI tutoring effectiveness
|
|
59
|
+
- Error signature clustering: groups similar compile/runtime errors across students to surface shared misconceptions
|
|
60
|
+
- Temporal behavior patterns: classifies students into 5 patterns (strategic solver, disengaged, burst-then-quit, stuck-silent, persistent learner)
|
|
61
|
+
- Cross-dimensional correlation: detects compound risk patterns (e.g., high AI usage + low AC rate)
|
|
62
|
+
- Code fill-in exercises: auto-generates blanked-code exercises from AC submissions for targeted practice
|
|
63
|
+
- LLM-powered actionable suggestions with priority framework (P0/P1/P2) — specific classroom actions, not generic advice
|
|
64
|
+
- 60/40 split layout with sticky AI suggestion sidebar, skeleton loading, confidence badges
|
|
65
|
+
- **Batch AI Summary** — one-click personalized learning summaries for all students on scoreboard pages
|
|
66
|
+
- Longitudinal student history tracking: records error trends, struggle indicators, and actionable advice across assignments
|
|
67
|
+
- Smart submission sampling based on milestones (first submit, first AC, score improvements, status changes)
|
|
68
|
+
- Supplemental generation for late-arriving students without regenerating existing summaries
|
|
69
|
+
- Draft/publish workflow with real-time SSE progress, stop/continue/retry controls
|
|
70
|
+
- Browse student conversations with filters (time / problem / class / student / userId)
|
|
71
|
+
- Autocomplete search for class and problem filters
|
|
72
|
+
- Multi-dimensional effectiveness metrics and question-type distribution
|
|
73
|
+
- CSV export with optional anonymization and metrics columns
|
|
74
|
+
|
|
75
|
+
### Admins
|
|
76
|
+
|
|
77
|
+
- Unified portal: Conversations / Analytics / Configuration tabs
|
|
78
|
+
- Multi-endpoint API management with model auto-discovery, drag-to-reorder priority, and automatic failover
|
|
79
|
+
- Cost control: token usage tracking, budget limits, cost dashboard
|
|
80
|
+
- Rate limiting, custom system prompt, one-click plugin update
|
|
67
81
|
|
|
68
82
|
<details>
|
|
69
83
|
<summary><b>Security</b></summary>
|
|
70
84
|
|
|
71
85
|
- Multi-layer jailbreak detection (input / prompt / output) with cross-turn protection
|
|
72
|
-
- CSRF token validation
|
|
73
|
-
- SSRF prevention on API endpoint configuration
|
|
74
|
-
- AES-256-GCM encrypted API key storage
|
|
86
|
+
- CSRF token validation, SSRF prevention, AES-256-GCM encrypted API key storage
|
|
75
87
|
- Paginated jailbreak audit logs
|
|
76
88
|
|
|
77
89
|
</details>
|
|
@@ -92,7 +104,7 @@ hydrooj addon add /path/to/hydro-ai-helper
|
|
|
92
104
|
pm2 restart hydrooj
|
|
93
105
|
```
|
|
94
106
|
|
|
95
|
-
Verify: visit `/ai-helper/hello` — a JSON response
|
|
107
|
+
Verify: visit `/ai-helper/hello` — a JSON response means success.
|
|
96
108
|
|
|
97
109
|
## Configuration
|
|
98
110
|
|
|
@@ -106,117 +118,136 @@ export ENCRYPTION_KEY="your-32-character-secret-key!!!"
|
|
|
106
118
|
|
|
107
119
|
Generate a random key: `openssl rand -base64 24 | head -c 32`
|
|
108
120
|
|
|
109
|
-
### Admin
|
|
110
|
-
|
|
111
|
-
After logging in, go to **Control Panel → AI Assistant** (`/ai-helper`), then switch to the "AI Configuration" tab:
|
|
112
|
-
|
|
113
|
-
1. **Add API endpoints** — fill in endpoint name, API Base URL, and API Key, then click "Fetch Models"
|
|
114
|
-
2. **Select models & set priority** — pick models from enabled endpoints and drag to reorder; failover is automatic
|
|
115
|
-
3. **Adjust settings** — rate limit (default: 5/min/user), custom system prompt
|
|
116
|
-
4. **Test & save** — click "Test Connection" to verify, then save
|
|
117
|
-
|
|
118
|
-
## Usage
|
|
121
|
+
### Admin Setup
|
|
119
122
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
1. Open a problem page; expand the AI panel from the bottom-right corner (wide screens show it as a side panel)
|
|
123
|
-
2. Choose a question type (Understand / Approach / Debug)
|
|
124
|
-
3. Optional: describe your understanding and what you've tried
|
|
125
|
-
4. Optional: attach your current code
|
|
126
|
-
5. Send and receive guided AI responses
|
|
127
|
-
6. If something is unclear, select the text and click "I don't understand" for a follow-up
|
|
128
|
-
7. After AC, use the "Code Optimization" feature for performance improvement suggestions
|
|
129
|
-
|
|
130
|
-
### Teachers / Admins
|
|
131
|
-
|
|
132
|
-
Go to **Control Panel → AI Assistant** (`/ai-helper`) and switch between tabs:
|
|
123
|
+
Go to **Control Panel → AI Assistant** (`/ai-helper`) → "AI Configuration" tab:
|
|
133
124
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
125
|
+
1. **Add API endpoints** — endpoint name, API Base URL, API Key → click "Fetch Models"
|
|
126
|
+
2. **Select models & priority** — pick models, drag to reorder; failover is automatic
|
|
127
|
+
3. **Adjust settings** — rate limit (default 5/min/user), custom system prompt
|
|
128
|
+
4. **Test & save** — "Test Connection" to verify, then save
|
|
137
129
|
|
|
138
130
|
## Telemetry & Privacy
|
|
139
131
|
|
|
140
|
-
|
|
132
|
+
Collects **anonymous statistics** (installation count, active users, conversations, version) for GitHub badges and development.
|
|
141
133
|
|
|
142
134
|
- Fully anonymous (random UUID, no PII); domain IDs are SHA-256 hashed
|
|
143
|
-
-
|
|
144
|
-
- Auto-cleanup after 90 days of inactivity
|
|
135
|
+
- No code, conversations, or personal data; auto-cleanup after 90 days
|
|
145
136
|
|
|
146
137
|
<details>
|
|
147
|
-
<summary><b>
|
|
138
|
+
<summary><b>Disable telemetry</b></summary>
|
|
148
139
|
|
|
149
140
|
```javascript
|
|
150
|
-
// Connect to MongoDB
|
|
151
141
|
use your_hydro_db
|
|
152
|
-
|
|
153
|
-
// Disable telemetry
|
|
154
142
|
db.ai_plugin_install.updateOne(
|
|
155
143
|
{ _id: 'install' },
|
|
156
144
|
{ $set: { telemetryEnabled: false } }
|
|
157
145
|
)
|
|
158
146
|
```
|
|
159
147
|
|
|
160
|
-
The plugin continues to work normally after disabling.
|
|
161
|
-
|
|
162
148
|
</details>
|
|
163
149
|
|
|
164
150
|
## Changelog
|
|
165
151
|
|
|
152
|
+
<details open>
|
|
153
|
+
<summary><b>v2.0.0</b> — Teaching Analysis & Design Overhaul</summary>
|
|
154
|
+
|
|
155
|
+
**Teaching Analysis System (NEW)**
|
|
156
|
+
- 8-dimension class-level analysis: common errors, comprehension gaps, learning strategies, at-risk students, difficulty anomalies, progress trends, cognitive paths, AI tutoring effectiveness
|
|
157
|
+
- Rule-engine-first architecture: anomaly detection via data pipeline, LLM for actionable suggestions — 1/30 cost of pure-LLM approach
|
|
158
|
+
- Error signature clustering with compiler error normalization
|
|
159
|
+
- Temporal behavior pattern analyzer (5-way student classification)
|
|
160
|
+
- Cross-dimensional correlation detection (3 priority pairs)
|
|
161
|
+
- Auto-generated code fill-in exercises from AC submissions
|
|
162
|
+
- Adaptive class-size strategy (<10 / 10-20 / 20-100+ students)
|
|
163
|
+
- 60/40 split layout with sticky suggestion sidebar, skeleton loading, confidence badges
|
|
164
|
+
|
|
165
|
+
**Batch Summary Enhancement**
|
|
166
|
+
- Student history tracking across assignments (error trends, struggle indicators, prior advice)
|
|
167
|
+
- Supplemental generation mode for late-arriving students
|
|
168
|
+
- Rewritten prompts with educational psychology principles and historical context injection
|
|
169
|
+
- Smart primary button state machine (generate new / retry failed / continue)
|
|
170
|
+
|
|
171
|
+
**Frontend Redesign**
|
|
172
|
+
- Unified design token system with green accent theme for teacher features
|
|
173
|
+
- Tab restyling with ARIA accessibility attributes and keyboard navigation
|
|
174
|
+
- Finding cards with severity-based color coding (high/medium/low)
|
|
175
|
+
- Responsive 60/40 → vertical layout below 768px
|
|
176
|
+
|
|
177
|
+
</details>
|
|
178
|
+
|
|
179
|
+
<details>
|
|
180
|
+
<summary><b>v1.21.0</b> — Batch AI Learning Summary</summary>
|
|
181
|
+
|
|
182
|
+
- One-click AI summary generation for all students on homework/contest scoreboard pages
|
|
183
|
+
- Smart submission sampling based on milestones (first submit, first AC, score improvements, status changes)
|
|
184
|
+
- Real-time SSE progress with stop / continue / retry-failed controls
|
|
185
|
+
- Draft → publish workflow; teachers can edit summaries before publishing
|
|
186
|
+
- Student view: auto-displays published summary on scoreboard with periodic polling
|
|
187
|
+
- Submission reference links in summaries clickable to view code details
|
|
188
|
+
- CSV export for generated summaries
|
|
189
|
+
|
|
190
|
+
</details>
|
|
191
|
+
|
|
166
192
|
<details>
|
|
167
|
-
<summary><b>v1.
|
|
193
|
+
<summary><b>v1.20.0</b> — Teacher Analytics Enhancement</summary>
|
|
168
194
|
|
|
169
|
-
-
|
|
195
|
+
- Autocomplete search for class, problem, and student filters
|
|
196
|
+
- UserId filtering and unified filter layout
|
|
197
|
+
- SVG icon set replacing emoji indicators
|
|
198
|
+
- Cost analytics period accuracy fixes
|
|
170
199
|
|
|
171
200
|
</details>
|
|
172
201
|
|
|
173
202
|
<details>
|
|
174
|
-
<summary><b>v1.
|
|
203
|
+
<summary><b>v1.19.0</b> — i18n & Effectiveness Metrics</summary>
|
|
175
204
|
|
|
176
|
-
-
|
|
177
|
-
-
|
|
178
|
-
-
|
|
179
|
-
- Security hardening: CSRF protection, SSRF prevention, 3-layer prompt injection defense
|
|
180
|
-
- Support AI assistant in homework/contest mode
|
|
205
|
+
- Full English/Chinese internationalization (frontend + backend)
|
|
206
|
+
- Multi-dimensional conversation effectiveness metrics replacing simple binary flag
|
|
207
|
+
- Metrics columns in analytics tables and CSV export
|
|
181
208
|
|
|
182
209
|
</details>
|
|
183
210
|
|
|
184
211
|
<details>
|
|
185
|
-
<summary><b>v1.
|
|
212
|
+
<summary><b>v1.18.0</b> — Telemetry Dashboard & Error Diagnostics</summary>
|
|
186
213
|
|
|
187
|
-
-
|
|
188
|
-
-
|
|
189
|
-
-
|
|
214
|
+
- Telemetry dashboard SPA for monitoring plugin installations
|
|
215
|
+
- Enhanced error diagnostics with endpoint-level context
|
|
216
|
+
- Admin feedback collection UI
|
|
190
217
|
|
|
191
218
|
</details>
|
|
192
219
|
|
|
193
220
|
<details>
|
|
194
|
-
<summary><b>v1.
|
|
221
|
+
<summary><b>v1.16.x</b> — Stability & Security</summary>
|
|
195
222
|
|
|
196
|
-
-
|
|
197
|
-
-
|
|
223
|
+
- Stabilize telemetry instanceId for Docker environments
|
|
224
|
+
- Upgrade DOMPurify to address XSS vulnerabilities
|
|
225
|
+
- Collapse jailbreak logs by default
|
|
198
226
|
|
|
199
227
|
</details>
|
|
200
228
|
|
|
201
229
|
<details>
|
|
202
|
-
<summary><b>v1.
|
|
230
|
+
<summary><b>v1.14.x</b> — SSE Streaming & Cost Control</summary>
|
|
203
231
|
|
|
204
|
-
-
|
|
205
|
-
-
|
|
232
|
+
- SSE streaming output — real-time character-by-character display
|
|
233
|
+
- Token usage tracking, budget limits, cost dashboard
|
|
234
|
+
- CSRF protection, SSRF prevention, 3-layer prompt injection defense
|
|
235
|
+
- Homework/contest mode support
|
|
206
236
|
|
|
207
237
|
</details>
|
|
208
238
|
|
|
209
239
|
<details>
|
|
210
|
-
<summary><b>v1.
|
|
211
|
-
|
|
212
|
-
- v1.
|
|
213
|
-
- v1.
|
|
214
|
-
- v1.
|
|
215
|
-
- v1.
|
|
216
|
-
- v1.
|
|
217
|
-
- v1.
|
|
240
|
+
<summary><b>v1.12.0 and earlier</b></summary>
|
|
241
|
+
|
|
242
|
+
- v1.12.0: Judge data integration, contest mode, ~45% token reduction
|
|
243
|
+
- v1.11.0: Improved guided response style, cross-turn jailbreak defense
|
|
244
|
+
- v1.10.x: Anonymous telemetry, one-click update
|
|
245
|
+
- v1.9.0: Security audit and hardening
|
|
246
|
+
- v1.8.x: "Code Optimization" question type (AC-only)
|
|
247
|
+
- v1.6.0: Unified admin portal with tabs
|
|
248
|
+
- v1.4.0: Multi-endpoint config with failover
|
|
218
249
|
- v1.2.0: Differentiated question types
|
|
219
|
-
- v1.0.0: Initial release
|
|
250
|
+
- v1.0.0: Initial release
|
|
220
251
|
|
|
221
252
|
</details>
|
|
222
253
|
|