vladyslav
commited on
Commit
·
159cbd7
1
Parent(s):
a8e81a1
Fixed bug with long invisible content after feedback
Browse files
app.py
CHANGED
@@ -70,7 +70,7 @@ def get_next_question(selected_answer):
|
|
70 |
gr.update(visible=False), # question_correct
|
71 |
gr.update(visible=False), # answers_correct
|
72 |
gr.update(visible=False), # interesting_question
|
73 |
-
"", # feedback_questions_output
|
74 |
)
|
75 |
|
76 |
# Writing answer in log
|
@@ -95,7 +95,7 @@ def get_next_question(selected_answer):
|
|
95 |
gr.update(visible=False), # question_correct
|
96 |
gr.update(visible=False), # answers_correct
|
97 |
gr.update(visible=False), # interesting_question
|
98 |
-
"", # feedback_questions_output
|
99 |
)
|
100 |
else:
|
101 |
# All questions are completed — ask for feedback
|
@@ -112,7 +112,7 @@ def get_next_question(selected_answer):
|
|
112 |
gr.update(visible=True), # question_correct
|
113 |
gr.update(visible=True), # answers_correct
|
114 |
gr.update(visible=True), # interesting_question
|
115 |
-
feedback_questions, # feedback_questions_output
|
116 |
)
|
117 |
|
118 |
|
@@ -138,7 +138,7 @@ def summarize_results(student_name,
|
|
138 |
gr.update(visible=True), # answers_correct
|
139 |
gr.update(visible=True), # interesting_question
|
140 |
gr.update(visible=True), # rating_text
|
141 |
-
feedback_questions, # feedback_questions_output
|
142 |
gr.update(visible=True), # feedback_not_provided
|
143 |
)
|
144 |
|
@@ -181,7 +181,7 @@ def summarize_results(student_name,
|
|
181 |
gr.update(visible=False, value=""), # answers_correct
|
182 |
gr.update(visible=False, value=""), # interesting_question
|
183 |
gr.update(visible=False), # rating_text
|
184 |
-
"", # feedback_questions_output
|
185 |
gr.update(visible=False), # feedback_not_provided
|
186 |
)
|
187 |
|
@@ -215,7 +215,7 @@ with gr.Blocks() as demo:
|
|
215 |
answer_radio = gr.Radio([], label="Варіанти відповіді", interactive=True, visible=False)
|
216 |
next_button = gr.Button("Наступне питання", visible=False)
|
217 |
|
218 |
-
feedback_questions_output = gr.Markdown(label="Пройдені питання")
|
219 |
rating_text = gr.Markdown(
|
220 |
"### Шкала оцінювання:\n\n#### -2 — дуже погано\n\n#### -1 — погано\n\n#### 0 — задовільно\n\n#### 1 — добре\n\n#### 2 — відмінно",
|
221 |
visible=False)
|
@@ -245,7 +245,7 @@ with gr.Blocks() as demo:
|
|
245 |
gr.update(visible=False, value=""), # question_correct
|
246 |
gr.update(visible=False, value=""), # answers_correct
|
247 |
gr.update(visible=False, value=""), # interesting_question
|
248 |
-
"", # feedback_questions_output
|
249 |
gr.update(visible=False), # feedback_not_provided
|
250 |
)
|
251 |
|
|
|
70 |
gr.update(visible=False), # question_correct
|
71 |
gr.update(visible=False), # answers_correct
|
72 |
gr.update(visible=False), # interesting_question
|
73 |
+
gr.update(visible=False, value=""), # feedback_questions_output
|
74 |
)
|
75 |
|
76 |
# Writing answer in log
|
|
|
95 |
gr.update(visible=False), # question_correct
|
96 |
gr.update(visible=False), # answers_correct
|
97 |
gr.update(visible=False), # interesting_question
|
98 |
+
gr.update(visible=False, value=""), # feedback_questions_output
|
99 |
)
|
100 |
else:
|
101 |
# All questions are completed — ask for feedback
|
|
|
112 |
gr.update(visible=True), # question_correct
|
113 |
gr.update(visible=True), # answers_correct
|
114 |
gr.update(visible=True), # interesting_question
|
115 |
+
gr.update(visible=True, value=feedback_questions), # feedback_questions_output
|
116 |
)
|
117 |
|
118 |
|
|
|
138 |
gr.update(visible=True), # answers_correct
|
139 |
gr.update(visible=True), # interesting_question
|
140 |
gr.update(visible=True), # rating_text
|
141 |
+
gr.update(visible=True, value=feedback_questions), # feedback_questions_output
|
142 |
gr.update(visible=True), # feedback_not_provided
|
143 |
)
|
144 |
|
|
|
181 |
gr.update(visible=False, value=""), # answers_correct
|
182 |
gr.update(visible=False, value=""), # interesting_question
|
183 |
gr.update(visible=False), # rating_text
|
184 |
+
gr.update(visible=False, value=""), # feedback_questions_output
|
185 |
gr.update(visible=False), # feedback_not_provided
|
186 |
)
|
187 |
|
|
|
215 |
answer_radio = gr.Radio([], label="Варіанти відповіді", interactive=True, visible=False)
|
216 |
next_button = gr.Button("Наступне питання", visible=False)
|
217 |
|
218 |
+
feedback_questions_output = gr.Markdown(label="Пройдені питання", value="Nothing", visible=False)
|
219 |
rating_text = gr.Markdown(
|
220 |
"### Шкала оцінювання:\n\n#### -2 — дуже погано\n\n#### -1 — погано\n\n#### 0 — задовільно\n\n#### 1 — добре\n\n#### 2 — відмінно",
|
221 |
visible=False)
|
|
|
245 |
gr.update(visible=False, value=""), # question_correct
|
246 |
gr.update(visible=False, value=""), # answers_correct
|
247 |
gr.update(visible=False, value=""), # interesting_question
|
248 |
+
gr.update(visible=False, value=""), # feedback_questions_output
|
249 |
gr.update(visible=False), # feedback_not_provided
|
250 |
)
|
251 |
|