Update app.py
Browse files
app.py
CHANGED
|
@@ -25,9 +25,10 @@ def process_survey(survey_id, submission_id):
|
|
| 25 |
return f"An error occurred while fetching the survey data: {e}"
|
| 26 |
|
| 27 |
|
| 28 |
-
def display_survey(
|
| 29 |
base_url = "https://app.surveystack.io/groups/"
|
| 30 |
group_id = "5e95e368fbbf75000146a006" # Group ID "Our-Sci"
|
|
|
|
| 31 |
|
| 32 |
# Construct the full URL using urljoin to ensure proper formatting
|
| 33 |
survey_url = urljoin(base_url, f"{group_id}/surveys/{survey_id}/submissions/new")
|
|
@@ -38,16 +39,16 @@ def display_survey(survey_id):
|
|
| 38 |
return iframe_html
|
| 39 |
|
| 40 |
with gr.Blocks() as app:
|
| 41 |
-
with gr.Row():
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
|
| 47 |
with gr.Row():
|
| 48 |
-
survey_output = gr.HTML()
|
| 49 |
|
| 50 |
-
submit_button.click(fn=display_survey, inputs=surveyID_input, outputs=survey_output)
|
| 51 |
|
| 52 |
survey_submission_ID = gr.Textbox(label="Before submitting your surveystack survey, PLEASE record your submission ID. Type it here.")
|
| 53 |
|
|
|
|
| 25 |
return f"An error occurred while fetching the survey data: {e}"
|
| 26 |
|
| 27 |
|
| 28 |
+
def display_survey():
|
| 29 |
base_url = "https://app.surveystack.io/groups/"
|
| 30 |
group_id = "5e95e368fbbf75000146a006" # Group ID "Our-Sci"
|
| 31 |
+
survey_id = "671fc52152e3225d7de349e6"
|
| 32 |
|
| 33 |
# Construct the full URL using urljoin to ensure proper formatting
|
| 34 |
survey_url = urljoin(base_url, f"{group_id}/surveys/{survey_id}/submissions/new")
|
|
|
|
| 39 |
return iframe_html
|
| 40 |
|
| 41 |
with gr.Blocks() as app:
|
| 42 |
+
#with gr.Row():
|
| 43 |
+
# with gr.Column():
|
| 44 |
+
# surveyID_input = gr.Textbox(label="Enter SurveyStack Survey ID")
|
| 45 |
+
# with gr.Column():
|
| 46 |
+
# submit_button = gr.Button("Load Survey")
|
| 47 |
|
| 48 |
with gr.Row():
|
| 49 |
+
survey_output = gr.HTML(value=display_survey())
|
| 50 |
|
| 51 |
+
#submit_button.click(fn=display_survey, inputs=surveyID_input, outputs=survey_output)
|
| 52 |
|
| 53 |
survey_submission_ID = gr.Textbox(label="Before submitting your surveystack survey, PLEASE record your submission ID. Type it here.")
|
| 54 |
|