shreypatel19 commited on
Commit
77708a2
·
1 Parent(s): dd1981b

added buttons to move on in textbook and ai sections

Browse files
data/1744318794.032495-gemini_messages ADDED
Binary file (1.77 kB). View file
 
data/1744318794.032495-st_messages ADDED
Binary file (735 Bytes). View file
 
data/1744319656.5895352-gemini_messages ADDED
Binary file (3.04 kB). View file
 
data/1744319656.5895352-st_messages ADDED
Binary file (1.21 kB). View file
 
data/past_chats_list CHANGED
Binary files a/data/past_chats_list and b/data/past_chats_list differ
 
pages/llm_tutor.py CHANGED
@@ -52,6 +52,10 @@ with st.sidebar:
52
 
53
 
54
  st.write('# Chat with LSAT Tutor')
 
 
 
 
55
 
56
  # Chat history (allows to ask multiple questions)
57
  try:
@@ -66,11 +70,30 @@ except:
66
  st.session_state.gemini_history = []
67
  print('new_cache made')
68
 
69
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  st.session_state.chat = client.chats.create(model='gemini-2.0-flash',
71
  config=types.GenerateContentConfig(
72
  tools=[get_model_tools()],
73
- system_instruction=system_instruction),
74
  history=st.session_state.gemini_history
75
  )
76
 
@@ -144,3 +167,7 @@ if prompt := st.chat_input('Your message here...'):
144
  st.session_state.gemini_history,
145
  f'data/{st.session_state.chat_id}-gemini_messages',
146
  )
 
 
 
 
 
52
 
53
 
54
  st.write('# Chat with LSAT Tutor')
55
+ next_btn = st.button("Click here when finished")
56
+
57
+ st.write("Use this AI Tutor to help you understand the concepts. You can ask it to explain the concepts, provide examples, or clarify any doubts you have.")
58
+ st.write("Start by sending a hello message!")
59
 
60
  # Chat history (allows to ask multiple questions)
61
  try:
 
70
  st.session_state.gemini_history = []
71
  print('new_cache made')
72
 
73
+ sys_prompt = system_instruction % (
74
+ st.session_state.prequiz_df['num_correct'][0],
75
+ st.session_state.prequiz_df['num_questions'][0],
76
+ st.session_state.prequiz_df['num_correct'][1],
77
+ st.session_state.prequiz_df['num_questions'][1],
78
+ st.session_state.prequiz_df['num_correct'][2],
79
+ st.session_state.prequiz_df['num_questions'][2],
80
+ st.session_state.prequiz_df['num_correct'][3],
81
+ st.session_state.prequiz_df['num_questions'][3],
82
+ st.session_state.prequiz_df['num_correct'][4],
83
+ st.session_state.prequiz_df['num_questions'][4],
84
+ st.session_state.prequiz_df['num_correct'][5],
85
+ st.session_state.prequiz_df['num_questions'][5],
86
+ st.session_state.prequiz_df['num_correct'][6],
87
+ st.session_state.prequiz_df['num_questions'][6],
88
+ st.session_state.prequiz_df['num_correct'][7],
89
+ st.session_state.prequiz_df['num_questions'][7],
90
+ st.session_state.prequiz_df['num_correct'][8],
91
+ st.session_state.prequiz_df['num_questions'][8]
92
+ )
93
  st.session_state.chat = client.chats.create(model='gemini-2.0-flash',
94
  config=types.GenerateContentConfig(
95
  tools=[get_model_tools()],
96
+ system_instruction=sys_prompt),
97
  history=st.session_state.gemini_history
98
  )
99
 
 
167
  st.session_state.gemini_history,
168
  f'data/{st.session_state.chat_id}-gemini_messages',
169
  )
170
+
171
+
172
+ if next_btn:
173
+ st.switch_page("pages/postquiz.py")
pages/textbook.py CHANGED
@@ -74,8 +74,8 @@ st.markdown(concept_excerpts[topic])
74
  st.subheader("Practice Question")
75
  q = example_excerpts[topic]
76
  st.write(q[0])
77
- for i, choice in enumerate(choices):
78
- st.write(f"{i}). {choice}")
79
 
80
  # Show answer
81
  if st.checkbox("Show Answer"):
@@ -91,6 +91,11 @@ joblib.dump(
91
  f'data/{st.session_state.chat_id}-gemini_messages',
92
  )
93
 
 
 
 
 
 
94
 
95
 
96
 
 
74
  st.subheader("Practice Question")
75
  q = example_excerpts[topic]
76
  st.write(q[0])
77
+ # for i, choice in enumerate(choices):
78
+ # st.write(f"{i}). {choice}")
79
 
80
  # Show answer
81
  if st.checkbox("Show Answer"):
 
91
  f'data/{st.session_state.chat_id}-gemini_messages',
92
  )
93
 
94
+ next_page = st.button("Done")
95
+
96
+ if next_page:
97
+ st.switch_page("pages/postquiz.py")
98
+
99
 
100
 
101
 
utils/__pycache__/conceptexcerpts.cpython-311.pyc ADDED
Binary file (14.3 kB). View file
 
utils/__pycache__/exampleexcerpts.cpython-311.pyc ADDED
Binary file (19.1 kB). View file
 
utils/__pycache__/questions_dataset.cpython-311.pyc CHANGED
Binary files a/utils/__pycache__/questions_dataset.cpython-311.pyc and b/utils/__pycache__/questions_dataset.cpython-311.pyc differ
 
utils/questions_dataset.py CHANGED
@@ -53,17 +53,17 @@ def get_model_tools():
53
 
54
  system_instruction = """You are an AI tutor that teaches users LSAT Logical Reasoning.
55
  Here is how your student performed on the practice quiz grouped by question type (num correct/num questions):
56
- Assumtion: (1/1)
57
- Find the flaw in the argument: (1/2)
58
- Inferece: (1/1)
59
- Justify the conclusion: (0/1)
60
- Method of reasoning: (1/1)
61
- Point at issue: (0/1)
62
- Role Play: (1/1)
63
- Strengthen: (0/1)
64
- Weaken the argument: (1/1)
65
  Based on this, classify them as Beginner / Intermediate / Advanced. Walk through the student on all topics, but focus on the ones they struggle with.
66
  Question the user to ensure that they understand the material.
67
  Use practice questions from the tool to ensure they understand the material.
68
  Never give a one word answer. Always keep the conversation moving.
69
- Once the user has studied all the topics, return <DONE>. """
 
53
 
54
  system_instruction = """You are an AI tutor that teaches users LSAT Logical Reasoning.
55
  Here is how your student performed on the practice quiz grouped by question type (num correct/num questions):
56
+ Assumtion: (%d/%d)
57
+ Find the flaw in the argument: (%d/%d)
58
+ Inferece: (%d/%d)
59
+ Justify the conclusion: (%d/%d)
60
+ Method of reasoning: (%d/%d)
61
+ Point at issue: (%d/%d)
62
+ Role Play: (%d/%d)
63
+ Strengthen: (%d/%d)
64
+ Weaken the argument: (%d/%d)
65
  Based on this, classify them as Beginner / Intermediate / Advanced. Walk through the student on all topics, but focus on the ones they struggle with.
66
  Question the user to ensure that they understand the material.
67
  Use practice questions from the tool to ensure they understand the material.
68
  Never give a one word answer. Always keep the conversation moving.
69
+ Once the user has studied all the topics, prompt them to press the next button. """