Spaces:
Runtime error
Runtime error
File size: 1,785 Bytes
2d63df8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
import streamlit as st
import json
def app():
st.header("Skills and Experience Exercise")
core_skills_questions = [
"Job: Title or description – where and when?",
"Skills and experience: Direct or transferable",
"Accomplishments: Measurable; if possible include examples like percentage of goal, dollars in sales, revenue growth, or savings; number of employees hired or trained",
"Benefit to the Employer: how your skills and/or experience benefit the organization and its people"
]
if 'skills_experience_sets' not in st.session_state:
st.session_state.skills_experience_sets = [{}]
# Function to add another set of questions
def add_another_set():
st.session_state.skills_experience_sets.append({})
# Display current sets of questions and responses
for i, skills_set in enumerate(st.session_state.skills_experience_sets):
with st.expander(f"Skills and Experience Set {i + 1}", expanded=True):
for question in core_skills_questions:
key = f"{question}_{i}"
st.session_state.skills_experience_sets[i][question] = st.text_area(
label=question,
key=key,
value=skills_set.get(question, "")
)
st.button("Add More", on_click=add_another_set)
if st.button('Save Skills and Experience'):
save_skills_and_experience()
st.success('Skills and Experience saved successfully!')
def save_skills_and_experience():
"""Save the skills and experience sets to a JSON file."""
with open('skills_and_experience_sets.json', 'w') as file:
json.dump(st.session_state['skills_experience_sets'], file, indent=4)
if __name__ == "__main__":
app()
|