Skip to content
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

Closed
wants to merge 247 commits into from
Closed
Show file tree
Hide file tree
Changes from 215 commits
Commits
Show all changes
247 commits
Select commit Hold shift + click to select a range
56fb468
Initial commit for project-level permissions
jacobpenny Apr 11, 2017
5167a0e
Merge remote-tracking branch 'aces/17.1-dev' into project-level-permi…
jacobpenny May 4, 2017
916f701
Use bootstrap in surveys
jacobpenny Feb 7, 2017
20e34a2
Update test user statement, update fixture
jacobpenny Apr 25, 2017
038ebd9
Add bilingual JSON instrument support and associated tools
jacobpenny May 4, 2017
cb3e8f5
Fix JSONInstrumentToLINSTConverter test
jacobpenny May 4, 2017
6713d5f
PHPCS fixes
jacobpenny May 4, 2017
6dbaedd
PHPCS fixes
jacobpenny May 4, 2017
5934e47
PHPCS fixes
jacobpenny May 4, 2017
42d154c
Survey style tweak
jacobpenny May 4, 2017
d1f554d
Add stage-0 babel preset
jacobpenny May 11, 2017
d395775
Add autoloading for project modules
jacobpenny May 11, 2017
346c39c
Add rewrite rule for testotheque SPA
jacobpenny May 11, 2017
a8c314d
Include project webpack config in main webpack config
jacobpenny May 11, 2017
68e78e2
Allow NDB_Page objects to return JSON
jacobpenny May 11, 2017
d6634d7
Commit compiled js
jacobpenny May 16, 2017
7b03845
Survey updates
jacobpenny May 16, 2017
e6c5ece
Fixed user project multi-select display
May 31, 2017
bbd3e6c
Create project/modules directory in travis preinstall
jacobpenny Jun 1, 2017
b0ee5c8
switched counter out for array_push
Jun 1, 2017
8c5144d
Merge pull request #1 from ZainVirani/user_acct_fix
jacobpenny Jun 1, 2017
3f4a3fb
Add migration to base sql files
jacobpenny Jun 1, 2017
6a291d9
Merge branch 'cap-dev' of github.com:jacobpenny/Loris into cap-dev
jacobpenny Jun 1, 2017
1d764f5
Place user_project_rel definition after user definition
jacobpenny Jun 1, 2017
864342b
Add InstrumentLogicParser stub and test harness
jacobpenny Jun 2, 2017
59df095
Tweak js test commands
jacobpenny Jun 2, 2017
569632d
Add webpack.config.test.js
jacobpenny Jun 2, 2017
dd74eb7
logic parser implemented
Jun 5, 2017
60e36ba
Changed output from raw numerical output to formatted JS code (to be …
Jun 5, 2017
dcae44b
logic update
Jun 6, 2017
b19f421
Parser tests
Jun 6, 2017
af09b01
Boolean ops testing
Jun 6, 2017
04befc0
bool ops finished and tested
Jun 7, 2017
17f68ce
more bool ops
Jun 7, 2017
3c3a21f
more functionality added
Jun 8, 2017
914970c
date ops
Jun 13, 2017
7184557
2-stage parsing technique
Jun 13, 2017
7b78fb2
date + time ops
Jun 13, 2017
e859c3b
Merge pull request #1 from ArminTaheri/CAP
ZainVirani Jun 13, 2017
47def4c
2 stage parser
Jun 13, 2017
9e137c7
typo
Jun 13, 2017
6046d97
rewrote parser
Jun 13, 2017
fa38c51
tests
Jun 13, 2017
d464a70
reorganize
Jun 13, 2017
695e945
bug fixes
Jun 14, 2017
3c3e72b
logic fixes
Jun 14, 2017
4fc948a
testing
Jun 14, 2017
f963ab2
added unit tests
Jun 14, 2017
1946790
more unit tests
Jun 15, 2017
4943d2e
Create README.md
ZainVirani Jun 15, 2017
a98fbfc
Create README.md
ZainVirani Jun 15, 2017
e417bf1
deleted old tests
Jun 15, 2017
af8070e
Create README.md
ZainVirani Jun 15, 2017
67cc6b9
update readme
Jun 15, 2017
f99d4f3
update readme
Jun 15, 2017
339c62e
cleanup
Jun 15, 2017
6c87d39
update README.md
ZainVirani Jun 15, 2017
3e64400
reorganize
Jun 15, 2017
6eca372
Merge branch 'CAP' of https://github.com/ZainVirani/Loris into CAP
Jun 15, 2017
46ce77d
Merge pull request #2 from ZainVirani/CAP
jacobpenny Jun 15, 2017
5086614
infinite variable nesting implemented + unit tests
Jun 19, 2017
34cf089
Update Evaluator.js
ZainVirani Jun 20, 2017
afe8f2a
Merge pull request #3 from ZainVirani/CAP
jacobpenny Jun 20, 2017
ec10d01
created generate_instrument_schemas.php
Jun 29, 2017
46e0226
added schema generator functionality
Jul 4, 2017
c7e76d3
Merge branch 'CAP' of https://github.com/ZainVirani/Loris into CAP
Jul 4, 2017
78709d0
wrapper script
Jul 4, 2017
f00629d
Add instrument preview and survey-react
jacobpenny Jul 4, 2017
2b6c6ee
created generate_instrument_schemas.php
Jun 29, 2017
4b785da
added schema generator functionality
Jul 4, 2017
857677e
wrapper script
Jul 4, 2017
3e00684
Merge branch 'CAP' of https://github.com/ZainVirani/Loris into CAP
Jul 4, 2017
2259744
wrapper writes to file
Jul 4, 2017
c77fb10
cleaned code
Jul 4, 2017
dda0b43
updated script
Jul 5, 2017
f713af0
Merge pull request #5 from ZainVirani/CAP
jacobpenny Jul 6, 2017
821a3fe
Update compiled JS
jacobpenny Jul 6, 2017
5303be5
Stacked radio buttons, improved error messaging
jacobpenny Jul 6, 2017
d69b7e2
Merge branch 'cap-dev' of github.com:jacobpenny/Loris into cap-dev
jacobpenny Jul 6, 2017
a17a206
fs resolution error in logicParser workaround
jacobpenny Jul 6, 2017
061371c
updated nested variables
Jul 6, 2017
e839fa1
parser tests
Jul 6, 2017
144e851
Merge pull request #6 from ZainVirani/CAP
jacobpenny Jul 7, 2017
5fc9c60
calc functionality
Jul 11, 2017
b3019a0
fix
Jul 11, 2017
b47108e
fix2
Jul 11, 2017
a6d7fd4
Merge pull request #7 from ZainVirani/CAP
jacobpenny Jul 11, 2017
4e0c089
Lift formula evaluation out of InstrumentForm
jacobpenny Jul 11, 2017
a5563cc
Parser and inst schema changes
Jul 12, 2017
8c8644e
Update README.md
ZainVirani Jul 12, 2017
7a99bb6
Merge branch 'CAP' of https://github.com/ZainVirani/Loris into CAP
Jul 12, 2017
b7b9231
Update README.md
ZainVirani Jul 12, 2017
f4dfe8b
Update README.md
ZainVirani Jul 12, 2017
7bb5c9e
Update README.md
ZainVirani Jul 12, 2017
2a612f0
Update README.md
ZainVirani Jul 12, 2017
71b6ecf
parser stuff + some branching logic on reqd resp
Jul 12, 2017
3d78913
Merge branch 'CAP' of https://github.com/ZainVirani/Loris into CAP
Jul 12, 2017
e33ece3
php parser
Jul 13, 2017
51963c8
Added RequiredResponse functionality with branching logic
Jul 18, 2017
f17c80b
php jison port
Jul 18, 2017
8513eaf
Parser and inst schema changes
Jul 12, 2017
1596c15
Update README.md
ZainVirani Jul 12, 2017
392af93
Update README.md
ZainVirani Jul 12, 2017
9f34634
Update README.md
ZainVirani Jul 12, 2017
c06f7c8
Update README.md
ZainVirani Jul 12, 2017
7334ea2
Update README.md
ZainVirani Jul 12, 2017
1496d82
parser stuff + some branching logic on reqd resp
Jul 12, 2017
4120807
php parser
Jul 13, 2017
d0c6441
Added RequiredResponse functionality with branching logic
Jul 18, 2017
4ca63cf
php jison port
Jul 18, 2017
36aaae2
Instrument logic tweaks
jacobpenny Jul 18, 2017
c6b35b4
Properly center radio group labels
jacobpenny Jul 18, 2017
f6a49b6
Recompile instrument-preview
jacobpenny Jul 18, 2017
7df81c8
added render_date
Jul 18, 2017
f6a88b5
Merge branch 'CAP' of https://github.com/ZainVirani/Loris into CAP
Jul 18, 2017
ea7be58
date render fix
Jul 19, 2017
9303b87
date picker rendering
Jul 19, 2017
e910cfe
Merge branch 'cap-dev' into CAP
ZainVirani Jul 19, 2017
82e09f7
cleanup
Jul 19, 2017
5101481
Merge branch 'CAP' of https://github.com/ZainVirani/Loris into CAP
Jul 19, 2017
0dd007d
Merge pull request #8 from ZainVirani/CAP
jacobpenny Jul 19, 2017
3feaec0
typo
Jul 19, 2017
206574c
Merge pull request #9 from ZainVirani/CAP
jacobpenny Jul 19, 2017
9eb7903
Override input label bolding
jacobpenny Jul 19, 2017
20b5707
Add DOB date picker in instrument preview
jacobpenny Jul 19, 2017
22e7d83
Cast zeros to Number too
jacobpenny Jul 24, 2017
653df96
Add NDB_BVL_Instrument_JSON
jacobpenny Jul 25, 2017
9424c49
Inline calc formulas
jacobpenny Jul 25, 2017
ced90d1
Allow array for options in RadioGroupElement
jacobpenny Jul 25, 2017
1ebdc72
Catch null variables errors from Evaluator
jacobpenny Jul 25, 2017
6b0de6f
Distinguish between null and undefined in Evaluator
jacobpenny Jul 25, 2017
3a48021
Add basic template for React instruments
jacobpenny Jul 25, 2017
5393b0d
Php parser (#10)
ZainVirani Jul 25, 2017
166476f
Add instrument view
jacobpenny Jul 25, 2017
9094c2d
Revert setup function signature change
jacobpenny Jul 25, 2017
820f239
Merge branch 'cap-dev' of github.com:jacobpenny/Loris into cap-dev
jacobpenny Jul 25, 2017
79462ba
Recompile instrument-view
jacobpenny Jul 25, 2017
c225d3d
Catch type errors in instrument form
jacobpenny Jul 25, 2017
0fd928d
Disable calculated fields
jacobpenny Jul 26, 2017
6e70bee
php parser moved; evaluation handling (#11)
ZainVirani Aug 9, 2017
39623aa
readme updates, handle evaluator errors (#13)
ZainVirani Aug 16, 2017
dee5a16
Circular references (#14)
ZainVirani Aug 16, 2017
8250c9b
Cap empty descr (#16)
ZainVirani Aug 16, 2017
286e1c4
Cap hidden field (#15)
ZainVirani Aug 16, 2017
6aecd99
Cap schema gen (#17)
ZainVirani Aug 16, 2017
69c77d4
Add/fix tests for Evaluator, throw custom errors
jacobpenny Aug 17, 2017
53163d1
Refactor for readability, fix small bugs
jacobpenny Aug 17, 2017
4681aa9
Allow arrays for options in RadioGroupElement and SelectElement
jacobpenny Aug 18, 2017
ff75678
More refactoring
jacobpenny Aug 18, 2017
7195b52
Compile JS
jacobpenny Aug 18, 2017
b7f6e2f
Fix bad merge
jacobpenny Aug 18, 2017
ca4d81c
Recompile JS
jacobpenny Aug 18, 2017
78bf03e
Merge remote-tracking branch 'aces/17.1-dev' into cap-dev
jacobpenny Aug 22, 2017
0d095dc
Make project_rel primary keys NOT NULL
jacobpenny Aug 23, 2017
1217cde
Move PHPParser and put into namespace, update tests
jacobpenny Aug 23, 2017
8670c7c
Update _getContext
jacobpenny Aug 23, 2017
0e1d5f2
Add instrument-view to webpack config
jacobpenny Aug 23, 2017
1a94ff3
Cap get context (#19)
ZainVirani Aug 29, 2017
412bf02
Front end validation, refactoring
jacobpenny Aug 29, 2017
8dc875f
Recompile JS
jacobpenny Aug 29, 2017
f12cd69
fix rounding
Aug 30, 2017
ad3bb74
fixed is_nan (PHP)
Aug 30, 2017
02f0a61
fix rounding (#21)
ZainVirani Aug 30, 2017
1821f00
Cap jquery fix (#22)
ZainVirani Aug 30, 2017
829211f
Fix typos
jacobpenny Aug 30, 2017
7afbe48
Merge remote-tracking branch 'jacobpenny/cap-dev' into CAP
Aug 30, 2017
754da9c
Implement NDB_BVL_Instrument_JSON::toJSON and use in display
jacobpenny Aug 30, 2017
39db7fe
Update react-survey to use InstrumentFormContainer
jacobpenny Aug 30, 2017
bf3afac
Recompile JS
jacobpenny Aug 30, 2017
8bbff45
Merge remote-tracking branch 'jacobpenny/cap-dev' into CAP
Aug 30, 2017
9b832a2
Fix RequireResponse issue
jacobpenny Aug 30, 2017
f462510
Cap schema fix (#24)
ZainVirani Aug 31, 2017
75e3b25
Save data in survey-react
jacobpenny Aug 31, 2017
e7f3d25
Decode survey values as array, not object
jacobpenny Aug 31, 2017
1937c63
Recompile JS
jacobpenny Aug 31, 2017
9b0e461
Merge branch 'cap-dev' of github.com:jacobpenny/Loris into cap-dev
jacobpenny Aug 31, 2017
b57fd09
Cap datediff fix (#23)
ZainVirani Aug 31, 2017
cef9ae8
Remove unused file
jacobpenny Aug 31, 2017
1ddf04b
Merge branch 'cap-dev' of github.com:jacobpenny/Loris into cap-dev
jacobpenny Aug 31, 2017
1b87b3d
Merge remote-tracking branch 'jacobpenny/cap-dev' into CAP
Aug 31, 2017
ca65451
Pass options to InstrumentFormContainer
jacobpenny Aug 31, 2017
2024c9b
Create DirectEntryReact component
jacobpenny Aug 31, 2017
9760a32
Implement backend validation and calculations
jacobpenny Aug 31, 2017
3a2b373
Fix scoping
jacobpenny Aug 31, 2017
3632c33
Recompile JS
jacobpenny Aug 31, 2017
ea187f3
Merge remote-tracking branch 'jacobpenny/cap-dev' into CAP
Sep 1, 2017
4471ed1
Cap css (#25)
ZainVirani Sep 1, 2017
cad3332
fixed date schema and enum
Sep 5, 2017
ac03cfc
Change varchars to text for most instrument fields
jacobpenny Sep 5, 2017
02c4ace
Change date(10) to date
jacobpenny Sep 5, 2017
18ce32e
Fix enum values in schema generator
jacobpenny Sep 5, 2017
3c2373f
Update status when survey submitted
jacobpenny Sep 5, 2017
421ee0f
merge conflict
Sep 5, 2017
ea4b339
Match parent function signature in NDB_BVL_Instrument_JSON#setup
jacobpenny Sep 5, 2017
bb7b5f4
Fix filterElements and invocation of it
jacobpenny Sep 6, 2017
c74c7aa
Add documentation for InstrumentForm and InstrumentFormContainer
jacobpenny Sep 6, 2017
8f63f74
Recompile JS
jacobpenny Sep 6, 2017
66eb372
new style
Sep 6, 2017
41feb7e
fix banner
Sep 6, 2017
99f6a3a
Update survey styles
jacobpenny Sep 6, 2017
41c7f53
Merge branch 'survey-style-changes' into cap-dev
jacobpenny Sep 6, 2017
3eedb09
Remove source map
jacobpenny Sep 6, 2017
f14761e
Nicer completion message for surveys
jacobpenny Sep 6, 2017
3e54933
Recompile JS
jacobpenny Sep 6, 2017
980bdcd
Update docs
jacobpenny Sep 6, 2017
878fe19
Merge remote-tracking branch 'aces/17.1-dev' into json-instruments-v1
jacobpenny Sep 7, 2017
9f68ff9
Revert "Initial commit for project-level permissions"
jacobpenny Sep 7, 2017
0c65d57
Revert projectLevelPermission schema changes
jacobpenny Sep 7, 2017
3c27686
Revert testoteque rewrite rule
jacobpenny Sep 7, 2017
d3d8f37
Revert various unrelated changes
jacobpenny Sep 7, 2017
a7c37bc
Revert webpack changes
jacobpenny Sep 7, 2017
86debcf
Revert more unrelated changes
jacobpenny Sep 7, 2017
deb1a81
Remove moment dependency
jacobpenny Sep 7, 2017
1449465
Rename NAIPTestSuite
jacobpenny Sep 7, 2017
796b08c
Recompile JS
jacobpenny Sep 7, 2017
339e9d1
Address PR comments for instrument docs
jacobpenny Sep 8, 2017
62bcbb5
Parser README update
jacobpenny Sep 8, 2017
cd5b7a1
Address most PR comments
jacobpenny Sep 8, 2017
026fe0a
font size change (#28)
ZainVirani Sep 8, 2017
b998b27
stylistic changes to save button (#27)
ZainVirani Sep 8, 2017
0312a48
fixed center tag
Sep 8, 2017
096199a
Merge pull request #32 from naiploris/JI_save_button
ZainVirani Sep 8, 2017
e5e5012
Update README.md
ZainVirani Sep 11, 2017
65ae5d7
Never require hidden elements
jacobpenny Sep 12, 2017
b919661
insert to test_names (#34)
ZainVirani Sep 12, 2017
1c8e3b7
Fix namespaces, fix indentation
jacobpenny Sep 13, 2017
151f1eb
Set survey mode in react-survey.php
jacobpenny Sep 13, 2017
bad54ee
Fix <= bug and add tests
jacobpenny Sep 13, 2017
8947d13
Move ParserTests into own testsuite
jacobpenny Sep 13, 2017
8f4dbb9
Fix context issue
jacobpenny Sep 13, 2017
66b8944
reset radio button (#36)
ZainVirani Sep 14, 2017
f8594b4
Cap gen schema fix (#33)
ZainVirani Sep 12, 2017
20b9f4d
Remove format check from NDB_Page
jacobpenny Sep 14, 2017
5732227
Rename calc field to score field
jacobpenny Sep 14, 2017
37679cd
Update instrument schema script
jacobpenny Sep 14, 2017
a84d8ee
Add back ->setup call
jacobpenny Sep 14, 2017
6cb0619
Fix lint issues
jacobpenny Sep 14, 2017
3e32895
Add comment placeholders to Parser
jacobpenny Sep 14, 2017
64f4a21
Fix linting issues
jacobpenny Sep 14, 2017
f1797b4
Fix linting issues
jacobpenny Sep 14, 2017
13800a5
Fix linting issues
jacobpenny Sep 14, 2017
7f46502
Fix linting issues
jacobpenny Sep 14, 2017
61f96ab
Fix linting issues
jacobpenny Sep 14, 2017
99281c6
Update inlineCalcFormulas to inlineScoreFormulas
jacobpenny Sep 15, 2017
278e887
Eslint
jacobpenny Sep 15, 2017
2d764cc
Recompile JS
jacobpenny Sep 15, 2017
6c9c491
Eslint
jacobpenny Sep 15, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"presets": [
"react",
"es2015"
"es2015",
"stage-0"
]
}
164 changes: 153 additions & 11 deletions docs/API/InstrumentFormat.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ Instrument format:
"InstrumentVersion": string,
"InstrumentFormatVersion" : "v0.0.2-dev",
"ShortName" : "InstrumentName", /* Required */
"LongName" : "The Human Readable Instrument Name", /* Required */
"LongName": {
Copy link
Collaborator

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

"en-ca": "The Human Readable Instrument Name",
"fr-ca": "Bonjour"
Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

Copy link
Contributor

@christinerogers christinerogers Sep 8, 2017

Choose a reason for hiding this comment

The 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),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

array() is PHP, not JSON. It should be []. The values for "string" should also be defined.

(Is this even required? Can't it be deduced from the options in longname?)

"IncludeMetaDataFields" : boolean
},
"Elements" : [ PageElements ]
Expand Down Expand Up @@ -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
Expand All @@ -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.


Expand All @@ -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 */
}
Expand All @@ -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
Expand All @@ -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
}
}
```
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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.


Expand Down Expand Up @@ -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


Expand Down Expand Up @@ -247,7 +268,6 @@ as follows:




### 2.1.4: NumericElement

A NumericElement represents a numeric data input and has the general form of:
Expand Down Expand Up @@ -313,6 +333,104 @@ the user. It has the following form.
score will be displayed with no accompagning text.


### 2.1.6: CalcFieldElement

Copy link
Collaborator

Choose a reason for hiding this comment

The 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,
Expand Down Expand Up @@ -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.
Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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,
Expand Down
52 changes: 52 additions & 0 deletions htdocs/css/direct-entry.css
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;
}
Loading