Update app.py
Browse files
app.py
CHANGED
|
@@ -2,9 +2,12 @@ import gradio as gr
|
|
| 2 |
import requests
|
| 3 |
from urllib.parse import urljoin, urlencode, quote
|
| 4 |
|
|
|
|
|
|
|
| 5 |
def process_survey(button_type, submission_id):
|
| 6 |
if button_type == 'data':
|
| 7 |
survey_id = "671fc52152e3225d7de349e6"
|
|
|
|
| 8 |
else:
|
| 9 |
survey_id = "671fe2d352e3225d7de34afc"
|
| 10 |
|
|
@@ -35,7 +38,8 @@ def process_survey(button_type, submission_id):
|
|
| 35 |
if button_type == 'data':
|
| 36 |
return 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)
|
| 37 |
else:
|
| 38 |
-
|
|
|
|
| 39 |
|
| 40 |
except Exception as e:
|
| 41 |
return f"An error occurred while fetching the survey data: {e}"
|
|
|
|
| 2 |
import requests
|
| 3 |
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"
|
| 10 |
+
|
| 11 |
else:
|
| 12 |
survey_id = "671fe2d352e3225d7de34afc"
|
| 13 |
|
|
|
|
| 38 |
if button_type == 'data':
|
| 39 |
return 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)
|
| 40 |
else:
|
| 41 |
+
parsed_data = parse_survey_stack_parameters(data)
|
| 42 |
+
return parsed_data, gr.Textbox(visible=True)
|
| 43 |
|
| 44 |
except Exception as e:
|
| 45 |
return f"An error occurred while fetching the survey data: {e}"
|