Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,8 @@ from urllib.parse import urljoin, urlencode, quote
|
|
| 4 |
|
| 5 |
from process_data import parse_survey_stack_parameters, parse_survey_stack_data
|
| 6 |
|
|
|
|
|
|
|
| 7 |
def process_survey(button_type, submission_id):
|
| 8 |
if button_type == 'data':
|
| 9 |
survey_id = "671fc52152e3225d7de349e6"
|
|
@@ -36,11 +38,13 @@ def process_survey(button_type, submission_id):
|
|
| 36 |
print(data)
|
| 37 |
|
| 38 |
if button_type == 'data':
|
| 39 |
-
|
| 40 |
-
|
|
|
|
| 41 |
else:
|
| 42 |
-
|
| 43 |
-
|
|
|
|
| 44 |
|
| 45 |
except Exception as e:
|
| 46 |
return f"An error occurred while fetching the survey data: {e}"
|
|
|
|
| 4 |
|
| 5 |
from process_data import parse_survey_stack_parameters, parse_survey_stack_data
|
| 6 |
|
| 7 |
+
global parsed_input_data
|
| 8 |
+
|
| 9 |
def process_survey(button_type, submission_id):
|
| 10 |
if button_type == 'data':
|
| 11 |
survey_id = "671fc52152e3225d7de349e6"
|
|
|
|
| 38 |
print(data)
|
| 39 |
|
| 40 |
if button_type == 'data':
|
| 41 |
+
global parsed_input_data = {}
|
| 42 |
+
parsed_input_data = parse_survey_stack_data(data)
|
| 43 |
+
return parsed_input_data, gr.HTML(visible=True), gr.Textbox(visible=False), gr.Textbox(visible=False), gr.Button(visible=False), gr.Textbox(visible=True), gr.Button(visible=True)
|
| 44 |
else:
|
| 45 |
+
parsed_param_data = parse_survey_stack_parameters(data)
|
| 46 |
+
parsed_final_output = process_specifications(parsed_input_data, parsed_input_data)
|
| 47 |
+
return parsed_final_output, gr.Textbox(visible=True)
|
| 48 |
|
| 49 |
except Exception as e:
|
| 50 |
return f"An error occurred while fetching the survey data: {e}"
|