OUAREDAEK commited on
Commit
8c9a3ad
·
verified ·
1 Parent(s): 78af178

Upload templates/index-old2.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. templates/index-old2.html +1018 -0
templates/index-old2.html ADDED
@@ -0,0 +1,1018 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="fr">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>PerseverAI - Compagnon Pédagogique</title>
7
+
8
+ <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
9
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
10
+
11
+ <style>
12
+ :root {
13
+ --primary: #2563eb;
14
+ --primary-dark: #1d4ed8;
15
+ --secondary: #475569;
16
+ --success: #16a34a;
17
+ --warning: #d97706;
18
+ --danger: #dc2626;
19
+ --info: #0891b2;
20
+ --purple: #7c3aed;
21
+ --gray-50: #f8fafc;
22
+ --gray-100: #f1f5f9;
23
+ --gray-200: #e2e8f0;
24
+ --gray-600: #475569;
25
+ --gray-800: #1e293b;
26
+ --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
27
+ --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
28
+ }
29
+
30
+ * { margin: 0; padding: 0; box-sizing: border-box; }
31
+
32
+ body {
33
+ font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
34
+ background: var(--gray-50);
35
+ color: var(--gray-800);
36
+ line-height: 1.5;
37
+ }
38
+
39
+ .container { max-width: 1400px; margin: 0 auto; padding: 24px; }
40
+
41
+ .header {
42
+ background: white;
43
+ border-radius: 12px;
44
+ padding: 24px 32px;
45
+ margin-bottom: 24px;
46
+ box-shadow: var(--shadow-sm);
47
+ border: 1px solid var(--gray-200);
48
+ }
49
+
50
+ .header h1 { font-size: 1.75rem; font-weight: 600; color: var(--gray-800); margin-bottom: 8px; }
51
+ .header p { color: var(--gray-600); font-size: 0.9rem; }
52
+ .badge { display: inline-block; background: var(--gray-100); padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; color: var(--gray-600); margin-top: 12px; }
53
+
54
+ .nav-tabs {
55
+ display: flex;
56
+ background: white;
57
+ border-radius: 12px;
58
+ border: 1px solid var(--gray-200);
59
+ overflow-x: auto;
60
+ margin-bottom: 24px;
61
+ }
62
+
63
+ .nav-tab {
64
+ padding: 14px 20px;
65
+ background: transparent;
66
+ border: none;
67
+ font-size: 0.9rem;
68
+ font-weight: 500;
69
+ color: var(--gray-600);
70
+ cursor: pointer;
71
+ transition: all 0.2s;
72
+ white-space: nowrap;
73
+ border-bottom: 2px solid transparent;
74
+ }
75
+
76
+ .nav-tab:hover { color: var(--primary); background: var(--gray-50); }
77
+ .nav-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
78
+
79
+ .card {
80
+ background: white;
81
+ border-radius: 12px;
82
+ border: 1px solid var(--gray-200);
83
+ padding: 24px;
84
+ margin-bottom: 24px;
85
+ }
86
+
87
+ .card-header {
88
+ display: flex;
89
+ justify-content: space-between;
90
+ align-items: center;
91
+ margin-bottom: 20px;
92
+ padding-bottom: 16px;
93
+ border-bottom: 1px solid var(--gray-200);
94
+ flex-wrap: wrap;
95
+ gap: 12px;
96
+ }
97
+
98
+ .card-header h3 { font-size: 1.25rem; font-weight: 600; color: var(--gray-800); }
99
+
100
+ .form-group { margin-bottom: 20px; }
101
+ .form-label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--gray-600); margin-bottom: 8px; }
102
+ .form-control {
103
+ width: 100%;
104
+ padding: 10px 14px;
105
+ border: 1px solid var(--gray-200);
106
+ border-radius: 8px;
107
+ font-size: 0.9rem;
108
+ transition: all 0.2s;
109
+ }
110
+ .form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
111
+ .form-row { display: flex; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
112
+ .form-col { flex: 1; min-width: 200px; }
113
+
114
+ .btn {
115
+ padding: 10px 18px;
116
+ border-radius: 8px;
117
+ font-size: 0.85rem;
118
+ font-weight: 500;
119
+ cursor: pointer;
120
+ transition: all 0.2s;
121
+ border: none;
122
+ }
123
+ .btn-primary { background: var(--primary); color: white; }
124
+ .btn-primary:hover { background: var(--primary-dark); }
125
+ .btn-secondary { background: white; border: 1px solid var(--gray-200); color: var(--gray-600); }
126
+ .btn-secondary:hover { background: var(--gray-50); }
127
+ .btn-large { padding: 12px 24px; font-size: 0.9rem; }
128
+
129
+ /* Planning Stats Cards */
130
+ .planning-stats {
131
+ display: grid;
132
+ grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
133
+ gap: 16px;
134
+ margin-bottom: 28px;
135
+ background: var(--gray-50);
136
+ border-radius: 16px;
137
+ padding: 20px;
138
+ }
139
+ .planning-stat-item {
140
+ text-align: center;
141
+ background: white;
142
+ padding: 16px;
143
+ border-radius: 12px;
144
+ border: 1px solid var(--gray-200);
145
+ }
146
+ .planning-stat-number {
147
+ font-size: 2rem;
148
+ font-weight: 700;
149
+ color: var(--primary);
150
+ }
151
+ .planning-stat-label {
152
+ font-size: 0.75rem;
153
+ color: var(--gray-600);
154
+ margin-top: 4px;
155
+ }
156
+
157
+ /* Planning Table */
158
+ .planning-sessions-table {
159
+ width: 100%;
160
+ border-collapse: collapse;
161
+ margin-top: 20px;
162
+ }
163
+ .planning-sessions-table th {
164
+ text-align: left;
165
+ padding: 14px 12px;
166
+ background: var(--gray-50);
167
+ border-bottom: 2px solid var(--gray-200);
168
+ font-weight: 600;
169
+ font-size: 0.8rem;
170
+ color: var(--gray-600);
171
+ }
172
+ .planning-sessions-table td {
173
+ padding: 16px 12px;
174
+ border-bottom: 1px solid var(--gray-200);
175
+ vertical-align: top;
176
+ }
177
+ .session-type-badge {
178
+ display: inline-block;
179
+ padding: 4px 10px;
180
+ border-radius: 20px;
181
+ font-size: 0.7rem;
182
+ font-weight: 500;
183
+ }
184
+ .type-apprentissage { background: #dbeafe; color: #1e40af; }
185
+ .type-consolidation { background: #dcfce7; color: #166534; }
186
+ .type-maintien { background: #fef3c7; color: #92400e; }
187
+
188
+ .retention-slider {
189
+ width: 100%;
190
+ margin: 15px 0;
191
+ }
192
+ .retention-slider input {
193
+ width: 100%;
194
+ cursor: pointer;
195
+ accent-color: var(--primary);
196
+ }
197
+ .retention-labels {
198
+ display: flex;
199
+ justify-content: space-between;
200
+ font-size: 0.7rem;
201
+ color: var(--gray-600);
202
+ margin-top: 5px;
203
+ }
204
+
205
+ .time-slots-group {
206
+ display: flex;
207
+ flex-wrap: wrap;
208
+ gap: 12px;
209
+ margin-top: 8px;
210
+ }
211
+ .time-slot-checkbox {
212
+ display: flex;
213
+ align-items: center;
214
+ gap: 6px;
215
+ background: var(--gray-50);
216
+ padding: 6px 12px;
217
+ border-radius: 20px;
218
+ border: 1px solid var(--gray-200);
219
+ cursor: pointer;
220
+ }
221
+ .radio-group {
222
+ display: flex;
223
+ gap: 20px;
224
+ margin-top: 8px;
225
+ }
226
+ .radio-option {
227
+ display: flex;
228
+ align-items: center;
229
+ gap: 8px;
230
+ cursor: pointer;
231
+ }
232
+
233
+ .notifications-table {
234
+ width: 100%;
235
+ border-collapse: collapse;
236
+ font-size: 0.85rem;
237
+ }
238
+ .notifications-table th {
239
+ text-align: left;
240
+ padding: 12px 8px;
241
+ background: var(--gray-50);
242
+ border-bottom: 2px solid var(--gray-200);
243
+ font-weight: 600;
244
+ }
245
+ .notifications-table td {
246
+ padding: 12px 8px;
247
+ border-bottom: 1px solid var(--gray-200);
248
+ }
249
+
250
+ .priority-high { color: var(--danger); font-weight: 600; }
251
+ .priority-medium { color: var(--warning); font-weight: 600; }
252
+ .priority-low { color: var(--success); font-weight: 600; }
253
+
254
+ .status-badge {
255
+ display: inline-block;
256
+ padding: 4px 10px;
257
+ border-radius: 20px;
258
+ font-size: 0.7rem;
259
+ font-weight: 500;
260
+ }
261
+ .status-pending { background: #fef3c7; color: #92400e; }
262
+ .status-accepted { background: #dcfce7; color: #166534; }
263
+
264
+ .action-cell {
265
+ display: flex;
266
+ flex-wrap: wrap;
267
+ gap: 6px;
268
+ }
269
+ .action-icon-btn {
270
+ background: transparent;
271
+ border: none;
272
+ cursor: pointer;
273
+ padding: 6px 10px;
274
+ border-radius: 20px;
275
+ font-size: 0.7rem;
276
+ font-weight: 500;
277
+ transition: all 0.2s;
278
+ }
279
+ .action-accept { background: #dcfce7; color: #166534; }
280
+ .action-reject { background: #fee2e2; color: #991b1b; }
281
+ .action-hold { background: #e0f2fe; color: #075985; }
282
+ .action-help { background: #fed7aa; color: #9a3412; }
283
+
284
+ .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
285
+ .stat-card { background: white; border: 1px solid var(--gray-200); border-radius: 8px; padding: 16px; text-align: center; }
286
+ .stat-value { font-size: 1.75rem; font-weight: 700; color: var(--primary); }
287
+
288
+ .chart-container { height: 300px; margin-top: 20px; }
289
+ .tab-content { display: none; }
290
+ .tab-content.active { display: block; }
291
+
292
+ /* Spaced Repetition Curve */
293
+ .spaced-repetition-container {
294
+ background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
295
+ border-radius: 16px;
296
+ padding: 20px;
297
+ margin-top: 20px;
298
+ }
299
+ .curve-legend {
300
+ display: flex;
301
+ justify-content: center;
302
+ gap: 24px;
303
+ margin-bottom: 16px;
304
+ font-size: 0.75rem;
305
+ }
306
+ .legend-item {
307
+ display: flex;
308
+ align-items: center;
309
+ gap: 8px;
310
+ }
311
+ .legend-color {
312
+ width: 20px;
313
+ height: 3px;
314
+ border-radius: 2px;
315
+ }
316
+ .legend-color.square {
317
+ width: 12px;
318
+ height: 12px;
319
+ border-radius: 50%;
320
+ }
321
+
322
+ @media (max-width: 768px) {
323
+ .container { padding: 16px; }
324
+ .planning-sessions-table { font-size: 0.7rem; }
325
+ .planning-sessions-table td, .planning-sessions-table th { padding: 8px 6px; }
326
+ }
327
+
328
+ .session-detail-line { font-size: 0.75rem; color: var(--gray-600); margin: 4px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
329
+ .export-btn { background: white; border: 1px solid var(--gray-200); padding: 8px 16px; border-radius: 8px; cursor: pointer; }
330
+ .export-btn:hover { background: var(--gray-50); }
331
+
332
+ /* Profile specific styles */
333
+ .profile-progress {
334
+ background: var(--gray-100);
335
+ border-radius: 12px;
336
+ padding: 16px;
337
+ margin-bottom: 24px;
338
+ }
339
+ .progress-bar-container {
340
+ background: var(--gray-200);
341
+ border-radius: 20px;
342
+ height: 10px;
343
+ margin: 12px 0;
344
+ overflow: hidden;
345
+ }
346
+ .progress-bar-fill {
347
+ background: var(--primary);
348
+ width: 0%;
349
+ height: 100%;
350
+ border-radius: 20px;
351
+ transition: width 0.3s ease;
352
+ }
353
+ .big5-rating {
354
+ display: flex;
355
+ gap: 8px;
356
+ margin-top: 8px;
357
+ flex-wrap: wrap;
358
+ }
359
+ .rating-btn {
360
+ width: 40px;
361
+ height: 40px;
362
+ border-radius: 40px;
363
+ border: 1px solid var(--gray-200);
364
+ background: white;
365
+ cursor: pointer;
366
+ font-weight: 600;
367
+ transition: all 0.2s;
368
+ }
369
+ .rating-btn:hover { background: var(--gray-100); }
370
+ .rating-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
371
+ .motivation-rating {
372
+ display: flex;
373
+ gap: 8px;
374
+ margin-top: 8px;
375
+ flex-wrap: wrap;
376
+ }
377
+ .profile-recommendations {
378
+ background: #fefce8;
379
+ border-left: 4px solid var(--warning);
380
+ padding: 16px;
381
+ border-radius: 12px;
382
+ margin-top: 20px;
383
+ }
384
+ .profile-summary-cards {
385
+ display: grid;
386
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
387
+ gap: 16px;
388
+ margin-bottom: 24px;
389
+ }
390
+ .profile-mini-card {
391
+ background: var(--gray-50);
392
+ border-radius: 12px;
393
+ padding: 16px;
394
+ text-align: center;
395
+ }
396
+ .profile-mini-card h4 { font-size: 0.75rem; color: var(--gray-600); margin-bottom: 8px; }
397
+ .profile-mini-card .value { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
398
+ .flex-between { display: flex; justify-content: space-between; align-items: center; }
399
+ </style>
400
+ </head>
401
+ <body>
402
+ <div class="container">
403
+ <header class="header">
404
+ <h1>PerseverAI</h1>
405
+ <p>Compagnon d'apprentissage autorégulé - Notifications IA & Actions</p>
406
+ <div class="badge">AI · Aid · Perseverance · Tableau des événements</div>
407
+ </header>
408
+
409
+ <nav class="nav-tabs">
410
+ <button class="nav-tab" onclick="showTab('profile')">Profil</button>
411
+ <button class="nav-tab" onclick="showTab('objectif')">Objectif</button>
412
+ <button class="nav-tab" onclick="showTab('planner')">Planning</button>
413
+ <button class="nav-tab" onclick="showTab('dashboard')">Mon Dashboard</button>
414
+ <button class="nav-tab" onclick="showTab('journal')">Mon Journal</button>
415
+ <button class="nav-tab active" onclick="showTab('notifications')">Notifications IA</button>
416
+ </nav>
417
+
418
+ <!-- NOUVEAU PROFIL PERSONNALISÉ COMPLET -->
419
+ <section id="profile" class="tab-content">
420
+ <div class="card">
421
+ <div class="card-header">
422
+ <h3>Profil d'Apprentissage Personnalisé</h3>
423
+ <div>
424
+ <button class="btn btn-secondary" onclick="autoFillProfile()">Remplir automatiquement</button>
425
+ <button class="btn btn-secondary" onclick="saveProfileData()">Sauvegarder</button>
426
+ </div>
427
+ </div>
428
+
429
+ <!-- Barre de progression -->
430
+ <div class="profile-progress">
431
+ <div class="flex-between">
432
+ <span><strong>Complétion du Profil</strong></span>
433
+ <span id="profileCompletionPercent">40%</span>
434
+ </div>
435
+ <div class="progress-bar-container">
436
+ <div class="progress-bar-fill" id="profileProgressFill" style="width: 40%;"></div>
437
+ </div>
438
+ <div class="flex-between" style="margin-top: 8px;">
439
+ <span>Questionnaires complétés: <span id="completedCount">2</span>/5</span>
440
+ <span>Profil personnalisé: <span id="profileLevel">Intermédiaire</span></span>
441
+ </div>
442
+ </div>
443
+
444
+ <!-- Section Big Five -->
445
+ <div class="card" style="margin-bottom: 20px; padding: 20px;">
446
+ <h4 style="margin-bottom: 16px;">Profil de Personnalité (Big Five Traits)</h4>
447
+ <p style="font-size: 0.8rem; color: var(--gray-600); margin-bottom: 20px;">Évaluez vos traits de personnalité sur une échelle de 1 à 5</p>
448
+
449
+ <div class="form-group">
450
+ <label class="form-label">Je suis quelqu'un de sociable, extraverti, énergique</label>
451
+ <div class="big5-rating" data-trait="extraversion">
452
+ <button type="button" class="rating-btn" data-value="1">1</button>
453
+ <button type="button" class="rating-btn" data-value="2">2</button>
454
+ <button type="button" class="rating-btn" data-value="3">3</button>
455
+ <button type="button" class="rating-btn" data-value="4">4</button>
456
+ <button type="button" class="rating-btn" data-value="5">5</button>
457
+ </div>
458
+ </div>
459
+
460
+ <div class="form-group">
461
+ <label class="form-label">Je fais preuve de curiosité intellectuelle, j'aime les nouvelles expériences</label>
462
+ <div class="big5-rating" data-trait="openness">
463
+ <button type="button" class="rating-btn" data-value="1">1</button>
464
+ <button type="button" class="rating-btn" data-value="2">2</button>
465
+ <button type="button" class="rating-btn" data-value="3">3</button>
466
+ <button type="button" class="rating-btn" data-value="4">4</button>
467
+ <button type="button" class="rating-btn" data-value="5">5</button>
468
+ </div>
469
+ </div>
470
+
471
+ <div class="form-group">
472
+ <label class="form-label">Je suis organisé, fiable, je respecte mes engagements</label>
473
+ <div class="big5-rating" data-trait="conscientiousness">
474
+ <button type="button" class="rating-btn" data-value="1">1</button>
475
+ <button type="button" class="rating-btn" data-value="2">2</button>
476
+ <button type="button" class="rating-btn" data-value="3">3</button>
477
+ <button type="button" class="rating-btn" data-value="4">4</button>
478
+ <button type="button" class="rating-btn" data-value="5">5</button>
479
+ </div>
480
+ </div>
481
+
482
+ <div class="form-group">
483
+ <label class="form-label">Je suis coopératif, serviable, empathique</label>
484
+ <div class="big5-rating" data-trait="agreeableness">
485
+ <button type="button" class="rating-btn" data-value="1">1</button>
486
+ <button type="button" class="rating-btn" data-value="2">2</button>
487
+ <button type="button" class="rating-btn" data-value="3">3</button>
488
+ <button type="button" class="rating-btn" data-value="4">4</button>
489
+ <button type="button" class="rating-btn" data-value="5">5</button>
490
+ </div>
491
+ </div>
492
+
493
+ <div class="form-group">
494
+ <label class="form-label">Je ressens facilement de l'anxiété, du stress, de la nervosité</label>
495
+ <div class="big5-rating" data-trait="neuroticism">
496
+ <button type="button" class="rating-btn" data-value="1">1</button>
497
+ <button type="button" class="rating-btn" data-value="2">2</button>
498
+ <button type="button" class="rating-btn" data-value="3">3</button>
499
+ <button type="button" class="rating-btn" data-value="4">4</button>
500
+ <button type="button" class="rating-btn" data-value="5">5</button>
501
+ </div>
502
+ </div>
503
+
504
+ <div style="margin-top: 16px; font-size: 0.8rem; color: var(--gray-600); background: var(--gray-50); padding: 12px; border-radius: 8px;">
505
+ Section complétée - Score neuroticisme: <span id="neuroticismScore">4.0</span> (qualité du sommeil importante)
506
+ </div>
507
+ </div>
508
+
509
+ <!-- Section Motivation -->
510
+ <div class="card" style="margin-bottom: 20px; padding: 20px;">
511
+ <h4 style="margin-bottom: 16px;">Profil Motivationnel</h4>
512
+ <p style="font-size: 0.8rem; color: var(--gray-600); margin-bottom: 20px;">Pourquoi étudiez-vous ? Sélectionnez vos principales motivations</p>
513
+
514
+ <div class="form-group">
515
+ <label class="form-label">J'étudie parce que j'aime apprendre, je trouve cela intéressant et plaisant</label>
516
+ <div class="motivation-rating" data-motivation="intrinsic">
517
+ <button type="button" class="rating-btn" data-value="1">1</button>
518
+ <button type="button" class="rating-btn" data-value="2">2</button>
519
+ <button type="button" class="rating-btn" data-value="3">3</button>
520
+ <button type="button" class="rating-btn" data-value="4">4</button>
521
+ <button type="button" class="rating-btn" data-value="5">5</button>
522
+ </div>
523
+ </div>
524
+
525
+ <div class="form-group">
526
+ <label class="form-label">J'étudie pour obtenir de bonnes notes et faire plaisir à mes parents/professeurs</label>
527
+ <div class="motivation-rating" data-motivation="introjected">
528
+ <button type="button" class="rating-btn" data-value="1">1</button>
529
+ <button type="button" class="rating-btn" data-value="2">2</button>
530
+ <button type="button" class="rating-btn" data-value="3">3</button>
531
+ <button type="button" class="rating-btn" data-value="4">4</button>
532
+ <button type="button" class="rating-btn" data-value="5">5</button>
533
+ </div>
534
+ </div>
535
+
536
+ <div style="margin-top: 16px; font-size: 0.8rem; color: var(--gray-600); background: var(--gray-50); padding: 12px; border-radius: 8px;">
537
+ Section complétée - Motivation introjectée: <span id="introjectedScore">4.0</span> (pression interne modérée)
538
+ </div>
539
+ </div>
540
+
541
+ <!-- Résumé des scores -->
542
+ <div class="profile-summary-cards">
543
+ <div class="profile-mini-card"><h4>Big Five Traits</h4><div class="value" id="summaryExtraversion">3.0</div><div>Extraversion</div></div>
544
+ <div class="profile-mini-card"><div class="value" id="summaryOpenness">3.0</div><div>Ouverture</div></div>
545
+ <div class="profile-mini-card"><div class="value" id="summaryConscientiousness">4.0</div><div>Conscience</div></div>
546
+ <div class="profile-mini-card"><h4>Motivation</h4><div class="value" id="summaryIntrinsic">3.0</div><div>Intrinsèque</div></div>
547
+ <div class="profile-mini-card"><div class="value" id="summaryIntrojected">4.0</div><div>Introjectée</div></div>
548
+ </div>
549
+
550
+ <!-- Recommandations personnalisées -->
551
+ <div class="profile-recommendations">
552
+ <h4 style="margin-bottom: 12px;"><i class="fas fa-lightbulb"></i> Recommandations Personnalisées Basées sur Votre Profil</h4>
553
+ <div id="recommendationsContainer">
554
+ <p>💤 <strong>Qualité du sommeil:</strong> Avec un névrosisme modéré, il est important de maintenir 7-8 heures de sommeil de qualité.</p>
555
+ <p>📅 <strong>Planification:</strong> Votre conscience est bonne. Établissez un planning régulier mais évitez le surmenage.</p>
556
+ </div>
557
+ </div>
558
+
559
+ <button class="btn btn-primary btn-large" onclick="finalizeProfile()" style="width:100%; margin-top: 20px;">
560
+ <i class="fas fa-check-circle"></i> Finaliser et Générer le Profil Personnalisé
561
+ </button>
562
+ </div>
563
+ </section>
564
+
565
+ <section id="objectif" class="tab-content">
566
+ <div class="card">
567
+ <div class="card-header"><h3>Définir mon Objectif d'Apprentissage</h3></div>
568
+ <div class="form-row">
569
+ <div class="form-col"><label class="form-label">Compétence Cible</label><select id="competence" class="form-control"></select></div>
570
+ <div class="form-col"><label class="form-label">Niveau Actuel</label><select id="level" class="form-control"><option value="0">Débutant</option><option value="1" selected>Intermédiaire</option><option value="2">Avancé</option></select></div>
571
+ </div>
572
+ <div class="form-row">
573
+ <div class="form-col"><label class="form-label">Date de Début</label><input type="date" id="start" class="form-control" value="2024-01-15"></div>
574
+ <div class="form-col"><label class="form-label">Date de Fin</label><input type="date" id="end" class="form-control" value="2024-12-31"></div>
575
+ </div>
576
+ <div class="form-row">
577
+ <div class="form-col"><label class="form-label">Durée par Session (minutes)</label><select id="sessionDuration" class="form-control"><option value="20" selected>20 minutes (Optimal)</option><option value="30">30 minutes</option><option value="45">45 minutes</option></select></div>
578
+ <div class="form-col"><label class="form-label">Méthode Productivité</label><div class="radio-group"><label class="radio-option"><input type="radio" name="productivityMethod" value="pomodoro" checked> Pomodoro</label><label class="radio-option"><input type="radio" name="productivityMethod" value="deepwork"> Deep Work</label></div></div>
579
+ </div>
580
+ <div class="form-row">
581
+ <div class="form-col"><label class="form-label">Type d'Énergie</label><div class="radio-group"><label class="radio-option"><input type="radio" name="energyType" value="morning" checked> Matinale</label><label class="radio-option"><input type="radio" name="energyType" value="evening"> Vespérale</label></div></div>
582
+ <div class="form-col"><label class="form-label">Créneaux Disponibles</label><div class="time-slots-group" id="timeSlotsGroup"><label class="time-slot-checkbox"><input type="checkbox" value="08:00-10:00"> 08:00-10:00</label><label class="time-slot-checkbox"><input type="checkbox" value="10:00-12:00"> 10:00-12:00</label><label class="time-slot-checkbox"><input type="checkbox" value="14:00-16:00"> 14:00-16:00</label></div></div>
583
+ </div>
584
+ <div class="form-group"><label class="form-label">Qualité Estimée de Rétention</label><div class="retention-slider"><input type="range" id="retentionQuality" min="0" max="3" step="1" value="2"><div class="retention-labels"><span>0 - Faible</span><span>1 - Moyenne</span><span>2 - Bonne</span><span>3 - Excellente</span></div></div><div class="retention-value" id="retentionValueDisplay">Bon - Consolidation progressive</div></div>
585
+ <button class="btn btn-primary btn-large" onclick="generatePlanner()" style="width:100%;"><i class="fas fa-magic"></i> Générer le Planner Personnalisé</button>
586
+ </div>
587
+ </section>
588
+
589
+ <section id="planner" class="tab-content">
590
+ <div class="card">
591
+ <div class="card-header"><h3><i class="fas fa-calendar-alt"></i> Planner Personnalisé</h3><button class="export-btn" onclick="exportPlanning()"><i class="fas fa-download"></i> Exporter</button></div>
592
+ <div class="planning-stats" id="planningStats"><div class="planning-stat-item"><div class="planning-stat-number" id="statSessions">6</div><div class="planning-stat-label">Sessions Planifiées</div></div><div class="planning-stat-item"><div class="planning-stat-number" id="statTotalDays">270</div><div class="planning-stat-label">Jours Totaux</div></div><div class="planning-stat-item"><div class="planning-stat-number" id="statQuality">3/4</div><div class="planning-stat-label">Niveau de Qualité</div></div><div class="planning-stat-item"><div class="planning-stat-number" id="statDuration">20min</div><div class="planning-stat-label">Durée/Session</div></div></div>
593
+ <div style="overflow-x: auto;"><table class="planning-sessions-table" id="sessionsTable"><thead><tr><th>Date</th><th>Session</th><th>Compétence</th><th>Durée</th><th>Intervalle</th><th>Type</th><th>Stratégie</th><th>Productivité</th><th>Heure Optimale</th></tr></thead><tbody id="sessionsTableBody"></tbody></table></div>
594
+ <div class="spaced-repetition-container"><h4 style="margin-bottom: 16px;"><i class="fas fa-chart-line"></i> Courbe de Répétition Espacée (SM-2 Algorithm)</h4><div class="curve-legend"><div class="legend-item"><div class="legend-color" style="background: #2563eb; width: 30px; height: 3px;"></div><span>Seuil de rétention (Forgetting Curve)</span></div><div class="legend-item"><div class="legend-color square" style="background: #ef4444;"></div><span>Sessions de révision</span></div><div class="legend-item"><div class="legend-color" style="background: #10b981; width: 30px; height: 3px;"></div><span>Intervalle optimal SM-2</span></div></div><div style="position: relative;"><canvas id="spacedRepetitionCurve" width="100%" height="220" style="max-height: 220px; width: 100%;"></canvas></div><div style="display: flex; justify-content: space-between; margin-top: 12px; font-size: 0.7rem; color: var(--gray-600);" id="intervalDatesCurve"></div><p style="font-size: 0.7rem; color: var(--gray-500); margin-top: 16px; text-align: center; font-style: italic;"><i class="fas fa-lightbulb"></i> La courbe montre l'évolution théorique de la rétention. Chaque révision au moment optimal (juste avant l'oubli) renforce la mémoire et augmente l'intervalle suivant.</p></div>
595
+ </div>
596
+ </section>
597
+
598
+ <section id="dashboard" class="tab-content">
599
+ <div class="card"><div class="card-header"><h3>Tableau de bord</h3></div><div class="stats-grid" id="dashboardStats"></div><div class="chart-container"><canvas id="progressChart"></canvas></div></div>
600
+ </section>
601
+
602
+ <section id="journal" class="tab-content">
603
+ <div class="card"><div class="card-header"><h3>Mon journal d'apprentissage</h3><button class="btn btn-secondary" onclick="saveJournal()">Sauvegarder</button></div>
604
+ <div class="form-group"><label class="form-label">Accompli aujourd'hui</label><textarea id="done" class="form-control" rows="2"></textarea></div>
605
+ <div class="form-group"><label class="form-label">Stratégie utilisée</label><textarea id="metacognition" class="form-control" rows="2"></textarea></div>
606
+ <div id="journalEntriesList"></div></div>
607
+ </section>
608
+
609
+ <section id="notifications" class="tab-content active">
610
+ <div class="card">
611
+ <div class="card-header"><h3><i class="fas fa-bell"></i> Notifications IA - Tableau des événements</h3><button class="btn btn-primary" onclick="generateRandomEvent()"><i class="fas fa-plus"></i> Générer un événement</button></div>
612
+ <div class="stats-grid"><div class="stat-card"><div class="stat-value" id="totalEvents">0</div><div class="stat-label">Total</div></div><div class="stat-card"><div class="stat-value" id="pendingEvents">0</div><div class="stat-label">En attente</div></div><div class="stat-card"><div class="stat-value" id="acceptedEvents">0</div><div class="stat-label">Acceptés</div></div></div>
613
+ <div style="overflow-x:auto;"><table class="notifications-table"><thead><tr><th>Date</th><th>Type</th><th>Titre</th><th>Message</th><th>Priorité</th><th>Statut</th><th>Actions</th></tr></thead><tbody id="notificationsTableBody"></tbody></table></div>
614
+ <div class="chart-container"><canvas id="notificationEfficiencyChart"></canvas></div>
615
+ </div>
616
+ </section>
617
+ </div>
618
+
619
+ <script>
620
+ // Données compétences
621
+ const competencesData = [
622
+ { "id": "D-MCONJ", "label": "Marques de la conjugaison", "category": "Discours" },
623
+ { "id": "D-PDV", "label": "Points de vue adoptés", "category": "Discours" },
624
+ { "id": "D-SSENT", "label": "Compréhension des mots", "category": "Discours" },
625
+ { "id": "M-CHOI", "label": "Choix des mots et des expressions", "category": "Maîtrise" },
626
+ { "id": "M-COMP", "label": "Construction des phrases", "category": "Maîtrise" },
627
+ { "id": "M-DEV", "label": "Développement du vocabulaire", "category": "Maîtrise" }
628
+ ];
629
+
630
+ let eventsList = [];
631
+ let currentSessions = [];
632
+ let spacedChart = null;
633
+
634
+ // Profil data
635
+ let profileData = {
636
+ extraversion: 3,
637
+ openness: 3,
638
+ conscientiousness: 4,
639
+ agreeableness: 3,
640
+ neuroticism: 3,
641
+ intrinsic: 3,
642
+ introjected: 4
643
+ };
644
+
645
+ const eventTemplates = [
646
+ { type: "Rappel d'étude", title: "Session de révision", message: "Votre session est prévue aujourd'hui.", priority: "high" },
647
+ { type: "Conseil IA", title: "Optimisation", message: "Révisez les conjugaisons.", priority: "medium" },
648
+ { type: "Encouragement", title: "Progression", message: "80% des objectifs atteints.", priority: "low" }
649
+ ];
650
+
651
+ document.addEventListener('DOMContentLoaded', () => {
652
+ initCompetencesSelect();
653
+ loadSavedData();
654
+ renderEventsTable();
655
+ updateEventStats();
656
+ createChart();
657
+ initProfileModule();
658
+ const retentionSlider = document.getElementById('retentionQuality');
659
+ if(retentionSlider) retentionSlider.addEventListener('input', function() {
660
+ const val = parseInt(this.value);
661
+ const messages = {0: "0 - Faible", 1: "1 - Moyenne", 2: "2 - Bon - Consolidation progressive", 3: "3 - Excellente"};
662
+ document.getElementById('retentionValueDisplay').innerText = messages[val];
663
+ });
664
+ generateDefaultPlanning();
665
+ });
666
+
667
+ function initCompetencesSelect() {
668
+ const select = document.getElementById('competence');
669
+ if(select) select.innerHTML = '<option value="comprendre_mots">Comprendre les mots</option>' + competencesData.map(c => `<option value="${c.id}">${c.label}</option>`).join('');
670
+ }
671
+
672
+ // ==================== MODULE PROFIL COMPLET ====================
673
+ function initProfileModule() {
674
+ loadProfileFromStorage();
675
+ setupRatingListeners();
676
+ updateProfileUI();
677
+ }
678
+
679
+ function setupRatingListeners() {
680
+ document.querySelectorAll('.big5-rating .rating-btn').forEach(btn => {
681
+ btn.addEventListener('click', function() {
682
+ const container = this.closest('.big5-rating');
683
+ const trait = container.dataset.trait;
684
+ const value = parseInt(this.dataset.value);
685
+ profileData[trait] = value;
686
+ updateRatingUI(container, value);
687
+ updateProfileUI();
688
+ saveProfileToStorage();
689
+ });
690
+ });
691
+ document.querySelectorAll('.motivation-rating .rating-btn').forEach(btn => {
692
+ btn.addEventListener('click', function() {
693
+ const container = this.closest('.motivation-rating');
694
+ const motivation = container.dataset.motivation;
695
+ const value = parseInt(this.dataset.value);
696
+ profileData[motivation] = value;
697
+ updateRatingUI(container, value);
698
+ updateProfileUI();
699
+ saveProfileToStorage();
700
+ });
701
+ });
702
+ }
703
+
704
+ function updateRatingUI(container, value) {
705
+ container.querySelectorAll('.rating-btn').forEach(btn => {
706
+ btn.classList.remove('active');
707
+ if(parseInt(btn.dataset.value) === value) btn.classList.add('active');
708
+ });
709
+ }
710
+
711
+ function updateProfileUI() {
712
+ // Mettre à jour les affichages
713
+ document.getElementById('summaryExtraversion').innerText = profileData.extraversion;
714
+ document.getElementById('summaryOpenness').innerText = profileData.openness;
715
+ document.getElementById('summaryConscientiousness').innerText = profileData.conscientiousness;
716
+ document.getElementById('summaryIntrinsic').innerText = profileData.intrinsic;
717
+ document.getElementById('summaryIntrojected').innerText = profileData.introjected;
718
+ document.getElementById('neuroticismScore').innerText = profileData.neuroticism;
719
+ document.getElementById('introjectedScore').innerText = profileData.introjected;
720
+
721
+ // Calcul du pourcentage de complétion (5 traits + 2 motivations = 7 champs)
722
+ let completed = 0;
723
+ if(profileData.extraversion) completed++;
724
+ if(profileData.openness) completed++;
725
+ if(profileData.conscientiousness) completed++;
726
+ if(profileData.agreeableness) completed++;
727
+ if(profileData.neuroticism) completed++;
728
+ if(profileData.intrinsic) completed++;
729
+ if(profileData.introjected) completed++;
730
+ const percent = Math.round((completed / 7) * 100);
731
+ document.getElementById('profileCompletionPercent').innerText = percent + '%';
732
+ document.getElementById('profileProgressFill').style.width = percent + '%';
733
+ document.getElementById('completedCount').innerText = Math.min(completed, 5);
734
+
735
+ let level = "Débutant";
736
+ if(profileData.conscientiousness >= 4 && profileData.intrinsic >= 4) level = "Avancé";
737
+ else if(profileData.conscientiousness >= 3) level = "Intermédiaire";
738
+ document.getElementById('profileLevel').innerText = level;
739
+
740
+ // Recommandations dynamiques
741
+ const recos = [];
742
+ if(profileData.neuroticism >= 4) recos.push("💤 <strong>Qualité du sommeil:</strong> Votre niveau de névrosisme est élevé. Accordez une attention particulière à votre sommeil (7-8h) et à des pauses régulières.");
743
+ else if(profileData.neuroticism >= 3) recos.push("💤 <strong>Qualité du sommeil:</strong> Avec un névrosisme modéré, il est important de maintenir 7-8 heures de sommeil de qualité.");
744
+ else recos.push("💤 <strong>Qualité du sommeil:</strong> Votre stabilité émotionnelle est bonne. Continuez à maintenir un bon rythme de sommeil.");
745
+
746
+ if(profileData.conscientiousness >= 4) recos.push("📅 <strong>Planification:</strong> Votre conscience est excellente. Établissez un planning régulier mais évitez le surmenage.");
747
+ else if(profileData.conscientiousness >= 3) recos.push("📅 <strong>Planification:</strong> Renforcez votre organisation avec des rappels et un agenda structuré.");
748
+ else recos.push("📅 <strong>Planification:</strong> Travaillez la régularité avec des petits objectifs quotidiens.");
749
+
750
+ if(profileData.intrinsic >= 4) recos.push("🎯 <strong>Motivation intrinsèque:</strong> Parfait ! Continuez à suivre vos passions et à explorer.");
751
+ else if(profileData.intrinsic <= 2) recos.push("🎯 <strong>Motivation intrinsèque:</strong> Essayez de trouver un sens plus profond à vos études pour renforcer votre engagement.");
752
+
753
+ document.getElementById('recommendationsContainer').innerHTML = recos.map(r => `<p>${r}</p>`).join('');
754
+ }
755
+
756
+ function autoFillProfile() {
757
+ profileData = { extraversion: 4, openness: 4, conscientiousness: 5, agreeableness: 4, neuroticism: 2, intrinsic: 5, introjected: 3 };
758
+ document.querySelectorAll('.big5-rating').forEach(container => {
759
+ const trait = container.dataset.trait;
760
+ if(profileData[trait]) updateRatingUI(container, profileData[trait]);
761
+ });
762
+ document.querySelectorAll('.motivation-rating').forEach(container => {
763
+ const motiv = container.dataset.motivation;
764
+ if(profileData[motiv]) updateRatingUI(container, profileData[motiv]);
765
+ });
766
+ updateProfileUI();
767
+ saveProfileToStorage();
768
+ showToast("Profil automatiquement rempli !");
769
+ }
770
+
771
+ function saveProfileData() {
772
+ saveProfileToStorage();
773
+ showToast("Profil sauvegardé !");
774
+ }
775
+
776
+ function finalizeProfile() {
777
+ saveProfileToStorage();
778
+ showToast("Profil finalisé et personnalisé !");
779
+ }
780
+
781
+ function saveProfileToStorage() {
782
+ localStorage.setItem('perseverAI_profile', JSON.stringify(profileData));
783
+ }
784
+
785
+ function loadProfileFromStorage() {
786
+ const saved = localStorage.getItem('perseverAI_profile');
787
+ if(saved) {
788
+ try {
789
+ const data = JSON.parse(saved);
790
+ Object.assign(profileData, data);
791
+ } catch(e) {}
792
+ }
793
+ document.querySelectorAll('.big5-rating').forEach(container => {
794
+ const trait = container.dataset.trait;
795
+ if(profileData[trait]) updateRatingUI(container, profileData[trait]);
796
+ });
797
+ document.querySelectorAll('.motivation-rating').forEach(container => {
798
+ const motiv = container.dataset.motivation;
799
+ if(profileData[motiv]) updateRatingUI(container, profileData[motiv]);
800
+ });
801
+ updateProfileUI();
802
+ }
803
+ // ==================== FIN PROFIL ====================
804
+
805
+ function retentionRate(days, strength = 0.5) { return Math.exp(-days / (strength * 30)) * 100; }
806
+
807
+ function drawSpacedRepetitionCurve(sessions) {
808
+ const canvas = document.getElementById('spacedRepetitionCurve');
809
+ if(!canvas || sessions.length === 0) return;
810
+ const ctx = canvas.getContext('2d');
811
+ const container = canvas.parentElement;
812
+ const width = container.clientWidth - 40;
813
+ const height = 200;
814
+ canvas.width = width;
815
+ canvas.height = height;
816
+ ctx.clearRect(0, 0, width, height);
817
+ const startDate = sessions[0].date.getTime();
818
+ const endDate = sessions[sessions.length-1].date.getTime();
819
+ const totalDays = (endDate - startDate) / (1000 * 60 * 60 * 24);
820
+ ctx.beginPath();
821
+ ctx.strokeStyle = '#2563eb';
822
+ ctx.lineWidth = 2.5;
823
+ ctx.setLineDash([]);
824
+ let firstPoint = true;
825
+ for(let x = 0; x <= width; x++) {
826
+ const dayProgression = (x / width) * totalDays;
827
+ const retention = retentionRate(dayProgression, 0.4);
828
+ const y = height - (retention / 100) * height;
829
+ if(firstPoint) { ctx.moveTo(x, y); firstPoint = false; }
830
+ else { ctx.lineTo(x, y); }
831
+ }
832
+ ctx.stroke();
833
+ ctx.beginPath();
834
+ ctx.moveTo(0, height);
835
+ for(let x = 0; x <= width; x++) {
836
+ const dayProgression = (x / width) * totalDays;
837
+ const retention = retentionRate(dayProgression, 0.4);
838
+ const y = height - (retention / 100) * height;
839
+ ctx.lineTo(x, y);
840
+ }
841
+ ctx.lineTo(width, height);
842
+ ctx.fillStyle = 'rgba(37, 99, 235, 0.05)';
843
+ ctx.fill();
844
+ ctx.beginPath();
845
+ ctx.strokeStyle = '#10b981';
846
+ ctx.lineWidth = 1.5;
847
+ ctx.setLineDash([8, 6]);
848
+ for(let i = 0; i < sessions.length; i++) {
849
+ const x = ((sessions[i].date.getTime() - startDate) / (endDate - startDate)) * width;
850
+ if(x >= 0 && x <= width) {
851
+ ctx.beginPath();
852
+ ctx.moveTo(x, 0);
853
+ ctx.lineTo(x, height);
854
+ ctx.stroke();
855
+ }
856
+ }
857
+ ctx.setLineDash([]);
858
+ for(let i = 0; i < sessions.length; i++) {
859
+ const x = ((sessions[i].date.getTime() - startDate) / (endDate - startDate)) * width;
860
+ const dayProgression = ((sessions[i].date.getTime() - startDate) / (1000 * 60 * 60 * 24));
861
+ const retentionAtSession = retentionRate(dayProgression, 0.4);
862
+ const y = height - (retentionAtSession / 100) * height;
863
+ ctx.beginPath();
864
+ ctx.fillStyle = '#ef4444';
865
+ ctx.arc(x, y, 6, 0, 2 * Math.PI);
866
+ ctx.fill();
867
+ ctx.fillStyle = 'white';
868
+ ctx.beginPath();
869
+ ctx.arc(x, y, 3, 0, 2 * Math.PI);
870
+ ctx.fill();
871
+ ctx.fillStyle = '#1e293b';
872
+ ctx.font = 'bold 9px Inter';
873
+ ctx.fillText(`R${i+1}`, x-5, y-8);
874
+ }
875
+ const datesDiv = document.getElementById('intervalDatesCurve');
876
+ if(datesDiv) datesDiv.innerHTML = sessions.map(s => `<span>${s.dateStr}</span>`).join('');
877
+ ctx.fillStyle = '#64748b';
878
+ ctx.font = '8px Inter';
879
+ ctx.fillText('100%', 5, 15);
880
+ ctx.fillText('75%', 5, height - (height * 0.25) + 5);
881
+ ctx.fillText('50%', 5, height - (height * 0.5) + 5);
882
+ ctx.fillText('25%', 5, height - (height * 0.75) + 5);
883
+ ctx.fillText('0%', 5, height - 5);
884
+ }
885
+
886
+ function generatePlanner() {
887
+ const competence = document.getElementById('competence')?.value || "comprendre_mots";
888
+ const competenceLabel = competencesData.find(c=>c.id===competence)?.label || "Comprendre les mots";
889
+ const startDate = new Date(document.getElementById('start')?.value || "2024-01-15");
890
+ const sessionDur = document.getElementById('sessionDuration')?.value || "20";
891
+ const method = document.querySelector('input[name="productivityMethod"]:checked')?.value || "pomodoro";
892
+ const timeSlot = document.querySelector('#timeSlotsGroup input:checked')?.value || "08:00-10:00";
893
+ const retention = document.getElementById('retentionQuality')?.value || "2";
894
+ const intervals = [1, 7, 16, 35, 70, 140];
895
+ const sessions = [];
896
+ for(let i = 0; i < intervals.length; i++) {
897
+ let currentDate = new Date(startDate);
898
+ if(i > 0) currentDate.setDate(startDate.getDate() + intervals[i-1]);
899
+ else currentDate = new Date(startDate);
900
+ const sessionTypes = ["Apprentissage", "Consolidation", "Consolidation", "Maintien", "Maintien", "Maintien"];
901
+ const strategies = ["Focus intense", "Révision active", "Révision active", "Révision active", "Révision active", "Révision active"];
902
+ sessions.push({ id: i+1, date: new Date(currentDate), dateStr: currentDate.toLocaleDateString('fr-FR'), dayName: currentDate.toLocaleDateString('fr-FR', { weekday: 'long' }), competence: competenceLabel, duration: sessionDur + " minutes", interval: intervals[i] + " jours", type: sessionTypes[i], strategy: strategies[i], productivity: method === 'pomodoro' ? 'Pomodoro' : 'Deep Work', optimalTime: timeSlot });
903
+ }
904
+ currentSessions = sessions;
905
+ renderPlanningTable(sessions);
906
+ updatePlanningStats(sessions, retention, sessionDur);
907
+ drawSpacedRepetitionCurve(sessions);
908
+ showToast("Planning personnalisé généré avec succès !");
909
+ showTab('planner');
910
+ }
911
+
912
+ function generateDefaultPlanning() {
913
+ const startDate = new Date("2024-01-17");
914
+ const intervals = [1, 7, 16, 35, 70, 140];
915
+ const sessions = [];
916
+ for(let i = 0; i < intervals.length; i++) {
917
+ let currentDate = new Date(startDate);
918
+ if(i > 0) currentDate.setDate(startDate.getDate() + (i===1?1: intervals[i-1]));
919
+ else currentDate = new Date(startDate);
920
+ const sessionTypes = ["Apprentissage", "Consolidation", "Consolidation", "Maintien", "Maintien", "Maintien"];
921
+ const strategies = ["Focus intense", "Révision active", "Révision active", "Révision active", "Révision active", "Révision active"];
922
+ sessions.push({ id: i+1, date: new Date(currentDate), dateStr: currentDate.toLocaleDateString('fr-FR'), dayName: currentDate.toLocaleDateString('fr-FR', { weekday: 'long' }), competence: "comprendre_mots", duration: "20 minutes", interval: intervals[i] + " jours", type: sessionTypes[i], strategy: strategies[i], productivity: "Pomodoro", optimalTime: "08:00-10:00" });
923
+ }
924
+ currentSessions = sessions;
925
+ renderPlanningTable(sessions);
926
+ updatePlanningStats(sessions, "2", "20");
927
+ drawSpacedRepetitionCurve(sessions);
928
+ }
929
+
930
+ function renderPlanningTable(sessions) {
931
+ const tbody = document.getElementById('sessionsTableBody');
932
+ if(!tbody) return;
933
+ tbody.innerHTML = sessions.map(s => `<tr><td style="white-space:nowrap;"><strong>${s.dateStr}</strong><br><span style="font-size:0.7rem;">${s.dayName}</span></td><td><strong>R${s.id}</strong></td><td>${s.competence}</td><td>${s.duration}</td><td>${s.interval}</td><td><span class="session-type-badge ${s.type === 'Apprentissage' ? 'type-apprentissage' : (s.type === 'Consolidation' ? 'type-consolidation' : 'type-maintien')}">${s.type}</span></td><td>${s.strategy}</td><td>${s.productivity}</td><td>${s.optimalTime}</td></tr>`).join('');
934
+ }
935
+
936
+ function updatePlanningStats(sessions, quality, duration) {
937
+ document.getElementById('statSessions').innerText = sessions.length;
938
+ if(sessions.length > 0) { const lastDate = sessions[sessions.length-1].date; const firstDate = sessions[0].date; const totalDays = Math.ceil((lastDate - firstDate) / (1000 * 60 * 60 * 24)); document.getElementById('statTotalDays').innerText = totalDays; }
939
+ const qualityMap = {'0':'1/4','1':'2/4','2':'3/4','3':'4/4'};
940
+ document.getElementById('statQuality').innerText = qualityMap[quality] || "3/4";
941
+ document.getElementById('statDuration').innerText = duration + "min";
942
+ }
943
+
944
+ function exportPlanning() {
945
+ let csv = "Date,Session,Compétence,Durée,Intervalle,Type,Stratégie,Productivité,Heure Optimale\n";
946
+ currentSessions.forEach(s => { csv += `"${s.dateStr}","R${s.id}","${s.competence}","${s.duration}","${s.interval}","${s.type}","${s.strategy}","${s.productivity}","${s.optimalTime}"\n`; });
947
+ const blob = new Blob([csv], {type: 'text/csv'});
948
+ const link = document.createElement('a');
949
+ link.href = URL.createObjectURL(blob);
950
+ link.download = 'planning_perseverai.csv';
951
+ link.click();
952
+ showToast("Planning exporté en CSV");
953
+ }
954
+
955
+ function generateRandomEvent() {
956
+ const template = eventTemplates[Math.floor(Math.random() * eventTemplates.length)];
957
+ const newEvent = { id: Date.now() + Math.random(), date: new Date().toLocaleString(), type: template.type, title: template.title, message: template.message, priority: template.priority, status: 'pending' };
958
+ eventsList.unshift(newEvent);
959
+ saveEvents();
960
+ renderEventsTable();
961
+ updateEventStats();
962
+ showToast(`Nouvel événement: ${template.title}`);
963
+ }
964
+
965
+ function executeAction(eventId, actionType, actionLabel) {
966
+ const eventIndex = eventsList.findIndex(e => e.id == eventId);
967
+ if(eventIndex === -1) return;
968
+ eventsList[eventIndex].status = actionType === 'ACCEPT' ? 'accepted' : (actionType === 'REJECT' ? 'rejected' : 'hold');
969
+ renderEventsTable();
970
+ updateEventStats();
971
+ saveEvents();
972
+ showToast(`${actionLabel}`);
973
+ }
974
+
975
+ function renderEventsTable() {
976
+ const tbody = document.getElementById('notificationsTableBody');
977
+ if(!tbody) return;
978
+ if(eventsList.length === 0) { tbody.innerHTML = '<tr><td colspan="7" style="text-align:center;">Aucun événement</td></tr>'; return; }
979
+ tbody.innerHTML = eventsList.map(event => `<tr><td>${event.date}</td><td>${event.type}</td><td><strong>${event.title}</strong></td><td>${event.message}</td><td><span class="priority-${event.priority}">${event.priority}</span></td><td><span class="status-badge ${event.status === 'accepted' ? 'status-accepted' : 'status-pending'}">${event.status === 'accepted' ? 'Accepté' : 'En attente'}</span></td><td class="action-cell"><button class="action-icon-btn action-accept" onclick="executeAction(${event.id}, 'ACCEPT', 'Accepté')">✓ Accepter</button><button class="action-icon-btn action-reject" onclick="executeAction(${event.id}, 'REJECT', 'Rejeté')">✗ Rejeter</button><button class="action-icon-btn action-hold" onclick="executeAction(${event.id}, 'HOLD', 'En attente')">⏸ Attente</button><button class="action-icon-btn action-help" onclick="executeAction(${event.id}, 'HELP', 'Aide demandée')">🆘 Aide</button></td></tr>`).join('');
980
+ }
981
+
982
+ function updateEventStats() {
983
+ document.getElementById('totalEvents').innerText = eventsList.length;
984
+ document.getElementById('pendingEvents').innerText = eventsList.filter(e => e.status === 'pending').length;
985
+ document.getElementById('acceptedEvents').innerText = eventsList.filter(e => e.status === 'accepted').length;
986
+ if(efficiencyChart) efficiencyChart.data.datasets[0].data = [eventsList.filter(e=>e.status==='accepted').length, eventsList.filter(e=>e.status==='rejected').length, eventsList.filter(e=>e.status==='pending').length];
987
+ efficiencyChart?.update();
988
+ }
989
+
990
+ let efficiencyChart = null;
991
+ function createChart() {
992
+ const ctx = document.getElementById('notificationEfficiencyChart')?.getContext('2d');
993
+ if(ctx) efficiencyChart = new Chart(ctx, { type: 'bar', data: { labels: ['Acceptés', 'Rejetés', 'En attente'], datasets: [{ label: 'Actions', data: [0,0,0], backgroundColor: ['#16a34a','#dc2626','#d97706'] }] }, options: { responsive: true } });
994
+ }
995
+
996
+ function saveJournal() { if(document.getElementById('done')?.value) { let journal = JSON.parse(localStorage.getItem('journal') || '[]'); journal.unshift({ date: new Date().toLocaleString(), done: document.getElementById('done').value }); localStorage.setItem('journal', JSON.stringify(journal)); showToast("Journal sauvegardé"); document.getElementById('done').value = ''; } }
997
+ function saveEvents() { localStorage.setItem('eventsList', JSON.stringify(eventsList)); }
998
+ function loadSavedData() { const saved = localStorage.getItem('eventsList'); if(saved) eventsList = JSON.parse(saved); }
999
+
1000
+ function showTab(tabId) {
1001
+ document.querySelectorAll('.tab-content').forEach(t => t.classList.remove('active'));
1002
+ document.getElementById(tabId).classList.add('active');
1003
+ document.querySelectorAll('.nav-tab').forEach(t => t.classList.remove('active'));
1004
+ if(window.event?.target) window.event.target.classList.add('active');
1005
+ if(tabId === 'dashboard') { const ctx = document.getElementById('progressChart')?.getContext('2d'); if(ctx && !window.dashChart) window.dashChart = new Chart(ctx, { type:'line', data:{ labels:['Sem1','Sem2','Sem3','Sem4'], datasets:[{ label:'Progression', data:[30,45,60,75], borderColor:'#2563eb' }] } }); }
1006
+ if(tabId === 'planner') { if(currentSessions.length === 0) generateDefaultPlanning(); else drawSpacedRepetitionCurve(currentSessions); }
1007
+ if(tabId === 'notifications') { renderEventsTable(); updateEventStats(); }
1008
+ if(tabId === 'profile') { loadProfileFromStorage(); updateProfileUI(); }
1009
+ }
1010
+
1011
+ function showToast(msg) { let div = document.createElement('div'); div.style.cssText = `position:fixed; bottom:20px; right:20px; background:#1e293b; color:white; padding:12px 20px; border-radius:8px; z-index:1000;`; div.innerHTML = msg; document.body.appendChild(div); setTimeout(()=>div.remove(), 2500); }
1012
+
1013
+ document.getElementById('dashboardStats') && (document.getElementById('dashboardStats').innerHTML = `<div class="stat-card"><div class="stat-value">12</div><div class="stat-label">Sessions</div></div><div class="stat-card"><div class="stat-value">85%</div><div class="stat-label">Complétion</div></div>`);
1014
+
1015
+ window.addEventListener('resize', () => { if(document.getElementById('planner').classList.contains('active') && currentSessions.length > 0) drawSpacedRepetitionCurve(currentSessions); });
1016
+ </script>
1017
+ </body>
1018
+ </html>