vladyslav commited on
Commit
d816512
·
1 Parent(s): fbe821c

Text fixes

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -24,7 +24,7 @@ feedback_questions = ""
24
  def get_question():
25
  global questions_data, current_question_index
26
  question = questions_data[current_question_index]
27
- question_text = f"## Питання {current_question_index + 1}/{len(questions_data)}:\n### {question['question']}"
28
  answers = [answer['answer'] for answer in question['answers']]
29
  random.shuffle(answers)
30
  return question_text, answers
@@ -97,7 +97,7 @@ def get_next_question(selected_answer):
97
  )
98
  else:
99
  # All questions are completed — ask for feedback
100
- question_text = "## Дякуємо за участь у тесті!\n## Нижче можете переглянути ваші та правильні відповіді\n## Залиште, будь ласка, відгук про тест в кінці сторінки.\n---"
101
  feedback_questions = prepare_questions_for_feedback(questions_data, answers_log)
102
  return (
103
  question_text, # question_radio
@@ -126,7 +126,7 @@ def summarize_results(student_name,
126
 
127
  if question_correct is None or answers_correct is None or interesting_question is None:
128
  return (
129
- "## Залиште відгук про тест!", # question_output
130
  gr.update(visible=True), # feedback_input
131
  gr.update(visible=True), # submit_feedback_button
132
  gr.update(visible=True), # question_correct
@@ -163,9 +163,9 @@ def summarize_results(student_name,
163
  )
164
 
165
  summary = (
166
- f"### Тест для моделі {model} закінчено!\n\n"
167
- f"### Ви відповіли правильно на {correct_answers_count} з {total_questions} питань.\n\n"
168
- f"### Оцінка за 12-бальною шкалою: {grade_12:.2f}.\n\n"
169
  )
170
 
171
  return (
@@ -185,8 +185,8 @@ def prepare_questions_for_feedback(questions, answer_log):
185
  feedback = []
186
 
187
  for i, question in enumerate(questions):
188
- question_text = f"### Питання: {question['question']}"
189
- quote = f"### Цитата: *{question['textPart']}*"
190
  user_answer = answer_log[i]['selected']
191
  answers_text = "\n".join(
192
  [
@@ -195,7 +195,7 @@ def prepare_questions_for_feedback(questions, answer_log):
195
  ]
196
  )
197
 
198
- feedback.append(f"{question_text}\n{quote}\n### Відповіді:\n{answers_text}\n---")
199
 
200
  return "\n".join(feedback)
201
 
@@ -206,7 +206,7 @@ def update_students(class_name):
206
 
207
  with gr.Blocks() as demo:
208
  with gr.Column():
209
- gr.Markdown("# Оберіть модель та книгу, щоб завантажити питання")
210
 
211
  class_name_input = gr.Dropdown(choices=CLASSES, label="Ваш клас", value=None)
212
  student_name_input = gr.Dropdown(label="Ваше ім'я", value=None, visible=False)
 
24
  def get_question():
25
  global questions_data, current_question_index
26
  question = questions_data[current_question_index]
27
+ question_text = f"### Питання {current_question_index + 1}/{len(questions_data)}:\n#### {question['question']}"
28
  answers = [answer['answer'] for answer in question['answers']]
29
  random.shuffle(answers)
30
  return question_text, answers
 
97
  )
98
  else:
99
  # All questions are completed — ask for feedback
100
+ question_text = "#### Дякуємо за участь у тесті!\n#### Нижче можете переглянути ваші та правильні відповіді\n#### Залиште, будь ласка, відгук про тест в кінці сторінки.\n---"
101
  feedback_questions = prepare_questions_for_feedback(questions_data, answers_log)
102
  return (
103
  question_text, # question_radio
 
126
 
127
  if question_correct is None or answers_correct is None or interesting_question is None:
128
  return (
129
+ "### Залиште відгук про тест!", # question_output
130
  gr.update(visible=True), # feedback_input
131
  gr.update(visible=True), # submit_feedback_button
132
  gr.update(visible=True), # question_correct
 
163
  )
164
 
165
  summary = (
166
+ f"#### Тест для моделі {model} закінчено!\n\n"
167
+ f"#### Ви відповіли правильно на {correct_answers_count} з {total_questions} питань.\n\n"
168
+ f"#### Оцінка за 12-бальною шкалою: {grade_12:.2f}.\n\n"
169
  )
170
 
171
  return (
 
185
  feedback = []
186
 
187
  for i, question in enumerate(questions):
188
+ question_text = f"#### Питання: {question['question']}"
189
+ quote = f"#### Цитата: *{question['textPart']}*"
190
  user_answer = answer_log[i]['selected']
191
  answers_text = "\n".join(
192
  [
 
195
  ]
196
  )
197
 
198
+ feedback.append(f"{question_text}\n{quote}\n#### Відповіді:\n{answers_text}\n---")
199
 
200
  return "\n".join(feedback)
201
 
 
206
 
207
  with gr.Blocks() as demo:
208
  with gr.Column():
209
+ gr.Markdown("### Оберіть модель та книгу, щоб завантажити питання")
210
 
211
  class_name_input = gr.Dropdown(choices=CLASSES, label="Ваш клас", value=None)
212
  student_name_input = gr.Dropdown(label="Ваше ім'я", value=None, visible=False)