# Generated by Django 3.2.21 on 2023-09-29 15:25

# Standard Library
import uuid

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


class Migration(migrations.Migration):

    dependencies = [
        ("django_easy_quiz", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="MoreInfoQuiz",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        help_text="Will be displayed below the resuls.", max_length=255
                    ),
                ),
            ],
            options={
                "verbose_name": "More-Info Quiz",
                "verbose_name_plural": "More-Info Quizzes",
            },
        ),
        migrations.CreateModel(
            name="SavedQuiz",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("uuid", models.UUIDField(default=uuid.uuid4, editable=False)),
                ("quiz_type", models.CharField(max_length=255)),
                ("started_quiz", models.DateTimeField(auto_now_add=True)),
                ("quiz_ended", models.BooleanField(default=False)),
                ("answers", models.JSONField(default={})),
                ("conclusion", models.JSONField(default={})),
                ("more_infos", models.JSONField(default={})),
                (
                    "interpretation_quiz",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="django_easy_quiz.interpretationquiz",
                    ),
                ),
                (
                    "weighted_answers_quiz",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="django_easy_quiz.weightedanswersquiz",
                    ),
                ),
            ],
            options={
                "verbose_name": "Saved Quiz",
                "verbose_name_plural": "Saved Quizzes",
            },
        ),
        migrations.CreateModel(
            name="MoreInfoQuestion",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("label", models.CharField(max_length=255)),
                (
                    "answer_is_txt",
                    models.BooleanField(
                        default=False,
                        help_text="Check this parameter to allow plain text answers instead of pre-defined answers.",
                    ),
                ),
                (
                    "quiz",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="django_easy_quiz.moreinfoquiz",
                    ),
                ),
            ],
            options={
                "verbose_name": "More-Info Question",
                "verbose_name_plural": "More-Info Questions",
            },
        ),
        migrations.CreateModel(
            name="MoreInfoAnswer",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("answer", models.CharField(max_length=512)),
                (
                    "question",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="django_easy_quiz.moreinfoquestion",
                    ),
                ),
            ],
            options={
                "verbose_name": "More-Info Answer",
                "verbose_name_plural": "More-Info Answers",
            },
        ),
        migrations.AddField(
            model_name="interpretationquiz",
            name="more_info_quiz",
            field=models.ForeignKey(
                blank=True,
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="django_easy_quiz.moreinfoquiz",
            ),
        ),
        migrations.AddField(
            model_name="weightedanswersquiz",
            name="more_info_quiz",
            field=models.ForeignKey(
                blank=True,
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="django_easy_quiz.moreinfoquiz",
            ),
        ),
    ]
