# Generated by Django 3.0.2 on 2020-05-29 18:37

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Exam',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('subject_name', models.CharField(max_length=50)),
                ('start_time', models.DateTimeField()),
                ('total_duration', models.DurationField()),
                ('total_marks', models.IntegerField(default=100)),
                ('negative_marks', models.IntegerField(default=0)),
                ('no_of_sections', models.IntegerField(default=1)),
            ],
        ),
        migrations.CreateModel(
            name='Student',
            fields=[
                ('email', models.EmailField(max_length=254, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=50)),
                ('roll_no', models.CharField(max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='Student_Exam',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('external_identifier', models.UUIDField(default=uuid.uuid4, unique=True)),
                ('warning_count', models.IntegerField(default=0)),
                ('start_time', models.DateTimeField(blank=True, null=True)),
                ('end_time', models.DateTimeField(blank=True, null=True)),
                ('ss', models.FileField(blank=True, null=True, upload_to=exam.models.Student_Exam.file_path_ss)),
                ('exam', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='exam.Exam')),
                ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='exam.Student')),
            ],
        ),
        migrations.CreateModel(
            name='Section',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('section_name', models.CharField(max_length=20)),
                ('section_duration', models.DurationField()),
                ('total_marks', models.IntegerField(default=100)),
                ('exam', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='exam.Exam')),
            ],
        ),
        migrations.CreateModel(
            name='Question',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('question_text', models.TextField()),
                ('ex_img', models.FileField(blank=True, null=True, upload_to=exam.models.Question.file_path)),
                ('question_type', models.CharField(choices=[('single_choice', 'single_choice'), ('multiple_choice', 'multiple_choice'), ('subjective', 'subjective')], default='single_choice', max_length=20)),
                ('marks', models.IntegerField(default=4)),
                ('choices', models.CharField(blank=True, max_length=100, null=True)),
                ('exam', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='exam.Exam')),
                ('section', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='exam.Section')),
            ],
        ),
        migrations.CreateModel(
            name='Student_Response',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('time_stamp', models.DateTimeField()),
                ('response', models.TextField()),
                ('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='exam.Question')),
                ('student_exam', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='exam.Student_Exam')),
            ],
            options={
                'unique_together': {('student_exam', 'question')},
            },
        ),
    ]
