# Generated by Django 5.2.17 on 2026-10-02 11:01

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


class Migration(migrations.Migration):

    dependencies = [
        ('exams', '0004_student_parent_user_student_student_user'),
    ]

    operations = [
        migrations.CreateModel(
            name='StoryLecture',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('subject', models.CharField(db_index=True, max_length=50)),
                ('chapter', models.CharField(blank=True, max_length=200)),
                ('question_text', models.TextField(help_text='The listed question this story teaches')),
                ('question_index', models.PositiveSmallIntegerField(help_text='1, 2, or 3 - which of the three listed questions')),
                ('story_text', models.TextField(help_text='Full story lecture in Roman Urdu')),
                ('analogy_used', models.CharField(blank=True, help_text='The human analogy, e.g. bond = marriage', max_length=200)),
                ('comprehension_question', models.TextField(help_text='One open question the student reflects on (3-line answer)')),
                ('teaching_date', models.DateField(db_index=True)),
                ('source_exam_date', models.DateField(help_text='Day 1 test that this story teaches')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'ordering': ['teaching_date', 'subject', 'question_index'],
                'unique_together': {('subject', 'question_index', 'teaching_date')},
            },
        ),
        migrations.CreateModel(
            name='StoryReflection',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('reflection_text', models.TextField(help_text='Student 3-line answer in Roman Urdu')),
                ('submitted_at', models.DateTimeField(auto_now_add=True)),
                ('story', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reflections', to='exams.storylecture')),
                ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='story_reflections', to='exams.student')),
            ],
            options={
                'ordering': ['-submitted_at'],
                'unique_together': {('student', 'story')},
            },
        ),
        migrations.CreateModel(
            name='ReflectionScore',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('solo_level', models.PositiveSmallIntegerField(choices=[(0, 'Prestructural - missing the point'), (1, 'Unistructural - one relevant idea'), (2, 'Multistructural - several ideas, unconnected'), (3, 'Relational - ideas connected, explains why'), (4, 'Extended abstract - generalizes')])),
                ('teacher_comment', models.TextField(blank=True)),
                ('scored_at', models.DateTimeField(auto_now_add=True)),
                ('reflection', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='score', to='exams.storyreflection')),
            ],
            options={
                'ordering': ['-scored_at'],
            },
        ),
    ]
