start physics...

This commit is contained in:
Ross
2020-12-15 23:07:06 +00:00
parent fc098f681c
commit 90f69c2c14
26 changed files with 1301 additions and 1 deletions
+72
View File
@@ -0,0 +1,72 @@
# Generated by Django 3.1.3 on 2020-12-15 18:36
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import sortedm2m.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('category', models.CharField(max_length=200)),
],
),
migrations.CreateModel(
name='Question',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('stem', models.TextField(help_text='Stem of the question')),
('a', models.TextField(help_text='The question text')),
('a_answer', models.BooleanField(default=True, help_text='Answer')),
('b', models.TextField(help_text='The question text')),
('b_answer', models.BooleanField(default=True, help_text='Answer')),
('c', models.TextField(help_text='The question text')),
('c_answer', models.BooleanField(default=True, help_text='Answer')),
('d', models.TextField(help_text='The question text')),
('d_answer', models.BooleanField(default=True, help_text='Answer')),
('e', models.TextField(help_text='The question text')),
('e_answer', models.BooleanField(default=True, help_text='Answer')),
('created_date', models.DateTimeField(default=django.utils.timezone.now)),
('author', models.ManyToManyField(blank=True, help_text='Author(s) of question', related_name='physics_authored_questions', to=settings.AUTH_USER_MODEL)),
('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='physics.category')),
],
),
migrations.CreateModel(
name='Exam',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200)),
('active', models.BooleanField(default=True, help_text='If an exam should be available')),
('publish_results', models.BooleanField(default=True, help_text='If an exams results should be available')),
('exam_questions', sortedm2m.fields.SortedManyToManyField(blank='true', help_text=None, related_name='exams', to='physics.Question')),
],
),
migrations.CreateModel(
name='CidUserAnswer',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('a', models.BooleanField()),
('b', models.BooleanField()),
('c', models.BooleanField()),
('d', models.BooleanField()),
('e', models.BooleanField()),
('cid', models.IntegerField(blank=True, null=True)),
('created', models.DateTimeField(auto_now_add=True)),
('updated', models.DateTimeField(auto_now=True)),
('exam', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='cid_user_answers', to='physics.exam')),
('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cid_user_answers', to='physics.question')),
],
),
]
View File