interviewsss / display_responses.py
ombhojane's picture
Upload 91 files
2d63df8 verified
import streamlit as st
import json
def load_json_data(file_path):
"""Utility function to load JSON data from a specified file path."""
try:
with open(file_path, 'r') as file:
return json.load(file)
except FileNotFoundError:
st.error(f"File {file_path} not found. Please ensure data has been saved.")
return None
def display_core_values():
"""Displays the user's core values."""
core_values = load_json_data('core_values_responses.json')
if core_values:
st.header("Your Core Values")
for question, answer in core_values.items():
st.text(f"{question}: {answer}")
def display_strength_responses():
"""Displays the user's responses to the strength exercises."""
strength_responses = load_json_data('strength_responses.json')
if strength_responses:
st.header("Your Strength Responses")
for key, value in strength_responses.items():
st.text(f"{key}: {value}")
def display_dynamic_strength_responses():
"""Displays dynamic strength responses (Exercise 3) from the network."""
network_feedback_list = load_json_data('dynamic_strength_responses.json')
if network_feedback_list:
st.header("Dynamic Strength Responses (Exercise 3)")
for feedback in network_feedback_list:
st.subheader(f"Feedback from {feedback['name']} ({feedback['role']})")
for question, response in feedback['responses'].items():
st.markdown(f"- **{question}:** {response}")
def display_skills_and_experience():
"""Displays the user's skills and experience responses."""
skills_and_experience_sets = load_json_data('skills_and_experience_sets.json')
if skills_and_experience_sets:
st.header("Your Skills and Experience")
for i, skills_set in enumerate(skills_and_experience_sets, start=1):
st.subheader(f"Skills and Experience Set {i}")
for question, answer in skills_set.items():
st.markdown(f"**{question}:** {answer}")
def display_preferences():
"""Displays the user's career preferences."""
preferences_sets = load_json_data('preferences_sets.json')
if preferences_sets:
st.header("Your Career Preferences")
for i, preferences_set in enumerate(preferences_sets, start=1):
st.subheader(f"Preferences Set {i}")
for preference, answer in preferences_set.items():
st.markdown(f"**{preference}:** {answer}")
def display_dream_job_info():
"""Displays the saved dream job information."""
try:
with open('dream_job_info.json', 'r') as file:
dream_job_info = json.load(file)
st.header("Your Dream Job Information")
st.markdown(f"**Dream Job Description:** {dream_job_info['dream_job_description']}")
st.markdown(f"**Is it a realistic possibility?** {dream_job_info['dream_job_realism']}")
if dream_job_info['dream_job_realism'] == "Yes":
st.markdown(f"**Explanation:** {dream_job_info['dream_job_explanation']}")
st.markdown(f"**Attributes:** {dream_job_info['dream_job_attributes']}")
st.markdown(f"**Feelings:** {dream_job_info['feel_sentence']}")
st.markdown(f"**Needs:** {dream_job_info['need_sentence']}")
st.markdown(f"**Goals:** {dream_job_info['goal_sentence']}")
except FileNotFoundError:
st.error("Dream Job Information not found.")
def display_priorities():
"""Display saved career priorities."""
try:
with open('career_priorities_data.json', 'r') as file:
priorities_data = json.load(file)
st.header("Your Career Priorities")
for aspect, data in priorities_data.items():
st.subheader(aspect)
st.markdown(f"**Priority Rating:** {data['rating']}")
st.markdown(f"**Reason:** {data['reason']}")
except FileNotFoundError:
st.error("Career Priorities data not found.")
# Ensure the app() function calls display_dream_job_info()
# Ensure the app() function calls display_preferences()
# Ensure the app() function calls display_skills_and_experience()
def app():
display_core_values()
display_strength_responses()
display_dynamic_strength_responses()
display_skills_and_experience()
display_preferences()
display_dream_job_info()
display_priorities()
if __name__ == "__main__":
app()