File size: 3,128 Bytes
f58c9c5
 
 
1bb3e7f
 
f58c9c5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1bb3e7f
f58c9c5
 
1bb3e7f
 
 
f58c9c5
 
1bb3e7f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f58c9c5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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)