# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-07-15 14:46
from __future__ import unicode_literals

import coding.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('codetests', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Answer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('attempt', models.IntegerField(default=0)),
                ('starttime', models.DateTimeField(null=True)),
                ('endtime', models.DateTimeField(null=True)),
                ('uploadtime', models.DateTimeField(null=True)),
                ('qnset', models.FileField(null=True, upload_to=coding.models.qn_upload)),
                ('solution', models.FileField(null=True, upload_to=coding.models.sol_upload)),
                ('ans', models.FileField(null=True, upload_to=coding.models.ans_upload)),
                ('codefile', models.FileField(null=True, upload_to=coding.models.code_upload)),
                ('qtype', models.CharField(choices=[('small', 'small'), ('large', 'large')], default='small', max_length=10)),
                ('result', models.CharField(choices=[('pass', 'pass'), ('fail', 'fail'), ('unattempted', 'unattempted')], default='unattempted', max_length=12)),
                ('coderesult', models.CharField(choices=[('pass', 'pass'), ('fail', 'fail'), ('unattempted', 'unattempted')], default='unattempted', max_length=12)),
                ('qn', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='codetests.Qns')),
            ],
        ),
        migrations.CreateModel(
            name='TestAttempt',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('start', models.DateTimeField(auto_now_add=True)),
                ('score', models.IntegerField(default=0)),
                ('testid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='codetests.CodeTests')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='answer',
            name='testattempt',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='coding.TestAttempt'),
        ),
    ]
