OUAREDAEK commited on
Commit
566cd17
·
verified ·
1 Parent(s): ce594fa

Upload templates/index-old.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. templates/index-old.html +3036 -0
templates/index-old.html ADDED
@@ -0,0 +1,3036 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>Dashboard Réflexif – ReflAgent</title>
7
+
8
+ <style>
9
+ /* ================= STYLES DE BASE ================= */
10
+ body {
11
+ font-family: 'Segoe UI', Arial, sans-serif;
12
+ background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
13
+ margin: 0;
14
+ padding: 20px;
15
+ color: #333;
16
+ }
17
+
18
+ h2, h3, h4 {
19
+ color: #1976D2;
20
+ margin-top: 0;
21
+ }
22
+
23
+ h2 {
24
+ background: linear-gradient(90deg, #1976D2, #2196F3);
25
+ -webkit-background-clip: text;
26
+ -webkit-text-fill-color: transparent;
27
+ padding: 10px 0;
28
+ border-bottom: 2px solid #e3f2fd;
29
+ margin-bottom: 25px;
30
+ }
31
+
32
+ h3 {
33
+ background: #e3f2fd;
34
+ padding: 12px 15px;
35
+ border-radius: 8px;
36
+ margin: 25px 0 15px;
37
+ display: flex;
38
+ align-items: center;
39
+ gap: 10px;
40
+ }
41
+
42
+ h3::before {
43
+ content: '';
44
+ display: inline-block;
45
+ width: 6px;
46
+ height: 24px;
47
+ background: #1976D2;
48
+ border-radius: 3px;
49
+ }
50
+
51
+ #reflection {
52
+ background: white;
53
+ padding: 30px;
54
+ border-radius: 20px;
55
+ max-width: 1400px;
56
+ margin: auto;
57
+ box-shadow: 0 10px 40px rgba(0,0,0,0.08);
58
+ border: 1px solid #e0e0e0;
59
+ }
60
+
61
+ /* ================= SYSTEME D'ONGLETS ================= */
62
+ .tabs-container {
63
+ margin-bottom: 30px;
64
+ }
65
+
66
+ .tabs {
67
+ display: flex;
68
+ background: #f8f9fa;
69
+ border-radius: 12px;
70
+ padding: 5px;
71
+ margin-bottom: 20px;
72
+ border: 1px solid #e0e0e0;
73
+ }
74
+
75
+ .tab-btn {
76
+ flex: 1;
77
+ padding: 15px 20px;
78
+ border: none;
79
+ background: transparent;
80
+ color: #666;
81
+ font-weight: 600;
82
+ font-size: 16px;
83
+ cursor: pointer;
84
+ border-radius: 8px;
85
+ transition: all 0.3s ease;
86
+ display: flex;
87
+ align-items: center;
88
+ justify-content: center;
89
+ gap: 10px;
90
+ }
91
+
92
+ .tab-btn:hover {
93
+ background: rgba(25, 118, 210, 0.1);
94
+ color: #1976D2;
95
+ }
96
+
97
+ .tab-btn.active {
98
+ background: #1976D2;
99
+ color: white;
100
+ box-shadow: 0 3px 8px rgba(25, 118, 210, 0.2);
101
+ }
102
+
103
+ .tab-content {
104
+ display: none;
105
+ animation: fadeIn 0.5s ease;
106
+ }
107
+
108
+ .tab-content.active {
109
+ display: block;
110
+ }
111
+
112
+ /* ================= NAVIGATION ================= */
113
+ .nav {
114
+ display: flex;
115
+ justify-content: space-between;
116
+ align-items: center;
117
+ margin-bottom: 30px;
118
+ background: linear-gradient(90deg, #e3f2fd, #f3e5f5);
119
+ padding: 15px 25px;
120
+ border-radius: 12px;
121
+ border: 1px solid #bbdefb;
122
+ }
123
+
124
+ #scenarioTitle {
125
+ font-size: 1.4em;
126
+ color: #333;
127
+ text-align: center;
128
+ flex-grow: 1;
129
+ margin: 0 20px;
130
+ }
131
+
132
+ button {
133
+ background: linear-gradient(135deg, #1976D2, #2196F3);
134
+ color: white;
135
+ border: none;
136
+ padding: 12px 25px;
137
+ border-radius: 10px;
138
+ cursor: pointer;
139
+ font-weight: 600;
140
+ font-size: 15px;
141
+ transition: all 0.3s ease;
142
+ box-shadow: 0 3px 8px rgba(25, 118, 210, 0.2);
143
+ display: flex;
144
+ align-items: center;
145
+ gap: 8px;
146
+ }
147
+
148
+ button:hover:not(:disabled) {
149
+ transform: translateY(-2px);
150
+ box-shadow: 0 5px 15px rgba(25, 118, 210, 0.3);
151
+ }
152
+
153
+ button:active:not(:disabled) {
154
+ transform: translateY(0);
155
+ }
156
+
157
+ button:disabled {
158
+ opacity: 0.5;
159
+ cursor: not-allowed;
160
+ background: #b0bec5;
161
+ }
162
+
163
+ /* ================= BOUTON LECTURE CROISÉE ================= */
164
+ #crossReadersBtn {
165
+ background: linear-gradient(135deg, #43A047, #4CAF50) !important;
166
+ color: white;
167
+ border: none;
168
+ padding: 12px 25px;
169
+ border-radius: 10px;
170
+ cursor: pointer;
171
+ font-weight: 600;
172
+ font-size: 15px;
173
+ transition: all 0.3s ease;
174
+ box-shadow: 0 3px 8px rgba(67, 160, 71, 0.2);
175
+ display: flex;
176
+ align-items: center;
177
+ justify-content: center;
178
+ gap: 8px;
179
+ width: 100%;
180
+ }
181
+
182
+ #crossReadersBtn:hover:not(:disabled) {
183
+ transform: translateY(-2px);
184
+ box-shadow: 0 5px 15px rgba(67, 160, 71, 0.3);
185
+ background: linear-gradient(135deg, #388E3C, #43A047) !important;
186
+ }
187
+
188
+ #crossReadersBtn:active:not(:disabled) {
189
+ transform: translateY(0);
190
+ }
191
+
192
+ #crossReadersBtn:disabled {
193
+ opacity: 0.5;
194
+ cursor: not-allowed;
195
+ background: #b0bec5 !important;
196
+ }
197
+
198
+ /* ================= ONGLET 1: ÉVALUATEUR GDPR ================= */
199
+ #tab-evaluator .evaluator-info {
200
+ background: linear-gradient(135deg, #fff3e0, #ffe0b2);
201
+ padding: 25px;
202
+ border-radius: 15px;
203
+ border-left: 6px solid #ff9800;
204
+ margin: 20px 0;
205
+ }
206
+
207
+ #tab-evaluator .evaluator-info h4 {
208
+ color: #ff9800;
209
+ margin-top: 0;
210
+ margin-bottom: 20px;
211
+ display: flex;
212
+ align-items: center;
213
+ gap: 10px;
214
+ font-size: 20px;
215
+ }
216
+
217
+ .evaluator-field {
218
+ margin-bottom: 20px;
219
+ background: white;
220
+ padding: 20px;
221
+ border-radius: 10px;
222
+ border: 1px solid #FFE0B2;
223
+ }
224
+
225
+ .evaluator-field label {
226
+ display: block;
227
+ margin-bottom: 12px;
228
+ color: #333;
229
+ font-weight: 600;
230
+ font-size: 15px;
231
+ }
232
+
233
+ .evaluator-field input[type="text"],
234
+ .evaluator-field select {
235
+ width: 100%;
236
+ padding: 14px 18px;
237
+ border: 2px solid #e0e0e0;
238
+ border-radius: 8px;
239
+ font-size: 15px;
240
+ transition: all 0.3s;
241
+ box-sizing: border-box;
242
+ background: white;
243
+ }
244
+
245
+ .evaluator-field input[type="text"]:focus,
246
+ .evaluator-field select:focus {
247
+ outline: none;
248
+ border-color: #1976D2;
249
+ box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
250
+ }
251
+
252
+ .evaluator-field input:disabled,
253
+ .evaluator-field select:disabled {
254
+ background: #f5f5f5;
255
+ color: #999;
256
+ cursor: not-allowed;
257
+ }
258
+
259
+ .evaluator-field small {
260
+ display: block;
261
+ margin-top: 8px;
262
+ color: #666;
263
+ font-size: 13px;
264
+ font-style: italic;
265
+ }
266
+
267
+ /* Style pour les boutons radio GDPR */
268
+ .gdpr-options {
269
+ display: flex;
270
+ gap: 30px;
271
+ margin-top: 10px;
272
+ flex-wrap: wrap;
273
+ }
274
+
275
+ .gdpr-option {
276
+ display: flex;
277
+ align-items: center;
278
+ gap: 10px;
279
+ cursor: pointer;
280
+ padding: 12px 20px;
281
+ border-radius: 8px;
282
+ background: white;
283
+ border: 2px solid #e0e0e0;
284
+ transition: all 0.3s;
285
+ flex: 1;
286
+ min-width: 250px;
287
+ }
288
+
289
+ .gdpr-option:hover {
290
+ border-color: #1976D2;
291
+ background: #f0f7ff;
292
+ }
293
+
294
+ .gdpr-option input[type="radio"] {
295
+ width: 20px;
296
+ height: 20px;
297
+ cursor: pointer;
298
+ }
299
+
300
+ .gdpr-option span {
301
+ font-size: 15px;
302
+ font-weight: 500;
303
+ color: #333;
304
+ }
305
+
306
+ #anonymousMessage {
307
+ background: #E3F2FD;
308
+ padding: 18px;
309
+ border-radius: 10px;
310
+ margin-top: 20px;
311
+ border-left: 4px solid #1976D2;
312
+ animation: fadeIn 0.5s ease;
313
+ }
314
+
315
+ #anonymousMessage p {
316
+ margin: 0;
317
+ color: #1976D2;
318
+ font-size: 14px;
319
+ line-height: 1.5;
320
+ }
321
+
322
+ /* ================= ONGLET 2: DASHBOARD ÉTUDIANT ================= */
323
+ #tab-dashboard .manifest-item {
324
+ background: linear-gradient(135deg, #f9fbe7, #f0f4c3);
325
+ padding: 20px;
326
+ border-radius: 12px;
327
+ border-left: 6px solid #cddc39;
328
+ margin: 15px 0;
329
+ box-shadow: 0 3px 10px rgba(0,0,0,0.05);
330
+ }
331
+
332
+ .manifest-item b {
333
+ color: #689f38;
334
+ }
335
+
336
+ /* ================= COMPÉTENCES ================= */
337
+ .bar {
338
+ background: #f5f5f5;
339
+ border-radius: 12px;
340
+ height: 22px;
341
+ margin: 8px 0 20px;
342
+ overflow: hidden;
343
+ box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
344
+ }
345
+
346
+ .fill {
347
+ height: 100%;
348
+ border-radius: 12px;
349
+ color: white;
350
+ font-size: 13px;
351
+ text-align: right;
352
+ padding-right: 12px;
353
+ line-height: 22px;
354
+ font-weight: 600;
355
+ transition: width 0.5s ease;
356
+ position: relative;
357
+ overflow: hidden;
358
+ }
359
+
360
+ .fill::after {
361
+ content: '';
362
+ position: absolute;
363
+ top: 0;
364
+ left: 0;
365
+ right: 0;
366
+ bottom: 0;
367
+ background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
368
+ }
369
+
370
+ /* ================= RADAR ================= */
371
+ #radar-container {
372
+ display: flex;
373
+ flex-wrap: wrap;
374
+ gap: 30px;
375
+ margin: 20px auto;
376
+ align-items: flex-start;
377
+ }
378
+
379
+ #radar {
380
+ flex: 1;
381
+ min-width: 500px;
382
+ max-width: 500px;
383
+ background: white;
384
+ border-radius: 15px;
385
+ padding: 20px;
386
+ box-shadow: 0 5px 20px rgba(0,0,0,0.08);
387
+ border: 1px solid #e0e0e0;
388
+ margin-left: auto;
389
+ }
390
+
391
+ /* ================= PROFILE-RADAR CONTAINER ================= */
392
+ .profile-radar-container {
393
+ display: flex;
394
+ gap: 30px;
395
+ margin: 20px 0;
396
+ align-items: flex-start;
397
+ }
398
+
399
+ .profile-radar-container .radar-bot-message {
400
+ flex: 1;
401
+ min-width: 300px;
402
+ max-width: 600px;
403
+ display: block !important;
404
+ }
405
+
406
+ .profile-radar-container #radar-container {
407
+ flex: 1;
408
+ min-width: 500px;
409
+ max-width: 500px;
410
+ margin-left: 0;
411
+ }
412
+
413
+ /* ================= GRILLE DES MÉTRIQUES RADAR ================= */
414
+ .radar-metrics-grid {
415
+ display: grid;
416
+ grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
417
+ gap: 20px;
418
+ margin: 25px 0;
419
+ }
420
+
421
+ .metric-card {
422
+ background: white;
423
+ border-radius: 12px;
424
+ padding: 20px;
425
+ box-shadow: 0 4px 12px rgba(0,0,0,0.08);
426
+ border-left: 5px solid #1976D2;
427
+ transition: transform 0.3s, box-shadow 0.3s;
428
+ display: flex;
429
+ flex-direction: column;
430
+ align-items: center;
431
+ text-align: center;
432
+ }
433
+
434
+ .metric-card:hover {
435
+ transform: translateY(-5px);
436
+ box-shadow: 0 8px 20px rgba(0,0,0,0.12);
437
+ }
438
+
439
+ .metric-icon {
440
+ font-size: 32px;
441
+ margin-bottom: 10px;
442
+ }
443
+
444
+ .metric-name {
445
+ font-weight: 600;
446
+ color: #333;
447
+ margin-bottom: 8px;
448
+ font-size: 16px;
449
+ }
450
+
451
+ .metric-value {
452
+ font-size: 28px;
453
+ font-weight: bold;
454
+ color: #1976D2;
455
+ margin: 5px 0;
456
+ }
457
+
458
+ .metric-value.high {
459
+ color: #43A047;
460
+ }
461
+
462
+ .metric-value.medium {
463
+ color: #FB8C00;
464
+ }
465
+
466
+ .metric-value.low {
467
+ color: #E53935;
468
+ }
469
+
470
+ .metric-description {
471
+ font-size: 13px;
472
+ color: #666;
473
+ margin-top: 8px;
474
+ line-height: 1.4;
475
+ }
476
+
477
+ /* ================= MESSAGE BOT RADAR ================= */
478
+ .radar-bot-message {
479
+ background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
480
+ padding: 20px;
481
+ border-radius: 15px;
482
+ border-left: 6px solid #1976D2;
483
+ box-shadow: 0 4px 12px rgba(25, 118, 210, 0.1);
484
+ animation: fadeIn 0.5s ease-in;
485
+ }
486
+
487
+ .radar-bot-header {
488
+ display: flex;
489
+ align-items: center;
490
+ gap: 12px;
491
+ margin-bottom: 15px;
492
+ }
493
+
494
+ .radar-bot-icon {
495
+ font-size: 28px;
496
+ background: #1976D2;
497
+ color: white;
498
+ width: 50px;
499
+ height: 50px;
500
+ border-radius: 50%;
501
+ display: flex;
502
+ align-items: center;
503
+ justify-content: center;
504
+ }
505
+
506
+ .radar-bot-title {
507
+ font-size: 18px;
508
+ font-weight: 600;
509
+ color: #1976D2;
510
+ margin: 0;
511
+ }
512
+
513
+ .radar-bot-content {
514
+ font-size: 16px;
515
+ line-height: 1.6;
516
+ color: #333;
517
+ margin: 0;
518
+ }
519
+
520
+ .radar-bot-insights {
521
+ background: white;
522
+ padding: 15px;
523
+ border-radius: 10px;
524
+ margin-top: 15px;
525
+ border: 1px solid #E3F2FD;
526
+ }
527
+
528
+ .radar-insight-item {
529
+ display: flex;
530
+ align-items: center;
531
+ gap: 10px;
532
+ margin-bottom: 8px;
533
+ padding: 8px 12px;
534
+ border-radius: 6px;
535
+ background: #F5F5F5;
536
+ transition: all 0.3s;
537
+ }
538
+
539
+ .radar-insight-item:hover {
540
+ background: #E3F2FD;
541
+ transform: translateX(5px);
542
+ }
543
+
544
+ .radar-insight-icon {
545
+ font-size: 20px;
546
+ width: 30px;
547
+ text-align: center;
548
+ }
549
+
550
+ .radar-insight-text {
551
+ flex-grow: 1;
552
+ font-size: 14px;
553
+ }
554
+
555
+ /* Légende radar */
556
+ .radar-legend {
557
+ display: flex;
558
+ justify-content: center;
559
+ gap: 25px;
560
+ margin: 15px 0 25px 0;
561
+ flex-wrap: wrap;
562
+ padding: 15px;
563
+ background: white;
564
+ border-radius: 10px;
565
+ border: 1px solid #e0e0e0;
566
+ box-shadow: 0 2px 8px rgba(0,0,0,0.05);
567
+ }
568
+
569
+ .legend-item {
570
+ display: flex;
571
+ align-items: center;
572
+ gap: 10px;
573
+ padding: 8px 15px;
574
+ background: #f8f9fa;
575
+ border-radius: 8px;
576
+ font-size: 14px;
577
+ font-weight: 500;
578
+ transition: transform 0.2s;
579
+ }
580
+
581
+ .legend-item:hover {
582
+ transform: translateY(-2px);
583
+ box-shadow: 0 3px 10px rgba(0,0,0,0.1);
584
+ }
585
+
586
+ .legend-color {
587
+ width: 20px;
588
+ height: 20px;
589
+ border-radius: 4px;
590
+ border: 2px solid white;
591
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
592
+ }
593
+
594
+ .legend-low {
595
+ background: linear-gradient(135deg, #e53935, #f44336);
596
+ }
597
+
598
+ .legend-medium {
599
+ background: linear-gradient(135deg, #fb8c00, #ff9800);
600
+ }
601
+
602
+ .legend-high {
603
+ background: linear-gradient(135deg, #43a047, #4caf50);
604
+ }
605
+
606
+ #radar-list {
607
+ list-style: none;
608
+ padding: 0;
609
+ margin: 15px 0;
610
+ display: grid;
611
+ grid-template-columns: repeat(2, 1fr);
612
+ gap: 10px;
613
+ }
614
+
615
+ #radar-list li {
616
+ background: #f8f9fa;
617
+ padding: 10px 15px;
618
+ border-radius: 8px;
619
+ font-size: 13px;
620
+ border-left: 4px solid #1976D2;
621
+ transition: all 0.3s;
622
+ display: flex;
623
+ justify-content: space-between;
624
+ align-items: center;
625
+ }
626
+
627
+ #radar-list li:hover {
628
+ background: #e3f2fd;
629
+ transform: translateX(5px);
630
+ }
631
+
632
+ #radar-list li .value {
633
+ font-weight: bold;
634
+ color: #1976D2;
635
+ font-size: 14px;
636
+ }
637
+
638
+ /* ================= HEATMAP ENRICHIE ================= */
639
+ .heatmap-and-indicators {
640
+ display: flex;
641
+ gap: 30px;
642
+ margin: 20px 0;
643
+ align-items: flex-start;
644
+ }
645
+
646
+ .heatmap-and-indicators .heatmap-analysis {
647
+ flex: 2;
648
+ min-width: 500px;
649
+ }
650
+
651
+ .heatmap-and-indicators .indicators-legend {
652
+ flex: 1;
653
+ min-width: 300px;
654
+ }
655
+
656
+ .heatmap-analysis {
657
+ background: white;
658
+ padding: 20px;
659
+ border-radius: 15px;
660
+ box-shadow: 0 5px 20px rgba(0,0,0,0.08);
661
+ border: 1px solid #e0e0e0;
662
+ margin: 10px auto;
663
+ }
664
+
665
+ .analysis-controls {
666
+ display: flex;
667
+ align-items: center;
668
+ gap: 15px;
669
+ margin-bottom: 20px;
670
+ padding: 15px;
671
+ background: #f8f9fa;
672
+ border-radius: 12px;
673
+ }
674
+
675
+ .analysis-controls label {
676
+ font-weight: 600;
677
+ color: #1976D2;
678
+ }
679
+
680
+ .analysis-controls select {
681
+ padding: 10px 20px;
682
+ border-radius: 8px;
683
+ border: 2px solid #1976D2;
684
+ background: white;
685
+ color: #333;
686
+ font-weight: 500;
687
+ cursor: pointer;
688
+ transition: all 0.3s;
689
+ flex-grow: 1;
690
+ max-width: 300px;
691
+ }
692
+
693
+ .analysis-controls select:hover {
694
+ border-color: #2196F3;
695
+ box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
696
+ }
697
+
698
+ #heatmap {
699
+ background: white;
700
+ border-radius: 15px;
701
+ padding: 15px;
702
+ box-shadow: 0 5px 20px rgba(0,0,0,0.08);
703
+ border: 1px solid #e0e0e0;
704
+ margin: 10px auto;
705
+ cursor: crosshair;
706
+ }
707
+
708
+ .enriched-legend {
709
+ background: white;
710
+ padding: 20px;
711
+ border-radius: 15px;
712
+ box-shadow: 0 5px 20px rgba(0,0,0,0.08);
713
+ border: 1px solid #e0e0e0;
714
+ margin-bottom: 20px;
715
+ }
716
+
717
+ .legend-section h5 {
718
+ color: #1976D2;
719
+ margin-bottom: 15px;
720
+ font-size: 16px;
721
+ display: flex;
722
+ align-items: center;
723
+ gap: 8px;
724
+ }
725
+
726
+ .legend-grid {
727
+ display: grid;
728
+ grid-template-columns: repeat(3, 1fr);
729
+ gap: 10px;
730
+ }
731
+
732
+ .legend-item-small {
733
+ display: flex;
734
+ align-items: center;
735
+ gap: 8px;
736
+ font-size: 13px;
737
+ }
738
+
739
+ .legend-color-small {
740
+ width: 20px;
741
+ height: 20px;
742
+ border-radius: 4px;
743
+ border: 2px solid white;
744
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
745
+ }
746
+
747
+ .persistence-indicators {
748
+ display: flex;
749
+ flex-direction: column;
750
+ gap: 12px;
751
+ }
752
+
753
+ .indicator {
754
+ display: flex;
755
+ align-items: center;
756
+ gap: 10px;
757
+ padding: 10px 15px;
758
+ background: white;
759
+ border-radius: 8px;
760
+ font-size: 14px;
761
+ border-left: 4px solid #1976D2;
762
+ }
763
+
764
+ .indicator-dot {
765
+ width: 12px;
766
+ height: 12px;
767
+ border-radius: 50%;
768
+ }
769
+
770
+ .persistence-analysis {
771
+ background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
772
+ padding: 20px;
773
+ border-radius: 12px;
774
+ border-left: 6px solid #1976D2;
775
+ }
776
+
777
+ .persistence-analysis h5 {
778
+ color: #1976D2;
779
+ margin-top: 0;
780
+ margin-bottom: 15px;
781
+ font-size: 16px;
782
+ display: flex;
783
+ align-items: center;
784
+ gap: 8px;
785
+ }
786
+
787
+ .persistence-text {
788
+ font-size: 14px;
789
+ line-height: 1.5;
790
+ }
791
+
792
+ .persistence-text > div {
793
+ margin-bottom: 8px;
794
+ padding: 10px;
795
+ background: white;
796
+ border-radius: 8px;
797
+ border-left: 3px solid #1976D2;
798
+ }
799
+
800
+ /* ================= ONGLET 3: MESSAGE RÉFLEXIF ET ÉVALUATION ================= */
801
+ #tab-evaluation #reflagent {
802
+ background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
803
+ padding: 25px;
804
+ border-radius: 15px;
805
+ border-left: 8px solid #43a047;
806
+ margin: 25px 0;
807
+ font-size: 16px;
808
+ line-height: 1.6;
809
+ position: relative;
810
+ overflow: hidden;
811
+ min-height: 100px;
812
+ display: flex;
813
+ align-items: center;
814
+ }
815
+
816
+ #tab-evaluation #reflagent::before {
817
+ content: '🤖';
818
+ position: absolute;
819
+ top: 15px;
820
+ right: 15px;
821
+ font-size: 40px;
822
+ opacity: 0.2;
823
+ }
824
+
825
+ /* ================= MÉTRIQUES DE CONFIANCE ================= */
826
+ #tab-evaluation hr {
827
+ border: none;
828
+ height: 2px;
829
+ background: linear-gradient(90deg, #1976D2, transparent);
830
+ margin: 40px 0;
831
+ }
832
+
833
+ .trust-item {
834
+ margin-bottom: 20px;
835
+ padding: 15px;
836
+ background: #f8f9fa;
837
+ border-radius: 12px;
838
+ transition: transform 0.3s;
839
+ }
840
+
841
+ .trust-item:hover {
842
+ transform: translateX(5px);
843
+ background: #f1f3f4;
844
+ }
845
+
846
+ .trust-item b {
847
+ display: block;
848
+ margin-bottom: 10px;
849
+ color: #1976D2;
850
+ font-size: 15px;
851
+ }
852
+
853
+ .stars {
854
+ display: flex;
855
+ gap: 8px;
856
+ margin: 10px 0;
857
+ }
858
+
859
+ .stars span {
860
+ font-size: 32px;
861
+ cursor: pointer;
862
+ color: #e0e0e0;
863
+ transition: all 0.2s;
864
+ text-shadow: none;
865
+ }
866
+
867
+ .stars span.active {
868
+ color: #ffd54f;
869
+ text-shadow: 0 2px 4px rgba(255, 213, 79, 0.3);
870
+ }
871
+
872
+ .stars span:hover {
873
+ transform: scale(1.2);
874
+ }
875
+
876
+ .stars span.inactive {
877
+ color: #e0e0e0;
878
+ text-shadow: none;
879
+ }
880
+
881
+ .stars span.inactive:hover {
882
+ color: #ffd54f;
883
+ }
884
+
885
+ /* ================= CHAMP COMMENTAIRE ================= */
886
+ textarea {
887
+ width: 100%;
888
+ min-height: 120px;
889
+ border-radius: 12px;
890
+ padding: 15px;
891
+ border: 2px solid #e0e0e0;
892
+ font-family: inherit;
893
+ font-size: 14px;
894
+ resize: vertical;
895
+ transition: all 0.3s;
896
+ margin-bottom: 20px;
897
+ }
898
+
899
+ textarea:focus {
900
+ outline: none;
901
+ border-color: #1976D2;
902
+ box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
903
+ }
904
+
905
+ /* ================= BARRE DE CONFIANCE ================= */
906
+ #trustBar {
907
+ height: 100%;
908
+ border-radius: 10px;
909
+ color: white;
910
+ font-size: 14px;
911
+ text-align: center;
912
+ line-height: 24px;
913
+ font-weight: bold;
914
+ transition: width 0.5s ease, background 0.5s ease;
915
+ position: relative;
916
+ overflow: hidden;
917
+ width: 0%;
918
+ background: #e0e0e0;
919
+ }
920
+
921
+ #trustBar::after {
922
+ content: '';
923
+ position: absolute;
924
+ top: 0;
925
+ left: 0;
926
+ right: 0;
927
+ bottom: 0;
928
+ background: linear-gradient(90deg,
929
+ transparent,
930
+ rgba(255,255,255,0.4),
931
+ transparent
932
+ );
933
+ animation: shimmer 2s infinite;
934
+ }
935
+
936
+ @keyframes shimmer {
937
+ 0% { transform: translateX(-100%); }
938
+ 100% { transform: translateX(100%); }
939
+ }
940
+
941
+ /* ================= MESSAGES ================= */
942
+ #saveTrustMsg {
943
+ padding: 10px 15px;
944
+ border-radius: 8px;
945
+ margin: 10px 0;
946
+ font-weight: 500;
947
+ text-align: center;
948
+ transition: all 0.3s;
949
+ min-height: 50px;
950
+ display: flex;
951
+ align-items: center;
952
+ justify-content: center;
953
+ }
954
+
955
+ /* ================= STATISTIQUES ================= */
956
+ .stats-grid {
957
+ display: grid;
958
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
959
+ gap: 15px;
960
+ margin: 20px 0;
961
+ }
962
+
963
+ .stat-item {
964
+ background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
965
+ padding: 15px;
966
+ border-radius: 10px;
967
+ text-align: center;
968
+ transition: transform 0.3s;
969
+ }
970
+
971
+ .stat-item:hover {
972
+ transform: translateY(-3px);
973
+ box-shadow: 0 5px 15px rgba(0,0,0,0.1);
974
+ }
975
+
976
+ .stat-value {
977
+ font-size: 28px;
978
+ font-weight: bold;
979
+ color: #1976D2;
980
+ margin: 10px 0;
981
+ }
982
+
983
+ .stat-label {
984
+ font-size: 13px;
985
+ color: #666;
986
+ font-weight: 500;
987
+ }
988
+
989
+ /* ================= ANIMATIONS ================= */
990
+ @keyframes fadeIn {
991
+ from { opacity: 0; transform: translateY(20px); }
992
+ to { opacity: 1; transform: translateY(0); }
993
+ }
994
+
995
+ @keyframes slideIn {
996
+ from { transform: translateX(100%); opacity: 0; }
997
+ to { transform: translateX(0); opacity: 1; }
998
+ }
999
+
1000
+ @keyframes slideOut {
1001
+ from { transform: translateX(0); opacity: 1; }
1002
+ to { transform: translateX(100%); opacity: 0; }
1003
+ }
1004
+
1005
+ @keyframes pulse {
1006
+ 0% { transform: scale(1); }
1007
+ 50% { transform: scale(1.05); }
1008
+ 100% { transform: scale(1); }
1009
+ }
1010
+
1011
+ /* ================= RESPONSIVE ================= */
1012
+ @media (max-width: 1200px) {
1013
+ #reflection {
1014
+ padding: 20px;
1015
+ }
1016
+
1017
+ .profile-radar-container,
1018
+ .heatmap-and-indicators {
1019
+ flex-direction: column;
1020
+ }
1021
+
1022
+ .profile-radar-container .radar-bot-message,
1023
+ .profile-radar-container #radar-container,
1024
+ .heatmap-and-indicators .heatmap-analysis,
1025
+ .heatmap-and-indicators .indicators-legend {
1026
+ min-width: 100%;
1027
+ max-width: 100%;
1028
+ }
1029
+
1030
+ #radar {
1031
+ min-width: 100%;
1032
+ max-width: 100%;
1033
+ margin-left: 0;
1034
+ }
1035
+
1036
+ .tabs {
1037
+ flex-direction: column;
1038
+ }
1039
+
1040
+ .tab-btn {
1041
+ width: 100%;
1042
+ }
1043
+ }
1044
+
1045
+ @media (max-width: 768px) {
1046
+ body {
1047
+ padding: 10px;
1048
+ }
1049
+
1050
+ .nav {
1051
+ flex-direction: column;
1052
+ gap: 15px;
1053
+ text-align: center;
1054
+ }
1055
+
1056
+ #scenarioTitle {
1057
+ margin: 10px 0;
1058
+ font-size: 1.2em;
1059
+ }
1060
+
1061
+ button {
1062
+ width: 100%;
1063
+ justify-content: center;
1064
+ }
1065
+
1066
+ .analysis-controls {
1067
+ flex-direction: column;
1068
+ align-items: stretch;
1069
+ }
1070
+
1071
+ .radar-legend {
1072
+ flex-direction: column;
1073
+ align-items: center;
1074
+ gap: 10px;
1075
+ }
1076
+
1077
+ #radar-list {
1078
+ grid-template-columns: 1fr;
1079
+ }
1080
+
1081
+ .legend-grid {
1082
+ grid-template-columns: repeat(2, 1fr);
1083
+ }
1084
+
1085
+ .persistence-indicators {
1086
+ flex-direction: column;
1087
+ }
1088
+
1089
+ .gdpr-options {
1090
+ flex-direction: column;
1091
+ gap: 10px;
1092
+ }
1093
+
1094
+ .gdpr-option {
1095
+ min-width: 100%;
1096
+ }
1097
+
1098
+ .radar-metrics-grid {
1099
+ grid-template-columns: 1fr;
1100
+ }
1101
+
1102
+ .heatmap-and-indicators .heatmap-analysis {
1103
+ min-width: 100%;
1104
+ }
1105
+ }
1106
+
1107
+ /* ================= PROGRESS BAR CONTAINER ================= */
1108
+ .progress-container {
1109
+ width: 100%;
1110
+ background: #f5f5f5;
1111
+ border-radius: 12px;
1112
+ height: 24px;
1113
+ margin: 8px 0 20px;
1114
+ overflow: hidden;
1115
+ box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
1116
+ }
1117
+
1118
+ /* ================= TOOLTIPS ================= */
1119
+ .tooltip {
1120
+ position: absolute;
1121
+ background: rgba(25, 118, 210, 0.95);
1122
+ color: white;
1123
+ padding: 12px 18px;
1124
+ border-radius: 10px;
1125
+ font-size: 14px;
1126
+ pointer-events: none;
1127
+ opacity: 0;
1128
+ transition: opacity 0.3s;
1129
+ z-index: 1000;
1130
+ max-width: 300px;
1131
+ box-shadow: 0 6px 20px rgba(0,0,0,0.2);
1132
+ border: 2px solid white;
1133
+ backdrop-filter: blur(5px);
1134
+ }
1135
+
1136
+ .tooltip::after {
1137
+ content: '';
1138
+ position: absolute;
1139
+ top: 100%;
1140
+ left: 50%;
1141
+ margin-left: -10px;
1142
+ border-width: 10px;
1143
+ border-style: solid;
1144
+ border-color: rgba(25, 118, 210, 0.95) transparent transparent transparent;
1145
+ }
1146
+
1147
+ /* ================= SCROLLBAR ================= */
1148
+ ::-webkit-scrollbar {
1149
+ width: 10px;
1150
+ }
1151
+
1152
+ ::-webkit-scrollbar-track {
1153
+ background: #f1f1f1;
1154
+ border-radius: 5px;
1155
+ }
1156
+
1157
+ ::-webkit-scrollbar-thumb {
1158
+ background: linear-gradient(135deg, #1976D2, #2196F3);
1159
+ border-radius: 5px;
1160
+ }
1161
+
1162
+ ::-webkit-scrollbar-thumb:hover {
1163
+ background: linear-gradient(135deg, #1565c0, #1976D2);
1164
+ }
1165
+
1166
+ /* ================= LOADING ================= */
1167
+ .loading {
1168
+ display: inline-block;
1169
+ width: 20px;
1170
+ height: 20px;
1171
+ border: 3px solid #f3f3f3;
1172
+ border-top: 3px solid #1976D2;
1173
+ border-radius: 50%;
1174
+ animation: spin 1s linear infinite;
1175
+ }
1176
+
1177
+ @keyframes spin {
1178
+ 0% { transform: rotate(0deg); }
1179
+ 100% { transform: rotate(360deg); }
1180
+ }
1181
+
1182
+ /* ================= NOTIFICATIONS ================= */
1183
+ .notification {
1184
+ position: fixed;
1185
+ top: 20px;
1186
+ right: 20px;
1187
+ background: white;
1188
+ padding: 18px;
1189
+ border-radius: 12px;
1190
+ box-shadow: 0 8px 25px rgba(0,0,0,0.15);
1191
+ border-left: 6px solid #1976D2;
1192
+ z-index: 10000;
1193
+ max-width: 320px;
1194
+ animation: slideIn 0.4s ease-out;
1195
+ display: flex;
1196
+ align-items: flex-start;
1197
+ gap: 12px;
1198
+ }
1199
+
1200
+ .notification-icon {
1201
+ font-size: 28px;
1202
+ flex-shrink: 0;
1203
+ }
1204
+
1205
+ .notification-content {
1206
+ flex-grow: 1;
1207
+ }
1208
+
1209
+ .notification-title {
1210
+ font-weight: bold;
1211
+ color: #1976D2;
1212
+ margin-bottom: 5px;
1213
+ font-size: 15px;
1214
+ }
1215
+
1216
+ .notification-message {
1217
+ color: #555;
1218
+ font-size: 13px;
1219
+ line-height: 1.4;
1220
+ }
1221
+
1222
+ .notification-close {
1223
+ background: none;
1224
+ border: none;
1225
+ color: #999;
1226
+ cursor: pointer;
1227
+ padding: 0;
1228
+ font-size: 20px;
1229
+ line-height: 1;
1230
+ }
1231
+ </style>
1232
+ </head>
1233
+
1234
+ <body>
1235
+
1236
+ <div id="reflection">
1237
+
1238
+ <!-- NAVIGATION SCÉNARIOS -->
1239
+ <div class="nav">
1240
+ <button id="prevScenario">⬅️ Scénario précédent</button>
1241
+ <h3 id="scenarioTitle">Chargement...</h3>
1242
+ <button id="nextScenario">Scénario suivant ➡️</button>
1243
+ </div>
1244
+
1245
+ <!-- SYSTEME D'ONGLETS -->
1246
+ <div class="tabs-container">
1247
+ <div class="tabs">
1248
+ <button class="tab-btn active" data-tab="tab-evaluator">
1249
+ <span>👤</span> Évaluateur (RGPD)
1250
+ </button>
1251
+ <button class="tab-btn" data-tab="tab-dashboard">
1252
+ <span>📊</span> Dashboard Étudiant
1253
+ </button>
1254
+ <button class="tab-btn" data-tab="tab-evaluation">
1255
+ <span>🤖</span> Message Réflexif & Évaluation
1256
+ </button>
1257
+ </div>
1258
+
1259
+ <!-- ONGLET 1: INFORMATIONS ÉVALUATEUR GDPR -->
1260
+ <div id="tab-evaluator" class="tab-content active">
1261
+ <h3>👤 Informations de l'évaluateur (RGPD)</h3>
1262
+
1263
+ <div class="evaluator-info">
1264
+ <!-- Consentement RGPD -->
1265
+ <div class="evaluator-field">
1266
+ <label for="gdprConsent">
1267
+ <strong><span style="color: #1976D2; margin-right: 5px;">🔒</span> Consentement RGPD <span style="color: #e53935;">*</span></strong>
1268
+ </label>
1269
+ <div class="gdpr-options">
1270
+ <label class="gdpr-option">
1271
+ <input type="radio" name="gdprConsent" value="accept" id="gdprAccept" required>
1272
+ <span>J'accepte de partager mes informations pour l'évaluation</span>
1273
+ </label>
1274
+ <label class="gdpr-option">
1275
+ <input type="radio" name="gdprConsent" value="decline" id="gdprDecline">
1276
+ <span>Je préfère rester anonyme</span>
1277
+ </label>
1278
+ </div>
1279
+ <small>Veuillez accepter le consentement RGPD pour pouvoir remplir les champs d'identification</small>
1280
+ </div>
1281
+
1282
+ <!-- Champs conditionnels (masqués par défaut) -->
1283
+ <div id="evaluatorFields" style="display: none;">
1284
+ <!-- Nom et prénom -->
1285
+ <div class="evaluator-field">
1286
+ <label for="evaluatorName">
1287
+ <strong><span style="color: #1976D2; margin-right: 5px;">📝</span> Nom et prénom <span style="color: #e53935;">*</span></strong>
1288
+ </label>
1289
+ <input type="text"
1290
+ id="evaluatorName"
1291
+ placeholder="Ex: Dupont Jean ou Marie Curie"
1292
+ maxlength="100"
1293
+ disabled>
1294
+ <small>Veuillez saisir votre nom et prénom</small>
1295
+ </div>
1296
+
1297
+ <!-- Rôle -->
1298
+ <div class="evaluator-field">
1299
+ <label for="evaluatorRole"><strong><span style="color: #1976D2; margin-right: 5px;">👔</span> Rôle principal <span style="color: #e53935;">*</span></strong></label>
1300
+ <select id="evaluatorRole" disabled>
1301
+ <option value="">Sélectionnez votre rôle...</option>
1302
+ <option value="enseignant">Enseignant / Formateur</option>
1303
+ <option value="chercheur">Chercheur / Scientifique</option>
1304
+ <option value="expert_pedago">Expert pédagogique</option>
1305
+ <option value="etudiant_avance">Étudiant avancé / Doctorant</option>
1306
+ <option value="conseiller">Conseiller pédagogique</option>
1307
+ <option value="responsable">Responsable de formation</option>
1308
+ <option value="autre">Autre professionnel de l'éducation</option>
1309
+ </select>
1310
+ <small>Sélectionnez votre rôle principal dans le domaine éducatif</small>
1311
+ </div>
1312
+
1313
+ <!-- Niveau d'expertise en réflexivité -->
1314
+ <div class="evaluator-field">
1315
+ <label for="expertiseLevel"><strong><span style="color: #1976D2; margin-right: 5px;">🎓</span> Niveau d'expertise en réflexivité <span style="color: #e53935;">*</span></strong></label>
1316
+ <select id="expertiseLevel" disabled>
1317
+ <option value="">Sélectionnez votre niveau...</option>
1318
+ <option value="debutant">Débutant - Je découvre la réflexivité</option>
1319
+ <option value="intermediaire">Intermédiaire - J'utilise régulièrement des outils réflexifs</option>
1320
+ <option value="avance">Avancé - Je conçois des dispositifs réflexifs</option>
1321
+ <option value="expert">Expert - Je forme à la réflexivité pédagogique</option>
1322
+ <option value="chercheur_reflex">Chercheur en réflexivité</option>
1323
+ </select>
1324
+ <small>Indiquez votre niveau de maîtrise des concepts et outils de réflexivité</small>
1325
+ </div>
1326
+
1327
+ <!-- Niveau de maîtrise des messages réflexifs -->
1328
+ <div class="evaluator-field">
1329
+ <label for="messageMastery"><strong><span style="color: #1976D2; margin-right: 5px;">💬</span> Niveau de maîtrise des messages réflexifs <span style="color: #e53935;">*</span></strong></label>
1330
+ <select id="messageMastery" disabled>
1331
+ <option value="">Sélectionnez votre niveau...</option>
1332
+ <option value="novice">Novice - Je commence à analyser des messages réflexifs</option>
1333
+ <option value="intermediaire_msg">Intermédiaire - J'évalue régulièrement des feedbacks réflexifs</option>
1334
+ <option value="avance_msg">Avancé - Je rédige des messages réflexifs pour autrui</option>
1335
+ <option value="expert_msg">Expert - Je forme à la conception de messages réflexifs</option>
1336
+ </select>
1337
+ <small>Indiquez votre expérience avec l'analyse et la création de messages réflexifs</small>
1338
+ </div>
1339
+ </div>
1340
+
1341
+ <!-- Message pour utilisateurs anonymes -->
1342
+ <div id="anonymousMessage" style="display: none;">
1343
+ <p>
1344
+ <strong><span style="margin-right: 5px;">🕵️</span> Évaluation anonyme :</strong> Vos évaluations seront enregistrées sans information personnelle.
1345
+ Seules vos réponses aux métriques de confiance seront conservées.
1346
+ </p>
1347
+ </div>
1348
+
1349
+ <!-- Boutons d'action -->
1350
+ <div style="display: flex; gap: 10px; margin-top: 20px;">
1351
+ <button onclick="fillSampleEvaluator()" type="button" style="background: #666; flex: 1;" id="fillExampleBtn">
1352
+ <span style="margin-right: 5px;">📋</span> Remplir exemple
1353
+ </button>
1354
+ <button onclick="clearEvaluatorFields()" type="button" style="background: #9e9e9e; flex: 1;" id="clearFieldsBtn">
1355
+ <span style="margin-right: 5px;">🗑️</span> Effacer
1356
+ </button>
1357
+ </div>
1358
+ </div>
1359
+ </div>
1360
+
1361
+ <!-- ONGLET 2: DASHBOARD ÉTUDIANT -->
1362
+ <div id="tab-dashboard" class="tab-content">
1363
+ <h3>📝 Manifeste étudiant</h3>
1364
+ <div id="manifest-list">
1365
+ <div class="manifest-item">
1366
+ <em>Chargement des données...</em>
1367
+ </div>
1368
+ </div>
1369
+
1370
+ <h3>📊 Progression par compétence</h3>
1371
+ <div id="competence-bars">
1372
+ <em>Chargement des compétences...</em>
1373
+ </div>
1374
+
1375
+ <!-- LÉGENDE RADAR -->
1376
+ <div class="radar-legend">
1377
+ <div class="legend-item">
1378
+ <div class="legend-color legend-low"></div>
1379
+ <span>Faible (0-50%)</span>
1380
+ </div>
1381
+ <div class="legend-item">
1382
+ <div class="legend-color legend-medium"></div>
1383
+ <span>Moyen (50-70%)</span>
1384
+ </div>
1385
+ <div class="legend-item">
1386
+ <div class="legend-color legend-high"></div>
1387
+ <span>Élevé (70-100%)</span>
1388
+ </div>
1389
+ </div>
1390
+
1391
+ <h3>🕸️ Radar – Learning Analytics</h3>
1392
+
1393
+ <!-- Grille des métriques radar -->
1394
+ <div class="radar-metrics-grid" id="radar-metrics-grid">
1395
+ <div class="metric-card">
1396
+ <div class="metric-icon">🚀</div>
1397
+ <div class="metric-name">Démarrage des activités</div>
1398
+ <div class="metric-value high">85%</div>
1399
+ <div class="metric-description">Rapidité d'initiation des tâches</div>
1400
+ </div>
1401
+
1402
+ <div class="metric-card">
1403
+ <div class="metric-icon">🎓</div>
1404
+ <div class="metric-name">Connaissances validées</div>
1405
+ <div class="metric-value high">72%</div>
1406
+ <div class="metric-description">Acquis démontrés et évalués</div>
1407
+ </div>
1408
+
1409
+ <div class="metric-card">
1410
+ <div class="metric-icon">📈</div>
1411
+ <div class="metric-name">Niveau moyen de compétence</div>
1412
+ <div class="metric-value medium">68%</div>
1413
+ <div class="metric-description">Moyenne des compétences maîtrisées</div>
1414
+ </div>
1415
+
1416
+ <div class="metric-card">
1417
+ <div class="metric-icon">🎯</div>
1418
+ <div class="metric-name">Taux d'erreur (inversé)</div>
1419
+ <div class="metric-value low">35%</div>
1420
+ <div class="metric-description">Précision et attention aux détails</div>
1421
+ </div>
1422
+
1423
+ <div class="metric-card">
1424
+ <div class="metric-icon">🏁</div>
1425
+ <div class="metric-name">Achèvement des activités</div>
1426
+ <div class="metric-value high">74%</div>
1427
+ <div class="metric-description">Terminaison des tâches initiées</div>
1428
+ </div>
1429
+
1430
+ <div class="metric-card">
1431
+ <div class="metric-icon">📚</div>
1432
+ <div class="metric-name">Interactions avec les ressources</div>
1433
+ <div class="metric-value high">80%</div>
1434
+ <div class="metric-description">Utilisation des supports d'apprentissage</div>
1435
+ </div>
1436
+
1437
+ <div class="metric-card">
1438
+ <div class="metric-icon">🔧</div>
1439
+ <div class="metric-name">Domaines de compétence</div>
1440
+ <div class="metric-value high">78%</div>
1441
+ <div class="metric-description">Étendue des compétences couvertes</div>
1442
+ </div>
1443
+ </div>
1444
+
1445
+ <!-- Conteneur Profil + Radar côte à côte -->
1446
+ <div class="profile-radar-container">
1447
+ <!-- Message Bot Radar Contextuel -->
1448
+ <div id="radar-bot-message" class="radar-bot-message">
1449
+ <div class="radar-bot-header">
1450
+ <div class="radar-bot-icon">🎯</div>
1451
+ <h4 class="radar-bot-title">Analyse de Profil</h4>
1452
+ </div>
1453
+ <p class="radar-bot-content" id="radar-bot-content">Analyse en cours...</p>
1454
+ <div class="radar-bot-insights">
1455
+ <div id="radar-bot-insights">
1456
+ <!-- Les insights seront ajoutés dynamiquement -->
1457
+ </div>
1458
+ </div>
1459
+ </div>
1460
+
1461
+ <!-- Container Radar -->
1462
+ <div id="radar-container">
1463
+ <canvas id="radar" width="700" height="700"></canvas>
1464
+ </div>
1465
+ </div>
1466
+
1467
+ <div id="radar-tooltip" class="tooltip"></div>
1468
+
1469
+ <!-- ================= HEATMAP ENRICHIE ================= -->
1470
+ <div class="heatmap-and-indicators">
1471
+ <div class="heatmap-analysis">
1472
+ <h3>🔥 Heatmap d'activité - Analyse de Persévérance</h3>
1473
+
1474
+ <div class="analysis-controls">
1475
+ <label for="persistenceMode">Mode d'analyse :</label>
1476
+ <select id="persistenceMode" onchange="changePersistenceAnalysis()">
1477
+ <option value="regularity">📊 Régularité du travail</option>
1478
+ <option value="effortPattern">🔄 Schéma d'effort</option>
1479
+ <option value="deadline">⏰ Gestion des échéances</option>
1480
+ <option value="combined">🎯 Vue combinée</option>
1481
+ </select>
1482
+ </div>
1483
+
1484
+ <!-- Canvas pour le heatmap -->
1485
+ <canvas id="heatmap" width="800" height="300"></canvas>
1486
+ </div>
1487
+
1488
+ <div class="indicators-legend">
1489
+ <!-- Légende des niveaux d'activité -->
1490
+ <div class="enriched-legend">
1491
+ <div class="legend-section">
1492
+ <h5>📈 Niveaux d'activité</h5>
1493
+ <div class="legend-grid">
1494
+ <div class="legend-item-small">
1495
+ <div class="legend-color-small" style="background:#EBEDF0;"></div>
1496
+ <span>Aucune activité</span>
1497
+ </div>
1498
+ <div class="legend-item-small">
1499
+ <div class="legend-color-small" style="background:#C6E48B;"></div>
1500
+ <span>Faible activité</span>
1501
+ </div>
1502
+ <div class="legend-item-small">
1503
+ <div class="legend-color-small" style="background:#7BC96F;"></div>
1504
+ <span>Activité modérée</span>
1505
+ </div>
1506
+ <div class="legend-item-small">
1507
+ <div class="legend-color-small" style="background:#239A3B;"></div>
1508
+ <span>Activité élevée</span>
1509
+ </div>
1510
+ <div class="legend-item-small">
1511
+ <div class="legend-color-small" style="background:#196127;"></div>
1512
+ <span>Activité intense</span>
1513
+ </div>
1514
+ </div>
1515
+ </div>
1516
+ </div>
1517
+
1518
+ <!-- Analyse de persévérance -->
1519
+ <div class="persistence-analysis" id="persistenceAnalysis">
1520
+ <h5>🎯 Indicateurs de Persévérance</h5>
1521
+ <div class="persistence-indicators">
1522
+ <div class="indicator">
1523
+ <span class="indicator-dot" style="background:#FF6B6B;"></span>
1524
+ <span>Régularité : <strong id="regularityScore">-</strong></span>
1525
+ </div>
1526
+ <div class="indicator">
1527
+ <span class="indicator-dot" style="background:#4ECDC4;"></span>
1528
+ <span>Schéma d'effort : <strong id="effortPattern">-</strong></span>
1529
+ </div>
1530
+ <div class="indicator">
1531
+ <span class="indicator-dot" style="background:#FFD166;"></span>
1532
+ <span>Gestion échéances : <strong id="deadlineScore">-</strong></span>
1533
+ </div>
1534
+ </div>
1535
+
1536
+ <div class="persistence-text" style="margin-top: 15px;">
1537
+ <div><strong>Régularité :</strong> <span id="regularityText">Analyse en cours...</span></div>
1538
+ <div><strong>Schéma d'effort :</strong> <span id="patternText">Analyse en cours...</span></div>
1539
+ </div>
1540
+ </div>
1541
+ </div>
1542
+ </div>
1543
+ </div>
1544
+
1545
+ <!-- ONGLET 3: MESSAGE RÉFLEXIF ET ÉVALUATION -->
1546
+ <div id="tab-evaluation" class="tab-content">
1547
+ <h3>🤖 ReflAgent – Analyse & accompagnement</h3>
1548
+ <div id="reflagent">
1549
+ <em>Le message d'analyse apparaîtra ici après chargement...</em>
1550
+ </div>
1551
+
1552
+ <hr>
1553
+
1554
+ <h3>🧑‍⚖️ Volet Expert – Métriques de Confiance</h3>
1555
+ <p style="color: #666; margin-bottom: 20px; font-style: italic;">
1556
+ Évaluez votre confiance dans l'analyse de ReflAgent pour ce scénario :
1557
+ </p>
1558
+
1559
+ <!-- MÉTRIQUES TRADUITES EN FRANÇAIS -->
1560
+ <div class="trust-item">
1561
+ <b>Authenticité Réflexive (AR)</b>
1562
+ <div class="stars" data-metric="AR">
1563
+ <!-- Les étoiles seront ajoutées par JavaScript -->
1564
+ </div>
1565
+ <small style="color: #666; display: block; margin-top: 5px;">
1566
+ L'analyse reflète-t-elle fidèlement la situation réelle de l'étudiant ?
1567
+ </small>
1568
+ </div>
1569
+
1570
+ <div class="trust-item">
1571
+ <b>Alignement Empathique (AE)</b>
1572
+ <div class="stars" data-metric="AE">
1573
+ <!-- Les étoiles seront ajoutées par JavaScript -->
1574
+ </div>
1575
+ <small style="color: #666; display: block; margin-top: 5px;">
1576
+ L'agent comprend-il les émotions, motivations et difficultés de l'étudiant ?
1577
+ </small>
1578
+ </div>
1579
+
1580
+ <div class="trust-item">
1581
+ <b>Encouragement Sensible au Risque (ESR)</b>
1582
+ <div class="stars" data-metric="ESR">
1583
+ <!-- Les étoiles seront ajoutées par JavaScript -->
1584
+ </div>
1585
+ <small style="color: #666; display: block; margin-top: 5px;">
1586
+ Les encouragements tiennent-ils compte des risques et difficultés identifiés ?
1587
+ </small>
1588
+ </div>
1589
+
1590
+ <div class="trust-item">
1591
+ <b>Support aux Défis Mentaux (SDM)</b>
1592
+ <div class="stars" data-metric="SDM">
1593
+ <!-- Les étoiles seront ajoutées par JavaScript -->
1594
+ </div>
1595
+ <small style="color: #666; display: block; margin-top: 5px;">
1596
+ L'agent aide-t-il l'étudiant à développer sa pensée critique et ses compétences cognitives ?
1597
+ </small>
1598
+ </div>
1599
+
1600
+ <div class="trust-item">
1601
+ <b>Support Métacognitif (SM)</b>
1602
+ <div class="stars" data-metric="SM">
1603
+ <!-- Les étoiles seront ajoutées par JavaScript -->
1604
+ </div>
1605
+ <small style="color: #666; display: block; margin-top: 5px;">
1606
+ L'agent aide-t-il l'étudiant à réfléchir sur ses propres stratégies d'apprentissage ?
1607
+ </small>
1608
+ </div>
1609
+
1610
+ <h4>💬 Commentaire expert</h4>
1611
+ <textarea id="trustComment" placeholder="Ajoutez vos observations, suggestions ou critiques concernant l'analyse de ReflAgent..."></textarea>
1612
+
1613
+ <div style="display: flex; justify-content: space-between; align-items: center; margin: 25px 0;">
1614
+ <div style="flex-grow: 1; margin-right: 20px;">
1615
+ <h4 style="margin-bottom: 10px;">🔒 Indice global de confiance</h4>
1616
+ <div class="progress-container">
1617
+ <div class="fill" id="trustBar">0%</div>
1618
+ </div>
1619
+ <div style="display: flex; justify-content: space-between; margin-top: 5px; font-size: 12px; color: #666;">
1620
+ <span>Faible confiance</span>
1621
+ <span>Confidence moyenne</span>
1622
+ <span>Forte confiance</span>
1623
+ </div>
1624
+ </div>
1625
+ <div style="display: flex; flex-direction: column; gap: 10px; align-items: flex-end;">
1626
+ <button id="saveTrustBtn" style="height: fit-content; width: 100%;">💾 Sauvegarder l'évaluation</button>
1627
+ <button id="crossReadersBtn" style="height: fit-content; width: 100%; background: linear-gradient(135deg, #43A047, #4CAF50);">
1628
+ 📊 Lecture croisée
1629
+ </button>
1630
+ </div>
1631
+ </div>
1632
+
1633
+ <div id="saveTrustMsg"></div>
1634
+
1635
+ <!-- Statistiques rapides -->
1636
+ <div class="stats-grid">
1637
+ <div class="stat-item">
1638
+ <div class="stat-label">Scénario actuel</div>
1639
+ <div class="stat-value" id="currentScenarioNum">-</div>
1640
+ </div>
1641
+ <div class="stat-item">
1642
+ <div class="stat-label">Confiance moyenne</div>
1643
+ <div class="stat-value" id="avgTrustScore">0%</div>
1644
+ </div>
1645
+ <div class="stat-item">
1646
+ <div class="stat-label">Niveau de risque</div>
1647
+ <div class="stat-value" id="riskLevel">-</div>
1648
+ </div>
1649
+ <div class="stat-item">
1650
+ <div class="stat-label">Activité moyenne</div>
1651
+ <div class="stat-value" id="avgActivity">-</div>
1652
+ </div>
1653
+ </div>
1654
+ </div>
1655
+ </div>
1656
+ </div>
1657
+
1658
+ <!-- Script principal -->
1659
+ <script>
1660
+ // ================= VARIABLES =================
1661
+ let scenarios = [];
1662
+ let currentScenarioIndex = 0;
1663
+ let radarMetrics = [];
1664
+
1665
+ // Métriques de radar par défaut (sans abréviations)
1666
+ const DEFAULT_RADAR_METRICS = [
1667
+ { label: "Démarrage des activités", value: 85 },
1668
+ { label: "Connaissances validées", value: 72 },
1669
+ { label: "Niveau moyen de compétence", value: 68 },
1670
+ { label: "Taux d'erreur (inversé)", value: 35 },
1671
+ { label: "Achèvement des activités", value: 74 },
1672
+ { label: "Interactions avec les ressources", value: 80 },
1673
+ { label: "Domaines de compétence", value: 78 }
1674
+ ];
1675
+
1676
+ // Noms des métriques traduits en français
1677
+ const trustMetrics = {
1678
+ "AR": 0, // Authenticité Réflexive
1679
+ "AE": 0, // Alignement Empathique
1680
+ "ESR": 0, // Encouragement Sensible au Risque
1681
+ "SDM": 0, // Support aux Défis Mentaux
1682
+ "SM": 0 // Support Métacognitif
1683
+ };
1684
+
1685
+ const trustWeights = {
1686
+ "AR": 0.30,
1687
+ "AE": 0.20,
1688
+ "ESR": 0.20,
1689
+ "SDM": 0.10,
1690
+ "SM": 0.20
1691
+ };
1692
+
1693
+ // ================= INIT =================
1694
+ document.addEventListener("DOMContentLoaded", () => {
1695
+ console.log("✅ DOM chargé, initialisation...");
1696
+ loadScenarios();
1697
+ initTrustStars();
1698
+ initTrustSave();
1699
+ initTabs();
1700
+ initGDPR();
1701
+
1702
+ // Initialiser la barre de confiance à 0%
1703
+ updateTrustBar();
1704
+ });
1705
+
1706
+ // ================= SYSTEME D'ONGLETS =================
1707
+ function initTabs() {
1708
+ const tabBtns = document.querySelectorAll('.tab-btn');
1709
+ const tabContents = document.querySelectorAll('.tab-content');
1710
+
1711
+ tabBtns.forEach(btn => {
1712
+ btn.addEventListener('click', () => {
1713
+ const tabId = btn.getAttribute('data-tab');
1714
+
1715
+ // Retirer la classe active de tous les boutons et contenus
1716
+ tabBtns.forEach(b => b.classList.remove('active'));
1717
+ tabContents.forEach(c => c.classList.remove('active'));
1718
+
1719
+ // Ajouter la classe active au bouton et au contenu correspondant
1720
+ btn.classList.add('active');
1721
+ document.getElementById(tabId).classList.add('active');
1722
+ });
1723
+ });
1724
+ }
1725
+
1726
+ // ================= GDPR =================
1727
+ function initGDPR() {
1728
+ const gdprAccept = document.getElementById('gdprAccept');
1729
+ const gdprDecline = document.getElementById('gdprDecline');
1730
+ const evaluatorFields = document.getElementById('evaluatorFields');
1731
+ const anonymousMessage = document.getElementById('anonymousMessage');
1732
+
1733
+ // Activer/désactiver les champs selon le choix GDPR
1734
+ function updateGDPRFields() {
1735
+ if (gdprAccept.checked) {
1736
+ // Afficher les champs et les activer
1737
+ evaluatorFields.style.display = 'block';
1738
+ anonymousMessage.style.display = 'none';
1739
+
1740
+ // Activer les champs
1741
+ document.getElementById('evaluatorName').disabled = false;
1742
+ document.getElementById('evaluatorRole').disabled = false;
1743
+ document.getElementById('expertiseLevel').disabled = false;
1744
+ document.getElementById('messageMastery').disabled = false;
1745
+ } else if (gdprDecline.checked) {
1746
+ // Cacher les champs et afficher le message anonyme
1747
+ evaluatorFields.style.display = 'none';
1748
+ anonymousMessage.style.display = 'block';
1749
+
1750
+ // Désactiver et vider les champs
1751
+ document.getElementById('evaluatorName').disabled = true;
1752
+ document.getElementById('evaluatorName').value = '';
1753
+ document.getElementById('evaluatorRole').disabled = true;
1754
+ document.getElementById('evaluatorRole').value = '';
1755
+ document.getElementById('expertiseLevel').disabled = true;
1756
+ document.getElementById('expertiseLevel').value = '';
1757
+ document.getElementById('messageMastery').disabled = true;
1758
+ document.getElementById('messageMastery').value = '';
1759
+ }
1760
+ }
1761
+
1762
+ // Écouter les changements
1763
+ gdprAccept.addEventListener('change', updateGDPRFields);
1764
+ gdprDecline.addEventListener('change', updateGDPRFields);
1765
+
1766
+ // Initialiser
1767
+ updateGDPRFields();
1768
+ }
1769
+
1770
+ // ================= CHARGEMENT JSON =================
1771
+ function loadScenarios() {
1772
+ console.log("Chargement des scénarios...");
1773
+ fetch("/static/scenarios.json")
1774
+ .then(r => {
1775
+ if (!r.ok) throw new Error("Erreur de chargement du fichier JSON");
1776
+ return r.json();
1777
+ })
1778
+ .then(data => {
1779
+ console.log("Scénarios chargés:", data.scenarios.length);
1780
+ scenarios = data.scenarios;
1781
+ loadScenario(0);
1782
+ })
1783
+ .catch(error => {
1784
+ console.error("Erreur:", error);
1785
+ document.getElementById("manifest-list").innerHTML =
1786
+ `<div class="manifest-item" style="background:#FFEBEE;color:#C62828;">
1787
+ Erreur de chargement des scénarios. Vérifiez que le fichier scenarios.json existe.
1788
+ </div>`;
1789
+ });
1790
+ }
1791
+
1792
+ // ================= CHARGER SCÉNARIO =================
1793
+ function loadScenario(index) {
1794
+ console.log("Chargement scénario", index);
1795
+ if (index < 0 || index >= scenarios.length) return;
1796
+ currentScenarioIndex = index;
1797
+ const s = scenarios[index];
1798
+
1799
+ // Mettre à jour le titre
1800
+ const titleElement = document.getElementById("scenarioTitle");
1801
+ titleElement.textContent = `Scénario ${s.id} – ${s.title}`;
1802
+
1803
+ // Mettre à jour le manifeste
1804
+ document.getElementById("manifest-list").innerHTML = `
1805
+ <div class="manifest-item">
1806
+ <b>Type de Manifest :</b> ${s.manifest.type}<br>
1807
+ <b>Manifeste (écrit par l'étudiant) :</b> ${s.manifest.manifeste}<br>
1808
+ <b>Description du Profil :</b> ${s.manifest.description}
1809
+ </div>`;
1810
+
1811
+ // Version minimaliste des compétences
1812
+ const c = document.getElementById("competence-bars");
1813
+ c.innerHTML = "";
1814
+
1815
+ const columnsContainer = document.createElement("div");
1816
+ columnsContainer.style.display = "flex";
1817
+ columnsContainer.style.flexWrap = "wrap";
1818
+ columnsContainer.style.gap = "20px";
1819
+
1820
+ const columnGroups = [4, 4, 3, 3];
1821
+ let currentIndex = 0;
1822
+
1823
+ columnGroups.forEach((groupSize) => {
1824
+ const column = document.createElement("div");
1825
+ column.style.flex = "1";
1826
+ column.style.minWidth = "200px";
1827
+
1828
+ for (let i = 0; i < groupSize && currentIndex < s.competences.length; i++) {
1829
+ const cp = s.competences[currentIndex];
1830
+
1831
+ const compItem = document.createElement("div");
1832
+ compItem.style.marginBottom = "15px";
1833
+
1834
+ let color;
1835
+ if (cp.value < 50) color = '#E53935';
1836
+ else if (cp.value < 70) color = '#FB8C00';
1837
+ else color = '#43A047';
1838
+
1839
+ compItem.innerHTML = `
1840
+ <div style="margin-bottom: 5px; font-weight: bold; font-size: 14px;">
1841
+ ${cp.label}
1842
+ </div>
1843
+ <div style="height: 20px; background: #e0e0e0; border-radius: 10px; overflow: hidden;">
1844
+ <div style="height: 100%; width: ${cp.value}%; background: ${color};
1845
+ display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-size: 12px;">
1846
+ ${cp.value}%
1847
+ </div>
1848
+ </div>
1849
+ `;
1850
+
1851
+ column.appendChild(compItem);
1852
+ currentIndex++;
1853
+ }
1854
+
1855
+ columnsContainer.appendChild(column);
1856
+ });
1857
+
1858
+ c.appendChild(columnsContainer);
1859
+
1860
+ // Mettre à jour le radar avec les nouvelles métriques
1861
+ if (s.radar && s.radar.length > 0) {
1862
+ radarMetrics = s.radar;
1863
+ } else {
1864
+ // Utiliser les métriques par défaut avec variation pour chaque scénario
1865
+ radarMetrics = DEFAULT_RADAR_METRICS.map(metric => {
1866
+ // Variation de ±15% selon l'index du scénario pour rendre les données plus réalistes
1867
+ const variation = (index % 7) * 5 - 15; // -15 à +15
1868
+ const newValue = Math.max(10, Math.min(95, metric.value + variation));
1869
+ return {
1870
+ label: metric.label,
1871
+ value: newValue
1872
+ };
1873
+ });
1874
+ }
1875
+
1876
+ // Mettre à jour la grille des métriques radar
1877
+ updateRadarMetricsGrid();
1878
+
1879
+ // Mettre à jour le graphique radar
1880
+ drawRadar();
1881
+
1882
+ // Mettre à jour le message bot radar (CONTEXTUEL)
1883
+ updateRadarBotMessage(s);
1884
+
1885
+ // Mettre à jour la heatmap enrichie
1886
+ drawEnrichedHeatmap(s);
1887
+
1888
+ // Mettre à jour le message ReflAgent
1889
+ document.getElementById("reflagent").textContent = s.reflAgent;
1890
+
1891
+ // Mettre à jour les boutons de navigation
1892
+ updateNavButtons();
1893
+
1894
+ // Mettre à jour les statistiques
1895
+ updateStats();
1896
+ }
1897
+
1898
+ // ================= MISE À JOUR DE LA GRILLE DES MÉTRIQUES RADAR =================
1899
+ function updateRadarMetricsGrid() {
1900
+ const grid = document.getElementById("radar-metrics-grid");
1901
+ if (!grid) return;
1902
+
1903
+ grid.innerHTML = "";
1904
+
1905
+ radarMetrics.forEach(metric => {
1906
+ // Déterminer la classe de couleur selon la valeur
1907
+ let colorClass = "";
1908
+ if (metric.value >= 70) colorClass = "high";
1909
+ else if (metric.value >= 40) colorClass = "medium";
1910
+ else colorClass = "low";
1911
+
1912
+ // Déterminer l'icône selon le type de métrique
1913
+ let icon = "📊";
1914
+ if (metric.label.includes("Démarrage")) icon = "🚀";
1915
+ else if (metric.label.includes("Connaissances")) icon = "🎓";
1916
+ else if (metric.label.includes("Niveau moyen")) icon = "📈";
1917
+ else if (metric.label.includes("Taux d'erreur")) icon = "🎯";
1918
+ else if (metric.label.includes("Achèvement")) icon = "🏁";
1919
+ else if (metric.label.includes("Interactions")) icon = "📚";
1920
+ else if (metric.label.includes("Domaines")) icon = "🔧";
1921
+
1922
+ // Déterminer la description
1923
+ let description = "";
1924
+ if (metric.label.includes("Démarrage")) description = "Rapidité d'initiation des tâches";
1925
+ else if (metric.label.includes("Connaissances")) description = "Acquis démontrés et évalués";
1926
+ else if (metric.label.includes("Niveau moyen")) description = "Moyenne des compétences maîtrisées";
1927
+ else if (metric.label.includes("Taux d'erreur")) description = "Précision et attention aux détails";
1928
+ else if (metric.label.includes("Achèvement")) description = "Terminaison des tâches initiées";
1929
+ else if (metric.label.includes("Interactions")) description = "Utilisation des supports d'apprentissage";
1930
+ else if (metric.label.includes("Domaines")) description = "Étendue des compétences couvertes";
1931
+
1932
+ const metricCard = document.createElement("div");
1933
+ metricCard.className = "metric-card";
1934
+ metricCard.innerHTML = `
1935
+ <div class="metric-icon">${icon}</div>
1936
+ <div class="metric-name">${metric.label}</div>
1937
+ <div class="metric-value ${colorClass}">${metric.value}%</div>
1938
+ <div class="metric-description">${description}</div>
1939
+ `;
1940
+
1941
+ grid.appendChild(metricCard);
1942
+ });
1943
+ }
1944
+
1945
+ // ================= NAVIGATION =================
1946
+ document.getElementById("prevScenario").onclick = () =>
1947
+ loadScenario(currentScenarioIndex - 1);
1948
+
1949
+ document.getElementById("nextScenario").onclick = () =>
1950
+ loadScenario(currentScenarioIndex + 1);
1951
+
1952
+ function updateNavButtons() {
1953
+ document.getElementById("prevScenario").disabled =
1954
+ currentScenarioIndex === 0;
1955
+ document.getElementById("nextScenario").disabled =
1956
+ currentScenarioIndex === scenarios.length - 1;
1957
+ }
1958
+
1959
+ // ================= BOUTON LECTURE CROISÉE =================
1960
+ document.getElementById('crossReadersBtn').onclick = () => {
1961
+ console.log('Navigation vers la page de lecture croisée...');
1962
+
1963
+ // Animation de transition
1964
+ const reflectionDiv = document.getElementById('reflection');
1965
+ if (reflectionDiv) {
1966
+ reflectionDiv.style.opacity = '0.7';
1967
+ reflectionDiv.style.transition = 'opacity 0.3s ease';
1968
+ }
1969
+
1970
+ // Redirection
1971
+ setTimeout(() => {
1972
+ window.location.href = 'cross_reading/cross_readers.html';
1973
+ }, 300);
1974
+ };
1975
+
1976
+ // ================= MESSAGE BOT RADAR CONTEXTUEL =================
1977
+ function updateRadarBotMessage(scenario) {
1978
+ const radarBotMessage = document.getElementById("radar-bot-message");
1979
+ const radarBotContent = document.getElementById("radar-bot-content");
1980
+ const radarBotInsights = document.getElementById("radar-bot-insights");
1981
+
1982
+ if (!radarBotMessage || !radarBotContent || !radarBotInsights) return;
1983
+
1984
+ // Messages pour chaque profil basé sur le titre du scénario
1985
+ const profileMessages = {
1986
+ "Étudiant engagé": {
1987
+ title: "Étudiant Engagé et Motivé",
1988
+ message: "🎯 Ton engagement est impressionnant ! Tu démontres une forte volonté d'apprendre. Continue à canaliser cette énergie vers des objectifs clairs.",
1989
+ insights: [
1990
+ { icon: "🔥", text: "Motivation élevée et constante" },
1991
+ { icon: "🎯", text: "Objectifs d'apprentissage bien définis" },
1992
+ { icon: "📚", text: "Implication active dans les activités" },
1993
+ { icon: "💪", text: "Persévérance face aux difficultés" }
1994
+ ]
1995
+ },
1996
+ "Étudiant orienté vers le succès": {
1997
+ title: "Étudiant Orienté Réussite",
1998
+ message: "🏆 Tu vises l'excellence avec détermination. Ta motivation par le succès est un atout, mais attention à ne pas négliger le processus d'apprentissage.",
1999
+ insights: [
2000
+ { icon: "⭐", text: "Fort désir de réussite et de reconnaissance" },
2001
+ { icon: "🎯", text: "Objectifs ambitieux et clairs" },
2002
+ { icon: "📈", text: "Performance supérieure aux attentes" },
2003
+ { icon: "⚖️", text: "Équilibre entre résultats et apprentissage à trouver" }
2004
+ ]
2005
+ },
2006
+ "Étudiant motivé": {
2007
+ title: "Étudiant Nouvellement Motivé",
2008
+ message: "🚀 Ta motivation est un excellent point de départ ! Tu découvres les joies de l'apprentissage. Capitalise sur cet élan pour construire des bases solides.",
2009
+ insights: [
2010
+ { icon: "🌟", text: "Motivation récente et prometteuse" },
2011
+ { icon: "🧱", text: "Construction des bases en cours" },
2012
+ { icon: "📖", text: "Curiosité et ouverture d'esprit" },
2013
+ { icon: "🌱", text: "Potentiel de croissance important" }
2014
+ ]
2015
+ },
2016
+ "Étudiant surmotivé": {
2017
+ title: "Étudiant Surmotivé",
2018
+ message: "💥 Ton niveau d'investissement est exceptionnel, mais attention au risque de surmenage. L'excellence durable nécessite un rythme soutenable.",
2019
+ insights: [
2020
+ { icon: "⚡", text: "Investissement maximal dans toutes les activités" },
2021
+ { icon: "⚠️", text: "Risque de burnout à surveiller" },
2022
+ { icon: "🎯", text: "Perfectionnisme parfois excessif" },
2023
+ { icon: "⚖️", text: "Équilibre vie étudiante/privée à préserver" }
2024
+ ]
2025
+ },
2026
+ "Étudiant stratégique": {
2027
+ title: "Étudiant Stratégique",
2028
+ message: "♟️ Tu abordes l'apprentissage avec intelligence et planification. Tes méthodes efficaces montrent une bonne compréhension des enjeux académiques.",
2029
+ insights: [
2030
+ { icon: "🧠", text: "Approche réfléchie et planifiée" },
2031
+ { icon: "🎯", text: "Optimisation des efforts pour des résultats maximaux" },
2032
+ { icon: "📊", text: "Analyse des retours pour amélioration" },
2033
+ { icon: "⚡", text: "Efficacité démontrée dans l'apprentissage" }
2034
+ ]
2035
+ },
2036
+ "Étudiant en amélioration": {
2037
+ title: "Étudiant en Phase d'Amélioration",
2038
+ message: "📈 Tu progresses régulièrement et montre une belle capacité d'adaptation. Continue à identifier tes points faibles pour les transformer en forces.",
2039
+ insights: [
2040
+ { icon: "📈", text: "Progression constante et mesurable" },
2041
+ { icon: "🔄", text: "Capacité d'adaptation et de remise en question" },
2042
+ { icon: "🎯", text: "Objectifs d'amélioration clairement identifiés" },
2043
+ { icon: "💪", text: "Persévérance dans l'effort d'apprentissage" }
2044
+ ]
2045
+ },
2046
+ "Étudiant en difficulté": {
2047
+ title: "Étudiant Rencontrant des Difficultés",
2048
+ message: "🆘 Tu fais face à des obstacles dans ton apprentissage. C'est normal d'avoir des difficultés - l'important est d'identifier les causes et de chercher du soutien.",
2049
+ insights: [
2050
+ { icon: "⚠️", text: "Difficultés persistantes dans certains domaines" },
2051
+ { icon: "🆘", text: "Besoin d'un soutien adapté identifié" },
2052
+ { icon: "💭", text: "Réflexion sur les causes des difficultés" },
2053
+ { icon: "🤝", text: "Ouverture à l'aide et au soutien" }
2054
+ ]
2055
+ },
2056
+ "Étudiant évitant l'échec": {
2057
+ title: "Étudiant Évitant l'Échec",
2058
+ message: "🛡️ Tu sembles éviter les situations qui pourraient mener à l'échec. Rappelle-toi que l'échec fait partie de l'apprentissage et peut être une source de croissance.",
2059
+ insights: [
2060
+ { icon: "🛡️", text: "Stratégie de protection face aux risques d'échec" },
2061
+ { icon: "🎯", text: "Choix de tâches sécurisantes et maîtrisées" },
2062
+ { icon: "⚠️", text: "Évitement des défis perçus comme risqués" },
2063
+ { icon: "🌱", text: "Potentiel de dépassement de ses limites" }
2064
+ ]
2065
+ },
2066
+ "Étudiant à risque": {
2067
+ title: "Étudiant à Risque de Décrochage",
2068
+ message: "🚨 Certains indicateurs suggèrent un risque de décrochage. Il est important d'agir maintenant pour retrouver un parcours d'apprentissage stable et épanouissant.",
2069
+ insights: [
2070
+ { icon: "🚨", text: "Indicateurs de risque identifiés" },
2071
+ { icon: "⚠️", text: "Engagement fluctuant ou en baisse" },
2072
+ { icon: "🆘", text: "Besoin urgent de soutien et d'accompagnement" },
2073
+ { icon: "🔍", text: "Identification des causes du désengagement" }
2074
+ ]
2075
+ },
2076
+ "Étudiant en progression": {
2077
+ title: "Étudiant en Progression Continue",
2078
+ message: "📊 Tu montres une belle progression dans tes apprentissages. Continue à capitaliser sur tes réussites pour maintenir cette dynamique positive.",
2079
+ insights: [
2080
+ { icon: "📊", text: "Amélioration mesurable des compétences" },
2081
+ { icon: "🎯", text: "Objectifs de progression atteints" },
2082
+ { icon: "🚀", text: "Dynamique d'apprentissage positive" },
2083
+ { icon: "💡", text: "Acquisition de nouvelles stratégies efficaces" }
2084
+ ]
2085
+ },
2086
+ "Étudiant acceptant l'échec": {
2087
+ title: "Étudiant Acceptant l'Échec",
2088
+ message: "😔 Tu sembles avoir accepté certaines difficultés comme inévitables. Pourtant, chaque obstacle peut être surmonté avec la bonne approche et du soutien.",
2089
+ insights: [
2090
+ { icon: "😔", text: "Acceptation passive des difficultés" },
2091
+ { icon: "⚠️", text: "Faible confiance dans sa capacité à progresser" },
2092
+ { icon: "🔄", text: "Besoin de redynamiser la motivation" },
2093
+ { icon: "🌟", text: "Potentiel non exploité identifié" }
2094
+ ]
2095
+ },
2096
+ "Étudiant inactif": {
2097
+ title: "Étudiant Inactif",
2098
+ message: "⏸️ Ton activité d'apprentissage est très limitée. Le premier pas est souvent le plus difficile - commence par de petites actions pour relancer ta motivation.",
2099
+ insights: [
2100
+ { icon: "⏸️", text: "Activité d'apprentissage très réduite" },
2101
+ { icon: "🚪", text: "Éloignement du parcours éducatif" },
2102
+ { icon: "🆘", text: "Besoin d'un accompagnement renforcé" },
2103
+ { icon: "🔓", text: "Potentiel de réengagement à débloquer" }
2104
+ ]
2105
+ },
2106
+ "Étudiant non engagé": {
2107
+ title: "Étudiant Non Engagé",
2108
+ message: "😐 Tu sembles peu engagé dans ton parcours d'apprentissage. Identifier ce qui pourrait te motiver à nouveau serait un premier pas important.",
2109
+ insights: [
2110
+ { icon: "😐", text: "Faible implication dans les activités" },
2111
+ { icon: "🎯", text: "Objectifs personnels à redéfinir" },
2112
+ { icon: "🔄", text: "Besoin de retrouver du sens à l'apprentissage" },
2113
+ { icon: "🌟", text: "Redécouverte des motivations intrinsèques" }
2114
+ ]
2115
+ },
2116
+ "Étudiant persévérant": {
2117
+ title: "Étudiant Persévérant",
2118
+ message: "🏅 Ta persévérance face aux difficultés est remarquable. Continue à avancer pas à pas - chaque effort contribue à ton apprentissage à long terme.",
2119
+ insights: [
2120
+ { icon: "🏅", text: "Persévérance exceptionnelle face aux défis" },
2121
+ { icon: "🐢", text: "Approche patiente et régulière" },
2122
+ { icon: "📈", text: "Progrès constants malgré les obstacles" },
2123
+ { icon: "💪", text: "Résilience et ténacité démontrées" }
2124
+ ]
2125
+ },
2126
+ "Étudiant actif": {
2127
+ title: "Étudiant Actif et Impliqué",
2128
+ message: "🎉 Tu es activement engagé dans ton apprentissage avec une bonne participation. Continue à maintenir ce niveau d'implication pour maximiser tes progrès.",
2129
+ insights: [
2130
+ { icon: "🎉", text: "Participation active et régulière" },
2131
+ { icon: "🤝", text: "Implication dans les activités collaboratives" },
2132
+ { icon: "💡", text: "Contributions pertinentes et réfléchies" },
2133
+ { icon: "🚀", text: "Dynamisme dans les apprentissages" }
2134
+ ]
2135
+ }
2136
+ };
2137
+
2138
+ // Récupérer le message pour le profil ou utiliser un message par défaut
2139
+ const profileMessage = profileMessages[scenario.title] || {
2140
+ title: "Profil d'Apprentissage",
2141
+ message: "Analyse de votre profil d'apprentissage en cours...",
2142
+ insights: [
2143
+ { icon: "📊", text: "Évaluation des indicateurs d'apprentissage" },
2144
+ { icon: "🎯", text: "Identification des forces et axes d'amélioration" },
2145
+ { icon: "🚀", text: "Recommandations personnalisées" }
2146
+ ]
2147
+ };
2148
+
2149
+ // Mettre à jour l'interface
2150
+ radarBotMessage.style.display = 'block';
2151
+ radarBotContent.innerHTML = `<strong>${profileMessage.title}</strong><br>${profileMessage.message}`;
2152
+
2153
+ // Mettre à jour les insights
2154
+ radarBotInsights.innerHTML = '';
2155
+ profileMessage.insights.forEach(insight => {
2156
+ const insightElement = document.createElement('div');
2157
+ insightElement.className = 'radar-insight-item';
2158
+ insightElement.innerHTML = `
2159
+ <div class="radar-insight-icon">${insight.icon}</div>
2160
+ <div class="radar-insight-text">${insight.text}</div>
2161
+ `;
2162
+ radarBotInsights.appendChild(insightElement);
2163
+ });
2164
+ }
2165
+
2166
+ // ================= RADAR =================
2167
+ function drawRadar() {
2168
+ const canvas = document.getElementById("radar");
2169
+ if (!canvas) {
2170
+ console.error("Canvas radar non trouvé!");
2171
+ return;
2172
+ }
2173
+
2174
+ const ctx = canvas.getContext("2d");
2175
+ const cx = canvas.width / 2;
2176
+ const cy = canvas.height / 2;
2177
+ const radius = 220;
2178
+ const n = radarMetrics.length;
2179
+
2180
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
2181
+
2182
+ // Dessiner le radar
2183
+ for (let i = 1; i <= 5; i++) {
2184
+ ctx.beginPath();
2185
+ ctx.arc(cx, cy, (radius / 5) * i, 0, 2 * Math.PI);
2186
+ ctx.strokeStyle = "#e0e0e0";
2187
+ ctx.stroke();
2188
+ }
2189
+
2190
+ // Dessiner les axes
2191
+ radarMetrics.forEach((m, i) => {
2192
+ const angle = (2 * Math.PI * i) / n - Math.PI / 2;
2193
+
2194
+ ctx.beginPath();
2195
+ ctx.moveTo(cx, cy);
2196
+ ctx.lineTo(cx + radius * Math.cos(angle), cy + radius * Math.sin(angle));
2197
+ ctx.strokeStyle = "#b0bec5";
2198
+ ctx.stroke();
2199
+
2200
+ // Labels
2201
+ const tx = cx + (radius + 35) * Math.cos(angle);
2202
+ const ty = cy + (radius + 35) * Math.sin(angle);
2203
+
2204
+ ctx.font = "12px Arial";
2205
+ ctx.fillStyle = "#000";
2206
+ ctx.textAlign = angle > Math.PI / 2 || angle < -Math.PI / 2 ? "right" : "left";
2207
+ ctx.textBaseline = "middle";
2208
+ ctx.fillText(`${m.label} : ${m.value}%`, tx, ty);
2209
+ });
2210
+
2211
+ // Dessiner le polygone
2212
+ ctx.beginPath();
2213
+ radarMetrics.forEach((m, i) => {
2214
+ const angle = (2 * Math.PI * i) / n - Math.PI / 2;
2215
+ const r = radius * (m.value / 100);
2216
+ const x = cx + r * Math.cos(angle);
2217
+ const y = cy + r * Math.sin(angle);
2218
+ i === 0 ? ctx.moveTo(x, y) : ctx.lineTo(x, y);
2219
+ });
2220
+ ctx.closePath();
2221
+
2222
+ ctx.fillStyle = "rgba(25,118,210,0.25)";
2223
+ ctx.fill();
2224
+ ctx.strokeStyle = "#1976D2";
2225
+ ctx.lineWidth = 2;
2226
+ ctx.stroke();
2227
+
2228
+ // Dessiner les points
2229
+ radarMetrics.forEach((m, i) => {
2230
+ const angle = (2 * Math.PI * i) / n - Math.PI / 2;
2231
+ const r = radius * (m.value / 100);
2232
+ const x = cx + r * Math.cos(angle);
2233
+ const y = cy + r * Math.sin(angle);
2234
+
2235
+ ctx.beginPath();
2236
+ ctx.arc(x, y, 4, 0, 2 * Math.PI);
2237
+ ctx.fillStyle = "#1976D2";
2238
+ ctx.fill();
2239
+ });
2240
+ }
2241
+
2242
+ // ================= HEATMAP ENRICHIE =================
2243
+ function drawEnrichedHeatmap(scenario) {
2244
+ const canvas = document.getElementById("heatmap");
2245
+ if (!canvas) return;
2246
+
2247
+ const ctx = canvas.getContext("2d");
2248
+ const cellSize = 25;
2249
+ const padding = 2;
2250
+ const days = ["L", "M", "M", "J", "V", "S", "D"];
2251
+ const weeks = 4;
2252
+ const totalDays = weeks * 7;
2253
+
2254
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
2255
+
2256
+ // Titre enrichi
2257
+ const scenarioTitles = {
2258
+ 1: {
2259
+ title: "Vous êtes engagé mais désorganisé",
2260
+ emoji: "😅",
2261
+ pattern: "Effort concentré avant échéances"
2262
+ },
2263
+ 2: {
2264
+ title: "Vous êtes actif mais peu efficace",
2265
+ emoji: "😰",
2266
+ pattern: "Démarrage lent avec accélération tardive"
2267
+ },
2268
+ 3: {
2269
+ title: "Vous êtes autonome et stratégique",
2270
+ emoji: "😊",
2271
+ pattern: "Travail régulier et équilibré"
2272
+ }
2273
+ };
2274
+
2275
+ const scenarioInfo = scenarioTitles[scenario.id] || {
2276
+ title: "Votre activité",
2277
+ emoji: "📊",
2278
+ pattern: "Schéma à analyser"
2279
+ };
2280
+
2281
+ ctx.font = "bold 18px Arial";
2282
+ ctx.fillStyle = "#1976D2";
2283
+ ctx.textAlign = "center";
2284
+ ctx.fillText(`${scenarioInfo.emoji} ${scenarioInfo.title}`, canvas.width / 2, 30);
2285
+
2286
+ ctx.font = "14px Arial";
2287
+ ctx.fillStyle = "#666";
2288
+ ctx.fillText(`Schéma détecté : ${scenarioInfo.pattern}`, canvas.width / 2, 55);
2289
+
2290
+ // Générer les données d'activité selon le scénario
2291
+ const activityData = generatePersistenceData(scenario.id, totalDays);
2292
+
2293
+ // Dessiner la heatmap
2294
+ const colors = ["#EBEDF0", "#C6E48B", "#7BC96F", "#239A3B", "#196127"];
2295
+
2296
+ for (let day = 0; day < totalDays; day++) {
2297
+ const week = Math.floor(day / 7);
2298
+ const weekday = day % 7;
2299
+
2300
+ const x = 45 + week * (cellSize * 7 + padding * 7) + weekday * (cellSize + padding);
2301
+ const y = 80 + weekday * (cellSize + padding);
2302
+
2303
+ const intensity = activityData[day];
2304
+
2305
+ // Dessiner la cellule
2306
+ ctx.fillStyle = colors[intensity];
2307
+ ctx.fillRect(x, y, cellSize, cellSize);
2308
+
2309
+ // Bordure avec indication des échéances (vendredi = jour important)
2310
+ if (weekday === 4) { // Vendredi
2311
+ ctx.strokeStyle = "#FF6B6B";
2312
+ ctx.lineWidth = 2;
2313
+ } else {
2314
+ ctx.strokeStyle = intensity > 0 ? "#239A3B" : "#eee";
2315
+ ctx.lineWidth = 1;
2316
+ }
2317
+ ctx.strokeRect(x, y, cellSize, cellSize);
2318
+
2319
+ // Indicateur de persévérance (points colorés)
2320
+ if (intensity >= 3) {
2321
+ // Point rouge pour forte activité (indice possible cram)
2322
+ ctx.fillStyle = intensity === 4 ? "#FF6B6B" : "#FFD166";
2323
+ ctx.beginPath();
2324
+ ctx.arc(x + cellSize - 5, y + 5, 3, 0, Math.PI * 2);
2325
+ ctx.fill();
2326
+ }
2327
+ }
2328
+
2329
+ // Analyser et afficher les métriques de persévérance
2330
+ analyzePersistenceMetrics(activityData, scenario.id);
2331
+ }
2332
+
2333
+ // Générer des données de persévérance selon le scénario
2334
+ function generatePersistenceData(scenarioId, totalDays) {
2335
+ const data = new Array(totalDays).fill(0);
2336
+
2337
+ switch(scenarioId) {
2338
+ case 1: // Scénario désorganisé - Effort concentré avant échéances
2339
+ for (let i = 0; i < totalDays; i++) {
2340
+ const weekday = i % 7;
2341
+ // Effort concentré les jeudis et vendredis (jours 3 et 4)
2342
+ if (weekday === 3 || weekday === 4) { // Jeudi et vendredi
2343
+ data[i] = Math.floor(Math.random() * 2) + 3; // 3-4 (forte activité)
2344
+ } else if (weekday === 5 || weekday === 6) { // Weekend
2345
+ data[i] = Math.floor(Math.random() * 2); // 0-1 (très faible)
2346
+ } else {
2347
+ data[i] = Math.floor(Math.random() * 2) + 1; // 1-2 (faible)
2348
+ }
2349
+ }
2350
+ break;
2351
+
2352
+ case 2: // Scénario peu efficace - Démarrage lent, accélération tardive
2353
+ for (let i = 0; i < totalDays; i++) {
2354
+ const progress = i / totalDays;
2355
+ if (progress < 0.3) {
2356
+ data[i] = Math.floor(Math.random() * 2); // 0-1 (début très faible)
2357
+ } else if (progress > 0.7) {
2358
+ data[i] = Math.floor(Math.random() * 2) + 3; // 3-4 (fin forte)
2359
+ } else {
2360
+ data[i] = Math.floor(Math.random() * 2) + 1; // 1-2 (milieu faible)
2361
+ }
2362
+ }
2363
+ break;
2364
+
2365
+ case 3: // Scénario stratégique - Travail régulier
2366
+ for (let i = 0; i < totalDays; i++) {
2367
+ const weekday = i % 7;
2368
+ // Travail régulier et équilibré toute la semaine
2369
+ if (weekday === 5 || weekday === 6) { // Weekend léger
2370
+ data[i] = Math.floor(Math.random() * 2); // 0-1
2371
+ } else {
2372
+ data[i] = Math.floor(Math.random() * 2) + 2; // 2-3 (régulier)
2373
+ }
2374
+ }
2375
+ break;
2376
+
2377
+ default:
2378
+ // Pattern par défaut
2379
+ for (let i = 0; i < totalDays; i++) {
2380
+ data[i] = Math.floor(Math.random() * 5); // 0-4 aléatoire
2381
+ }
2382
+ }
2383
+
2384
+ return data;
2385
+ }
2386
+
2387
+ // Analyser les métriques de persévérance
2388
+ function analyzePersistenceMetrics(activityData, scenarioId) {
2389
+ const totalDays = activityData.length;
2390
+ const weeks = Math.ceil(totalDays / 7);
2391
+
2392
+ // 1. Calculer la régularité (écart-type)
2393
+ const avgActivity = activityData.reduce((a, b) => a + b, 0) / totalDays;
2394
+ const variance = activityData.reduce((a, b) => a + Math.pow(b - avgActivity, 2), 0) / totalDays;
2395
+ const stdDev = Math.sqrt(variance);
2396
+ const regularity = Math.max(0, 100 - stdDev * 25); // Score de 0-100
2397
+
2398
+ // 2. Identifier le schéma d'effort
2399
+ let pattern = "Indéterminé";
2400
+ let patternDescription = "";
2401
+ let patternColor = "#666";
2402
+
2403
+ // Analyser la distribution par semaine
2404
+ const weeklyPatterns = [];
2405
+ for (let w = 0; w < weeks; w++) {
2406
+ const weekData = activityData.slice(w * 7, Math.min((w + 1) * 7, totalDays));
2407
+ if (weekData.length < 5) continue;
2408
+
2409
+ const weekAvg = weekData.reduce((a, b) => a + b, 0) / weekData.length;
2410
+
2411
+ // Vérifier les patterns
2412
+ if (weekData[4] > weekAvg * 1.5 && weekData[3] > weekAvg * 1.3) {
2413
+ weeklyPatterns.push("deadline"); // Pic jeudi/vendredi
2414
+ } else if (weekData[0] < weekAvg * 0.7 && weekData[4] > weekAvg * 1.2) {
2415
+ weeklyPatterns.push("acceleration"); // Démarrage lent, fin forte
2416
+ } else if (Math.max(...weekData) - Math.min(...weekData) < 1.5) {
2417
+ weeklyPatterns.push("regular"); // Régulier
2418
+ } else if (weekData[5] < weekAvg * 0.5 && weekData[6] < weekAvg * 0.5) {
2419
+ weeklyPatterns.push("weekend_break"); // Pause weekend
2420
+ }
2421
+ }
2422
+
2423
+ // Déterminer le pattern dominant
2424
+ let dominantPattern = "regular"; // Par défaut
2425
+ if (weeklyPatterns.length > 0) {
2426
+ const patternCounts = weeklyPatterns.reduce((acc, val) => {
2427
+ acc[val] = (acc[val] || 0) + 1;
2428
+ return acc;
2429
+ }, {});
2430
+
2431
+ dominantPattern = Object.keys(patternCounts).reduce((a, b) =>
2432
+ patternCounts[a] > patternCounts[b] ? a : b, "regular"
2433
+ );
2434
+ }
2435
+
2436
+ // Associer les descriptions
2437
+ const patternMap = {
2438
+ "regular": {
2439
+ name: "Travail régulier",
2440
+ desc: "Effort équilibré tout au long de la semaine avec une bonne constance",
2441
+ color: "#43A047"
2442
+ },
2443
+ "deadline": {
2444
+ name: "Effort concentré avant échéances",
2445
+ desc: "Pic d'activité marqué les jeudis et vendredis, typique du 'cramming'",
2446
+ color: "#E53935"
2447
+ },
2448
+ "acceleration": {
2449
+ name: "Accélération progressive",
2450
+ desc: "Démarrage lent en début de semaine avec accélération avant les deadlines",
2451
+ color: "#FB8C00"
2452
+ },
2453
+ "weekend_break": {
2454
+ name: "Pause weekend marquée",
2455
+ desc: "Activité réduite le weekend avec reprise en début de semaine",
2456
+ color: "#2196F3"
2457
+ }
2458
+ };
2459
+
2460
+ if (patternMap[dominantPattern]) {
2461
+ pattern = patternMap[dominantPattern].name;
2462
+ patternDescription = patternMap[dominantPattern].desc;
2463
+ patternColor = patternMap[dominantPattern].color;
2464
+ }
2465
+
2466
+ // 3. Calculer la gestion des échéances
2467
+ const deadlineDays = activityData.filter((_, index) => index % 7 === 3 || index % 7 === 4);
2468
+ const nonDeadlineDays = activityData.filter((_, index) => index % 7 !== 3 && index % 7 !== 4);
2469
+
2470
+ const deadlineAvg = deadlineDays.length > 0 ?
2471
+ deadlineDays.reduce((a, b) => a + b, 0) / deadlineDays.length : 0;
2472
+ const nonDeadlineAvg = nonDeadlineDays.length > 0 ?
2473
+ nonDeadlineDays.reduce((a, b) => a + b, 0) / nonDeadlineDays.length : 0;
2474
+
2475
+ let deadlineScore = 50;
2476
+ if (deadlineAvg > 0 && nonDeadlineAvg > 0) {
2477
+ const ratio = deadlineAvg / nonDeadlineAvg;
2478
+ if (ratio > 1.5) {
2479
+ deadlineScore = Math.min(100, 30 + (ratio - 1.5) * 40);
2480
+ } else if (ratio < 0.8) {
2481
+ deadlineScore = Math.max(0, 70 - (0.8 - ratio) * 50);
2482
+ } else {
2483
+ deadlineScore = 65 + Math.random() * 20;
2484
+ }
2485
+ }
2486
+
2487
+ // Mettre à jour l'interface
2488
+ document.getElementById("regularityScore").textContent = Math.round(regularity) + "%";
2489
+ document.getElementById("regularityScore").style.color = regularity > 70 ? "#43A047" : regularity > 40 ? "#FB8C00" : "#E53935";
2490
+
2491
+ document.getElementById("effortPattern").textContent = pattern;
2492
+ document.getElementById("effortPattern").style.color = patternColor;
2493
+
2494
+ document.getElementById("deadlineScore").textContent = Math.round(deadlineScore) + "%";
2495
+ document.getElementById("deadlineScore").style.color = deadlineScore > 70 ? "#43A047" : deadlineScore > 40 ? "#FB8C00" : "#E53935";
2496
+
2497
+ // Mettre à jour l'analyse textuelle
2498
+ document.getElementById("regularityText").textContent =
2499
+ regularity > 75 ? "Excellente régularité ! Travail stable et constant dans le temps" :
2500
+ regularity > 60 ? "Bonne régularité avec quelques variations acceptables" :
2501
+ regularity > 40 ? "Régularité moyenne, rythme de travail avec des hauts et des bas" :
2502
+ "Faible régularité, rythme de travail très irrégulier avec des pics et des creux";
2503
+
2504
+ document.getElementById("patternText").textContent = patternDescription;
2505
+ }
2506
+
2507
+ // Changer le mode d'analyse
2508
+ function changePersistenceAnalysis() {
2509
+ const mode = document.getElementById("persistenceMode").value;
2510
+ const currentScenario = scenarios[currentScenarioIndex];
2511
+
2512
+ // Mettre à jour l'affichage selon le mode
2513
+ const heatmapCanvas = document.getElementById("heatmap");
2514
+ const ctx = heatmapCanvas.getContext("2d");
2515
+
2516
+ // Effacer et redessiner avec des annotations spécifiques
2517
+ drawEnrichedHeatmap(currentScenario);
2518
+
2519
+ // Ajouter des annotations spécifiques au mode
2520
+ ctx.font = "14px Arial";
2521
+ ctx.fillStyle = "#1976D2";
2522
+ ctx.textAlign = "center";
2523
+
2524
+ switch(mode) {
2525
+ case "regularity":
2526
+ ctx.fillText("📊 Analyse de la régularité - Écart-type des activités", heatmapCanvas.width / 2, 280);
2527
+ break;
2528
+ case "effortPattern":
2529
+ ctx.fillText("🔄 Identification du schéma d'effort dominant", heatmapCanvas.width / 2, 280);
2530
+ break;
2531
+ case "deadline":
2532
+ ctx.fillText("⏰ Focus sur la gestion des échéances (jeudis/vendredis)", heatmapCanvas.width / 2, 280);
2533
+ break;
2534
+ case "combined":
2535
+ ctx.fillText("🎯 Vue combinée : Régularité + Schéma + Échéances", heatmapCanvas.width / 2, 280);
2536
+ break;
2537
+ }
2538
+ }
2539
+
2540
+ // ================= MÉTRIQUES DE CONFIANCE =================
2541
+ function initTrustStars(){
2542
+ console.log("Initialisation des étoiles...");
2543
+
2544
+ // Réinitialiser toutes les métriques
2545
+ for (const key in trustMetrics) {
2546
+ trustMetrics[key] = 0;
2547
+ }
2548
+
2549
+ let starsCreated = 0;
2550
+
2551
+ document.querySelectorAll(".stars").forEach(div => {
2552
+ const metric = div.dataset.metric;
2553
+ console.log(`Création des étoiles pour: ${metric}`);
2554
+
2555
+ // Vérifier que la métrique existe
2556
+ if (!trustMetrics.hasOwnProperty(metric)) {
2557
+ console.error(`Métrique inconnue: ${metric}`);
2558
+ return;
2559
+ }
2560
+
2561
+ // Vider le conteneur
2562
+ div.innerHTML = '';
2563
+
2564
+ // Créer 5 étoiles
2565
+ for (let i = 1; i <= 5; i++) {
2566
+ const star = document.createElement("span");
2567
+ star.textContent = "★";
2568
+ star.classList.add("inactive");
2569
+ star.style.cursor = "pointer";
2570
+ star.title = `${i} étoile${i > 1 ? 's' : ''}`;
2571
+
2572
+ // Stocker la valeur dans un attribut data
2573
+ star.dataset.value = i;
2574
+
2575
+ star.onclick = function() {
2576
+ const value = parseInt(this.dataset.value);
2577
+ console.log(`Clic sur ${metric}: ${value} étoiles`);
2578
+
2579
+ // Mettre à jour la valeur de la métrique
2580
+ trustMetrics[metric] = value;
2581
+
2582
+ // Mettre à jour l'affichage des étoiles dans ce groupe
2583
+ const allStarsInGroup = this.parentElement.children;
2584
+ for (let j = 0; j < allStarsInGroup.length; j++) {
2585
+ const starElem = allStarsInGroup[j];
2586
+ const starValue = parseInt(starElem.dataset.value);
2587
+
2588
+ if (starValue <= value) {
2589
+ starElem.classList.remove("inactive");
2590
+ starElem.classList.add("active");
2591
+ } else {
2592
+ starElem.classList.add("inactive");
2593
+ starElem.classList.remove("active");
2594
+ }
2595
+ }
2596
+
2597
+ // Mettre à jour la barre de progression
2598
+ updateTrustBar();
2599
+ };
2600
+
2601
+ div.appendChild(star);
2602
+ starsCreated++;
2603
+ }
2604
+ });
2605
+
2606
+ console.log(`${starsCreated} étoiles créées pour ${Object.keys(trustMetrics).length} métriques`);
2607
+ console.log("Métriques initialisées:", trustMetrics);
2608
+ }
2609
+
2610
+ function updateTrustBar(){
2611
+ console.log("=== MISE À JOUR BARRE DE CONFIANCE ===");
2612
+
2613
+ let scoreTotal = 0;
2614
+ let scoreMaxPossible = 0;
2615
+ let details = [];
2616
+
2617
+ // Calcul détaillé
2618
+ for (const metric in trustMetrics) {
2619
+ const valeur = trustMetrics[metric];
2620
+ const poids = trustWeights[metric];
2621
+ const contribution = valeur * poids;
2622
+ const maxContribution = 5 * poids;
2623
+
2624
+ scoreTotal += contribution;
2625
+ scoreMaxPossible += maxContribution;
2626
+
2627
+ details.push({
2628
+ métrique: metric,
2629
+ valeur: valeur,
2630
+ poids: poids,
2631
+ contribution: contribution.toFixed(2),
2632
+ max: maxContribution.toFixed(2)
2633
+ });
2634
+ }
2635
+
2636
+ console.log("Détails du calcul:");
2637
+ details.forEach(d => {
2638
+ console.log(`${d.métrique}: ${d.valeur}/5 × ${d.poids} = ${d.contribution} / ${d.max}`);
2639
+ });
2640
+
2641
+ console.log(`Total: ${scoreTotal.toFixed(2)} / ${scoreMaxPossible.toFixed(2)}`);
2642
+
2643
+ // Calcul du pourcentage
2644
+ let pourcentage = 0;
2645
+ if (scoreMaxPossible > 0) {
2646
+ pourcentage = Math.round((scoreTotal / scoreMaxPossible) * 100);
2647
+ }
2648
+
2649
+ console.log(`Pourcentage calculé: ${pourcentage}%`);
2650
+
2651
+ // Mettre à jour la barre de progression
2652
+ const barre = document.getElementById("trustBar");
2653
+ if (barre) {
2654
+ barre.style.width = pourcentage + "%";
2655
+ barre.textContent = pourcentage + "%";
2656
+
2657
+ // Changer la couleur selon le niveau
2658
+ if (pourcentage < 40) {
2659
+ barre.style.background = "#E53935"; // Rouge - Faible
2660
+ barre.title = `Faible confiance (${pourcentage}%)`;
2661
+ } else if (pourcentage < 70) {
2662
+ barre.style.background = "#FB8C00"; // Orange - Moyen
2663
+ barre.title = `Confiance moyenne (${pourcentage}%)`;
2664
+ } else {
2665
+ barre.style.background = "#43A047"; // Vert - Fort
2666
+ barre.title = `Forte confiance (${pourcentage}%)`;
2667
+ }
2668
+
2669
+ console.log(`Barre mise à jour: ${pourcentage}% (width: ${pourcentage}%)`);
2670
+ } else {
2671
+ console.error("Élément #trustBar non trouvé!");
2672
+ }
2673
+
2674
+ // Mettre à jour la statistique de confiance moyenne
2675
+ const avgTrustElem = document.getElementById("avgTrustScore");
2676
+ if (avgTrustElem) {
2677
+ avgTrustElem.textContent = pourcentage + "%";
2678
+ console.log(`Statistique moyenne mise à jour: ${pourcentage}%`);
2679
+ }
2680
+
2681
+ // Afficher un résumé dans la console
2682
+ console.log("=== RÉSUMÉ FINAL ===");
2683
+ console.log(`Indice global de confiance: ${pourcentage}%`);
2684
+ console.log("Valeurs des métriques:", JSON.stringify(trustMetrics, null, 2));
2685
+ console.log("====================");
2686
+
2687
+ return pourcentage;
2688
+ }
2689
+
2690
+ function initTrustSave(){
2691
+ const saveBtn = document.getElementById("saveTrustBtn");
2692
+ if (!saveBtn) {
2693
+ console.error("Bouton de sauvegarde non trouvé!");
2694
+ return;
2695
+ }
2696
+
2697
+ saveBtn.onclick = () => {
2698
+ console.log("=== DÉBUT SAUVEGARDE ===");
2699
+
2700
+ // Récupérer les informations GDPR
2701
+ const gdprAccept = document.getElementById('gdprAccept').checked;
2702
+ const gdprDecline = document.getElementById('gdprDecline').checked;
2703
+
2704
+ // Récupérer les informations conditionnelles
2705
+ let evaluatorName = "";
2706
+ let evaluatorRole = "";
2707
+ let expertiseLevel = "";
2708
+ let messageMastery = "";
2709
+
2710
+ if (gdprAccept) {
2711
+ evaluatorName = document.getElementById("evaluatorName").value.trim();
2712
+ evaluatorRole = document.getElementById("evaluatorRole").value;
2713
+ expertiseLevel = document.getElementById("expertiseLevel").value;
2714
+ messageMastery = document.getElementById("messageMastery").value;
2715
+ }
2716
+
2717
+ const comment = document.getElementById("trustComment").value;
2718
+ const msgDiv = document.getElementById("saveTrustMsg");
2719
+
2720
+ // Validation : consentement GDPR obligatoire
2721
+ if (!gdprAccept && !gdprDecline) {
2722
+ const message = "❌ Veuillez sélectionner une option de consentement RGPD.";
2723
+ console.error(message);
2724
+
2725
+ if (msgDiv) {
2726
+ msgDiv.textContent = message;
2727
+ msgDiv.style.background = "#FFEBEE";
2728
+ msgDiv.style.color = "#C62828";
2729
+ }
2730
+ return;
2731
+ }
2732
+
2733
+ // Validation : si GDPR accepté, vérifier les champs obligatoires
2734
+ if (gdprAccept) {
2735
+ if (!evaluatorName) {
2736
+ const message = "❌ Veuillez saisir votre nom et prénom.";
2737
+ console.error(message);
2738
+
2739
+ if (msgDiv) {
2740
+ msgDiv.textContent = message;
2741
+ msgDiv.style.background = "#FFEBEE";
2742
+ msgDiv.style.color = "#C62828";
2743
+ }
2744
+
2745
+ const nameField = document.getElementById("evaluatorName");
2746
+ nameField.style.borderColor = "#E53935";
2747
+ nameField.style.boxShadow = "0 0 0 3px rgba(229, 57, 53, 0.1)";
2748
+ nameField.focus();
2749
+
2750
+ setTimeout(() => {
2751
+ nameField.style.borderColor = "#e0e0e0";
2752
+ nameField.style.boxShadow = "none";
2753
+ }, 3000);
2754
+
2755
+ return;
2756
+ }
2757
+
2758
+ if (!evaluatorRole) {
2759
+ const message = "❌ Veuillez sélectionner votre rôle.";
2760
+ console.error(message);
2761
+
2762
+ if (msgDiv) {
2763
+ msgDiv.textContent = message;
2764
+ msgDiv.style.background = "#FFEBEE";
2765
+ msgDiv.style.color = "#C62828";
2766
+ }
2767
+ return;
2768
+ }
2769
+
2770
+ if (!expertiseLevel) {
2771
+ const message = "❌ Veuillez sélectionner votre niveau d'expertise en réflexivité.";
2772
+ console.error(message);
2773
+
2774
+ if (msgDiv) {
2775
+ msgDiv.textContent = message;
2776
+ msgDiv.style.background = "#FFEBEE";
2777
+ msgDiv.style.color = "#C62828";
2778
+ }
2779
+ return;
2780
+ }
2781
+
2782
+ if (!messageMastery) {
2783
+ const message = "❌ Veuillez sélectionner votre niveau de maîtrise des messages réflexifs.";
2784
+ console.error(message);
2785
+
2786
+ if (msgDiv) {
2787
+ msgDiv.textContent = message;
2788
+ msgDiv.style.background = "#FFEBEE";
2789
+ msgDiv.style.color = "#C62828";
2790
+ }
2791
+ return;
2792
+ }
2793
+ }
2794
+
2795
+ // Vérifier si au moins une évaluation
2796
+ let hasEvaluation = false;
2797
+ for (const metric in trustMetrics) {
2798
+ if (trustMetrics[metric] > 0) {
2799
+ hasEvaluation = true;
2800
+ break;
2801
+ }
2802
+ }
2803
+
2804
+ if (!hasEvaluation) {
2805
+ const message = "⚠️ Veuillez évaluer au moins une métrique avant de sauvegarder.";
2806
+ console.warn(message);
2807
+
2808
+ if (msgDiv) {
2809
+ msgDiv.textContent = message;
2810
+ msgDiv.style.background = "#FFF3E0";
2811
+ msgDiv.style.color = "#EF6C00";
2812
+ }
2813
+ return;
2814
+ }
2815
+
2816
+ // Calculer l'indice de confiance
2817
+ const trustScore = updateTrustBar(); // Cette fonction retourne le pourcentage
2818
+
2819
+ console.log(`Indice calculé pour sauvegarde: ${trustScore}%`);
2820
+
2821
+ // Préparer les données
2822
+ const data = {
2823
+ scenario_id: scenarios[currentScenarioIndex].id,
2824
+ scenario_title: scenarios[currentScenarioIndex].title,
2825
+ trust_metrics: {...trustMetrics},
2826
+ trust_score: trustScore,
2827
+ gdpr_consent: gdprAccept ? "accept" : "decline",
2828
+ evaluator_name: gdprAccept ? evaluatorName : null,
2829
+ evaluator_role: gdprAccept ? evaluatorRole : null,
2830
+ expertise_level: gdprAccept ? expertiseLevel : null,
2831
+ message_mastery: gdprAccept ? messageMastery : null,
2832
+ comment: comment || null,
2833
+ timestamp: new Date().toISOString(),
2834
+ trust_weights: {...trustWeights}
2835
+ };
2836
+
2837
+ console.log("Données à envoyer:", JSON.stringify(data, null, 2));
2838
+
2839
+ // Envoyer au serveur
2840
+ fetch("/save_trust", {
2841
+ method: "POST",
2842
+ headers: { "Content-Type": "application/json" },
2843
+ body: JSON.stringify(data)
2844
+ })
2845
+ .then(res => {
2846
+ if (!res.ok) throw new Error(`Erreur HTTP ${res.status}: ${res.statusText}`);
2847
+ return res.json();
2848
+ })
2849
+ .then(responseData => {
2850
+ console.log("✅ Réponse du serveur:", responseData);
2851
+
2852
+ if (msgDiv) {
2853
+ const nameDisplay = gdprAccept ? evaluatorName : "Évaluateur anonyme";
2854
+ msgDiv.innerHTML = `
2855
+ <div style="display: flex; align-items: center; gap: 10px;">
2856
+ <div style="font-size: 24px;">✅</div>
2857
+ <div>
2858
+ <strong>Évaluation sauvegardée avec succès !</strong><br>
2859
+ <small>Merci ${nameDisplay} pour votre contribution.</small><br>
2860
+ <small><em>Indice global: ${trustScore}%</em></small>
2861
+ </div>
2862
+ </div>
2863
+ `;
2864
+ msgDiv.style.background = "#E8F5E9";
2865
+ msgDiv.style.color = "#2E7D32";
2866
+ msgDiv.style.padding = "15px";
2867
+ }
2868
+
2869
+ // Réinitialiser après succès (optionnel)
2870
+ setTimeout(() => {
2871
+ resetTrustEvaluation();
2872
+ }, 3000);
2873
+ })
2874
+ .catch(error => {
2875
+ console.error("❌ Erreur de sauvegarde:", error);
2876
+ if (msgDiv) {
2877
+ msgDiv.textContent = `❌ Erreur: ${error.message}`;
2878
+ msgDiv.style.background = "#FFEBEE";
2879
+ msgDiv.style.color = "#C62828";
2880
+ }
2881
+ });
2882
+ };
2883
+
2884
+ console.log("✅ Bouton de sauvegarde initialisé");
2885
+ }
2886
+
2887
+ // Fonction pour réinitialiser l'évaluation
2888
+ function resetTrustEvaluation() {
2889
+ console.log("Réinitialisation de l'évaluation...");
2890
+
2891
+ // Réinitialiser les métriques
2892
+ for (const key in trustMetrics) {
2893
+ trustMetrics[key] = 0;
2894
+ }
2895
+
2896
+ // Réinitialiser les étoiles
2897
+ document.querySelectorAll(".stars").forEach(div => {
2898
+ Array.from(div.children).forEach(star => {
2899
+ star.classList.add("inactive");
2900
+ star.classList.remove("active");
2901
+ });
2902
+ });
2903
+
2904
+ // Réinitialiser la barre
2905
+ updateTrustBar();
2906
+
2907
+ // Vider le commentaire
2908
+ document.getElementById("trustComment").value = "";
2909
+
2910
+ console.log("Évaluation réinitialisée");
2911
+ }
2912
+
2913
+ // ================= FONCTIONS UTILITAIRES =================
2914
+
2915
+ // Mettre à jour les statistiques
2916
+ function updateStats() {
2917
+ if (!scenarios || scenarios.length === 0) return;
2918
+
2919
+ const currentScenario = scenarios[currentScenarioIndex];
2920
+
2921
+ document.getElementById("currentScenarioNum").textContent = currentScenario.id;
2922
+
2923
+ // Niveau de risque
2924
+ const risk = currentScenario.risk || 50;
2925
+ let riskLevel = "Moyen";
2926
+ let riskColor = "#FB8C00";
2927
+
2928
+ if (risk < 40) {
2929
+ riskLevel = "Faible";
2930
+ riskColor = "#43A047";
2931
+ } else if (risk > 70) {
2932
+ riskLevel = "Élevé";
2933
+ riskColor = "#E53935";
2934
+ }
2935
+
2936
+ document.getElementById("riskLevel").textContent = riskLevel;
2937
+ document.getElementById("riskLevel").style.color = riskColor;
2938
+
2939
+ // Activité moyenne à partir des données radar
2940
+ if (currentScenario.radar && currentScenario.radar.length > 0) {
2941
+ const avgRadar = currentScenario.radar.reduce((sum, item) => sum + item.value, 0) / currentScenario.radar.length;
2942
+ document.getElementById("avgActivity").textContent = Math.round(avgRadar) + "%";
2943
+ }
2944
+ }
2945
+
2946
+ // Fonction pour remplir un exemple d'évaluateur
2947
+ function fillSampleEvaluator() {
2948
+ // Sélectionner l'option GDPR "accept"
2949
+ document.getElementById('gdprAccept').checked = true;
2950
+ document.getElementById('gdprDecline').checked = false;
2951
+
2952
+ // Mettre à jour les champs
2953
+ initGDPR();
2954
+
2955
+ // Remplir les champs
2956
+ document.getElementById("evaluatorName").value = "Martin Sophie";
2957
+ document.getElementById("evaluatorRole").value = "enseignant";
2958
+ document.getElementById("expertiseLevel").value = "avance";
2959
+ document.getElementById("messageMastery").value = "intermediaire_msg";
2960
+
2961
+ showNotification("Exemple", "Champs d'évaluateur remplis avec un exemple", "info");
2962
+ }
2963
+
2964
+ // Fonction pour effacer les champs évaluateur
2965
+ function clearEvaluatorFields() {
2966
+ // Sélectionner l'option GDPR "decline" par défaut
2967
+ document.getElementById('gdprDecline').checked = true;
2968
+ document.getElementById('gdprAccept').checked = false;
2969
+
2970
+ // Mettre à jour les champs
2971
+ initGDPR();
2972
+
2973
+ showNotification("Champs effacés", "Les informations d'évaluateur ont été effacées", "info");
2974
+ }
2975
+
2976
+ // Fonction pour afficher une notification
2977
+ function showNotification(title, message, type = "info") {
2978
+ console.log(`[${type}] ${title}: ${message}`);
2979
+
2980
+ const msgDiv = document.getElementById("saveTrustMsg");
2981
+ if (msgDiv) {
2982
+ msgDiv.textContent = `${title}: ${message}`;
2983
+ msgDiv.style.background = type === "success" ? "#E8F5E9" :
2984
+ type === "error" ? "#FFEBEE" : "#E3F2FD";
2985
+ msgDiv.style.color = type === "success" ? "#2E7D32" :
2986
+ type === "error" ? "#C62828" : "#1565C0";
2987
+ }
2988
+ }
2989
+
2990
+ // Fonction de test
2991
+ window.testTrustMetrics = function() {
2992
+ console.log("=== TEST MÉTRIQUES DE CONFIANCE ===");
2993
+
2994
+ // Tester quelques combinaisons
2995
+ const tests = [
2996
+ { nom: "Parfait", valeurs: { AR: 5, AE: 5, ESR: 5, SDM: 5, SM: 5 } },
2997
+ { nom: "Moyen", valeurs: { AR: 3, AE: 3, ESR: 3, SDM: 3, SM: 3 } },
2998
+ { nom: "Faible", valeurs: { AR: 1, AE: 2, ESR: 1, SDM: 2, SM: 1 } },
2999
+ { nom: "Mixte", valeurs: { AR: 5, AE: 4, ESR: 3, SDM: 2, SM: 1 } }
3000
+ ];
3001
+
3002
+ tests.forEach(test => {
3003
+ console.log(`\nTest: ${test.nom}`);
3004
+
3005
+ // Appliquer les valeurs
3006
+ for (const metric in test.valeurs) {
3007
+ if (trustMetrics.hasOwnProperty(metric)) {
3008
+ trustMetrics[metric] = test.valeurs[metric];
3009
+ }
3010
+ }
3011
+
3012
+ // Calculer
3013
+ const score = updateTrustBar();
3014
+ console.log(`Résultat: ${score}%`);
3015
+
3016
+ // Réinitialiser pour le prochain test
3017
+ for (const metric in trustMetrics) {
3018
+ trustMetrics[metric] = 0;
3019
+ }
3020
+ });
3021
+
3022
+ console.log("=== FIN TESTS ===");
3023
+ };
3024
+
3025
+ // Exposer les fonctions globales
3026
+ window.changePersistenceAnalysis = changePersistenceAnalysis;
3027
+ window.drawEnrichedHeatmap = drawEnrichedHeatmap;
3028
+ window.updateStats = updateStats;
3029
+ window.showNotification = showNotification;
3030
+ window.fillSampleEvaluator = fillSampleEvaluator;
3031
+ window.clearEvaluatorFields = clearEvaluatorFields;
3032
+ window.updateRadarMetricsGrid = updateRadarMetricsGrid;
3033
+ </script>
3034
+
3035
+ </body>
3036
+ </html>