Spaces:
Sleeping
Sleeping
Jonas Wiesli
commited on
Commit
•
2fa8fbf
1
Parent(s):
99163bf
changed remaining questions box
Browse files
app.py
CHANGED
@@ -46,7 +46,7 @@ with gr.Blocks() as iface:
|
|
46 |
|
47 |
with gr.Row():
|
48 |
with gr.Column(scale=2):
|
49 |
-
questionCounter = gr.Label(
|
50 |
finishButton = gr.Button("Try to Solve")
|
51 |
with gr.Column(scale=10):
|
52 |
i = 0
|
@@ -117,16 +117,17 @@ with gr.Blocks() as iface:
|
|
117 |
return "--- YOU'VE RUN OUT OF QUESTIONS, MAKE YOUR CHOICE ---"
|
118 |
|
119 |
def updateQuestions(questionCounterText):
|
120 |
-
remainingQuestions = int(questionCounterText["
|
121 |
if remainingQuestions > 0:
|
122 |
remainingQuestions -= 1
|
123 |
-
return
|
124 |
|
125 |
def checkIfQuestionsLeft(questionCounterText):
|
126 |
-
remainingQuestions = int(questionCounterText["
|
127 |
return remainingQuestions > 0
|
128 |
|
129 |
def tryToSolve():
|
|
|
130 |
return {solvingBox: gr.update(visible=True)}
|
131 |
|
132 |
# again, ugly workaround
|
|
|
46 |
|
47 |
with gr.Row():
|
48 |
with gr.Column(scale=2):
|
49 |
+
questionCounter = gr.Label(label="Remaining Questions", value="24")
|
50 |
finishButton = gr.Button("Try to Solve")
|
51 |
with gr.Column(scale=10):
|
52 |
i = 0
|
|
|
117 |
return "--- YOU'VE RUN OUT OF QUESTIONS, MAKE YOUR CHOICE ---"
|
118 |
|
119 |
def updateQuestions(questionCounterText):
|
120 |
+
remainingQuestions = int(questionCounterText["value"])
|
121 |
if remainingQuestions > 0:
|
122 |
remainingQuestions -= 1
|
123 |
+
return str(remainingQuestions)
|
124 |
|
125 |
def checkIfQuestionsLeft(questionCounterText):
|
126 |
+
remainingQuestions = int(questionCounterText["value"])
|
127 |
return remainingQuestions > 0
|
128 |
|
129 |
def tryToSolve():
|
130 |
+
print("ayy you clicked")
|
131 |
return {solvingBox: gr.update(visible=True)}
|
132 |
|
133 |
# again, ugly workaround
|