vbv/server/vbv_lernwelt/assignment/migrations/0001_initial.py

388 lines
17 KiB
Python

# Generated by Django 3.2.13 on 2023-05-01 15:43
import django.db.models.deletion
import wagtail.blocks
import wagtail.fields
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
("course", "0006_alter_coursesession_attendance_days"),
("wagtailcore", "0083_workflowcontenttype"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name="Assignment",
fields=[
(
"page_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="wagtailcore.page",
),
),
(
"starting_position",
wagtail.fields.RichTextField(
help_text="Erläuterung der Ausgangslage"
),
),
(
"effort_required",
models.CharField(
blank=True, help_text="Zeitaufwand als Text", max_length=100
),
),
(
"performance_objectives",
wagtail.fields.StreamField(
[
(
"performance_objective",
wagtail.blocks.StructBlock(
[("text", wagtail.blocks.TextBlock())]
),
)
],
blank=True,
help_text="Leistungsziele des Auftrags",
use_json_field=True,
),
),
(
"tasks",
wagtail.fields.StreamField(
[
(
"task",
wagtail.blocks.StructBlock(
[
("title", wagtail.blocks.TextBlock()),
(
"file_submission_required",
wagtail.blocks.BooleanBlock(required=False),
),
(
"content",
wagtail.blocks.StreamBlock(
[
(
"explanation",
wagtail.blocks.StructBlock(
[
(
"text",
wagtail.blocks.RichTextBlock(
features=[
"ul",
"bold",
"italic",
]
),
)
]
),
),
(
"user_text_input",
wagtail.blocks.StructBlock(
[
(
"text",
wagtail.blocks.RichTextBlock(
blank=True,
features=[
"ul",
"bold",
"italic",
],
required=False,
),
)
]
),
),
(
"user_confirmation",
wagtail.blocks.StructBlock(
[
(
"text",
wagtail.blocks.RichTextBlock(
features=[
"ul",
"bold",
"italic",
]
),
)
]
),
),
],
blank=True,
),
),
]
),
)
],
blank=True,
help_text="Teilaufgaben",
use_json_field=True,
),
),
(
"evaluation_description",
wagtail.fields.RichTextField(
blank=True, help_text="Beschreibung der Bewertung"
),
),
(
"evaluation_document_url",
models.CharField(
blank=True,
help_text="URL zum Beurteilungsinstrument",
max_length=255,
),
),
(
"evaluation_tasks",
wagtail.fields.StreamField(
[
(
"task",
wagtail.blocks.StructBlock(
[
("title", wagtail.blocks.TextBlock()),
(
"description",
wagtail.blocks.RichTextBlock(
blank=True,
features=["ul", "bold", "italic"],
required=False,
),
),
("max_points", wagtail.blocks.IntegerBlock()),
(
"sub_tasks",
wagtail.blocks.ListBlock(
wagtail.blocks.StructBlock(
[
(
"title",
wagtail.blocks.TextBlock(),
),
(
"description",
wagtail.blocks.RichTextBlock(
blank=True,
features=[
"ul",
"bold",
"italic",
],
required=False,
),
),
(
"points",
wagtail.blocks.IntegerBlock(),
),
]
),
blank=True,
use_json_field=True,
),
),
]
),
)
],
blank=True,
help_text="Beurteilungsschritte",
use_json_field=True,
),
),
],
options={
"verbose_name": "Auftrag",
},
bases=("wagtailcore.page",),
),
migrations.CreateModel(
name="AssignmentListPage",
fields=[
(
"page_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="wagtailcore.page",
),
),
],
options={
"abstract": False,
},
bases=("wagtailcore.page",),
),
migrations.CreateModel(
name="AssignmentCompletionAuditLog",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("created_at", models.DateTimeField(auto_now_add=True)),
(
"completion_status",
models.CharField(
choices=[
(1, "in_progress"),
(2, "submitted"),
(3, "evaluation_in_progress"),
(4, "evaluation_submitted"),
],
default="in_progress",
max_length=255,
),
),
("completion_data", models.JSONField(default=dict)),
("additional_json_data", models.JSONField(default=dict)),
("assignment_user_email", models.CharField(max_length=255)),
("assignment_slug", models.CharField(max_length=255)),
(
"evaluation_user_email",
models.CharField(blank=True, default="", max_length=255),
),
(
"assignment",
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="+",
to="assignment.assignment",
),
),
(
"assignment_user",
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="+",
to=settings.AUTH_USER_MODEL,
),
),
(
"course_session",
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="+",
to="course.coursesession",
),
),
(
"evaluation_user",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="+",
to=settings.AUTH_USER_MODEL,
),
),
],
),
migrations.CreateModel(
name="AssignmentCompletion",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("created_at", models.DateTimeField(auto_now_add=True)),
("updated_at", models.DateTimeField(auto_now=True)),
("submitted_at", models.DateTimeField(blank=True, null=True)),
("evaluated_at", models.DateTimeField(blank=True, null=True)),
(
"completion_status",
models.CharField(
choices=[
(1, "in_progress"),
(2, "submitted"),
(3, "evaluation_in_progress"),
(4, "evaluation_submitted"),
],
default="in_progress",
max_length=255,
),
),
("completion_data", models.JSONField(default=dict)),
("additional_json_data", models.JSONField(default=dict)),
(
"assignment",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="assignment.assignment",
),
),
(
"assignment_user",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL,
),
),
(
"course_session",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="course.coursesession",
),
),
(
"evaluation_user",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="+",
to=settings.AUTH_USER_MODEL,
),
),
],
),
migrations.AddConstraint(
model_name="assignmentcompletion",
constraint=models.UniqueConstraint(
fields=("assignment_user", "assignment", "course_session"),
name="assignment_completion_unique_user_assignment_course_session",
),
),
]