Update app.py
Browse files
app.py
CHANGED
|
@@ -212,10 +212,10 @@ def main():
|
|
| 212 |
intervention_frequency = intervention_stats['Intervention Frequency (%)'].values[0]
|
| 213 |
# Display the "Intervention Frequency (%)" text
|
| 214 |
# st.markdown("<h3 style='color: #358E66;'>Intervention Frequency</h3>", unsafe_allow_html=True)
|
| 215 |
-
st.markdown("<h3 style='color: #358E66; margin-bottom: 0px;'>Intervention Frequency</h3>",unsafe_allow_html=True)
|
| 216 |
# Display the frequency value below it
|
| 217 |
# st.markdown(f"<h1 style='color: #358E66;'>{intervention_frequency}%</h1>", unsafe_allow_html=True)
|
| 218 |
-
st.markdown(f"<h1 style='color: #358E66; margin-top: 0px;'>{intervention_frequency}%</h1>", unsafe_allow_html=True)
|
| 219 |
|
| 220 |
# Add download button for Intervention Session Statistics chart
|
| 221 |
download_chart(intervention_fig, "intervention_statistics_chart.png")
|
|
@@ -246,9 +246,9 @@ def main():
|
|
| 246 |
st.markdown("<h2 style='color: #358E66;'>N/A</h2>", unsafe_allow_html=True)
|
| 247 |
|
| 248 |
# Display the "Engagement Average (%)" text and value
|
| 249 |
-
st.markdown("<h4 style='color: #358E66;'>Engagement Average (%)</h4>", unsafe_allow_html=True)
|
| 250 |
if engagement_avg_stats is not None:
|
| 251 |
-
st.markdown(f"<h2 style='color: #358E66; margin-top: 0px;'>{engagement_avg_stats}%</h2>", unsafe_allow_html=True)
|
| 252 |
else:
|
| 253 |
st.markdown("<h2 style='color: #358E66;'>N/A</h2>", unsafe_allow_html=True)
|
| 254 |
|
|
@@ -474,6 +474,22 @@ def plot_student_metrics(student_metrics_df):
|
|
| 474 |
ax.text(bar.get_x() + bar.get_width() / 2, height,
|
| 475 |
f'{height:.0f}%', ha='center', va='bottom', color='black') # No decimal for integer percentage
|
| 476 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 477 |
# Set labels, title, and legend
|
| 478 |
ax.set_xlabel('Student')
|
| 479 |
ax.set_ylabel('Percentage (%)')
|
|
|
|
| 212 |
intervention_frequency = intervention_stats['Intervention Frequency (%)'].values[0]
|
| 213 |
# Display the "Intervention Frequency (%)" text
|
| 214 |
# st.markdown("<h3 style='color: #358E66;'>Intervention Frequency</h3>", unsafe_allow_html=True)
|
| 215 |
+
st.markdown("<h3 style='color: #358E66; margin-bottom: 0px; margin-bottom: 0px;'>Intervention Frequency</h3>",unsafe_allow_html=True)
|
| 216 |
# Display the frequency value below it
|
| 217 |
# st.markdown(f"<h1 style='color: #358E66;'>{intervention_frequency}%</h1>", unsafe_allow_html=True)
|
| 218 |
+
st.markdown(f"<h1 style='color: #358E66; margin-top: 0px; margin-bottom: 0px;'>{intervention_frequency}%</h1>", unsafe_allow_html=True)
|
| 219 |
|
| 220 |
# Add download button for Intervention Session Statistics chart
|
| 221 |
download_chart(intervention_fig, "intervention_statistics_chart.png")
|
|
|
|
| 246 |
st.markdown("<h2 style='color: #358E66;'>N/A</h2>", unsafe_allow_html=True)
|
| 247 |
|
| 248 |
# Display the "Engagement Average (%)" text and value
|
| 249 |
+
st.markdown("<h4 style='color: #358E66; margin-top: 0px; margin-bottom: 0px;'>Engagement Average (%)</h4>", unsafe_allow_html=True)
|
| 250 |
if engagement_avg_stats is not None:
|
| 251 |
+
st.markdown(f"<h2 style='color: #358E66; margin-top: 0px; margin-bottom: 0px;'>{engagement_avg_stats}%</h2>", unsafe_allow_html=True)
|
| 252 |
else:
|
| 253 |
st.markdown("<h2 style='color: #358E66;'>N/A</h2>", unsafe_allow_html=True)
|
| 254 |
|
|
|
|
| 474 |
ax.text(bar.get_x() + bar.get_width() / 2, height,
|
| 475 |
f'{height:.0f}%', ha='center', va='bottom', color='black') # No decimal for integer percentage
|
| 476 |
|
| 477 |
+
# Add average lines for attendance and engagement
|
| 478 |
+
ax.axhline(
|
| 479 |
+
y=attendance_avg_stats,
|
| 480 |
+
color='#005288',
|
| 481 |
+
linestyle='--',
|
| 482 |
+
linewidth=1.5,
|
| 483 |
+
label=f'Attendance Average: {attendance_avg_stats}%'
|
| 484 |
+
)
|
| 485 |
+
ax.axhline(
|
| 486 |
+
y=engagement_avg_stats,
|
| 487 |
+
color='#3AB0FF',
|
| 488 |
+
linestyle='--',
|
| 489 |
+
linewidth=1.5,
|
| 490 |
+
label=f'Engagement Average: {engagement_avg_stats}%'
|
| 491 |
+
)
|
| 492 |
+
|
| 493 |
# Set labels, title, and legend
|
| 494 |
ax.set_xlabel('Student')
|
| 495 |
ax.set_ylabel('Percentage (%)')
|