Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -220,25 +220,30 @@ class ReportGenerator:
|
|
220 |
"""Cria o gráfico de ranking completo dos alunos."""
|
221 |
plt.figure(figsize=(15, max(10, len(self.data) * 0.4)))
|
222 |
students_data = self.data.sort_values('Acertos Absolutos', ascending=True)
|
223 |
-
|
224 |
colors = [self.colors[nivel] for nivel in students_data['Nível']]
|
225 |
bars = plt.barh(range(len(students_data)), students_data['Acertos Absolutos'])
|
226 |
-
|
227 |
for bar, color in zip(bars, colors):
|
228 |
bar.set_color(color)
|
229 |
bar.set_alpha(0.8)
|
230 |
|
231 |
plt.yticks(range(len(students_data)), students_data['Nome do Aluno'],
|
232 |
fontsize=10)
|
233 |
-
|
234 |
-
|
235 |
-
|
|
|
|
|
236 |
va='center', fontsize=10, fontweight='bold')
|
237 |
-
|
238 |
plt.title('Ranking Completo - Acertos Absolutos', pad=20)
|
239 |
plt.xlabel('Número de Acertos')
|
240 |
plt.grid(True, axis='x', alpha=0.3)
|
241 |
-
|
|
|
|
|
|
|
242 |
return plt.gcf()
|
243 |
|
244 |
def create_time_performance_plot(self) -> plt.Figure:
|
|
|
220 |
"""Cria o gráfico de ranking completo dos alunos."""
|
221 |
plt.figure(figsize=(15, max(10, len(self.data) * 0.4)))
|
222 |
students_data = self.data.sort_values('Acertos Absolutos', ascending=True)
|
223 |
+
|
224 |
colors = [self.colors[nivel] for nivel in students_data['Nível']]
|
225 |
bars = plt.barh(range(len(students_data)), students_data['Acertos Absolutos'])
|
226 |
+
|
227 |
for bar, color in zip(bars, colors):
|
228 |
bar.set_color(color)
|
229 |
bar.set_alpha(0.8)
|
230 |
|
231 |
plt.yticks(range(len(students_data)), students_data['Nome do Aluno'],
|
232 |
fontsize=10)
|
233 |
+
|
234 |
+
# Adicionar texto com acertos e número total de tarefas
|
235 |
+
for i, (bar, tarefas) in enumerate(zip(bars, students_data['Tarefas Completadas'])):
|
236 |
+
plt.text(bar.get_width(), i,
|
237 |
+
f' {bar.get_width():.0f} acertos / {tarefas:.0f} tarefas',
|
238 |
va='center', fontsize=10, fontweight='bold')
|
239 |
+
|
240 |
plt.title('Ranking Completo - Acertos Absolutos', pad=20)
|
241 |
plt.xlabel('Número de Acertos')
|
242 |
plt.grid(True, axis='x', alpha=0.3)
|
243 |
+
|
244 |
+
# Ajustar margens para acomodar o texto adicional
|
245 |
+
plt.margins(x=0.2)
|
246 |
+
|
247 |
return plt.gcf()
|
248 |
|
249 |
def create_time_performance_plot(self) -> plt.Figure:
|