# Generated by Django 5.2.17 on 2026-10-06 04:27

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('exams', '0019_workflowstate'),
    ]

    operations = [
        migrations.AddField(
            model_name='student',
            name='medium',
            field=models.CharField(choices=[('EN', 'English'), ('UR', 'Urdu / Roman Urdu')], default='EN', help_text='EN: corrections in English. UR: corrections in Urdu (Roman Urdu in inputs, Urdu script in display where supported).', max_length=2),
        ),
        migrations.CreateModel(
            name='ReasoningStep',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('current_step', models.PositiveSmallIntegerField(default=1)),
                ('completed_steps', models.JSONField(blank=True, default=list, help_text='List of step numbers the student has finished.')),
                ('faded_answers', models.JSONField(blank=True, default=dict, help_text='Answers to the faded-solution gaps, keyed by blank index.')),
                ('rewritten_answer', models.TextField(blank=True, help_text="Student's rewritten full answer (Step 3).")),
                ('submitted_at', models.DateTimeField(blank=True, help_text='When the student submitted for teacher review (Step 4).', null=True)),
                ('teacher_feedback', models.TextField(blank=True)),
                ('teacher_reviewed_at', models.DateTimeField(blank=True, null=True)),
                ('started_at', models.DateTimeField(auto_now_add=True)),
                ('last_activity', models.DateTimeField(auto_now=True, db_index=True)),
                ('exam', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reasoning_steps', to='exams.exam')),
                ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reasoning_steps', to='exams.student')),
            ],
            options={
                'ordering': ['-last_activity'],
                'indexes': [models.Index(fields=['student', 'current_step'], name='exams_reaso_student_4e84ca_idx'), models.Index(fields=['submitted_at'], name='exams_reaso_submitt_ae8a81_idx')],
                'unique_together': {('student', 'exam')},
            },
        ),
    ]
