Spaces:
Sleeping
Sleeping
Shreeti Shrestha
commited on
Commit
·
020091c
1
Parent(s):
393ff97
adding pre-quiz stats
Browse files
pages/prequiz_results.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import pandas as pd
|
| 3 |
import time
|
|
|
|
| 4 |
|
| 5 |
df = pd.read_csv("./LSATLR_questions.csv")
|
| 6 |
df['qid'] = df['qid'].astype(int)
|
|
@@ -9,6 +10,21 @@ prequiz_qs = df[df['qid'] < 0].sort_values(by='qid', ascending=False).reset_inde
|
|
| 9 |
st.title("Pre-Quiz")
|
| 10 |
st.write("Results:")
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
def response_to_idx(response, row):
|
| 13 |
if response == row['A']:
|
| 14 |
return 0
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import pandas as pd
|
| 3 |
import time
|
| 4 |
+
import altair as alt
|
| 5 |
|
| 6 |
df = pd.read_csv("./LSATLR_questions.csv")
|
| 7 |
df['qid'] = df['qid'].astype(int)
|
|
|
|
| 10 |
st.title("Pre-Quiz")
|
| 11 |
st.write("Results:")
|
| 12 |
|
| 13 |
+
def display_pre_quiz():
|
| 14 |
+
source = st.session_state.prequiz_df
|
| 15 |
+
if source is not None and len(source) > 0:
|
| 16 |
+
st.write("Pre-Quiz Results: \n")
|
| 17 |
+
source["Performance"] = source["num_correct"] / source["num_questions"] * 100
|
| 18 |
+
source = source.sort_values(by='Performance', ascending=False)
|
| 19 |
+
c = alt.Chart(source).mark_bar().encode(y=alt.Y("Subtopic", sort=None), x=alt.X(
|
| 20 |
+
"Performance",
|
| 21 |
+
scale=alt.Scale(domain=[0, 100]),
|
| 22 |
+
axis=alt.Axis(values=[0, 25, 50, 75, 100], title="Performance (%)")
|
| 23 |
+
))
|
| 24 |
+
st.altair_chart(c,use_container_width=True)
|
| 25 |
+
|
| 26 |
+
display_pre_quiz()
|
| 27 |
+
|
| 28 |
def response_to_idx(response, row):
|
| 29 |
if response == row['A']:
|
| 30 |
return 0
|
utils/__pycache__/conceptexcerpts.cpython-311.pyc
DELETED
|
Binary file (14 kB)
|
|
|
utils/__pycache__/exampleexcerpts.cpython-311.pyc
DELETED
|
Binary file (18.8 kB)
|
|
|
utils/__pycache__/firebase_util.cpython-311.pyc
DELETED
|
Binary file (3.6 kB)
|
|
|
utils/__pycache__/questions_dataset.cpython-311.pyc
DELETED
|
Binary file (4.57 kB)
|
|
|