mbosse99 commited on
Commit
56b5571
·
1 Parent(s): 18b432b

Update with question input

Browse files
Files changed (1) hide show
  1. app.py +21 -3
app.py CHANGED
@@ -42,6 +42,9 @@ def upload_blob(pdf_name, json_data, pdf_data_jobdescription,pdf_data_cv):
42
  def test(text_val):
43
  print(text_val)
44
 
 
 
 
45
  def main():
46
  st.markdown(
47
  """
@@ -70,13 +73,28 @@ def main():
70
 
71
  job_title = st.text_input("Enter the job title:")
72
  email = st.text_input("Enter the email:")
 
 
 
 
 
73
  submitted = st.form_submit_button("Submit")
74
  if submitted:
75
  if len(job_title) > 0 and len(email) > 0 and uploaded_file_jobdescription and uploaded_file_cv:
76
  data = {
77
  "title": job_title,
78
- "email": email
 
 
 
79
  }
 
 
 
 
 
 
 
80
  json_data = json.dumps(data, ensure_ascii=False)
81
 
82
  # Eine zufällige UUID generieren
@@ -91,10 +109,10 @@ def main():
91
  pdf_data_cv = uploaded_file_cv.read()
92
 
93
  upload_success = upload_blob(pdf_name, json_data, pdf_data_jobdescription,pdf_data_cv)
94
-
95
-
96
  else:
97
  st.write("Please fill out both fields and upload a PDF file.")
 
 
98
  if not upload_success:
99
  st.error('An error has occurred. Please contact the administrator. Sorry for the inconvenience.', icon="🚨")
100
  else:
 
42
  def test(text_val):
43
  print(text_val)
44
 
45
+ if 'questions' not in st.session_state:
46
+ st.session_state.questions = []
47
+
48
  def main():
49
  st.markdown(
50
  """
 
73
 
74
  job_title = st.text_input("Enter the job title:")
75
  email = st.text_input("Enter the email:")
76
+ with st.expander("Enter up to three predefined questions if needed. Otherwise leave it blank:"):
77
+ question_one = st.text_input("Enter the first question:")
78
+ question_two = st.text_input("Enter the second question:")
79
+ question_three = st.text_input("Enter the third question:")
80
+
81
  submitted = st.form_submit_button("Submit")
82
  if submitted:
83
  if len(job_title) > 0 and len(email) > 0 and uploaded_file_jobdescription and uploaded_file_cv:
84
  data = {
85
  "title": job_title,
86
+ "email": email,
87
+ "question_one": "",
88
+ "question_two": "",
89
+ "question_three": "",
90
  }
91
+ if question_one:
92
+ data["question_one"] = question_one
93
+ if question_two:
94
+ data["question_two"] = question_two
95
+ if question_three:
96
+ data["question_three"] = question_three
97
+
98
  json_data = json.dumps(data, ensure_ascii=False)
99
 
100
  # Eine zufällige UUID generieren
 
109
  pdf_data_cv = uploaded_file_cv.read()
110
 
111
  upload_success = upload_blob(pdf_name, json_data, pdf_data_jobdescription,pdf_data_cv)
 
 
112
  else:
113
  st.write("Please fill out both fields and upload a PDF file.")
114
+
115
+
116
  if not upload_success:
117
  st.error('An error has occurred. Please contact the administrator. Sorry for the inconvenience.', icon="🚨")
118
  else: