Update app.py
Browse files
app.py
CHANGED
|
@@ -43,8 +43,8 @@ def process_survey(button_type, submission_id):
|
|
| 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 |
-
|
| 47 |
-
return
|
| 48 |
|
| 49 |
except Exception as e:
|
| 50 |
return f"An error occurred while fetching the survey data: {e}"
|
|
@@ -96,14 +96,16 @@ with gr.Blocks() as app:
|
|
| 96 |
|
| 97 |
param_submit_button = gr.Button("Parse Parameters", visible=False)
|
| 98 |
|
| 99 |
-
|
|
|
|
|
|
|
| 100 |
|
| 101 |
|
| 102 |
#param_submit_button.click(fn=process_survey, inputs=[survey2_submission_ID, survey_number], outputs=[get_survey_back2])
|
| 103 |
param_submit_button.click(
|
| 104 |
lambda button_type: process_survey("param", button_type),
|
| 105 |
inputs=survey2_submission_ID,
|
| 106 |
-
outputs=[
|
| 107 |
)
|
| 108 |
|
| 109 |
data_submit_button.click(
|
|
|
|
| 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_farm_json, parsed_interactions_json, parsed_trial_json = process_specifications(parsed_input_data, parsed_input_data)
|
| 47 |
+
return parsed_farm_json, parsed_interactions_json, parsed_trial_json, gr.HTML(visible=True), gr.HTML(visible=True), gr.HTML(visible=True)
|
| 48 |
|
| 49 |
except Exception as e:
|
| 50 |
return f"An error occurred while fetching the survey data: {e}"
|
|
|
|
| 96 |
|
| 97 |
param_submit_button = gr.Button("Parse Parameters", visible=False)
|
| 98 |
|
| 99 |
+
json_output_farm = gr.HTML(label="Farm Data JSON", visible=False)
|
| 100 |
+
json_output_interactions = gr.HTML(label="Interactions Data JSON", visible=False)
|
| 101 |
+
json_output_trials = gr.HTML(label="Trials Data JSON", visible=False)
|
| 102 |
|
| 103 |
|
| 104 |
#param_submit_button.click(fn=process_survey, inputs=[survey2_submission_ID, survey_number], outputs=[get_survey_back2])
|
| 105 |
param_submit_button.click(
|
| 106 |
lambda button_type: process_survey("param", button_type),
|
| 107 |
inputs=survey2_submission_ID,
|
| 108 |
+
outputs=[json_output_farm, json_output_interactions, json_output_trials, json_output_farm, json_output_interactions, json_output_trials]
|
| 109 |
)
|
| 110 |
|
| 111 |
data_submit_button.click(
|