rashid01 commited on
Commit
06c8c47
Β·
verified Β·
1 Parent(s): 2efc47f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -61
app.py CHANGED
@@ -123,20 +123,22 @@ def start_mock_interview(interview_details):
123
 
124
  def schedule_mock_interview():
125
  st.subheader("Schedule a Mock Interview")
126
- date = st.date_input("Select Date", min_value=datetime.today())
127
- time = st.time_input("Select Time", value=datetime.now().time())
128
- duration = st.selectbox("Duration (Minutes)", [30, 45, 60])
129
- role = st.selectbox("Select Role", ["Software Developer", "Data Analyst", "Marketing Manager"])
 
 
130
  now = datetime.now()
131
  selected_datetime = datetime.combine(date, time)
132
 
133
  col1, col2 = st.columns(2)
134
  with col1:
135
- if st.button("Start Interview Now"):
136
  start_mock_interview({"role": role, "duration": duration})
137
 
138
  with col2:
139
- if st.button("Schedule Interview"):
140
  if selected_datetime < now:
141
  st.error("Selected time is in the past. Please choose a future time.")
142
  else:
@@ -185,10 +187,10 @@ def connect_resources():
185
  # Form to connect with career coaches or mentors
186
  with st.form("contact_form"):
187
  st.write("For personalized assistance, please fill out this form:")
188
- name = st.text_input("Name")
189
- email = st.text_input("Email")
190
- message = st.text_area("Message")
191
- submit_button = st.form_submit_button("Submit")
192
 
193
  if submit_button:
194
  if not name or not email or not message:
@@ -278,59 +280,29 @@ with st.sidebar:
278
  st.title("Menu")
279
  st.markdown("<h3>About Us</h3><p>We help you prepare for job interviews with simulated questions and feedback.</p>", unsafe_allow_html=True)
280
  st.markdown("<h3>Sponsored By</h3><p>Your trusted career preparation partner.</p>", unsafe_allow_html=True)
281
- st.markdown("<h3>Contact Us</h3><p>For support, email us at <a href='mailto:support@example.com'>support@example.com</a>.</p>", unsafe_allow_html=True)
282
-
283
- st.title("πŸ’Ό TechPrep")
284
-
285
- model_choice = st.selectbox("Select AI Model", ["Gemini", "OpenAI"])
286
- role = st.selectbox("Select Role", ["Software Developer", "Data Analyst", "Marketing Manager"])
287
- question_type = st.selectbox("Select Question Type", ["Behavioral", "Technical", "Situational"])
288
- num_questions = st.slider("Number of Questions", 1, 10)
289
- difficulty = st.selectbox("Select Difficulty Level", ["Easy", "Medium", "Hard"])
290
-
291
- st.header("πŸ“ Generate Interview Questions")
292
- if st.button("Generate Questions"):
293
- with st.spinner("Generating questions..."):
294
- questions = generate_questions(model_choice, role, question_type, num_questions, difficulty)
295
- st.markdown(style_output("Questions Generated:", "#4CAF50"), unsafe_allow_html=True)
296
- st.write(questions)
297
- progress_data["questions_solved"][question_type] += num_questions
298
-
299
- st.header("πŸ—£οΈ Provide Feedback")
300
- answer = st.text_area("Submit Your Answer")
301
- if st.button("Submit Answer"):
302
- if not answer:
303
- st.error("Please enter an answer to receive feedback.")
304
- else:
305
- with st.spinner("Providing feedback..."):
306
- feedback = provide_feedback(model_choice, answer)
307
- st.markdown(style_output("Feedback Received:", "#FF5722"), unsafe_allow_html=True)
308
- st.write(feedback)
309
- progress_data["feedback_provided"] += 1
310
-
311
- st.header("πŸ’‘ Interview Tips")
312
- if st.button("Get Tips"):
313
- with st.spinner("Fetching tips..."):
314
- tips = get_tips(model_choice, role)
315
- st.markdown(style_output("Tips Received:", "#2196F3"), unsafe_allow_html=True)
316
- st.write(tips)
317
- progress_data["tips_retrieved"] += 1
318
-
319
- st.header("πŸ“… Schedule Mock Interview")
320
- schedule_mock_interview()
321
-
322
- st.header("πŸ“ˆ Progress and Resources")
323
- col1, col2 = st.columns(2)
324
- with col1:
325
  track_progress()
326
- with col2:
 
 
327
  connect_resources()
328
 
329
- # Footer
330
- st.markdown("""
331
- <div class="footer">
332
- <p>&copy; 2024 TechPrep. All rights reserved.</p>
333
- </div>
334
- """, unsafe_allow_html=True)
335
 
336
 
 
123
 
124
  def schedule_mock_interview():
125
  st.subheader("Schedule a Mock Interview")
126
+
127
+ # Unique keys for each widget
128
+ date = st.date_input("Select Date", min_value=datetime.today(), key="schedule_date")
129
+ time = st.time_input("Select Time", value=datetime.now().time(), key="schedule_time")
130
+ duration = st.selectbox("Duration (Minutes)", [30, 45, 60], key="duration_select")
131
+ role = st.selectbox("Select Role", ["Software Developer", "Data Analyst", "Marketing Manager"], key="role_select")
132
  now = datetime.now()
133
  selected_datetime = datetime.combine(date, time)
134
 
135
  col1, col2 = st.columns(2)
136
  with col1:
137
+ if st.button("Start Interview Now", key="start_now"):
138
  start_mock_interview({"role": role, "duration": duration})
139
 
140
  with col2:
141
+ if st.button("Schedule Interview", key="schedule_interview"):
142
  if selected_datetime < now:
143
  st.error("Selected time is in the past. Please choose a future time.")
144
  else:
 
187
  # Form to connect with career coaches or mentors
188
  with st.form("contact_form"):
189
  st.write("For personalized assistance, please fill out this form:")
190
+ name = st.text_input("Name", key="contact_name")
191
+ email = st.text_input("Email", key="contact_email")
192
+ message = st.text_area("Message", key="contact_message")
193
+ submit_button = st.form_submit_button("Submit", key="contact_submit")
194
 
195
  if submit_button:
196
  if not name or not email or not message:
 
280
  st.title("Menu")
281
  st.markdown("<h3>About Us</h3><p>We help you prepare for job interviews with simulated questions and feedback.</p>", unsafe_allow_html=True)
282
  st.markdown("<h3>Sponsored By</h3><p>Your trusted career preparation partner.</p>", unsafe_allow_html=True)
283
+ st.markdown("<h3>Contact Us</h3><p>For support, email us at support@techprep.com</p>", unsafe_allow_html=True)
284
+
285
+ # Main app
286
+ menu = st.sidebar.selectbox("Select a Page", ["Home", "Mock Interviews", "Track Progress", "Resources"])
287
+
288
+ if menu == "Home":
289
+ st.title("Welcome to TechPrep!")
290
+ st.write("Your comprehensive tool for interview preparation. Choose an option from the menu to get started.")
291
+
292
+ elif menu == "Mock Interviews":
293
+ st.title("Mock Interviews")
294
+ schedule_mock_interview()
295
+
296
+ elif menu == "Track Progress":
297
+ st.title("Track Your Progress")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
  track_progress()
299
+
300
+ elif menu == "Resources":
301
+ st.title("Resources")
302
  connect_resources()
303
 
304
+
305
+
306
+
 
 
 
307
 
308