vladyslav commited on
Commit
fbaf544
·
1 Parent(s): 255e287

Add 12-point grading scale to summary output

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -84,7 +84,15 @@ def summarize_results(student_name, class_name, model, book, feedback, rating):
84
 
85
  correct_answers_count = sum(1 for answer in answers_log if answer['isCorrect'])
86
  total_questions = len(questions_data)
87
- summary = f"# Усі питання пройдено.\n\n## Ви відповіли правильно на {correct_answers_count} з {total_questions} питань.\n\n### Ваш відгук: {feedback}\n### Ваша оцінка: {rating}/5"
 
 
 
 
 
 
 
 
88
  return summary, gr.update(visible=False, value=""), gr.update(visible=False, value=0), gr.update(visible=False)
89
 
90
 
 
84
 
85
  correct_answers_count = sum(1 for answer in answers_log if answer['isCorrect'])
86
  total_questions = len(questions_data)
87
+
88
+ grade_12 = (correct_answers_count / total_questions) * 12
89
+
90
+ summary = (
91
+ f"# Усі питання пройдено.\n\n"
92
+ f"## Ви відповіли правильно на {correct_answers_count} з {total_questions} питань.\n\n"
93
+ f"## Оцінка за 12-бальною шкалою: {grade_12:.2f}\n\n"
94
+ )
95
+
96
  return summary, gr.update(visible=False, value=""), gr.update(visible=False, value=0), gr.update(visible=False)
97
 
98