-
Notifications
You must be signed in to change notification settings - Fork 5
Adding a New Form
NOTE: This is current understanding and I need to implement a form to confirm
First add the new instrument
using python manage.py populate_instrument
from the webcdi
directory. This will use the json file instruments.json
found in directory webcdi/static/json
. Prior to running populate_instrument
you will need to add the relevant json data. A single record is of the form
{
"language": "English",
"form": "WS",
"verbose_name": "Words and Sentences",
"min_age": 16,
"max_age": 30,
"csv_file": "cdi_form_csv/[English_WS].csv",
"json_data": "cdi_forms/form_data/English_WS_meta.json",
"fillable_headers": "cdi_form_csv/EnglishWS_pdf_headers.csv"
},
fillable_headers
is optional.
This clearly identifies several other json files which are used by step 2.
Note: The naming convention is important and needs to be followed. I will document when I understand.
To run populate_items
, run python manage.py populate_instrument
.
The first line of cdi_form_csv/[English_WS].csv specifies the fields. Some are required and some are optional (presentation_order is optional). The first line should look like the following: itemID,item,item_type,category,choices,uni_lemma,definition,gloss,complexity_category,presentation_order
Subsequent lines are data items loaded into the tables. They will be of the form: item_1,choo_choo,word,col_1,understands; produces,choo choo,choo choo,choo choo,,1
-
itemID
is a unique reference for the line item within the instrument. -
item
is a human understandable code (no spaces). -
item_type
can be any of the following: word, complexity, pronoun_usage, word_form, usage, connecting_words, word_ending,combine, first_signs, phrases, starting_to_talk. A new page is shown to the end user when this changes. -
category
appears to be a subsection of item_type and seems to cause a page break in the questionnaire for users. -
choices
is one of produces, not yet;sometimes;often, simple;complex, no;yes, understands, never; sometimes; often, understands; produces, pronoun; article -
uni_lemma
is for analysis purposes and can be blank -
definition
andgloss
seem to always be the same and is the text string presented to the user -
complexity_category
seems to be for analysis purposes and is often blank -
presentation_order
is an integer best left out of the csv (and header). If it is not there the items are presented in order. If it is there, the items are presented in the presenation_order given (I believe, not tested)
English_WS_meta.json
specifies pages, page titles and instructions. The file is of the form
{
"parts": [
{
"id": 1,
"title": "PART 1: Words Children Use",
"types": [
{
"id": "word",
"sections": [
{
"id": "sounds",
"title": "1. Sound Effects And Animal Sounds"
"footnote": "* or word used in your family"
},
{
"id": "animals",
"title": "2. Animals (Real Or Toy)"
}
],
"text": "Children understand many more words than they say. We are particularly interested in the words your child both understands and SAYS. Please go through the list and mark the words you have heard your child SAY on their own. If your child uses a different pronunciation of a word (for example, \"raffe\" instead of \"giraffe\" or \"sketti\" for \"spaghetti\") or says a different word that has a similar meaning as the word listed here (e.g., \"nana\" for \"grandma\"), go ahead and mark it. Remember that this is a \"catalogue\" of all the words that are used by many different children. Don't worry if your child only says a few of these right now.",
"title": "A: Vocabulary Checklist",
"type": "checkbox"
},
{
"id": 2,
"title": "PART 2: Sentences and Grammar",
"types" : [
{
"id" : "ending"
"title": Word endings / Part 1",
"type": "radiobutton"
}
]
}
}
]
}
-
id
: unique identified -
title
: Title of this part of the questionnaire -
types.id
: relates to item_type in cdi_form_csv/[English_WS].csv -
types.text
: explanatory text at the top of the page -
types.title
: title at top of page -
types.type
: checkbox, radiobutton or textbox (there may be others) and defines how the respondent can answer -
types.sections.id
: relates to category in cdi_form_csv/[English_WS].csv -
types.sections.titles
: is shown on the top of the page in the questionnaire -
types.sections.footnote
: optional field for additional guidance for the user