Spaces:
Sleeping
Sleeping
import streamlit as st | |
import altair as alt | |
import pandas as pd | |
from plots import altair_gauge, pred_bar_chart | |
import streamlit.components.v1 as components | |
md_about_qual = ''' | |
The Quality of Assessment for Learning (QuAL) score measures three | |
components of high-quality feedback via three subscores: | |
1. A detailed description of the behavior observed (rated 0-3 depending on detail level) | |
2. A suggestion for improvement is present (rated no = 0, yes = 1) | |
3. Linkage between the behavior and the suggestion is present (rated no = 0, yes = 1) | |
The final QuAL score is the sum of these subscores, so it ranges from 0 (lowest quality) | |
to 5 (highest quality). | |
''' | |
class NQDFullReport(object): | |
def __init__(self, parent : st, results : dict): | |
self.p = parent | |
self.results = results | |
def draw(self): | |
st = self.p | |
st.header('Understand Your Score') | |
st.subheader('About the QuAL Score') | |
# with st.expander('About the QuAL Score', True): | |
st.markdown(md_about_qual) | |
st.subheader('Level of Detail') | |
c1, c2 = st.columns(2) | |
with c1: | |
gauge = altair_gauge(self.results['q1']['label'], 3, 'Level of Detail') | |
gauge_html = gauge.to_html() | |
# components.html(gauge_html, height=225, width=334) | |
st.altair_chart(gauge, use_container_width=True) | |
with c2: | |
bar = pred_bar_chart(self.results['q1']['scores']) | |
st.altair_chart(bar, use_container_width=True) | |
st.subheader('Suggestion for Improvement') | |
c1, c2 = st.columns(2) | |
with c1: | |
q2lab = self.results['q2i']['label'] | |
st.markdown('#### Suggestion Given') | |
if q2lab == 0: | |
md_str = '# β Yes' | |
else: | |
md_str = '# β No' | |
st.markdown(md_str) | |
# st.metric('Suggestion Given', (md_str), | |
# help='Did the evaluator give a suggestion for improvement?') | |
gauge = altair_gauge(self.results['q2i']['label'], 1, 'Suggestion for Improvement') | |
# st.altair_chart(gauge, use_container_width=True) | |
with c2: | |
bar = pred_bar_chart(self.results['q2i']['scores'], binary_labels={0: 'Yes', 1: 'No'}) | |
st.altair_chart(bar, use_container_width=True) | |
st.subheader('Suggestion Linking') | |
c1, c2 = st.columns(2) | |
with c1: | |
q2lab = self.results['q3i']['label'] | |
st.markdown('#### Suggestion Linked') | |
if q2lab == 0: | |
md_str = '# β Yes' | |
else: | |
md_str = '# β No' | |
st.markdown(md_str) | |
# st.metric('Suggestion Given', (md_str), | |
# help='Did the evaluator give a suggestion for improvement?') | |
gauge = altair_gauge(self.results['q3i']['label'], 1, 'Suggestion for Improvement') | |
# st.altair_chart(gauge, use_container_width=True) | |
with c2: | |
bar = pred_bar_chart(self.results['q3i']['scores'], binary_labels={0: 'Yes', 1: 'No'}) | |
st.altair_chart(bar, use_container_width=True) | |