-
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 #338 from praekeltfoundation/forms-integer-type-qu…
…estion Add integer type question with min and max fields
- Loading branch information
Showing
14 changed files
with
340 additions
and
48 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
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,220 @@ | ||
# Generated by Django 4.2.11 on 2024-06-20 06:39 | ||
|
||
from django.db import migrations | ||
import wagtail.blocks | ||
import wagtail.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("home", "0069_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, | ||
), | ||
), | ||
] | ||
), | ||
), | ||
], | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
title,question_type,tags,slug,version,locale,high_result_page,high_inflection,medium_result_page,medium_inflection,low_result_page,generic_error,question,explainer,error,answers,scores,semantic_ids | ||
Health Assessment,categorical_question,checker,health-assessment,v1.0,en,high-inflection,4.0,medium-score,2.0,low-score,"Sorry, we didn't quite get that.",How often do you check your blood pressure,We need to know your blood pressure for a proper risk assessment,Sorry we don't understand.,"Once a week,Twice a week,Thrice a week","1.0,3.0,4.5","test-1,test-2,test-3" | ||
Health Assessment,categorical_question,checker,health-assessment,v1.0,en,high-inflection,4.0,medium-score,2.0,low-score,"Sorry, we didn't quite get that.",Have you been vaccinated against COVID-19?,We need to know if you have been vaccinated for a proper risk assessment,Sorry we didn't quite catch that.,"Yes,No","3.0,1.0","test-1,test-2" | ||
Health Assessment,categorical_question,checker,health-assessment,v1.0,en,high-inflection,4.0,medium-score,2.0,low-score,"Sorry, we didn't quite get that.",How high is your temperature?,We need to know your temperature for a proper risk assessment. A very high temperature could suggest an infection is present.,Please choose the option that matches your answer.,"Between 37.5C and 38C,Between 38.1C and 40C,Between 40.1C and 41.1C","3.0,2.0,1.0","test-1,test-2,test-3" | ||
title,question_type,tags,slug,version,locale,high_result_page,high_inflection,medium_result_page,medium_inflection,low_result_page,generic_error,question,explainer,error,min,max,answers,scores,semantic_ids | ||
Health Assessment,categorical_question,checker,health-assessment,v1.0,en,high-inflection,4.0,medium-score,2.0,low-score,"Sorry, we didn't quite get that.",How often do you check your blood pressure,We need to know your blood pressure for a proper risk assessment,Sorry we don't understand.,,,"Once a week,Twice a week,Thrice a week","1.0,3.0,4.5","test-1,test-2,test-3" | ||
Health Assessment,categorical_question,checker,health-assessment,v1.0,en,high-inflection,4.0,medium-score,2.0,low-score,"Sorry, we didn't quite get that.",Have you been vaccinated against COVID-19?,We need to know if you have been vaccinated for a proper risk assessment,Sorry we didn't quite catch that.,,,"Yes,No","3.0,1.0","test-1,test-2" | ||
Health Assessment,categorical_question,checker,health-assessment,v1.0,en,high-inflection,4.0,medium-score,2.0,low-score,"Sorry, we didn't quite get that.",How high is your temperature?,We need to know your temperature for a proper risk assessment. A very high temperature could suggest an infection is present.,Please choose the option that matches your answer.,,,"Between 37.5C and 38C,Between 38.1C and 40C,Between 40.1C and 41.1C","3.0,2.0,1.0","test-1,test-2,test-3" | ||
Integer Type Question,integer_question,integer-type-question,integer-type-question,v1.0,en,high-inflection,5.0,medium-score,3.0,low-score,This is a generic error,How much do you weigh in kilograms?,We need to test integer type questions,Sorry your min and max weight should be between 40 and 500kg.,40,500,,, |
8 changes: 4 additions & 4 deletions
8
home/tests/import-export-data/assessment_missing_related_page.csv
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
title,question_type,tags,slug,locale,high_result_page,high_inflection,medium_result_page,medium_inflection,low_result_page,generic_error,questions,error,answers,score,semantic_ids | ||
Fake Test,categorical_question,"Random, selection",fake-test,en,fake-page,4,fake-page,3,fake-page,We did not quite get that,Select a number for the first question,Please retry,"A,B","4.0,1.0","test-1,test-2" | ||
Fake Test,categorical_question,"Random, selection",fake-test,en,fake-page,4,fake-page,3,fake-page,We did not quite get that,Select a number for the second question,We did not quite get that,"A,B,C","1.0,3.0,4.0","test-1,test-2,test-3" | ||
Fake Test,categorical_question,"Random, selection",fake-test,en,fake-page,4,fake-page,3,fake-page,We did not quite get that,Select a number for the third question,Sorry we did not quite get that,"A,B,C","2.0,1.0,2.0","test-1,test-2,test-3" | ||
title,question_type,tags,slug,locale,high_result_page,high_inflection,medium_result_page,medium_inflection,low_result_page,generic_error,questions,error,min,max,answers,score,semantic_ids | ||
Fake Test,categorical_question,"Random, selection",fake-test,en,fake-page,4,fake-page,3,fake-page,We did not quite get that,Select a number for the first question,Please retry,,,"A,B","4.0,1.0","test-1,test-2" | ||
Fake Test,categorical_question,"Random, selection",fake-test,en,fake-page,4,fake-page,3,fake-page,We did not quite get that,Select a number for the second question,We did not quite get that,,,"A,B,C","1.0,3.0,4.0","test-1,test-2,test-3" | ||
Fake Test,categorical_question,"Random, selection",fake-test,en,fake-page,4,fake-page,3,fake-page,We did not quite get that,Select a number for the third question,Sorry we did not quite get that,,,"A,B,C","2.0,1.0,2.0","test-1,test-2,test-3" |
Oops, something went wrong.