# Generated by Django 3.0.4 on 2020-03-19 10:27

import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    dependencies = [
        ('crm', '0006_auto_20200310_1531'),
        ('question', '0007_auto_20200319_0846'),
        ('examtest', '0007_auto_20200319_1355'),
    ]

    operations = [
        migrations.CreateModel(
            name='AnswerDetail',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_delete', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('user_answer', django.contrib.postgres.fields.jsonb.JSONField()),
                ('score', models.FloatField(default=0, verbose_name='本题得分')),
                ('is_right', models.BooleanField(default=False, verbose_name='是否正确')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AlterModelOptions(
            name='testrule',
            options={'verbose_name': '出题规则', 'verbose_name_plural': '出题规则'},
        ),
        migrations.AlterField(
            model_name='testrule',
            name='danxuan_score',
            field=models.FloatField(default=0, verbose_name='单选分数'),
        ),
        migrations.AlterField(
            model_name='testrule',
            name='duoxuan_score',
            field=models.FloatField(default=0, verbose_name='多选分数'),
        ),
        migrations.AlterField(
            model_name='testrule',
            name='panduan_score',
            field=models.FloatField(default=0, verbose_name='判断分数'),
        ),
        migrations.CreateModel(
            name='ExamTest',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_delete', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('name', models.CharField(max_length=200, verbose_name='名称')),
                ('type', models.CharField(default='自助模考', max_length=50, verbose_name='考试类型')),
                ('limit', models.IntegerField(default=0, verbose_name='限时(分钟)')),
                ('score', models.IntegerField(default=0, verbose_name='得分')),
                ('took', models.IntegerField(default=0, verbose_name='耗时(秒)')),
                ('start_time', models.DateTimeField(verbose_name='开始答题时间')),
                ('end_time', models.DateTimeField(verbose_name='结束答题时间')),
                ('consumer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='crm.Consumer', verbose_name='模考人')),
                ('detail', models.ManyToManyField(related_name='答题记录', through='examtest.AnswerDetail', to='question.Question')),
                ('rule', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='examtest.TestRule', verbose_name='出题规则')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='answerdetail',
            name='examtest',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='examtest.ExamTest'),
        ),
        migrations.AddField(
            model_name='answerdetail',
            name='question',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='question.Question'),
        ),
    ]
