Audit fixes 2026-10-03: seed keeps admin edits, plan cache, refresh limit, payment and tutor guards
- seed_content no longer undoes admin work: a SeedRecord ledger (content/seed_sync.py) stops deleted/renamed/re-worded content from being recreated and keeps admin-edited lesson text; new rows in the seed files still arrive (migration content.0010) - plan list cache is invalidated on Plan save (receiver used a stale 'v1' key) - token refresh per-IP cap 30/hour -> 600/hour (TOKEN_REFRESH_IP_RATE) - a failed gateway result only changes a pending order (forged NOK no longer overwrites refunded/canceled) - tutor gets the correct answer only after the student has answered - support reply notification moved to a TicketMessage post_save signal - global daily cap on paid AI questions (AI_GLOBAL_DAILY_MAX, default 3000) - Bazaar verify uses only the order's SKU; bazaar orders require a SKU - /api/health warns on the committed signing key; deploy.sh saves local commits; 400 for bad ?unit= / ?period=; account delete keeps the referrer's Conversion - earlier today: no stub answers outside DEBUG, ?grade= removed, logged fallbacks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -459,8 +459,15 @@ def question_focus(question_id, user_id) -> str:
|
||||
'دانشآموز دربارهی این سوالِ تمرینِ اپ میپرسد:',
|
||||
f'صورتِ سوال: {question.prompt}',
|
||||
'گزینهها: ' + ' | '.join(c.value for c in choices),
|
||||
f'جوابِ درست: {correct}',
|
||||
]
|
||||
# جوابِ درست فقط بعد از اینکه خودش جواب داده. تا ۲۰۲۶-۱۰-۰۳ همیشه میرفت: کسی که API را
|
||||
# مستقیم صدا میزد پیش از جواب دادن، جواب را از دستیار میگرفت و امتیاز میبرد (فرانت دکمه را
|
||||
# فقط بعد از جوابِ غلط نشان میدهد، ولی سرور شرطی نداشت). اینکه مدل در آن حالت جواب را
|
||||
# تکرار میکرد با مدلِ زنده آزموده نشد؛ فقط رسیدنش به پرامپت.
|
||||
if last is None:
|
||||
lines.append('دانشآموز هنوز جواب نداده؛ جوابِ نهایی یا گزینهی درست را نگو، فقط راهِ فکر کردن را نشان بده.')
|
||||
else:
|
||||
lines.append(f'جوابِ درست: {correct}')
|
||||
if last is not None:
|
||||
verdict = 'درست' if last.correct else 'غلط'
|
||||
lines.append(f'آخرین جوابِ دانشآموز: {last.choice.value} ({verdict})')
|
||||
|
||||
Reference in New Issue
Block a user