Spaces:
Sleeping
Sleeping
Javierss
commited on
Commit
·
6a4df58
1
Parent(s):
00efd23
Add finish button
Browse files- __pycache__/app.cpython-311.pyc +0 -0
- app.py +32 -4
__pycache__/app.cpython-311.pyc
CHANGED
Binary files a/__pycache__/app.cpython-311.pyc and b/__pycache__/app.cpython-311.pyc differ
|
|
app.py
CHANGED
@@ -197,6 +197,7 @@ with gr.Blocks() as demo:
|
|
197 |
+ """ </p>
|
198 |
"""
|
199 |
),
|
|
|
200 |
]
|
201 |
|
202 |
# Return the initial output components
|
@@ -237,6 +238,7 @@ with gr.Blocks() as demo:
|
|
237 |
gr.Textbox(visible=False),
|
238 |
gr.Button(visible=False),
|
239 |
gr.Markdown(visible=False),
|
|
|
240 |
]
|
241 |
)
|
242 |
|
@@ -257,6 +259,7 @@ with gr.Blocks() as demo:
|
|
257 |
gr.Textbox(visible=False),
|
258 |
gr.Button(visible=False),
|
259 |
gr.Markdown(visible=False),
|
|
|
260 |
]
|
261 |
)
|
262 |
|
@@ -276,6 +279,7 @@ with gr.Blocks() as demo:
|
|
276 |
gr.Textbox(visible=False),
|
277 |
gr.Button(visible=False),
|
278 |
gr.Markdown(visible=False),
|
|
|
279 |
]
|
280 |
|
281 |
else:
|
@@ -294,6 +298,7 @@ with gr.Blocks() as demo:
|
|
294 |
gr.Textbox(visible=False),
|
295 |
gr.Button(visible=False),
|
296 |
gr.Markdown(visible=False),
|
|
|
297 |
]
|
298 |
)
|
299 |
|
@@ -312,6 +317,7 @@ with gr.Blocks() as demo:
|
|
312 |
gr.Textbox(visible=False),
|
313 |
gr.Button(visible=False),
|
314 |
gr.Markdown(visible=False),
|
|
|
315 |
]
|
316 |
)
|
317 |
|
@@ -336,6 +342,7 @@ with gr.Blocks() as demo:
|
|
336 |
gr.Textbox(visible=False),
|
337 |
gr.Button(visible=False),
|
338 |
gr.Markdown(visible=False),
|
|
|
339 |
]
|
340 |
)
|
341 |
|
@@ -394,8 +401,9 @@ with gr.Blocks() as demo:
|
|
394 |
visible=True,
|
395 |
),
|
396 |
gr.Textbox(curiosity, visible=True, label=Menu["Curiosity"]),
|
397 |
-
gr.Button(Menu["Play_again"], visible=True),
|
398 |
gr.Markdown(visible=False),
|
|
|
399 |
]
|
400 |
)
|
401 |
|
@@ -413,6 +421,7 @@ with gr.Blocks() as demo:
|
|
413 |
gr.Textbox(hint_out if hint else "", visible=hint, label="Pista"),
|
414 |
gr.Button(visible=False),
|
415 |
gr.Markdown(ranking_md, visible=ranking_vis),
|
|
|
416 |
]
|
417 |
)
|
418 |
|
@@ -431,6 +440,7 @@ with gr.Blocks() as demo:
|
|
431 |
gr.Textbox(visible=False),
|
432 |
gr.Button(visible=False),
|
433 |
gr.Markdown(visible=False),
|
|
|
434 |
]
|
435 |
)
|
436 |
|
@@ -452,6 +462,12 @@ with gr.Blocks() as demo:
|
|
452 |
but = gr.Button(Menu["Start"])
|
453 |
give_up = gr.Button("Pista", visible=False)
|
454 |
reload = gr.Button(Menu["Play_again"], visible=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
455 |
|
456 |
# Define the UI events for the game
|
457 |
|
@@ -472,19 +488,31 @@ with gr.Blocks() as demo:
|
|
472 |
reload.click(
|
473 |
reset,
|
474 |
inputs=[difficulty],
|
475 |
-
outputs=[state, out, inp, img, but, radio, hint_out, reload, header],
|
476 |
)
|
477 |
demo.load(
|
478 |
reset,
|
479 |
inputs=[difficulty],
|
480 |
-
outputs=[state, out, inp, img, but, radio, hint_out, reload, header],
|
481 |
)
|
482 |
|
483 |
# Define events that trigger the game state update
|
484 |
state.change(
|
485 |
update,
|
486 |
inputs=[state, radio, inp, hint],
|
487 |
-
outputs=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
488 |
)
|
489 |
|
490 |
if __name__ == "__main__":
|
|
|
197 |
+ """ </p>
|
198 |
"""
|
199 |
),
|
200 |
+
gr.Button(visible=False),
|
201 |
]
|
202 |
|
203 |
# Return the initial output components
|
|
|
238 |
gr.Textbox(visible=False),
|
239 |
gr.Button(visible=False),
|
240 |
gr.Markdown(visible=False),
|
241 |
+
gr.Button(visible=False),
|
242 |
]
|
243 |
)
|
244 |
|
|
|
259 |
gr.Textbox(visible=False),
|
260 |
gr.Button(visible=False),
|
261 |
gr.Markdown(visible=False),
|
262 |
+
gr.Button(visible=False),
|
263 |
]
|
264 |
)
|
265 |
|
|
|
279 |
gr.Textbox(visible=False),
|
280 |
gr.Button(visible=False),
|
281 |
gr.Markdown(visible=False),
|
282 |
+
gr.Button(visible=False),
|
283 |
]
|
284 |
|
285 |
else:
|
|
|
298 |
gr.Textbox(visible=False),
|
299 |
gr.Button(visible=False),
|
300 |
gr.Markdown(visible=False),
|
301 |
+
gr.Button(visible=False),
|
302 |
]
|
303 |
)
|
304 |
|
|
|
317 |
gr.Textbox(visible=False),
|
318 |
gr.Button(visible=False),
|
319 |
gr.Markdown(visible=False),
|
320 |
+
gr.Button(visible=False),
|
321 |
]
|
322 |
)
|
323 |
|
|
|
342 |
gr.Textbox(visible=False),
|
343 |
gr.Button(visible=False),
|
344 |
gr.Markdown(visible=False),
|
345 |
+
gr.Button(visible=False),
|
346 |
]
|
347 |
)
|
348 |
|
|
|
401 |
visible=True,
|
402 |
),
|
403 |
gr.Textbox(curiosity, visible=True, label=Menu["Curiosity"]),
|
404 |
+
gr.Button(Menu["Play_again"], variant="primary", visible=True),
|
405 |
gr.Markdown(visible=False),
|
406 |
+
gr.Button(visible=True),
|
407 |
]
|
408 |
)
|
409 |
|
|
|
421 |
gr.Textbox(hint_out if hint else "", visible=hint, label="Pista"),
|
422 |
gr.Button(visible=False),
|
423 |
gr.Markdown(ranking_md, visible=ranking_vis),
|
424 |
+
gr.Button(visible=False),
|
425 |
]
|
426 |
)
|
427 |
|
|
|
440 |
gr.Textbox(visible=False),
|
441 |
gr.Button(visible=False),
|
442 |
gr.Markdown(visible=False),
|
443 |
+
gr.Button(visible=False),
|
444 |
]
|
445 |
)
|
446 |
|
|
|
462 |
but = gr.Button(Menu["Start"])
|
463 |
give_up = gr.Button("Pista", visible=False)
|
464 |
reload = gr.Button(Menu["Play_again"], visible=False)
|
465 |
+
finish = gr.Button(
|
466 |
+
"Terminar y rellenar cuestionario",
|
467 |
+
variant="stop",
|
468 |
+
link="https://docs.google.com/forms/u/2/d/1Iq-T9OKAvYyoxwN-njjljzJgnUxYlnqMCctUGg_PUjE/edit?usp=forms_home&ths=true",
|
469 |
+
visible=False,
|
470 |
+
)
|
471 |
|
472 |
# Define the UI events for the game
|
473 |
|
|
|
488 |
reload.click(
|
489 |
reset,
|
490 |
inputs=[difficulty],
|
491 |
+
outputs=[state, out, inp, img, but, radio, hint_out, reload, header, finish],
|
492 |
)
|
493 |
demo.load(
|
494 |
reset,
|
495 |
inputs=[difficulty],
|
496 |
+
outputs=[state, out, inp, img, but, radio, hint_out, reload, header, finish],
|
497 |
)
|
498 |
|
499 |
# Define events that trigger the game state update
|
500 |
state.change(
|
501 |
update,
|
502 |
inputs=[state, radio, inp, hint],
|
503 |
+
outputs=[
|
504 |
+
state,
|
505 |
+
but,
|
506 |
+
radio,
|
507 |
+
out,
|
508 |
+
give_up,
|
509 |
+
inp,
|
510 |
+
img,
|
511 |
+
hint_out,
|
512 |
+
reload,
|
513 |
+
ranking,
|
514 |
+
finish,
|
515 |
+
],
|
516 |
)
|
517 |
|
518 |
if __name__ == "__main__":
|