JACOBBBB commited on
Commit
925de67
1 Parent(s): 5e89a77

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -7
app.py CHANGED
@@ -61,11 +61,22 @@ if st.button("Analyze and Respond"):
61
  # Display the generated professional response
62
  st.write("Generated Professional Response:", professional_response)
63
 
64
- # Text input for user to enter their own response
65
- user_response = st.text_area("Enter your response to the review", "")
66
 
67
- # Button to submit response
68
- if st.button("Submit Response"):
69
- if user_response:
70
- st.session_state['responses'].append(user_response)
71
- st.success("Your response has been recorded for the competition!")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  # Display the generated professional response
62
  st.write("Generated Professional Response:", professional_response)
63
 
 
 
64
 
65
+ st.title('Monthly Best Response Competition')
66
+ # Simple form for input using Streamlit
67
+ with st.form("user_input_form"):
68
+ user_input = st.text_input("Enter your response:")
69
+ submit_button = st.form_submit_button("Submit")
70
+
71
+ if submit_button:
72
+ # Current time when the input is received
73
+ current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
74
+ # Format the entry to be saved
75
+ entry = f"{current_time}: {user_input}\n"
76
+ # Save the input to a local file
77
+ with open("monthly_competition_entries.txt", "a") as file:
78
+ file.write(entry)
79
+ st.success("Your response has been saved and entered into the competition!")
80
+
81
+ # Display outside the form context
82
+ st.write("Feel free to submit more responses. Each unique response counts as a separate entry.")