Update app.py
Browse files
app.py
CHANGED
|
@@ -29,9 +29,9 @@ def process_survey(button_type, submission_id):
|
|
| 29 |
print(data)
|
| 30 |
|
| 31 |
if button_type == 'data':
|
| 32 |
-
return data, gr.HTML(visible=True), gr.Textbox(visible=False), gr.Textbox(visible=False), gr.Button(visible=False), gr.Textbox(visible=False)
|
| 33 |
else:
|
| 34 |
-
return data
|
| 35 |
|
| 36 |
except Exception as e:
|
| 37 |
return f"An error occurred while fetching the survey data: {e}"
|
|
@@ -78,11 +78,6 @@ with gr.Blocks() as app:
|
|
| 78 |
parameter_survey_output = gr.HTML(value=display_parameter_survey(), visible=False)
|
| 79 |
|
| 80 |
#data_submit_button.click(fn=process_survey, inputs=[survey_submission_ID, survey_number], outputs=[get_survey_back, parameter_survey_output, data_survey_output, survey_submission_ID, data_submit_button, get_survey_back])
|
| 81 |
-
data_submit_button.click(
|
| 82 |
-
lambda button_type: process_survey("data", button_type),
|
| 83 |
-
inputs=[survey_submission_ID],
|
| 84 |
-
outputs=[get_survey_back, parameter_survey_output, data_survey_output, survey_submission_ID, data_submit_button]
|
| 85 |
-
)
|
| 86 |
|
| 87 |
survey2_submission_ID = gr.Textbox(label="Before submitting your surveystack survey, PLEASE record your submission ID. Type it here.", visible=False)
|
| 88 |
|
|
@@ -95,7 +90,13 @@ with gr.Blocks() as app:
|
|
| 95 |
param_submit_button.click(
|
| 96 |
lambda button_type: process_survey("param", button_type),
|
| 97 |
inputs=survey2_submission_ID,
|
| 98 |
-
outputs=get_survey_back2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
)
|
| 100 |
|
| 101 |
app.launch()
|
|
|
|
| 29 |
print(data)
|
| 30 |
|
| 31 |
if button_type == 'data':
|
| 32 |
+
return data, gr.HTML(visible=True), gr.Textbox(visible=False), gr.Textbox(visible=False), gr.Button(visible=False), gr.Textbox(visible=False), gr.Textbox(visible=True), gr.Textbox(visible=True)
|
| 33 |
else:
|
| 34 |
+
return data, gr.Textbox(visible=True)
|
| 35 |
|
| 36 |
except Exception as e:
|
| 37 |
return f"An error occurred while fetching the survey data: {e}"
|
|
|
|
| 78 |
parameter_survey_output = gr.HTML(value=display_parameter_survey(), visible=False)
|
| 79 |
|
| 80 |
#data_submit_button.click(fn=process_survey, inputs=[survey_submission_ID, survey_number], outputs=[get_survey_back, parameter_survey_output, data_survey_output, survey_submission_ID, data_submit_button, get_survey_back])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
|
| 82 |
survey2_submission_ID = gr.Textbox(label="Before submitting your surveystack survey, PLEASE record your submission ID. Type it here.", visible=False)
|
| 83 |
|
|
|
|
| 90 |
param_submit_button.click(
|
| 91 |
lambda button_type: process_survey("param", button_type),
|
| 92 |
inputs=survey2_submission_ID,
|
| 93 |
+
outputs=[get_survey_back2, get_survey_back2]
|
| 94 |
+
)
|
| 95 |
+
|
| 96 |
+
data_submit_button.click(
|
| 97 |
+
lambda button_type: process_survey("data", button_type),
|
| 98 |
+
inputs=[survey_submission_ID],
|
| 99 |
+
outputs=[get_survey_back, parameter_survey_output, data_survey_output, survey_submission_ID, data_submit_button, survey2_submission_ID, param_submit_button]
|
| 100 |
)
|
| 101 |
|
| 102 |
app.launch()
|