vladyslav
commited on
Commit
·
e165dce
1
Parent(s):
074b318
Small text formatting updates
Browse files
app.py
CHANGED
@@ -43,7 +43,7 @@ def load_questions(model, book):
|
|
43 |
|
44 |
if questions_data:
|
45 |
first_question = questions_data[current_question_index]
|
46 |
-
question_text = f"
|
47 |
answers = [answer['answer'] for answer in first_question['answers']]
|
48 |
return question_text, answers
|
49 |
else:
|
@@ -63,14 +63,14 @@ def get_next_question(selected_answer):
|
|
63 |
current_question_index += 1
|
64 |
if current_question_index < len(questions_data):
|
65 |
next_question = questions_data[current_question_index]
|
66 |
-
question_text = f"
|
67 |
answers = [answer['answer'] for answer in next_question['answers']]
|
68 |
return question_text, gr.update(choices=answers, interactive=True), gr.update(visible=True)
|
69 |
else:
|
70 |
# All questions are completed — summarizing
|
71 |
correct_answers_count = sum(1 for answer in answers_log if answer['isCorrect'])
|
72 |
total_questions = len(questions_data)
|
73 |
-
summary = f"# Усі питання пройдено.\n\n
|
74 |
return summary, gr.update(visible=False), gr.update(visible=False)
|
75 |
|
76 |
|
|
|
43 |
|
44 |
if questions_data:
|
45 |
first_question = questions_data[current_question_index]
|
46 |
+
question_text = f"# Питання:\n## {first_question['question']}"
|
47 |
answers = [answer['answer'] for answer in first_question['answers']]
|
48 |
return question_text, answers
|
49 |
else:
|
|
|
63 |
current_question_index += 1
|
64 |
if current_question_index < len(questions_data):
|
65 |
next_question = questions_data[current_question_index]
|
66 |
+
question_text = f"# Питання:\n## {next_question['question']}"
|
67 |
answers = [answer['answer'] for answer in next_question['answers']]
|
68 |
return question_text, gr.update(choices=answers, interactive=True), gr.update(visible=True)
|
69 |
else:
|
70 |
# All questions are completed — summarizing
|
71 |
correct_answers_count = sum(1 for answer in answers_log if answer['isCorrect'])
|
72 |
total_questions = len(questions_data)
|
73 |
+
summary = f"# Усі питання пройдено.\n\n##**Ви відповіли правильно на {correct_answers_count} з {total_questions} питань.**"
|
74 |
return summary, gr.update(visible=False), gr.update(visible=False)
|
75 |
|
76 |
|