danielraynaud commited on
Commit
b792ac5
·
verified ·
1 Parent(s): a25294a

Update performance_analyzer.py

Browse files
Files changed (1) hide show
  1. 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
- ''', (user_id,))
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
- ''', (user_id,))
31
- return [row['topic'] for row in cursor.fetchall()]
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 []