rosemariafontana commited on
Commit
13a1013
·
verified ·
1 Parent(s): 048aded

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -13,12 +13,14 @@ def display_survey(survey_id):
13
  iframe_html = f'<iframe src="{survey_url}" width="100%" height="600px"></iframe>'
14
  return iframe_html
15
 
16
- app = gr.Interface(
17
- fn=display_survey,
18
- inputs=gr.Textbox(label="Enter SurveyStack Survey ID"),
19
- outputs="html",
20
- title="SurveyStack Survey Viewer",
21
- description="Enter the Survey ID to start the survey."
22
- )
 
 
23
 
24
  app.launch()
 
13
  iframe_html = f'<iframe src="{survey_url}" width="100%" height="600px"></iframe>'
14
  return iframe_html
15
 
16
+ with gr.Blocks() as app:
17
+ with gr.Row():
18
+ surveyID_input = gr.Textbox(label="Enter SurveyStack Survey ID")
19
+
20
+ with gr.Row():
21
+ survey_output = gr.HTML()
22
+
23
+ surveyID_input.change(fn=display_survey, inputs=surveyID_input, outputs=survey_output)
24
+
25
 
26
  app.launch()