Update app.py
Browse files
app.py
CHANGED
|
@@ -128,7 +128,7 @@ def penalize_for_grammar(student_answer):
|
|
| 128 |
grammar_errors, _ = detect_grammar_errors(student_answer) # Only take the first element (error count)
|
| 129 |
|
| 130 |
# Apply a penalty based on the number of grammar errors (max 70% penalty)
|
| 131 |
-
penalty = max(0.
|
| 132 |
return penalty
|
| 133 |
|
| 134 |
|
|
|
|
| 128 |
grammar_errors, _ = detect_grammar_errors(student_answer) # Only take the first element (error count)
|
| 129 |
|
| 130 |
# Apply a penalty based on the number of grammar errors (max 70% penalty)
|
| 131 |
+
penalty = max(0.8, 1 - 0.1 * grammar_errors)
|
| 132 |
return penalty
|
| 133 |
|
| 134 |
|