56 lines
1.7 KiB
Python
56 lines
1.7 KiB
Python
import wagtail_factories
|
|
|
|
from vbv_lernwelt.assignment.models import AssignmentPage, Assignment, TaskBlock
|
|
|
|
|
|
class ExplanationBlockFactory(wagtail_factories.StructBlockFactory):
|
|
class Meta:
|
|
model = "assignment.ExplanationBlock"
|
|
|
|
text = """Erläutere die Kundensituation und die Ausgangslage.
|
|
Hast du alle Informationen, die du für den Policen-Check benötigst?
|
|
Halte die wichtigsten Eckwerte des aktuellen Versicherungsverhältnisse in deiner Dokumentation fest (z.B wie lang wo versichert, Alter des Fahrzeugs, Kundenprofil, etc.)
|
|
"""
|
|
|
|
|
|
class UserTextInputBlockFactory(wagtail_factories.StructBlockFactory):
|
|
class Meta:
|
|
model = "assignment.UserTextInputBlock"
|
|
|
|
|
|
class UserConfirmationBlockFactory(wagtail_factories.StructBlockFactory):
|
|
class Meta:
|
|
model = "assignment.UserConfirmationBlock"
|
|
|
|
confirmation_text = "Ja, ich habe Motorfahrzeugversicherungspolice von jemandem aus meiner Familie oder meinem Freundeskreis erhalten."
|
|
|
|
|
|
class TaskBlockFactory(wagtail_factories.StructBlockFactory):
|
|
class Meta:
|
|
model = TaskBlock
|
|
|
|
title = "Teilauftrag"
|
|
file_submission_required = False
|
|
content = wagtail_factories.StreamFieldFactory(
|
|
[
|
|
("explanation", ExplanationBlockFactory()),
|
|
("user_text_input", UserTextInputBlockFactory()),
|
|
("user_confirmation", UserConfirmationBlockFactory()),
|
|
],
|
|
use_json_field=True,
|
|
)
|
|
|
|
|
|
class AssignmentFactory(wagtail_factories.PageFactory):
|
|
title = "Auftrag"
|
|
|
|
class Meta:
|
|
model = Assignment
|
|
|
|
|
|
class AssignmentPageFactory(wagtail_factories.PageFactory):
|
|
title = "Aufträge"
|
|
|
|
class Meta:
|
|
model = AssignmentPage
|