# Generated by Django 6.0.3 on 2026-03-08 12:26

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('academics', '0001_initial'),
        ('people', '0001_initial'),
        ('tasks', '0002_alter_classtask_subject'),
    ]

    operations = [
        migrations.CreateModel(
            name='SpecificStudentTask',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=255)),
                ('description', models.TextField(blank=True, null=True)),
                ('document', models.FileField(blank=True, null=True, upload_to='tasks/specific/')),
                ('due_date', models.DateField(blank=True, null=True)),
                ('total_marks', models.PositiveIntegerField(blank=True, null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='created_specific_tasks', to='people.teacher')),
                ('subject', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='specific_tasks', to='academics.subject')),
            ],
            options={
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='SpecificStudentTaskAssignment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.CharField(choices=[('PENDING', 'Pending'), ('SUBMITTED', 'Submitted'), ('GRADED', 'Graded')], default='PENDING', max_length=20)),
                ('assigned_at', models.DateTimeField(auto_now_add=True)),
                ('academic_class', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='specific_task_assignments', to='academics.academicclass')),
                ('enrollment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='specific_task_assignments', to='academics.studentenrollment')),
                ('specific_task', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='assignments', to='tasks.specificstudenttask')),
                ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='specific_task_assignments', to='people.student')),
            ],
            options={
                'unique_together': {('specific_task', 'student')},
            },
        ),
        migrations.CreateModel(
            name='SpecificStudentTaskItem',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('question_text', models.TextField()),
                ('attachment', models.FileField(blank=True, null=True, upload_to='tasks/specific_questions/')),
                ('marks', models.PositiveIntegerField(blank=True, null=True)),
                ('order', models.PositiveIntegerField(default=1)),
                ('answer_text', models.TextField(blank=True, null=True)),
                ('answer_file', models.FileField(blank=True, null=True, upload_to='tasks/specific_answers/')),
                ('marks_obtained', models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True)),
                ('teacher_remark', models.TextField(blank=True, null=True)),
                ('submitted_at', models.DateTimeField(blank=True, null=True)),
                ('assignment', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='answers', to='tasks.specificstudenttaskassignment')),
                ('specific_task', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='task_items', to='tasks.specificstudenttask')),
            ],
            options={
                'ordering': ['order'],
            },
        ),
    ]
