-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #339 from praekeltfoundation/forms-year-of-birth
Add year of birth question type
- Loading branch information
Showing
5 changed files
with
280 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,247 @@ | ||
# Generated by Django 4.2.11 on 2024-06-25 06:58 | ||
|
||
from django.db import migrations | ||
import wagtail.blocks | ||
import wagtail.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("home", "0070_alter_assessment_questions"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="assessment", | ||
name="questions", | ||
field=wagtail.fields.StreamField( | ||
[ | ||
( | ||
"categorical_question", | ||
wagtail.blocks.StructBlock( | ||
[ | ||
( | ||
"question", | ||
wagtail.blocks.TextBlock( | ||
help_text="The question to ask the user" | ||
), | ||
), | ||
( | ||
"explainer", | ||
wagtail.blocks.TextBlock( | ||
help_text="Explainer message which tells the user why we need this question", | ||
required=False, | ||
), | ||
), | ||
( | ||
"error", | ||
wagtail.blocks.TextBlock( | ||
help_text="Error message for this question if we don't understand the input", | ||
required=False, | ||
), | ||
), | ||
( | ||
"answers", | ||
wagtail.blocks.ListBlock( | ||
wagtail.blocks.StructBlock( | ||
[ | ||
( | ||
"answer", | ||
wagtail.blocks.TextBlock( | ||
help_text="The choice shown to the user for this option" | ||
), | ||
), | ||
( | ||
"score", | ||
wagtail.blocks.FloatBlock( | ||
help_text="How much to add to the total score if this answer is chosen" | ||
), | ||
), | ||
( | ||
"semantic_id", | ||
wagtail.blocks.TextBlock( | ||
help_text="Semantic ID for this answer" | ||
), | ||
), | ||
] | ||
) | ||
), | ||
), | ||
] | ||
), | ||
), | ||
( | ||
"age_question", | ||
wagtail.blocks.StructBlock( | ||
[ | ||
( | ||
"question", | ||
wagtail.blocks.TextBlock( | ||
help_text="The question to ask the user" | ||
), | ||
), | ||
( | ||
"explainer", | ||
wagtail.blocks.TextBlock( | ||
help_text="Explainer message which tells the user why we need this question", | ||
required=False, | ||
), | ||
), | ||
( | ||
"error", | ||
wagtail.blocks.TextBlock( | ||
help_text="Error message for this question if we don't understand the input", | ||
required=False, | ||
), | ||
), | ||
] | ||
), | ||
), | ||
( | ||
"multiselect_question", | ||
wagtail.blocks.StructBlock( | ||
[ | ||
( | ||
"question", | ||
wagtail.blocks.TextBlock( | ||
help_text="The question to ask the user" | ||
), | ||
), | ||
( | ||
"explainer", | ||
wagtail.blocks.TextBlock( | ||
help_text="Explainer message which tells the user why we need this question", | ||
required=False, | ||
), | ||
), | ||
( | ||
"error", | ||
wagtail.blocks.TextBlock( | ||
help_text="Error message for this question if we don't understand the input", | ||
required=False, | ||
), | ||
), | ||
( | ||
"answers", | ||
wagtail.blocks.ListBlock( | ||
wagtail.blocks.StructBlock( | ||
[ | ||
( | ||
"answer", | ||
wagtail.blocks.TextBlock( | ||
help_text="The choice shown to the user for this option" | ||
), | ||
), | ||
( | ||
"score", | ||
wagtail.blocks.FloatBlock( | ||
help_text="How much to add to the total score if this answer is chosen" | ||
), | ||
), | ||
( | ||
"semantic_id", | ||
wagtail.blocks.TextBlock( | ||
help_text="Semantic ID for this answer" | ||
), | ||
), | ||
] | ||
) | ||
), | ||
), | ||
] | ||
), | ||
), | ||
( | ||
"freetext_question", | ||
wagtail.blocks.StructBlock( | ||
[ | ||
( | ||
"question", | ||
wagtail.blocks.TextBlock( | ||
help_text="The question to ask the user" | ||
), | ||
), | ||
( | ||
"explainer", | ||
wagtail.blocks.TextBlock( | ||
help_text="Explainer message which tells the user why we need this question", | ||
required=False, | ||
), | ||
), | ||
] | ||
), | ||
), | ||
( | ||
"integer_question", | ||
wagtail.blocks.StructBlock( | ||
[ | ||
( | ||
"question", | ||
wagtail.blocks.TextBlock( | ||
help_text="The question to ask the user" | ||
), | ||
), | ||
( | ||
"explainer", | ||
wagtail.blocks.TextBlock( | ||
help_text="Explainer message which tells the user why we need this question", | ||
required=False, | ||
), | ||
), | ||
( | ||
"error", | ||
wagtail.blocks.TextBlock( | ||
help_text="Error message for this question if we don't understand the input", | ||
required=False, | ||
), | ||
), | ||
( | ||
"min", | ||
wagtail.blocks.IntegerBlock( | ||
help_text="The minimum value that can be entered", | ||
required=False, | ||
), | ||
), | ||
( | ||
"max", | ||
wagtail.blocks.IntegerBlock( | ||
help_text="The maximum value that can be entered", | ||
required=False, | ||
), | ||
), | ||
] | ||
), | ||
), | ||
( | ||
"year_of_birth_question", | ||
wagtail.blocks.StructBlock( | ||
[ | ||
( | ||
"question", | ||
wagtail.blocks.TextBlock( | ||
help_text="The question to ask the user" | ||
), | ||
), | ||
( | ||
"explainer", | ||
wagtail.blocks.TextBlock( | ||
help_text="Explainer message which tells the user why we need this question", | ||
required=False, | ||
), | ||
), | ||
( | ||
"error", | ||
wagtail.blocks.TextBlock( | ||
help_text="Error message for this question if we don't understand the input", | ||
required=False, | ||
), | ||
), | ||
] | ||
), | ||
), | ||
], | ||
use_json_field=True, | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters