Spaces:
Sleeping
Sleeping
JACINTO VELASCO commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -125,6 +125,15 @@ def main():
|
|
| 125 |
porcentaje = round((correctas / total) * 100, 1) if total > 0 else 0
|
| 126 |
st.metric("Respuestas correctas", f"{correctas} ({porcentaje}%)")
|
| 127 |
st.metric("Respondidas", total)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
|
| 129 |
if st.session_state.current < len(questions):
|
| 130 |
real_index = st.session_state.shuffled_indices[st.session_state.current]
|
|
|
|
| 125 |
porcentaje = round((correctas / total) * 100, 1) if total > 0 else 0
|
| 126 |
st.metric("Respuestas correctas", f"{correctas} ({porcentaje}%)")
|
| 127 |
st.metric("Respondidas", total)
|
| 128 |
+
# Estadísticas siempre visibles
|
| 129 |
+
if 'history' in st.session_state and st.session_state.history:
|
| 130 |
+
df_temp = pd.DataFrame(st.session_state.history)
|
| 131 |
+
df_temp["incorrecto"] = ~df_temp["correcto"]
|
| 132 |
+
resumen = df_temp.groupby("tipo")[["correcto", "incorrecto"]].sum()
|
| 133 |
+
resumen["total"] = resumen["correcto"] + resumen["incorrecto"]
|
| 134 |
+
resumen["% acierto"] = (resumen["correcto"] / resumen["total"] * 100).round(1)
|
| 135 |
+
st.markdown("#### Resumen por tipo")
|
| 136 |
+
st.dataframe(resumen[["% acierto"]], height=200)
|
| 137 |
|
| 138 |
if st.session_state.current < len(questions):
|
| 139 |
real_index = st.session_state.shuffled_indices[st.session_state.current]
|