Update dummy data and factories
This commit is contained in:
parent
39f542c638
commit
6ba06e9fe9
|
|
@ -7,7 +7,7 @@ from factory import CREATE_STRATEGY
|
||||||
from wagtail.core.rich_text import RichText
|
from wagtail.core.rich_text import RichText
|
||||||
|
|
||||||
from assignments.models import Assignment
|
from assignments.models import Assignment
|
||||||
from book.blocks import BasicKnowledgeBlock, ImageUrlBlock, LinkBlock, AssignmentBlock
|
from book.blocks import BasicKnowledgeBlock, ImageUrlBlock, LinkBlock, AssignmentBlock, VideoBlock
|
||||||
from book.models import Book, Topic, Module, Chapter, ContentBlock, TextBlock
|
from book.models import Book, Topic, Module, Chapter, ContentBlock, TextBlock
|
||||||
from core.factories import BasePageFactory, fake, DummyImageFactory, fake_paragraph, fake_title
|
from core.factories import BasePageFactory, fake, DummyImageFactory, fake_paragraph, fake_title
|
||||||
|
|
||||||
|
|
@ -78,6 +78,12 @@ class AssignmentBlockFactory(wagtail_factories.StructBlockFactory):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = AssignmentBlock
|
model = AssignmentBlock
|
||||||
|
|
||||||
|
class VideoBlockFactory(wagtail_factories.StructBlockFactory):
|
||||||
|
url = factory.LazyAttribute(lambda x: 'https://www.youtube.com/watch?v=lO9d-AJai8Q')
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = VideoBlock
|
||||||
|
|
||||||
|
|
||||||
block_types = ['text_block', 'basic_knowledge', 'student_entry', 'image_block', 'task']
|
block_types = ['text_block', 'basic_knowledge', 'student_entry', 'image_block', 'task']
|
||||||
|
|
||||||
|
|
@ -94,6 +100,8 @@ class ContentBlockFactory(BasePageFactory):
|
||||||
'assignment': AssignmentBlockFactory,
|
'assignment': AssignmentBlockFactory,
|
||||||
'image_block': wagtail_factories.ImageChooserBlockFactory,
|
'image_block': wagtail_factories.ImageChooserBlockFactory,
|
||||||
'image_url_block': ImageUrlBlockFactory,
|
'image_url_block': ImageUrlBlockFactory,
|
||||||
|
'link_block': LinkBlockFactory,
|
||||||
|
'video_block': VideoBlockFactory,
|
||||||
'task': TextBlockFactory
|
'task': TextBlockFactory
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -130,10 +138,10 @@ class ContentBlockFactory(BasePageFactory):
|
||||||
if block_type == 'text_block':
|
if block_type == 'text_block':
|
||||||
kwargs['{}__{}__{}__{}'.format(stream_field_name, idx, block_type, field)] = RichText(
|
kwargs['{}__{}__{}__{}'.format(stream_field_name, idx, block_type, field)] = RichText(
|
||||||
value[field])
|
value[field])
|
||||||
if block_type == 'task':
|
elif block_type == 'task':
|
||||||
kwargs['{}__{}__{}__{}'.format(stream_field_name, idx, block_type, field)] = RichText(
|
kwargs['{}__{}__{}__{}'.format(stream_field_name, idx, block_type, field)] = RichText(
|
||||||
value[field])
|
value[field])
|
||||||
if block_type == 'basic_knowledge':
|
elif block_type == 'basic_knowledge':
|
||||||
if field == 'description':
|
if field == 'description':
|
||||||
kwargs[
|
kwargs[
|
||||||
'{}__{}__{}__{}'.format(stream_field_name, idx, block_type, field)] = RichText(
|
'{}__{}__{}__{}'.format(stream_field_name, idx, block_type, field)] = RichText(
|
||||||
|
|
@ -146,7 +154,9 @@ class ContentBlockFactory(BasePageFactory):
|
||||||
kwargs[
|
kwargs[
|
||||||
'{}__{}__{}__{}'.format(stream_field_name, idx, block_type, field)] = value[field]
|
'{}__{}__{}__{}'.format(stream_field_name, idx, block_type, field)] = value[field]
|
||||||
|
|
||||||
|
else:
|
||||||
|
kwargs[
|
||||||
|
'{}__{}__{}__{}'.format(stream_field_name, idx, block_type, field)] = value[field]
|
||||||
|
|
||||||
# image file
|
# image file
|
||||||
#
|
#
|
||||||
|
|
|
||||||
|
|
@ -92,9 +92,10 @@ data = [
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'type': 'link',
|
'type': 'link_block',
|
||||||
'value': {
|
'value': {
|
||||||
'text': '<p>Raum: Welt ohne Geld.</p>'
|
'text': 'Raum: Welt ohne Geld.',
|
||||||
|
'url': 'https://google.ch'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
@ -392,7 +393,7 @@ data = [
|
||||||
'type': 'image_url_block',
|
'type': 'image_url_block',
|
||||||
'value': {
|
'value': {
|
||||||
'title': '',
|
'title': '',
|
||||||
'url': 'https://ucarecdn.com/6d57537c-f75f-4c2e-9ea5-d2e3d2490c0d/'
|
'url': 'https://ucarecdn.com/01066102-8a8a-47e8-9cce-ac00703482a9/zettel.png'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -525,20 +526,6 @@ data = [
|
||||||
'url': 'https://www.youtube.com/watch?v=BPpLF3W2ZOc'
|
'url': 'https://www.youtube.com/watch?v=BPpLF3W2ZOc'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
'type': 'task',
|
|
||||||
'value': {
|
|
||||||
'text': '<p>Vergleichen Sie Ihre Notizen mit den Musterlösungen und ergänzen Sie, wo nötig.</p>'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'type': 'link_block',
|
|
||||||
'value': {
|
|
||||||
'text': 'Musterlösung: Notizen',
|
|
||||||
'url': 'https://myskillbox.ch/rooms'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
@ -548,7 +535,19 @@ data = [
|
||||||
'content_blocks': [
|
'content_blocks': [
|
||||||
{
|
{
|
||||||
'type': 'yellow',
|
'type': 'yellow',
|
||||||
'title': 'Basiswissen: Geldanlagen',
|
'title': 'Basiswissen: Geldanlage',
|
||||||
|
'contents': [
|
||||||
|
{
|
||||||
|
'type': 'basic_knowledge',
|
||||||
|
'value': {
|
||||||
|
'description': '<p>Hier braucht es eine kurze Beschreibung zum jeweiligen Thema. Dieser Inhaltblock muss immer gleich aufgebaut sein.</p>'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'type': 'yellow',
|
||||||
|
'title': 'Basiswissen: Anlageformen',
|
||||||
'contents': [
|
'contents': [
|
||||||
{
|
{
|
||||||
'type': 'basic_knowledge',
|
'type': 'basic_knowledge',
|
||||||
|
|
@ -571,36 +570,35 @@ data = [
|
||||||
{
|
{
|
||||||
'type': 'task',
|
'type': 'task',
|
||||||
'value': {
|
'value': {
|
||||||
'text': '<p>Studieren Sie zuerst das Basiswissen zum Thema «Geldanlagen». Nach welchen drei grundsätzlichen Gesichtspunkten kann man die Geldanlage unterscheiden?</p>'
|
'text': '<p>Studieren Sie zuerst das Basiswissen zum Thema «Geldanlagen» und «Anlageformen». Nach welchen drei grundsätzlichen Gesichtspunkten kann man die Geldanlage unterscheiden?</p>'
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'type': 'assignment',
|
|
||||||
'value': {
|
|
||||||
'title': 'Notizen zum Video «Funktionen der Bank»',
|
|
||||||
'assignment': 'Sehen Sie sich den Film zum Thema «Funktionen der Bank» an. Machen Sie sich Notizen zu den wichtigen Inhalten.'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'type': 'video_block',
|
|
||||||
'value': {
|
|
||||||
'url': 'https://www.youtube.com/watch?v=BPpLF3W2ZOc'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'type': 'task',
|
'type': 'task',
|
||||||
'value': {
|
'value': {
|
||||||
'text': '<p>Vergleichen Sie Ihre Notizen mit den Musterlösungen und ergänzen Sie, wo nötig.</p>'
|
'text': '<p>Beurteilen Sie die unterschiedlichen Anlageformen (Aufbewahrungsform). Füllen Sie auf Grund der Erkenntnisse aus dem Basiswissen die folgende Umfrage aus.</p>'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'type': 'link_block',
|
'type': 'link_block',
|
||||||
'value': {
|
'value': {
|
||||||
'text': 'Musterlösung: Notizen',
|
'text': 'Umfrage: Anlageformen',
|
||||||
'url': 'https://myskillbox.ch/rooms'
|
'url': 'https://de.surveymonkey.com/r/C6QKZVF'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'type': 'task',
|
||||||
|
'value': {
|
||||||
|
'text': '<p>Setzen Sie sich mit allen Lernenden zusammen, welche sich über dieselben Anlageformen informiert haben und gleichen Sie Ihre Resultate ab.</p>'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'type': 'assignment',
|
||||||
|
'value': {
|
||||||
|
'title': 'Anlageberatung',
|
||||||
|
'assignment': 'Beraten Sie folgenden zwei Personen wie sie am Besten ihre Geld anlegen sollen: \n Maxim: 23-jährig, in keiner festen Beziehung, Verkäufer, 80 Prozent angestellt bei Interdiscount, eine Tochter (zwei-jährig), Schulden in der Höhe von CHF 8000.- Er erbt von seinem Vater CHF 40000.-, wodurch er ein Vermögen von CHF 32000 hat. \n Emilie: 48-jährig, verheiratet, Lehrerin, 80% angestellt bei der Prim. Bremgarten, ein Sohn (26-jährig), Vermögen in der Höhe von CHF 160000.-. Emilie und ihr Mann haben das Haus verkauft und wohnen zukünftig in einer Mietwohnung, weshalb sie ein Vermögen von CHF 160000.- haben.'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
@ -615,14 +613,14 @@ data = [
|
||||||
{
|
{
|
||||||
'type': 'task',
|
'type': 'task',
|
||||||
'value': {
|
'value': {
|
||||||
'text': '<p>Bilden Sie Kleingruppen und wählen Sie eine der folgenden Geschäftsbanken: UBS, Credit Suisse, PostFinance, Raiffeisen, Zürcher Kantonalbank. Analysieren sie auf der Website der jeweiligen Bank die Konditionen für mindestens drei Spar- und Anlagemöglichkeiten. Tragen Sie die Konditionen in die unten verlinkte Vorlage ein.</p>'
|
'text': '<p>Bilden Sie Kleingruppen und wählen Sie eine der folgenden Geschäftsbanken: UBS, Credit Suisse, PostFinance, Raiffeisen, Zürcher Kantonalbank. \n Analysieren sie auf der Website der jeweiligen Bank die Konditionen für mindestens drei Spar- und Anlagemöglichkeiten. Tragen Sie die Konditionen in die unten verlinkte Vorlage ein.</p>'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'type': 'link_block',
|
'type': 'link_block',
|
||||||
'value': {
|
'value': {
|
||||||
'text': 'Vorlage: Konditionen Analgeformen',
|
'text': 'PDF Vorlage: Konditionen Anlageformen',
|
||||||
'url': 'https://myskillbox.ch/rooms'
|
'url': 'https://ucarecdn.com/8940cf2b-c972-4ea8-a0d3-ba4f2737f132/vorlagekondition.pdf'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -635,7 +633,7 @@ data = [
|
||||||
'type': 'assignment',
|
'type': 'assignment',
|
||||||
'value': {
|
'value': {
|
||||||
'title': 'Welche Geldanlage ist sinnvoll?',
|
'title': 'Welche Geldanlage ist sinnvoll?',
|
||||||
'assignment': 'Ziehen Sie drei für Ihre Situation sinnvolle Schlüsse, welche Geldanlage sinnvoll ist.'
|
'assignment': 'Ziehen Sie drei für Ihre Situation sinnvolle Schlüsse.'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue