-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Json Instruments V1 - WIP #3136
Changes from 215 commits
56fb468
5167a0e
916f701
20e34a2
038ebd9
cb3e8f5
6713d5f
6dbaedd
5934e47
42d154c
d1f554d
d395775
346c39c
a8c314d
68e78e2
d6634d7
7b03845
e6c5ece
bbd3e6c
b0ee5c8
8c5144d
3f4a3fb
6a291d9
1d764f5
864342b
59df095
569632d
dd74eb7
60e36ba
dcae44b
b19f421
af09b01
04befc0
17f68ce
3c3a21f
914970c
7184557
7b78fb2
e859c3b
47def4c
9e137c7
6046d97
fa38c51
d464a70
695e945
3c3e72b
4fc948a
f963ab2
1946790
4943d2e
a98fbfc
e417bf1
af8070e
67cc6b9
f99d4f3
339c62e
6c87d39
3e64400
6eca372
46ce77d
5086614
34cf089
afe8f2a
ec10d01
46e0226
c7e76d3
78709d0
f00629d
2b6c6ee
4b785da
857677e
3e00684
2259744
c77fb10
dda0b43
f713af0
821a3fe
5303be5
d69b7e2
a17a206
061371c
e839fa1
144e851
5fc9c60
b3019a0
b47108e
a6d7fd4
4e0c089
a5563cc
8c8644e
7a99bb6
b7b9231
f4dfe8b
7bb5c9e
2a612f0
71b6ecf
3d78913
e33ece3
51963c8
f17c80b
8513eaf
1596c15
392af93
9f34634
c06f7c8
7334ea2
1496d82
4120807
d0c6441
4ca63cf
36aaae2
c6b35b4
f6a49b6
7df81c8
f6a88b5
ea7be58
9303b87
e910cfe
82e09f7
5101481
0dd007d
3feaec0
206574c
9eb7903
20b5707
22e7d83
653df96
9424c49
ced90d1
1ebdc72
6b0de6f
3a48021
5393b0d
166476f
9094c2d
820f239
79462ba
c225d3d
0fd928d
6e70bee
39623aa
dee5a16
8250c9b
286e1c4
6aecd99
69c77d4
53163d1
4681aa9
ff75678
7195b52
b7f6e2f
ca4d81c
78bf03e
0d095dc
1217cde
8670c7c
0e1d5f2
1a94ff3
412bf02
8dc875f
f12cd69
ad3bb74
02f0a61
1821f00
829211f
7afbe48
754da9c
39db7fe
bf3afac
8bbff45
9b832a2
f462510
75e3b25
e7f3d25
1937c63
9b0e461
b57fd09
cef9ae8
1ddf04b
1b87b3d
ca65451
2024c9b
9760a32
3a2b373
3632c33
ea187f3
4471ed1
cad3332
ac03cfc
02c4ace
18ce32e
3c2373f
421ee0f
ea4b339
bb7b5f4
c74c7aa
8f63f74
66eb372
41feb7e
99f6a3a
41c7f53
3eedb09
f14761e
3e54933
980bdcd
878fe19
9f68ff9
0c65d57
3c27686
d3d8f37
a7c37bc
86debcf
deb1a81
1449465
796b08c
339e9d1
62bcbb5
cd5b7a1
026fe0a
b998b27
0312a48
096199a
e5e5012
65ae5d7
b919661
1c8e3b7
151f1eb
bad54ee
8947d13
8f4dbb9
66b8944
f8594b4
20b9f4d
5732227
37679cd
a84d8ee
6cb0619
3e32895
64f4a21
f1797b4
13800a5
7f46502
61f96ab
99281c6
278e887
2d764cc
6c9c491
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"presets": [ | ||
"react", | ||
"es2015" | ||
"es2015", | ||
"stage-0" | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,11 @@ Instrument format: | |
"InstrumentVersion": string, | ||
"InstrumentFormatVersion" : "v0.0.2-dev", | ||
"ShortName" : "InstrumentName", /* Required */ | ||
"LongName" : "The Human Readable Instrument Name", /* Required */ | ||
"LongName": { | ||
"en-ca": "The Human Readable Instrument Name", | ||
"fr-ca": "Bonjour" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the CA part should be capitalized. It looks weird to have "en-ca" and not "en-CA". For the documentation, it should also be a real translation and not something completely different. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggest: "Instrument Title" / "Titre de l'Instrument" -- this would conform with other documentation for PHP/LINST |
||
}, /* An object keyed by language - Required */ | ||
"SupportedLanguages": array(string), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
(Is this even required? Can't it be deduced from the options in longname?) |
||
"IncludeMetaDataFields" : boolean | ||
}, | ||
"Elements" : [ PageElements ] | ||
|
@@ -60,7 +64,12 @@ Where each key should be interpreted as so: | |
|
||
`Meta.ShortName`: A short name for this test suitable for a database table or file name. | ||
|
||
`Meta.LongName`: The long, human readable version of this instrument name. | ||
`Meta.LongName`: An object keyed by language (which are specified in SupportedLanguages), the values of which | ||
are the human readable instrument names in those languages. | ||
|
||
`Meta.SupportedLanguages`: An array which specifies which languages this instrument supports. These will used as | ||
keys in Meta.LongName as well as the Description, Labels, and Options.Values properties of | ||
PageElements. | ||
|
||
`Meta.IncludeMetaDataFields`: An implementation (such as Loris) may have special fields | ||
that are included with every instrument such as a scored Candidate Age or | ||
|
@@ -69,7 +78,7 @@ Where each key should be interpreted as so: | |
them. | ||
Default: true | ||
|
||
`Elements`: An array of elements which this instrument consits of. Elements are described by | ||
`Elements`: An array of elements which this instrument consists of. Elements are described by | ||
JSON objects defined below and can be either an individual element, or an ElementGroup. | ||
|
||
|
||
|
@@ -89,7 +98,10 @@ the following format: | |
{ | ||
"Type" : string, | ||
"Name" : UniqueQuestionIdentifier, | ||
"Description" : "Human readable question text", | ||
"Description" : {} // Object keyed by language with string values, | ||
"Hidden": boolean, | ||
"HiddenSurvey": boolean, | ||
"DisplayIf": boolean or string of LorisScript, | ||
"Options" : { | ||
/* TypeDependent JSON Options */ | ||
} | ||
|
@@ -106,8 +118,8 @@ the following format: | |
descriptions of the types below only specify if it's required, | ||
but these restrictions apply to all types where it's required. | ||
|
||
`Description`: The human readable description of this element, such | ||
as question or label text. This may or may not be required | ||
`Description`: An object containing the human readable descriptions of this element keyed by language, | ||
` used as question or label text. This may or may not be required | ||
depending on element type. | ||
|
||
`Options`: An object containing the type dependent options for this element. If omitted | ||
|
@@ -133,12 +145,16 @@ as follows. It denotes a group of values of which the user must select one optio | |
"Description" : REQUIRED, | ||
"Options" : { | ||
"Values" : { | ||
'en-ca': { | ||
"SaveValue" : "Human Readable Description", | ||
"SaveValue2" : "Another human readable description" | ||
... | ||
} | ||
}, | ||
"AllowMultiple" : boolean, | ||
"RequireResponse" : boolean | ||
"RequireResponse" : boolean || string, | ||
"Hidden": boolean, | ||
"HiddenSurvey": boolean | ||
} | ||
} | ||
``` | ||
|
@@ -149,8 +165,9 @@ as follows. It denotes a group of values of which the user must select one optio | |
|
||
`Description`: Required. Follows PageElement.Name rules. | ||
|
||
`Options.Values`: REQUIRED. Contains a JSON object specifying the | ||
options to be selected. Each key/value corresponds | ||
|
||
`Options.Values`: REQUIRED. Contains a JSON object, keyed by language, the values of which are | ||
JSON objects specifying the options to be selected. Each key/value corresponds | ||
to <option value="JSONKey">JSONValue</option> in an | ||
HTML implementation. The JSONKey contains the value | ||
to be saved if selected, and the JSONValue contains | ||
|
@@ -161,7 +178,7 @@ as follows. It denotes a group of values of which the user must select one optio | |
one option can be selected. | ||
Default: false | ||
|
||
`Options.RequireResponse`: Boolean. If true, an implementation should | ||
`Options.RequireResponse`: Boolean || String. If true, an implementation should | ||
automatically add a not_answered option to the | ||
select box in addition to the values specified | ||
to allow the user to explicitly not answer a question | ||
|
@@ -170,6 +187,8 @@ as follows. It denotes a group of values of which the user must select one optio | |
This is done instead of simply adding the option to | ||
Values to ensure consistency with other PageElement types | ||
such as date or text. | ||
If it is a string it is interpreted as LorisScript and | ||
evaluated. | ||
Default: true. | ||
|
||
|
||
|
@@ -211,6 +230,8 @@ save it. The format is as follows: | |
`Options.RequireResponse`: If true, there MUST be some way for the user to specify | ||
that the question is not answered, regardless of other rules. If false, | ||
the not answered option is supressed. | ||
If it is a string it is interpreted as LorisScript and | ||
evaluated. | ||
Default: true | ||
|
||
|
||
|
@@ -247,7 +268,6 @@ as follows: | |
|
||
|
||
|
||
|
||
### 2.1.4: NumericElement | ||
|
||
A NumericElement represents a numeric data input and has the general form of: | ||
|
@@ -313,6 +333,104 @@ the user. It has the following form. | |
score will be displayed with no accompagning text. | ||
|
||
|
||
### 2.1.6: CalcFieldElement | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This whole element type is unnecessary. That's what a score field type directly above it. All that needs to be done is have the Formula added as an option in the score type. |
||
A calc field represents a placeholder to display/save values based on other | ||
data entered by the user in the instrument but does not directly get input from | ||
the user. It has the following form. | ||
|
||
```js | ||
{ | ||
"Type": "calc", | ||
"Name": REQUIRED, | ||
"Description": OPTIONAL, | ||
"Formula": string, | ||
"Options": { | ||
/* None currently */ | ||
} | ||
} | ||
``` | ||
|
||
`Type`: MUST be "score". | ||
|
||
`Name`: Required. Follows `PageElement.Name` rules. The Name MAY be used by an | ||
implementation as a field name to save calculated data into. | ||
|
||
`Description`: Optional. Follows `PageElement.Name` rules. If not specified, the | ||
score will be displayed with no accompagning text. | ||
|
||
`Formula`: A string of LorisScript which will determine the displayed value of this field. | ||
|
||
### 2.1.7: RadioElement | ||
|
||
A Radio element represents a HTML radio type and appears as follows. | ||
It denotes a group of values of which the user must select one option. | ||
|
||
```js | ||
{ | ||
"Type" : "radio", | ||
"Name" : REQUIRED, | ||
"Description" : REQUIRED, | ||
"Options" : { | ||
"Values" : { | ||
'en-ca': { | ||
"SaveValue" : "Human Readable Description", | ||
"SaveValue2" : "Another human readable description" | ||
... | ||
} | ||
}, | ||
"AllowMultiple" : boolean, | ||
"RequireResponse" : boolean || string, | ||
"Hidden": boolean, | ||
"HiddenSurvey": boolean | ||
} | ||
} | ||
``` | ||
|
||
`Type`: MUST be select. | ||
|
||
`Name`: Required. Follows PageElement.Name rules. | ||
|
||
`Description`: Required. Follows PageElement.Name rules. | ||
|
||
|
||
`Options.Values`: REQUIRED. Contains a JSON object, keyed by language, the values of which are | ||
JSON objects specifying the options to be selected. Each key/value corresponds | ||
to <option value="JSONKey">JSONValue</option> in an | ||
HTML implementation. The JSONKey contains the value | ||
to be saved if selected, and the JSONValue contains | ||
the human friendly text to display to the user. | ||
|
||
A DateElement represents a way for a user to enter a date. The general format is | ||
as follows: | ||
|
||
```js | ||
{ | ||
"Type": "date", | ||
"Name": REQUIRED, | ||
"Description": REQUIRED, | ||
"Options" : { | ||
"MinDate" : "YYYY-MM-DD", | ||
"MaxDate" : "YYYY-MM-DD", | ||
"RequireResponse" : boolean | ||
} | ||
} | ||
``` | ||
|
||
`Type`: MUST be "date" | ||
|
||
`Name`: Required. Follows `PageElement.Name` rules. | ||
|
||
`Description`: Required. Follows `PageElement.Name` rules. | ||
|
||
`Options.MinDate`: The minimum date that can be chosen by the user. Format is YYYY-MM-DD | ||
|
||
`Options.MaxDate`: The maximum date that can be chosen by the user. Format is YYYY-MM-DD | ||
|
||
`Options.RequireResponse`: Follows the same rules as TextElement:Options.RequireResponse | ||
|
||
|
||
|
||
## 2.2: Layout related types | ||
|
||
The following types are related to page layout and not directly related to user input, | ||
|
@@ -370,6 +488,30 @@ input. It has the following form: | |
|
||
`Options`: None | ||
|
||
### 2.2.3: RadioLabelElement | ||
|
||
To be used above one or more RadioElements of the same cardinality. The labels are | ||
aligned above the radio inputs. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see why a special element type is needed for this and not just a normal label and the element group/table types. It seems to just add extra maintenance overhead, but this can be addressed later. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is a bit awkward I agree. |
||
|
||
```js | ||
{ | ||
"Type": "radio-labels", | ||
"Labels": { | ||
"languageKey": array | ||
}, | ||
"Options": { | ||
/* None currently */ | ||
|
||
} | ||
} | ||
``` | ||
|
||
`Type`: MUST be "label" | ||
|
||
`Description`: Required. The text to display in the label. | ||
|
||
`Options`: None | ||
|
||
# 3.0.0: ElementGroups | ||
|
||
ElementGroups represent some kind of grouping of elements and may represent, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
.instrument-label { | ||
margin-bottom: 0px; | ||
} | ||
|
||
h1 { | ||
font-size: 24px; | ||
} | ||
|
||
.title { | ||
text-align: center; | ||
margin-bottom: 0px; | ||
} | ||
|
||
.title h1 { | ||
text-align: center; | ||
margin-top: 0px; | ||
margin-bottom: 16px; | ||
} | ||
|
||
label { | ||
font-weight: normal; | ||
text-align: justify; | ||
} | ||
|
||
#banner { | ||
background-color: #08245b; | ||
padding: 10px; | ||
} | ||
|
||
#logo { | ||
max-height: 55px; | ||
padding-right: 5px; | ||
} | ||
|
||
.studyTitle { | ||
color: white; | ||
font-size: 28px; | ||
vertical-align: bottom; | ||
line-height: 1; | ||
} | ||
|
||
.instrumentContainer { | ||
padding: 1% 2% 2% 2%; | ||
} | ||
|
||
.complete { | ||
display: flex; | ||
margin-top: 100px; | ||
justify-content: center; | ||
align-items: center; | ||
font-size: 2em; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version above should be 0.0.3-dev