Spaces:
Sleeping
Sleeping
Commit
ยท
9f5efd9
1
Parent(s):
ac75410
time data
Browse files- app.py +1 -1
- pages/llm_tutor.py +5 -0
- pages/postquiz.py +6 -1
- pages/prequiz.py +6 -1
- pages/textbook.py +5 -0
- utils/__pycache__/conceptexcerpts.cpython-311.pyc +0 -0
- utils/__pycache__/exampleexcerpts.cpython-311.pyc +0 -0
- utils/__pycache__/firebase_util.cpython-311.pyc +0 -0
- utils/__pycache__/questions_dataset.cpython-311.pyc +0 -0
- utils/firebase_util.py +12 -2
app.py
CHANGED
@@ -7,7 +7,7 @@ st.title("LSATLR Study")
|
|
7 |
st.write("""Welcome to our Study! The guidelines are as follows:
|
8 |
1. We'll start with a short survey followed by a pre-quiz of LSAT Logical Reasoning questions
|
9 |
2. Then you'll be assigned to a learning session based on your group (A or B)
|
10 |
-
3. Use the "Click here when finished" to end session once you're done
|
11 |
4. You'll then be directed to a post-quiz to review concepts learnt
|
12 |
5. The study ends with a post survey to assess general experience
|
13 |
6. You're expected to complete steps 1 - 5 in one sitting
|
|
|
7 |
st.write("""Welcome to our Study! The guidelines are as follows:
|
8 |
1. We'll start with a short survey followed by a pre-quiz of LSAT Logical Reasoning questions
|
9 |
2. Then you'll be assigned to a learning session based on your group (A or B)
|
10 |
+
3. Use the "Click here when finished" to end session once you're done
|
11 |
4. You'll then be directed to a post-quiz to review concepts learnt
|
12 |
5. The study ends with a post survey to assess general experience
|
13 |
6. You're expected to complete steps 1 - 5 in one sitting
|
pages/llm_tutor.py
CHANGED
@@ -3,6 +3,8 @@ import streamlit as st
|
|
3 |
from utils.questions_dataset import system_instruction, get_model_tools
|
4 |
from google.genai import types
|
5 |
from google import genai
|
|
|
|
|
6 |
|
7 |
st.set_page_config(page_title="LSAT Group A", page_icon="๐")
|
8 |
|
@@ -95,4 +97,7 @@ if user_input:
|
|
95 |
st.session_state.gemini_history = st.session_state.chat.get_history()
|
96 |
|
97 |
if next_btn:
|
|
|
|
|
|
|
98 |
st.switch_page("pages/postquiz.py")
|
|
|
3 |
from utils.questions_dataset import system_instruction, get_model_tools
|
4 |
from google.genai import types
|
5 |
from google import genai
|
6 |
+
import time
|
7 |
+
from utils.firebase_util import push_study_time_data
|
8 |
|
9 |
st.set_page_config(page_title="LSAT Group A", page_icon="๐")
|
10 |
|
|
|
97 |
st.session_state.gemini_history = st.session_state.chat.get_history()
|
98 |
|
99 |
if next_btn:
|
100 |
+
print(time.time())
|
101 |
+
print(st.session_state.tutor_start_time)
|
102 |
+
push_study_time_data(time.time() - st.session_state.tutor_start_time)
|
103 |
st.switch_page("pages/postquiz.py")
|
pages/postquiz.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
import pandas as pd
|
3 |
from utils.firebase_util import push_postquiz_data
|
|
|
4 |
|
5 |
df = pd.read_csv("./LSATLR_questions.csv")
|
6 |
df['qid'] = df['qid'].astype(int)
|
@@ -20,6 +21,7 @@ for index, row in postquiz_qs.iterrows():
|
|
20 |
st.divider()
|
21 |
|
22 |
def on_submit():
|
|
|
23 |
corr = []
|
24 |
for index, row in postquiz_qs.iterrows():
|
25 |
correct_answer = row[row['Correct Ans.']]
|
@@ -29,7 +31,7 @@ def on_submit():
|
|
29 |
corr.append(0)
|
30 |
postquiz_qs['Correct'] = corr
|
31 |
postquiz_qs.groupby('Subtopic').agg(num_correct=('Correct', 'sum'), num_questions=('Correct', 'count')).reset_index()
|
32 |
-
push_postquiz_data(corr)
|
33 |
st.switch_page("pages/postsurvey.py")
|
34 |
|
35 |
|
@@ -38,3 +40,6 @@ btn = st.button("Submit")
|
|
38 |
|
39 |
if btn:
|
40 |
on_submit()
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
import pandas as pd
|
3 |
from utils.firebase_util import push_postquiz_data
|
4 |
+
import time
|
5 |
|
6 |
df = pd.read_csv("./LSATLR_questions.csv")
|
7 |
df['qid'] = df['qid'].astype(int)
|
|
|
21 |
st.divider()
|
22 |
|
23 |
def on_submit():
|
24 |
+
duration = time.time() - st.session_state.postquiz_start_time
|
25 |
corr = []
|
26 |
for index, row in postquiz_qs.iterrows():
|
27 |
correct_answer = row[row['Correct Ans.']]
|
|
|
31 |
corr.append(0)
|
32 |
postquiz_qs['Correct'] = corr
|
33 |
postquiz_qs.groupby('Subtopic').agg(num_correct=('Correct', 'sum'), num_questions=('Correct', 'count')).reset_index()
|
34 |
+
push_postquiz_data(corr, duration)
|
35 |
st.switch_page("pages/postsurvey.py")
|
36 |
|
37 |
|
|
|
40 |
|
41 |
if btn:
|
42 |
on_submit()
|
43 |
+
|
44 |
+
|
45 |
+
st.session_state.postquiz_start_time = time.time()
|
pages/prequiz.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
import pandas as pd
|
3 |
from utils.firebase_util import push_prequiz_data
|
|
|
4 |
|
5 |
df = pd.read_csv("./LSATLR_questions.csv")
|
6 |
df['qid'] = df['qid'].astype(int)
|
@@ -20,6 +21,7 @@ for index, row in prequiz_qs.iterrows():
|
|
20 |
st.divider()
|
21 |
|
22 |
def on_submit():
|
|
|
23 |
corr = []
|
24 |
for index, row in prequiz_qs.iterrows():
|
25 |
correct_answer = row[row['Correct Ans.']]
|
@@ -30,10 +32,12 @@ def on_submit():
|
|
30 |
prequiz_qs['Correct'] = corr
|
31 |
pqq_processed = prequiz_qs.groupby('Subtopic').agg(num_correct=('Correct', 'sum'), num_questions=('Correct', 'count')).reset_index()
|
32 |
st.session_state.prequiz_df = pqq_processed
|
33 |
-
push_prequiz_data(corr)
|
34 |
if st.session_state.group_id == "A":
|
|
|
35 |
st.switch_page("pages/llm_tutor.py")
|
36 |
else:
|
|
|
37 |
st.switch_page("pages/textbook.py")
|
38 |
|
39 |
|
@@ -42,3 +46,4 @@ btn = st.button("Submit")
|
|
42 |
if btn:
|
43 |
on_submit()
|
44 |
|
|
|
|
1 |
import streamlit as st
|
2 |
import pandas as pd
|
3 |
from utils.firebase_util import push_prequiz_data
|
4 |
+
import time
|
5 |
|
6 |
df = pd.read_csv("./LSATLR_questions.csv")
|
7 |
df['qid'] = df['qid'].astype(int)
|
|
|
21 |
st.divider()
|
22 |
|
23 |
def on_submit():
|
24 |
+
duration = time.time() - st.session_state.prequiz_start_time
|
25 |
corr = []
|
26 |
for index, row in prequiz_qs.iterrows():
|
27 |
correct_answer = row[row['Correct Ans.']]
|
|
|
32 |
prequiz_qs['Correct'] = corr
|
33 |
pqq_processed = prequiz_qs.groupby('Subtopic').agg(num_correct=('Correct', 'sum'), num_questions=('Correct', 'count')).reset_index()
|
34 |
st.session_state.prequiz_df = pqq_processed
|
35 |
+
push_prequiz_data(corr, duration)
|
36 |
if st.session_state.group_id == "A":
|
37 |
+
st.session_state.tutor_start_time = time.time()
|
38 |
st.switch_page("pages/llm_tutor.py")
|
39 |
else:
|
40 |
+
st.session_state.textbook_start_time = time.time()
|
41 |
st.switch_page("pages/textbook.py")
|
42 |
|
43 |
|
|
|
46 |
if btn:
|
47 |
on_submit()
|
48 |
|
49 |
+
st.session_state.prequiz_start_time = time.time()
|
pages/textbook.py
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
import streamlit as st
|
2 |
from utils.conceptexcerpts import concept_excerpts
|
3 |
from utils.exampleexcerpts import example_excerpts
|
|
|
|
|
4 |
|
5 |
st.set_page_config(page_title="LSAT Group B", page_icon="๐")
|
6 |
st.title("๐Logical Reasoning: Group B")
|
@@ -29,6 +31,9 @@ if st.checkbox("Show Answer"):
|
|
29 |
next_page = st.button("Click here when finished")
|
30 |
|
31 |
if next_page:
|
|
|
|
|
|
|
32 |
st.switch_page("pages/postquiz.py")
|
33 |
|
34 |
|
|
|
1 |
import streamlit as st
|
2 |
from utils.conceptexcerpts import concept_excerpts
|
3 |
from utils.exampleexcerpts import example_excerpts
|
4 |
+
import time
|
5 |
+
from utils.firebase_util import push_study_time_data
|
6 |
|
7 |
st.set_page_config(page_title="LSAT Group B", page_icon="๐")
|
8 |
st.title("๐Logical Reasoning: Group B")
|
|
|
31 |
next_page = st.button("Click here when finished")
|
32 |
|
33 |
if next_page:
|
34 |
+
print(time.time())
|
35 |
+
print(st.session_state.textbook_start_time)
|
36 |
+
push_study_time_data(time.time() - st.session_state.textbook_start_time)
|
37 |
st.switch_page("pages/postquiz.py")
|
38 |
|
39 |
|
utils/__pycache__/conceptexcerpts.cpython-311.pyc
ADDED
Binary file (14 kB). View file
|
|
utils/__pycache__/exampleexcerpts.cpython-311.pyc
ADDED
Binary file (18.8 kB). View file
|
|
utils/__pycache__/firebase_util.cpython-311.pyc
ADDED
Binary file (3.6 kB). View file
|
|
utils/__pycache__/questions_dataset.cpython-311.pyc
ADDED
Binary file (4.57 kB). View file
|
|
utils/firebase_util.py
CHANGED
@@ -36,7 +36,7 @@ def push_postsurvey_data(q1, q2, q3, q4, q5, q6, q7, q8, q9):
|
|
36 |
'q9': q9
|
37 |
})
|
38 |
|
39 |
-
def push_prequiz_data(prequiz_correct):
|
40 |
ref = db.reference('prequiz')
|
41 |
ref.push({
|
42 |
'name': st.session_state.name,
|
@@ -51,9 +51,10 @@ def push_prequiz_data(prequiz_correct):
|
|
51 |
'q8': prequiz_correct[7],
|
52 |
'q9': prequiz_correct[8],
|
53 |
'q10': prequiz_correct[9],
|
|
|
54 |
})
|
55 |
|
56 |
-
def push_postquiz_data(postquiz_correct):
|
57 |
ref = db.reference('postquiz')
|
58 |
ref.push({
|
59 |
'name': st.session_state.name,
|
@@ -68,4 +69,13 @@ def push_postquiz_data(postquiz_correct):
|
|
68 |
'q8': postquiz_correct[7],
|
69 |
'q9': postquiz_correct[8],
|
70 |
'q10': postquiz_correct[9],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
})
|
|
|
36 |
'q9': q9
|
37 |
})
|
38 |
|
39 |
+
def push_prequiz_data(prequiz_correct, duration):
|
40 |
ref = db.reference('prequiz')
|
41 |
ref.push({
|
42 |
'name': st.session_state.name,
|
|
|
51 |
'q8': prequiz_correct[7],
|
52 |
'q9': prequiz_correct[8],
|
53 |
'q10': prequiz_correct[9],
|
54 |
+
'time': duration
|
55 |
})
|
56 |
|
57 |
+
def push_postquiz_data(postquiz_correct, duration):
|
58 |
ref = db.reference('postquiz')
|
59 |
ref.push({
|
60 |
'name': st.session_state.name,
|
|
|
69 |
'q8': postquiz_correct[7],
|
70 |
'q9': postquiz_correct[8],
|
71 |
'q10': postquiz_correct[9],
|
72 |
+
'time': duration
|
73 |
+
})
|
74 |
+
|
75 |
+
def push_study_time_data(duration):
|
76 |
+
ref = db.reference('study_time')
|
77 |
+
ref.push({
|
78 |
+
'name': st.session_state.name,
|
79 |
+
'group_id': st.session_state.group_id,
|
80 |
+
'time': duration
|
81 |
})
|