Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -716,6 +716,15 @@ def grade_standard(student_name: str, student_class: str, title: str, student_su
|
|
| 716 |
remarks = (data.get("remarks") or "").strip()
|
| 717 |
|
| 718 |
wc = count_words(student_summary)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 719 |
len_s = length_stars(wc)
|
| 720 |
grammar_star = round(grammar_stars_from_count(len(issues)), 1)
|
| 721 |
|
|
|
|
| 716 |
remarks = (data.get("remarks") or "").strip()
|
| 717 |
|
| 718 |
wc = count_words(student_summary)
|
| 719 |
+
# 🚫 Hard fail for short summaries
|
| 720 |
+
if wc < 100:
|
| 721 |
+
md = [
|
| 722 |
+
"### 📚 Standard Mode — Grading Report",
|
| 723 |
+
"> ## ❌ FINAL SCORE: −1 ⭐",
|
| 724 |
+
f"> **Reason:** Too short ({wc} words). Minimum 100 words required."
|
| 725 |
+
]
|
| 726 |
+
return "\n".join(md), "", "Not saved."
|
| 727 |
+
|
| 728 |
len_s = length_stars(wc)
|
| 729 |
grammar_star = round(grammar_stars_from_count(len(issues)), 1)
|
| 730 |
|