Spaces:
Runtime error
Runtime error
danielraynaud
commited on
Update performance_analyzer.py
Browse files- performance_analyzer.py +6 -6
performance_analyzer.py
CHANGED
@@ -9,11 +9,11 @@ class PerformanceAnalyzer:
|
|
9 |
try:
|
10 |
cursor = self.conn.cursor()
|
11 |
cursor.execute('''
|
12 |
-
SELECT topic, AVG(performance_score) as avg_score
|
13 |
-
FROM study_progress
|
14 |
WHERE user_id = ?
|
15 |
GROUP BY topic
|
16 |
-
|
17 |
return dict(cursor.fetchall())
|
18 |
except Exception as e:
|
19 |
logging.error(f"Erro ao analisar performance: {e}")
|
@@ -23,12 +23,12 @@ class PerformanceAnalyzer:
|
|
23 |
try:
|
24 |
cursor = self.conn.cursor()
|
25 |
cursor.execute('''
|
26 |
-
SELECT topic
|
27 |
FROM study_progress
|
28 |
WHERE user_id = ? AND performance_score < 70
|
29 |
GROUP BY topic
|
30 |
-
|
31 |
-
return [row[
|
32 |
except Exception as e:
|
33 |
logging.error(f"Erro ao buscar áreas fracas: {e}")
|
34 |
return []
|
|
|
9 |
try:
|
10 |
cursor = self.conn.cursor()
|
11 |
cursor.execute('''
|
12 |
+
SELECT topic, AVG(performance_score) as avg_score
|
13 |
+
FROM study_progress
|
14 |
WHERE user_id = ?
|
15 |
GROUP BY topic
|
16 |
+
''', (user_id,))
|
17 |
return dict(cursor.fetchall())
|
18 |
except Exception as e:
|
19 |
logging.error(f"Erro ao analisar performance: {e}")
|
|
|
23 |
try:
|
24 |
cursor = self.conn.cursor()
|
25 |
cursor.execute('''
|
26 |
+
SELECT topic
|
27 |
FROM study_progress
|
28 |
WHERE user_id = ? AND performance_score < 70
|
29 |
GROUP BY topic
|
30 |
+
''', (user_id,))
|
31 |
+
return [row[0] for row in cursor.fetchall()]
|
32 |
except Exception as e:
|
33 |
logging.error(f"Erro ao buscar áreas fracas: {e}")
|
34 |
return []
|