|
|
|
import streamlit as st |
|
import json |
|
|
|
def display_strength_exercise_3(): |
|
st.subheader("Strengths Exercise 3: Feedback from Your Network") |
|
|
|
|
|
if 'network_feedback_list' not in st.session_state: |
|
st.session_state['network_feedback_list'] = [] |
|
|
|
if st.button('Add More Feedback'): |
|
st.session_state['network_feedback_list'].append({}) |
|
|
|
|
|
idx = 0 |
|
for feedback in st.session_state['network_feedback_list']: |
|
with st.container(): |
|
st.write(f"Feedback #{idx + 1}") |
|
name = st.text_input("Name", key=f"network_name_{idx}") |
|
role = st.text_input("Role", key=f"network_role_{idx}") |
|
|
|
feedback_questions = [ |
|
"What tasks am I best at?", |
|
"How would you describe me to others?", |
|
"What are not my strengths?", |
|
"Preferred roles in projects?", |
|
] |
|
|
|
|
|
feedback['name'] = name |
|
feedback['role'] = role |
|
feedback['responses'] = {} |
|
for question in feedback_questions: |
|
feedback['responses'][question] = st.text_area(question, key=f"{idx}_{question}") |
|
idx += 1 |
|
|
|
if st.button('Save Network Feedback'): |
|
|
|
with open('dynamic_strength_responses.json', 'w') as f: |
|
json.dump(st.session_state['network_feedback_list'], f) |
|
st.success('Network feedback saved successfully!') |
|
|
|
def app(): |
|
display_strength_exercise_3() |
|
|
|
if __name__ == "__main__": |
|
app() |
|
|