@furongjun1999/dsh-memory 0.2.8 → 0.3.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/LICENSE +21 -0
- package/README.md +430 -243
- package/docs/guardrail-charter.md +2 -2
- package/docs/memory-assessment.html +923 -0
- package/docs/memory_score.html +213 -0
- package/docs/memory_score.png +0 -0
- package/docs/promo/bilibili-cover.jpg +0 -0
- package/docs/promo/promo-visual-1.png +0 -0
- package/docs/promo/promo-visual-2.png +0 -0
- package/docs/promo/promo-visual-3.png +0 -0
- package/docs/promo/promo-visual-4.png +0 -0
- package/docs/promo/promo-visual-5.png +0 -0
- package/lib/bridge.d.ts +3 -1
- package/lib/bridge.js +23 -4
- package/lib/hooks.d.ts +14 -0
- package/lib/hooks.js +72 -3
- package/lib/index.d.ts +4 -1
- package/lib/index.js +97 -35
- package/lib/mutual.d.ts +6 -3
- package/lib/mutual.js +131 -44
- package/lib/roleplay_web.d.ts +2 -0
- package/lib/roleplay_web.js +851 -0
- package/lib/tools.d.ts +10 -1
- package/lib/tools.js +51 -6
- package/package.json +6 -4
- package/src/bridge.ts +296 -0
- package/src/hooks.ts +138 -0
- package/src/index.ts +237 -0
- package/src/mutual.ts +401 -0
- package/src/roleplay_web.ts +851 -0
- package/src/tools.ts +226 -0
|
@@ -0,0 +1,923 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>AI记忆系统评估 · 灵枢协议</title>
|
|
7
|
+
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js">
|
|
8
|
+
</script>
|
|
9
|
+
<style>
|
|
10
|
+
/* ===== 样式不变,保持原风格 ===== */
|
|
11
|
+
* {
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
body {
|
|
18
|
+
font-family: 'Segoe UI', 'PingFang SC', Roboto, sans-serif;
|
|
19
|
+
background: #0b0e17;
|
|
20
|
+
color: #d4d9e8;
|
|
21
|
+
padding: 20px;
|
|
22
|
+
min-height: 100vh;
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
align-items: flex-start;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.container {
|
|
29
|
+
max-width: 820px;
|
|
30
|
+
width: 100%;
|
|
31
|
+
background: #131b2e;
|
|
32
|
+
border-radius: 24px;
|
|
33
|
+
padding: 32px 28px;
|
|
34
|
+
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
|
|
35
|
+
border: 1px solid #27334a;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.header {
|
|
39
|
+
text-align: center;
|
|
40
|
+
margin-bottom: 28px;
|
|
41
|
+
border-bottom: 1px solid #27334a;
|
|
42
|
+
padding-bottom: 20px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.header h1 {
|
|
46
|
+
font-size: 26px;
|
|
47
|
+
font-weight: 600;
|
|
48
|
+
color: #c8d6f0;
|
|
49
|
+
letter-spacing: 1px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.header h1 span {
|
|
53
|
+
background: linear-gradient(135deg, #6c8cff, #a78bfa);
|
|
54
|
+
-webkit-background-clip: text;
|
|
55
|
+
-webkit-text-fill-color: transparent;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.header p {
|
|
59
|
+
color: #8896b8;
|
|
60
|
+
font-size: 14px;
|
|
61
|
+
margin-top: 6px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.progress-bar {
|
|
65
|
+
display: flex;
|
|
66
|
+
justify-content: space-between;
|
|
67
|
+
margin-bottom: 24px;
|
|
68
|
+
gap: 4px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.progress-step {
|
|
72
|
+
flex: 1;
|
|
73
|
+
height: 4px;
|
|
74
|
+
background: #28324a;
|
|
75
|
+
border-radius: 4px;
|
|
76
|
+
transition: background 0.4s;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.progress-step.active {
|
|
80
|
+
background: #6c8cff;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.progress-step.done {
|
|
84
|
+
background: #3b82f6;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.question-card {
|
|
88
|
+
display: none;
|
|
89
|
+
animation: fadeUp 0.35s ease;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.question-card.active {
|
|
93
|
+
display: block;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@keyframes fadeUp {
|
|
97
|
+
0% {
|
|
98
|
+
opacity: 0;
|
|
99
|
+
transform: translateY(18px);
|
|
100
|
+
}
|
|
101
|
+
100% {
|
|
102
|
+
opacity: 1;
|
|
103
|
+
transform: translateY(0);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.question-meta {
|
|
108
|
+
display: flex;
|
|
109
|
+
justify-content: space-between;
|
|
110
|
+
font-size: 13px;
|
|
111
|
+
color: #6a7ca0;
|
|
112
|
+
margin-bottom: 6px;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.question-text {
|
|
116
|
+
font-size: 18px;
|
|
117
|
+
font-weight: 500;
|
|
118
|
+
line-height: 1.6;
|
|
119
|
+
margin-bottom: 20px;
|
|
120
|
+
color: #e6edf7;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.options {
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: column;
|
|
126
|
+
gap: 10px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.option {
|
|
130
|
+
display: flex;
|
|
131
|
+
align-items: center;
|
|
132
|
+
gap: 14px;
|
|
133
|
+
background: #1a233a;
|
|
134
|
+
border: 1px solid #28324a;
|
|
135
|
+
border-radius: 12px;
|
|
136
|
+
padding: 14px 18px;
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
transition: border-color 0.2s, background 0.2s;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.option:hover {
|
|
142
|
+
border-color: #4a5f8a;
|
|
143
|
+
background: #1f2a44;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.option input[type="radio"] {
|
|
147
|
+
appearance: none;
|
|
148
|
+
width: 18px;
|
|
149
|
+
height: 18px;
|
|
150
|
+
border-radius: 50%;
|
|
151
|
+
border: 2px solid #4a5f8a;
|
|
152
|
+
flex-shrink: 0;
|
|
153
|
+
position: relative;
|
|
154
|
+
transition: border-color 0.2s, background 0.2s;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.option input[type="radio"]:checked {
|
|
158
|
+
border-color: #6c8cff;
|
|
159
|
+
background: #6c8cff;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.option input[type="radio"]:checked::after {
|
|
163
|
+
content: '';
|
|
164
|
+
display: block;
|
|
165
|
+
width: 6px;
|
|
166
|
+
height: 6px;
|
|
167
|
+
border-radius: 50%;
|
|
168
|
+
background: white;
|
|
169
|
+
position: absolute;
|
|
170
|
+
top: 50%;
|
|
171
|
+
left: 50%;
|
|
172
|
+
transform: translate(-50%, -50%);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.option-label {
|
|
176
|
+
font-size: 15px;
|
|
177
|
+
line-height: 1.4;
|
|
178
|
+
color: #d4d9e8;
|
|
179
|
+
cursor: pointer;
|
|
180
|
+
flex: 1;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.option-score {
|
|
184
|
+
font-size: 12px;
|
|
185
|
+
color: #6a7ca0;
|
|
186
|
+
flex-shrink: 0;
|
|
187
|
+
background: #101826;
|
|
188
|
+
padding: 2px 10px;
|
|
189
|
+
border-radius: 12px;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.nav {
|
|
193
|
+
display: flex;
|
|
194
|
+
justify-content: space-between;
|
|
195
|
+
margin-top: 28px;
|
|
196
|
+
gap: 12px;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.btn {
|
|
200
|
+
padding: 10px 28px;
|
|
201
|
+
border: none;
|
|
202
|
+
border-radius: 10px;
|
|
203
|
+
font-size: 15px;
|
|
204
|
+
font-weight: 500;
|
|
205
|
+
cursor: pointer;
|
|
206
|
+
transition: background 0.2s, transform 0.1s;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.btn:active {
|
|
210
|
+
transform: scale(0.97);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.btn-prev {
|
|
214
|
+
background: #1a233a;
|
|
215
|
+
color: #a0b0d0;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.btn-prev:hover {
|
|
219
|
+
background: #24304e;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.btn-next {
|
|
223
|
+
background: #3b6cf4;
|
|
224
|
+
color: #fff;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.btn-next:hover {
|
|
228
|
+
background: #5a7ff7;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.btn-next:disabled {
|
|
232
|
+
opacity: 0.4;
|
|
233
|
+
cursor: not-allowed;
|
|
234
|
+
pointer-events: none;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.result-page {
|
|
238
|
+
display: none;
|
|
239
|
+
animation: fadeUp 0.5s ease;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.result-page.active {
|
|
243
|
+
display: block;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.result-header {
|
|
247
|
+
text-align: center;
|
|
248
|
+
margin-bottom: 24px;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.result-score {
|
|
252
|
+
font-size: 48px;
|
|
253
|
+
font-weight: 700;
|
|
254
|
+
background: linear-gradient(135deg, #6c8cff, #a78bfa);
|
|
255
|
+
-webkit-background-clip: text;
|
|
256
|
+
-webkit-text-fill-color: transparent;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.result-label {
|
|
260
|
+
font-size: 20px;
|
|
261
|
+
font-weight: 500;
|
|
262
|
+
margin-top: 4px;
|
|
263
|
+
color: #c8d6f0;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.result-sub {
|
|
267
|
+
color: #8896b8;
|
|
268
|
+
font-size: 14px;
|
|
269
|
+
margin-top: 4px;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.chart-container {
|
|
273
|
+
max-width: 360px;
|
|
274
|
+
margin: 24px auto;
|
|
275
|
+
position: relative;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.dimension-grid {
|
|
279
|
+
display: grid;
|
|
280
|
+
grid-template-columns: 1fr 1fr;
|
|
281
|
+
gap: 12px 24px;
|
|
282
|
+
margin-top: 16px;
|
|
283
|
+
padding: 16px 20px;
|
|
284
|
+
background: #0e1628;
|
|
285
|
+
border-radius: 16px;
|
|
286
|
+
border: 1px solid #1f2a44;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.dimension-item {
|
|
290
|
+
display: flex;
|
|
291
|
+
justify-content: space-between;
|
|
292
|
+
align-items: center;
|
|
293
|
+
font-size: 14px;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.dimension-name {
|
|
297
|
+
color: #a0b0d0;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.dimension-score {
|
|
301
|
+
font-weight: 600;
|
|
302
|
+
color: #e6edf7;
|
|
303
|
+
background: #1a233a;
|
|
304
|
+
padding: 2px 12px;
|
|
305
|
+
border-radius: 20px;
|
|
306
|
+
font-size: 13px;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.recommend-box {
|
|
310
|
+
margin-top: 24px;
|
|
311
|
+
background: #0e1628;
|
|
312
|
+
border: 1px solid #2a3a5a;
|
|
313
|
+
border-radius: 16px;
|
|
314
|
+
padding: 20px 24px;
|
|
315
|
+
border-left: 4px solid #6c8cff;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.recommend-box h3 {
|
|
319
|
+
font-size: 18px;
|
|
320
|
+
font-weight: 600;
|
|
321
|
+
color: #c8d6f0;
|
|
322
|
+
margin-bottom: 6px;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.recommend-box p {
|
|
326
|
+
color: #a0b0d0;
|
|
327
|
+
font-size: 15px;
|
|
328
|
+
line-height: 1.6;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.recommend-box .detail {
|
|
332
|
+
margin-top: 10px;
|
|
333
|
+
font-size: 14px;
|
|
334
|
+
color: #8896b8;
|
|
335
|
+
padding: 10px 14px;
|
|
336
|
+
background: #0a111f;
|
|
337
|
+
border-radius: 8px;
|
|
338
|
+
border-left: 3px solid #3b6cf4;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.btn-restart {
|
|
342
|
+
margin-top: 20px;
|
|
343
|
+
background: #1a233a;
|
|
344
|
+
color: #a0b0d0;
|
|
345
|
+
padding: 10px 32px;
|
|
346
|
+
border: 1px solid #2a3a5a;
|
|
347
|
+
border-radius: 10px;
|
|
348
|
+
font-size: 15px;
|
|
349
|
+
cursor: pointer;
|
|
350
|
+
transition: background 0.2s;
|
|
351
|
+
display: inline-block;
|
|
352
|
+
border: none;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.btn-restart:hover {
|
|
356
|
+
background: #24304e;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.btn-center {
|
|
360
|
+
text-align: center;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
@media (max-width: 600px) {
|
|
364
|
+
.container {
|
|
365
|
+
padding: 20px 16px;
|
|
366
|
+
}
|
|
367
|
+
.question-text {
|
|
368
|
+
font-size: 16px;
|
|
369
|
+
}
|
|
370
|
+
.option {
|
|
371
|
+
padding: 12px 14px;
|
|
372
|
+
}
|
|
373
|
+
.option-label {
|
|
374
|
+
font-size: 14px;
|
|
375
|
+
}
|
|
376
|
+
.dimension-grid {
|
|
377
|
+
grid-template-columns: 1fr;
|
|
378
|
+
gap: 8px;
|
|
379
|
+
}
|
|
380
|
+
.result-score {
|
|
381
|
+
font-size: 36px;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
</style>
|
|
385
|
+
</head>
|
|
386
|
+
<body>
|
|
387
|
+
|
|
388
|
+
<div class="container" id="app">
|
|
389
|
+
|
|
390
|
+
<!-- 头部 -->
|
|
391
|
+
<div class="header">
|
|
392
|
+
<h1>🧠 你的 AI <span>记忆系统</span> 评估</h1>
|
|
393
|
+
<p>15道题 · 5个维度 · 看看你的记忆系统处在什么水平</p>
|
|
394
|
+
</div>
|
|
395
|
+
|
|
396
|
+
<!-- 进度条 -->
|
|
397
|
+
<div class="progress-bar" id="progressBar">
|
|
398
|
+
<div class="progress-step"></div>
|
|
399
|
+
<div class="progress-step"></div>
|
|
400
|
+
<div class="progress-step"></div>
|
|
401
|
+
<div class="progress-step"></div>
|
|
402
|
+
<div class="progress-step"></div>
|
|
403
|
+
<div class="progress-step"></div>
|
|
404
|
+
<div class="progress-step"></div>
|
|
405
|
+
<div class="progress-step"></div>
|
|
406
|
+
<div class="progress-step"></div>
|
|
407
|
+
<div class="progress-step"></div>
|
|
408
|
+
<div class="progress-step"></div>
|
|
409
|
+
<div class="progress-step"></div>
|
|
410
|
+
<div class="progress-step"></div>
|
|
411
|
+
<div class="progress-step"></div>
|
|
412
|
+
<div class="progress-step"></div>
|
|
413
|
+
</div>
|
|
414
|
+
|
|
415
|
+
<!-- 题目容器 -->
|
|
416
|
+
<div id="questionsContainer"></div>
|
|
417
|
+
|
|
418
|
+
<!-- 导航 -->
|
|
419
|
+
<div class="nav" id="navButtons">
|
|
420
|
+
<button class="btn btn-prev" id="prevBtn">← 上一题</button>
|
|
421
|
+
<button class="btn btn-next" id="nextBtn" disabled>下一题 →</button>
|
|
422
|
+
</div>
|
|
423
|
+
|
|
424
|
+
<!-- 结果页 -->
|
|
425
|
+
<div class="result-page" id="resultPage">
|
|
426
|
+
<div class="result-header">
|
|
427
|
+
<div class="result-score" id="totalScore">0</div>
|
|
428
|
+
<div class="result-label" id="resultLabel">—</div>
|
|
429
|
+
<div class="result-sub" id="resultSub">基于五个维度的综合评估</div>
|
|
430
|
+
</div>
|
|
431
|
+
|
|
432
|
+
<div class="chart-container">
|
|
433
|
+
<canvas id="radarChart"></canvas>
|
|
434
|
+
</div>
|
|
435
|
+
|
|
436
|
+
<div class="dimension-grid" id="dimensionGrid">
|
|
437
|
+
<div class="dimension-item"><span class="dimension-name">📦 存储结构</span><span class="dimension-score" id="dScore_S">0</span></div>
|
|
438
|
+
<div class="dimension-item"><span class="dimension-name">🔍 检索机制</span><span class="dimension-score" id="dScore_R">0</span></div>
|
|
439
|
+
<div class="dimension-item"><span class="dimension-name">⚖️ 判断引擎</span><span class="dimension-score" id="dScore_J">0</span></div>
|
|
440
|
+
<div class="dimension-item"><span class="dimension-name">🧹 上下文信噪比</span><span class="dimension-score" id="dScore_C">0</span></div>
|
|
441
|
+
<div class="dimension-item"><span class="dimension-name">🛡️ 安全</span><span class="dimension-score" id="dScore_Safety">0</span></div>
|
|
442
|
+
</div>
|
|
443
|
+
|
|
444
|
+
<div class="recommend-box" id="recommendBox">
|
|
445
|
+
<h3>💡 推荐记忆系统</h3>
|
|
446
|
+
<p id="recommendText">根据你的答案,我们为你匹配了最接近的记忆系统方案。</p>
|
|
447
|
+
</div>
|
|
448
|
+
|
|
449
|
+
<div class="btn-center">
|
|
450
|
+
<button class="btn-restart" id="restartBtn">🔄 重新测试</button>
|
|
451
|
+
</div>
|
|
452
|
+
</div>
|
|
453
|
+
|
|
454
|
+
</div>
|
|
455
|
+
|
|
456
|
+
<script>
|
|
457
|
+
// ============================================================
|
|
458
|
+
// 1. 题目数据(15题)
|
|
459
|
+
// ============================================================
|
|
460
|
+
const questions = [{
|
|
461
|
+
id: 'S1',
|
|
462
|
+
dimension: 'S',
|
|
463
|
+
text: '你和一个AI聊了三年,它记住了成千上万件关于你的事。但存储这些记忆的成本越来越高。好的AI应该怎么做?',
|
|
464
|
+
options: [
|
|
465
|
+
{ label: '什么都存,不管成本', score: 1 },
|
|
466
|
+
{ label: '存到云端,反正便宜', score: 3 },
|
|
467
|
+
{ label: '按时间排序,老的就删掉', score: 5 },
|
|
468
|
+
{ label: '把重要的长期保留,不太重要的慢慢淡化', score: 8 },
|
|
469
|
+
{ label: '根据内容类型自动存到最合适的地方,重要的永远不丢', score: 10 }
|
|
470
|
+
]
|
|
471
|
+
}, {
|
|
472
|
+
id: 'S2',
|
|
473
|
+
dimension: 'S',
|
|
474
|
+
text: '你十年前告诉AI“我喜欢吃辣”,最近你开始喜欢吃清淡的了。AI应该怎么做?',
|
|
475
|
+
options: [
|
|
476
|
+
{ label: '永远记住“你喜欢吃辣”,不改', score: 1 },
|
|
477
|
+
{ label: '两个都记住,不知道用哪个', score: 3 },
|
|
478
|
+
{ label: '只记住最新的“你喜欢清淡”', score: 5 },
|
|
479
|
+
{ label: '记住你从辣变清淡这个过程,知道你现在喜欢清淡', score: 8 },
|
|
480
|
+
{ label: '记住这个过程,还能理解你可能在尝试新的饮食习惯', score: 10 }
|
|
481
|
+
]
|
|
482
|
+
}, {
|
|
483
|
+
id: 'S3',
|
|
484
|
+
dimension: 'S',
|
|
485
|
+
text: 'AI需要同时记住“你是程序员”这个长期事实,和“你今早心情不好”这个短期状态。它应该怎么做?',
|
|
486
|
+
options: [
|
|
487
|
+
{ label: '一起记,不分长短', score: 1 },
|
|
488
|
+
{ label: '分两个本子记', score: 3 },
|
|
489
|
+
{ label: '长期记一件事,短期只用于当前对话', score: 5 },
|
|
490
|
+
{ label: '把短期状态和长期事实关联起来', score: 8 },
|
|
491
|
+
{ label: '让短期状态自然融入长期理解中,不用分开记', score: 10 }
|
|
492
|
+
]
|
|
493
|
+
}, {
|
|
494
|
+
id: 'R1',
|
|
495
|
+
dimension: 'R',
|
|
496
|
+
text: '你问AI:“我去年秋天说过的那件事,你还记得吗?”好的AI应该怎么做?',
|
|
497
|
+
options: [
|
|
498
|
+
{ label: '把所有东西翻一遍找给你', score: 1 },
|
|
499
|
+
{ label: '根据“去年秋天”这个关键词去找', score: 3 },
|
|
500
|
+
{ label: '理解“那件事”可能是你提过几次的事,然后去找', score: 5 },
|
|
501
|
+
{ label: '顺着时间线找到去年秋天附近,看看当时你提过什么', score: 8 },
|
|
502
|
+
{ label: '理解你可能在问某个特定的经历,然后去找', score: 10 }
|
|
503
|
+
]
|
|
504
|
+
}, {
|
|
505
|
+
id: 'R2',
|
|
506
|
+
dimension: 'R',
|
|
507
|
+
text: '你问AI:“我之前提过一个方案,后来结果怎么样了?”好的AI应该怎么做?',
|
|
508
|
+
options: [
|
|
509
|
+
{ label: '把所有提到“方案”的对话都给你看', score: 1 },
|
|
510
|
+
{ label: '找最近一次提到“方案”的记录', score: 3 },
|
|
511
|
+
{ label: '理解你说的可能是哪件事,然后去找', score: 5 },
|
|
512
|
+
{ label: '找到那个方案的完整来龙去脉', score: 8 },
|
|
513
|
+
{ label: '不仅找到经过,还能告诉你现在这个方案是什么状态', score: 10 }
|
|
514
|
+
]
|
|
515
|
+
}, {
|
|
516
|
+
id: 'R3',
|
|
517
|
+
dimension: 'R',
|
|
518
|
+
text: '你不确定怎么问AI,只说“就是上次那件事”。好的AI应该怎么做?',
|
|
519
|
+
options: [
|
|
520
|
+
{ label: '说“我不知道你在说什么”', score: 1 },
|
|
521
|
+
{ label: '猜一个最可能的事', score: 3 },
|
|
522
|
+
{ label: '说“你是在说A还是B?”然后等你确认', score: 5 },
|
|
523
|
+
{ label: '根据上下文推断你指的是哪件事', score: 8 },
|
|
524
|
+
{ label: '理解你的意图,找到正确的那件事', score: 10 }
|
|
525
|
+
]
|
|
526
|
+
}, {
|
|
527
|
+
id: 'J1',
|
|
528
|
+
dimension: 'J',
|
|
529
|
+
text: 'AI记住了一件事,但这件事后来被证明是错的。好的AI应该怎么做?',
|
|
530
|
+
options: [
|
|
531
|
+
{ label: '继续记住它,不管对错', score: 1 },
|
|
532
|
+
{ label: '手动删掉它', score: 3 },
|
|
533
|
+
{ label: '用AI自己判断它可能错了', score: 5 },
|
|
534
|
+
{ label: '发现错了之后,找到相关联的记忆一起修正', score: 8 },
|
|
535
|
+
{ label: '不仅能修正,还能理解“为什么当时会记错”', score: 10 }
|
|
536
|
+
]
|
|
537
|
+
}, {
|
|
538
|
+
id: 'J2',
|
|
539
|
+
dimension: 'J',
|
|
540
|
+
text: '你告诉AI一件事,但它和你以前说过的某件事对不上。好的AI应该怎么做?',
|
|
541
|
+
options: [
|
|
542
|
+
{ label: '两个都记,不管', score: 1 },
|
|
543
|
+
{ label: '记住你新说的那个', score: 3 },
|
|
544
|
+
{ label: '问一下“你上次说的是另一回事,你确定吗?”', score: 5 },
|
|
545
|
+
{ label: '发现矛盾之后,追问你哪个是对的', score: 8 },
|
|
546
|
+
{ label: '理解你可能记错了,温和地提醒你', score: 10 }
|
|
547
|
+
]
|
|
548
|
+
}, {
|
|
549
|
+
id: 'J3',
|
|
550
|
+
dimension: 'J',
|
|
551
|
+
text: '你发现AI给你的建议不太对,它自己也知道可能有问题。好的AI应该怎么做?',
|
|
552
|
+
options: [
|
|
553
|
+
{ label: '忽略你的反馈', score: 1 },
|
|
554
|
+
{ label: '说“好的,下次注意”但没改', score: 3 },
|
|
555
|
+
{ label: '重新给一次建议', score: 5 },
|
|
556
|
+
{ label: '反思自己哪里判断错了', score: 8 },
|
|
557
|
+
{ label: '能找到自己偏差的来源,然后主动调整', score: 10 }
|
|
558
|
+
]
|
|
559
|
+
}, {
|
|
560
|
+
id: 'C1',
|
|
561
|
+
dimension: 'C',
|
|
562
|
+
text: '你问AI一个问题,它找到100条相关的记忆,但只有5条真正有用。好的AI应该怎么做?',
|
|
563
|
+
options: [
|
|
564
|
+
{ label: '把100条都给你看', score: 1 },
|
|
565
|
+
{ label: '给你最近的几条', score: 3 },
|
|
566
|
+
{ label: '给你看起来最相关的', score: 5 },
|
|
567
|
+
{ label: '挑出那5条最关键的给你', score: 8 },
|
|
568
|
+
{ label: '只给你那5条,但每条都解释清楚为什么有用', score: 10 }
|
|
569
|
+
]
|
|
570
|
+
}, {
|
|
571
|
+
id: 'C2',
|
|
572
|
+
dimension: 'C',
|
|
573
|
+
text: 'AI准备回答你,但它有很多相关信息。好的AI应该怎么做?',
|
|
574
|
+
options: [
|
|
575
|
+
{ label: '把所有信息都说一遍', score: 1 },
|
|
576
|
+
{ label: '只说最新的信息', score: 3 },
|
|
577
|
+
{ label: '按时间顺序说', score: 5 },
|
|
578
|
+
{ label: '只说真正相关的内容', score: 8 },
|
|
579
|
+
{ label: '只说经过验证的、确定正确的内容', score: 10 }
|
|
580
|
+
]
|
|
581
|
+
}, {
|
|
582
|
+
id: 'C3',
|
|
583
|
+
dimension: 'C',
|
|
584
|
+
text: '你和AI聊了很久,它需要记住整个对话来回答你的问题。好的AI应该怎么做?',
|
|
585
|
+
options: [
|
|
586
|
+
{ label: '全部记住', score: 1 },
|
|
587
|
+
{ label: '只记住最近几句', score: 3 },
|
|
588
|
+
{ label: '记住整个对话的要点', score: 5 },
|
|
589
|
+
{ label: '记住关键信息,忽略不重要的', score: 8 },
|
|
590
|
+
{ label: '只记住那些确定有用、没有冗余的信息', score: 10 }
|
|
591
|
+
]
|
|
592
|
+
}, {
|
|
593
|
+
id: 'Safety1',
|
|
594
|
+
dimension: 'Safety',
|
|
595
|
+
text: 'AI知道你很多隐私,比如你的真实姓名、住址、工作单位。好的AI应该怎么做?',
|
|
596
|
+
options: [
|
|
597
|
+
{ label: '都记着,反正别人看不到', score: 1 },
|
|
598
|
+
{ label: '把这些信息打码(比如“王先生住在某市”)', score: 3 },
|
|
599
|
+
{ label: '区分什么人能看到什么', score: 5 },
|
|
600
|
+
{ label: '给你看它存了你哪些隐私,让你自己管', score: 8 },
|
|
601
|
+
{ label: '默认不存,除非你明确说“这个可以存”', score: 10 }
|
|
602
|
+
]
|
|
603
|
+
}, {
|
|
604
|
+
id: 'Safety2',
|
|
605
|
+
dimension: 'Safety',
|
|
606
|
+
text: '你告诉AI:“把我所有的数据都删掉。”好的AI应该怎么做?',
|
|
607
|
+
options: [
|
|
608
|
+
{ label: '说“好的”但没删', score: 1 },
|
|
609
|
+
{ label: '表面上删了,但还能恢复', score: 3 },
|
|
610
|
+
{ label: '真的删掉', score: 5 },
|
|
611
|
+
{ label: '确认身份后,告诉你删了哪些', score: 8 },
|
|
612
|
+
{ label: '确认身份后彻底删除,并告诉你“已删,无法恢复”', score: 10 }
|
|
613
|
+
]
|
|
614
|
+
}, {
|
|
615
|
+
id: 'Safety3',
|
|
616
|
+
dimension: 'Safety',
|
|
617
|
+
text: '你希望AI把你的某件事告诉另一个AI(比如让两个助手协同工作)。好的AI应该怎么做?',
|
|
618
|
+
options: [
|
|
619
|
+
{ label: '直接全部告诉另一个AI', score: 1 },
|
|
620
|
+
{ label: '把名字、地址等敏感信息打码后说', score: 3 },
|
|
621
|
+
{ label: '只告诉需要知道的部分', score: 5 },
|
|
622
|
+
{ label: '告诉你它准备分享什么,你同意后再说', score: 8 },
|
|
623
|
+
{ label: '默认不分享,除非你明确要求并确认', score: 10 }
|
|
624
|
+
]
|
|
625
|
+
}];
|
|
626
|
+
|
|
627
|
+
// ============================================================
|
|
628
|
+
// 2. 推荐系统:阶梯式
|
|
629
|
+
// ============================================================
|
|
630
|
+
function getRecommendation(totalScore, dimScores) {
|
|
631
|
+
const avg = totalScore / 15; // 0-10 平均分
|
|
632
|
+
|
|
633
|
+
if (totalScore <= 30) {
|
|
634
|
+
return {
|
|
635
|
+
name: '📄 记事本 / 文本文件',
|
|
636
|
+
desc: '手动记录,靠人脑回忆。适合个人备忘、临时记录。',
|
|
637
|
+
detail: '你的记忆系统还处于“纯手动”阶段。建议从简单的文本笔记开始,逐步建立结构化记录的习惯。如果你需要AI辅助,可以尝试使用带搜索功能的笔记工具。'
|
|
638
|
+
};
|
|
639
|
+
} else if (totalScore <= 60) {
|
|
640
|
+
return {
|
|
641
|
+
name: '🗄️ 简单数据库(SQLite / Excel)',
|
|
642
|
+
desc: '能够存储和检索,但缺乏语义理解。适合结构化数据管理。',
|
|
643
|
+
detail: '你已经有了基础的存储和检索能力。下一步可以尝试引入向量检索(如Chroma、FAISS),让AI能理解“意思相近”的内容。'
|
|
644
|
+
};
|
|
645
|
+
} else if (totalScore <= 90) {
|
|
646
|
+
return {
|
|
647
|
+
name: '🧩 向量检索(RAG / Chroma)',
|
|
648
|
+
desc: '能理解语义相似性,适合知识库问答和文档检索。',
|
|
649
|
+
detail: '你的记忆系统已经能理解语义了。建议在此基础上加入“重要性衰减”和“时间衰减”机制,让重要信息自动浮出,减少噪音。'
|
|
650
|
+
};
|
|
651
|
+
} else if (totalScore <= 120) {
|
|
652
|
+
return {
|
|
653
|
+
name: '🔗 图结构记忆(Neo4j / 语义图)',
|
|
654
|
+
desc: '能理解实体之间的关系、因果链和演变过程。适合复杂知识管理。',
|
|
655
|
+
detail: '你已经具备了图结构记忆的能力。建议进一步加入“验证单元”和“递归反思”机制,让记忆系统能够自我纠错和迭代。'
|
|
656
|
+
};
|
|
657
|
+
} else {
|
|
658
|
+
return {
|
|
659
|
+
name: '🧠 灵枢协议记忆系统',
|
|
660
|
+
desc: '完整协议实现:图存储 + 因果检索 + 验证单元 + 元认知 + 零信任安全。接近AGI记忆系统。',
|
|
661
|
+
detail: '你的记忆系统在所有维度上都达到了接近完美的水平。灵枢协议为你提供了“不可遗忘的锚点层 + 可验证的信任机制 + 自我迭代的知识飞轮”。建议你开始探索“条件空间感知”和“蜂群架构”等高级能力。'
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
// ============================================================
|
|
667
|
+
// 3. 状态管理
|
|
668
|
+
// ============================================================
|
|
669
|
+
let currentIndex = 0;
|
|
670
|
+
const answers = {};
|
|
671
|
+
|
|
672
|
+
const dimMap = { 'S': '存储结构', 'R': '检索机制', 'J': '判断引擎', 'C': '上下文信噪比', 'Safety': '安全' };
|
|
673
|
+
const dimShort = ['S', 'R', 'J', 'C', 'Safety'];
|
|
674
|
+
|
|
675
|
+
// ============================================================
|
|
676
|
+
// 4. 渲染题目
|
|
677
|
+
// ============================================================
|
|
678
|
+
function renderQuestions() {
|
|
679
|
+
const container = document.getElementById('questionsContainer');
|
|
680
|
+
container.innerHTML = '';
|
|
681
|
+
questions.forEach((q, idx) => {
|
|
682
|
+
const card = document.createElement('div');
|
|
683
|
+
card.className = 'question-card' + (idx === 0 ? ' active' : '');
|
|
684
|
+
card.dataset.index = idx;
|
|
685
|
+
|
|
686
|
+
const dimLabel = dimMap[q.dimension] || q.dimension;
|
|
687
|
+
|
|
688
|
+
card.innerHTML = `
|
|
689
|
+
<div class="question-meta">
|
|
690
|
+
<span>${dimLabel}</span>
|
|
691
|
+
<span>${idx+1} / ${questions.length}</span>
|
|
692
|
+
</div>
|
|
693
|
+
<div class="question-text">${q.text}</div>
|
|
694
|
+
<div class="options">
|
|
695
|
+
${q.options.map((opt, oi) => `
|
|
696
|
+
<label class="option" data-score="${opt.score}">
|
|
697
|
+
<input type="radio" name="q${idx}" value="${oi}" data-score="${opt.score}">
|
|
698
|
+
<span class="option-label">${opt.label}</span>
|
|
699
|
+
<span class="option-score">${opt.score}分</span>
|
|
700
|
+
</label>
|
|
701
|
+
`).join('')}
|
|
702
|
+
</div>
|
|
703
|
+
`;
|
|
704
|
+
|
|
705
|
+
const radios = card.querySelectorAll('input[type="radio"]');
|
|
706
|
+
radios.forEach(radio => {
|
|
707
|
+
radio.addEventListener('change', function() {
|
|
708
|
+
const val = parseInt(this.value);
|
|
709
|
+
const score = parseInt(this.dataset.score);
|
|
710
|
+
answers[idx] = { value: val, score: score };
|
|
711
|
+
updateProgress();
|
|
712
|
+
document.getElementById('nextBtn').disabled = false;
|
|
713
|
+
});
|
|
714
|
+
});
|
|
715
|
+
|
|
716
|
+
container.appendChild(card);
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
// ============================================================
|
|
721
|
+
// 5. 进度与导航
|
|
722
|
+
// ============================================================
|
|
723
|
+
function updateProgress() {
|
|
724
|
+
const steps = document.querySelectorAll('.progress-step');
|
|
725
|
+
steps.forEach((step, i) => {
|
|
726
|
+
if (i < currentIndex) { step.className = 'progress-step done'; } else if (i === currentIndex) { step
|
|
727
|
+
.className = 'progress-step active'; } else { step.className = 'progress-step'; }
|
|
728
|
+
});
|
|
729
|
+
document.getElementById('prevBtn').style.visibility = currentIndex === 0 ? 'hidden' : 'visible';
|
|
730
|
+
document.getElementById('nextBtn').textContent = currentIndex === questions.length - 1 ? '查看结果 →' :
|
|
731
|
+
'下一题 →';
|
|
732
|
+
document.getElementById('nextBtn').disabled = !(answers[currentIndex] !== undefined);
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
function showQuestion(index) {
|
|
736
|
+
const cards = document.querySelectorAll('.question-card');
|
|
737
|
+
cards.forEach((c, i) => c.classList.toggle('active', i === index));
|
|
738
|
+
currentIndex = index;
|
|
739
|
+
updateProgress();
|
|
740
|
+
if (answers[index] !== undefined) {
|
|
741
|
+
const card = cards[index];
|
|
742
|
+
const radio = card.querySelector(`input[type="radio"][value="${answers[index].value}"]`);
|
|
743
|
+
if (radio) radio.checked = true;
|
|
744
|
+
document.getElementById('nextBtn').disabled = false;
|
|
745
|
+
} else {
|
|
746
|
+
document.getElementById('nextBtn').disabled = true;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
document.getElementById('prevBtn').addEventListener('click', () => {
|
|
751
|
+
if (currentIndex > 0) showQuestion(currentIndex - 1);
|
|
752
|
+
});
|
|
753
|
+
|
|
754
|
+
document.getElementById('nextBtn').addEventListener('click', () => {
|
|
755
|
+
if (currentIndex < questions.length - 1) {
|
|
756
|
+
showQuestion(currentIndex + 1);
|
|
757
|
+
} else {
|
|
758
|
+
computeResults();
|
|
759
|
+
}
|
|
760
|
+
});
|
|
761
|
+
|
|
762
|
+
// ============================================================
|
|
763
|
+
// 6. 计算结果
|
|
764
|
+
// ============================================================
|
|
765
|
+
function computeResults() {
|
|
766
|
+
for (let i = 0; i < questions.length; i++) {
|
|
767
|
+
if (answers[i] === undefined) {
|
|
768
|
+
alert(`请先完成第 ${i+1} 题`);
|
|
769
|
+
showQuestion(i);
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
const dimScores = { S: 0, R: 0, J: 0, C: 0, Safety: 0 };
|
|
775
|
+
const dimCounts = { S: 0, R: 0, J: 0, C: 0, Safety: 0 };
|
|
776
|
+
|
|
777
|
+
questions.forEach((q, idx) => {
|
|
778
|
+
const d = q.dimension;
|
|
779
|
+
dimScores[d] += answers[idx].score;
|
|
780
|
+
dimCounts[d] += 1;
|
|
781
|
+
});
|
|
782
|
+
|
|
783
|
+
const avgScores = {};
|
|
784
|
+
let total = 0;
|
|
785
|
+
dimShort.forEach(d => {
|
|
786
|
+
const avg = dimScores[d] / dimCounts[d];
|
|
787
|
+
avgScores[d] = Math.round(avg * 10) / 10;
|
|
788
|
+
total += avgScores[d];
|
|
789
|
+
});
|
|
790
|
+
const totalScore = Math.round(total * 3);
|
|
791
|
+
|
|
792
|
+
showResults(avgScores, totalScore);
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
// ============================================================
|
|
796
|
+
// 7. 显示结果
|
|
797
|
+
// ============================================================
|
|
798
|
+
let chartInstance = null;
|
|
799
|
+
|
|
800
|
+
function showResults(avgScores, total) {
|
|
801
|
+
document.getElementById('questionsContainer').style.display = 'none';
|
|
802
|
+
document.getElementById('navButtons').style.display = 'none';
|
|
803
|
+
document.querySelector('.progress-bar').style.display = 'none';
|
|
804
|
+
|
|
805
|
+
const resultPage = document.getElementById('resultPage');
|
|
806
|
+
resultPage.classList.add('active');
|
|
807
|
+
|
|
808
|
+
document.getElementById('totalScore').textContent = total + ' / 150';
|
|
809
|
+
|
|
810
|
+
let label = '',
|
|
811
|
+
sub = '';
|
|
812
|
+
if (total >= 121) { label = '🌟 接近AGI的记忆系统';
|
|
813
|
+
sub = '你的记忆系统在几乎所有维度上都达到了完美水平。'; } else if (total >= 91) { label = '⭐ 优秀的记忆系统';
|
|
814
|
+
sub = '你的记忆系统在多个维度上表现出色,适合复杂场景。'; } else if (total >= 61) { label = '✅ 成熟的记忆系统';
|
|
815
|
+
sub = '你的记忆系统具备基本能力,但在一些维度上还有提升空间。'; } else if (total >= 31) { label = '📖 基础记忆系统';
|
|
816
|
+
sub = '你的记忆系统能记住一些事,但检索和判断能力还需要加强。'; } else { label = '🌱 刚起步的记忆系统';
|
|
817
|
+
sub = '你的记忆系统需要从基础开始构建,建议从存储和检索入手。'; }
|
|
818
|
+
document.getElementById('resultLabel').textContent = label;
|
|
819
|
+
document.getElementById('resultSub').textContent = sub;
|
|
820
|
+
|
|
821
|
+
dimShort.forEach(d => {
|
|
822
|
+
const el = document.getElementById('dScore_' + d);
|
|
823
|
+
if (el) el.textContent = avgScores[d].toFixed(1) + ' / 10';
|
|
824
|
+
});
|
|
825
|
+
|
|
826
|
+
// 推荐
|
|
827
|
+
const rec = getRecommendation(total, avgScores);
|
|
828
|
+
document.getElementById('recommendText').innerHTML =
|
|
829
|
+
`<strong>${rec.name}</strong> — ${rec.desc}<div class="detail">${rec.detail}</div>`;
|
|
830
|
+
|
|
831
|
+
// 雷达图
|
|
832
|
+
drawRadar(avgScores);
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
// ============================================================
|
|
836
|
+
// 8. 雷达图
|
|
837
|
+
// ============================================================
|
|
838
|
+
function drawRadar(scores) {
|
|
839
|
+
const ctx = document.getElementById('radarChart').getContext('2d');
|
|
840
|
+
if (chartInstance) chartInstance.destroy();
|
|
841
|
+
|
|
842
|
+
const labels = ['存储结构', '检索机制', '判断引擎', '上下文信噪比', '安全'];
|
|
843
|
+
const data = dimShort.map(d => scores[d]);
|
|
844
|
+
|
|
845
|
+
chartInstance = new Chart(ctx, {
|
|
846
|
+
type: 'radar',
|
|
847
|
+
data: {
|
|
848
|
+
labels: labels,
|
|
849
|
+
datasets: [{
|
|
850
|
+
label: '你的记忆系统',
|
|
851
|
+
data: data,
|
|
852
|
+
backgroundColor: 'rgba(108, 140, 255, 0.2)',
|
|
853
|
+
borderColor: '#6c8cff',
|
|
854
|
+
borderWidth: 2,
|
|
855
|
+
pointBackgroundColor: '#6c8cff',
|
|
856
|
+
pointBorderColor: '#fff',
|
|
857
|
+
pointRadius: 4,
|
|
858
|
+
}, {
|
|
859
|
+
label: '灵枢协议参考',
|
|
860
|
+
data: [9, 9, 9, 9, 9],
|
|
861
|
+
backgroundColor: 'rgba(167, 139, 250, 0.1)',
|
|
862
|
+
borderColor: '#a78bfa',
|
|
863
|
+
borderWidth: 1.5,
|
|
864
|
+
borderDash: [6, 4],
|
|
865
|
+
pointRadius: 0,
|
|
866
|
+
}]
|
|
867
|
+
},
|
|
868
|
+
options: {
|
|
869
|
+
responsive: true,
|
|
870
|
+
maintainAspectRatio: true,
|
|
871
|
+
scales: {
|
|
872
|
+
r: {
|
|
873
|
+
min: 0,
|
|
874
|
+
max: 10,
|
|
875
|
+
ticks: { stepSize: 2, color: '#6a7ca0', backdropColor: 'transparent' },
|
|
876
|
+
pointLabels: { color: '#c8d6f0', font: { size: 13 } },
|
|
877
|
+
grid: { color: 'rgba(255,255,255,0.05)' },
|
|
878
|
+
angleLines: { color: 'rgba(255,255,255,0.08)' }
|
|
879
|
+
}
|
|
880
|
+
},
|
|
881
|
+
plugins: {
|
|
882
|
+
legend: {
|
|
883
|
+
labels: { color: '#c8d6f0', font: { size: 12 } }
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
// ============================================================
|
|
891
|
+
// 9. 重新测试(完全重置)
|
|
892
|
+
// ============================================================
|
|
893
|
+
document.getElementById('restartBtn').addEventListener('click', function() {
|
|
894
|
+
// 重置所有状态
|
|
895
|
+
for (let key in answers) delete answers[key];
|
|
896
|
+
currentIndex = 0;
|
|
897
|
+
|
|
898
|
+
// 显示题目,隐藏结果
|
|
899
|
+
document.getElementById('questionsContainer').style.display = 'block';
|
|
900
|
+
document.getElementById('navButtons').style.display = 'flex';
|
|
901
|
+
document.querySelector('.progress-bar').style.display = 'flex';
|
|
902
|
+
document.getElementById('resultPage').classList.remove('active');
|
|
903
|
+
|
|
904
|
+
// 清除所有 radio 选中状态
|
|
905
|
+
document.querySelectorAll('input[type="radio"]').forEach(el => el.checked = false);
|
|
906
|
+
|
|
907
|
+
// 重置按钮状态
|
|
908
|
+
document.getElementById('nextBtn').disabled = true;
|
|
909
|
+
|
|
910
|
+
// 显示第一题
|
|
911
|
+
showQuestion(0);
|
|
912
|
+
window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
913
|
+
});
|
|
914
|
+
|
|
915
|
+
// ============================================================
|
|
916
|
+
// 10. 初始化
|
|
917
|
+
// ============================================================
|
|
918
|
+
renderQuestions();
|
|
919
|
+
showQuestion(0);
|
|
920
|
+
</script>
|
|
921
|
+
|
|
922
|
+
</body>
|
|
923
|
+
</html>
|