return mascotMood on answer submission
The math-app frontend prototype drives a RobotMascot with a fixed set of
moods; this gives that animation an explicit backend signal. Complements
the existing Lesson.mascot_animation / LessonIntro.mascotAnimation, which
are unchanged.
serializers.py
- AnswerResponseSerializer: new mascotMood field.
views.py
- QuestionAnswerView: mascotMood = 'happy' for a correct answer else
'encourage', on both the fresh response and the idempotent-replay
response.
tests.py
- QuestionAnswerMascotMoodTests: correct -> happy, wrong -> encourage,
and the mood is preserved across an idempotent replay.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -79,6 +79,9 @@ class AnswerResponseSerializer(serializers.Serializer):
|
||||
correctOptionId = serializers.CharField()
|
||||
xpEarned = serializers.IntegerField()
|
||||
heartsRemaining = serializers.IntegerField()
|
||||
# حالتِ انیمیشنِ ماسکوت («رُبو») برای فرانت: جوابِ درست → happy، غلط →
|
||||
# encourage. همخوان با RobotMood در MathApp_frontend.
|
||||
mascotMood = serializers.CharField()
|
||||
|
||||
|
||||
# ---- Lesson completion ----
|
||||
|
||||
Reference in New Issue
Block a user