From 72880e8f12b3a590961bb43a71ba89d03fdb701d Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 10 May 2024 18:46:26 -0400 Subject: [PATCH] more extracting of snippets --- .remarkrc | 54 ++++-- .zenodo.json | 8 +- docs/tutorials/create-new-items.md | 71 -------- docs/tutorials/translating-an-activity.md | 155 +++--------------- ...dinburgh_handedness_inventory_short.jsonld | 76 ++++----- ...ndedness_inventory_short_multi_lang.jsonld | 50 ++++++ .../activities/EHI/items/EHI_results.jsonld | 32 ++-- .../activities/EHI/items/throwing.jsonld | 76 ++++----- .../activities/EHI/items/writing.jsonld | 76 ++++----- .../EHI/leftRightValueConstraints.jsonld | 40 ++--- .../leftRightValueConstraintsMultiLang.jsonld | 46 ++++++ mkdocs.yml | 2 +- mlc_config.json | 24 ++- 13 files changed, 333 insertions(+), 377 deletions(-) create mode 100644 example_ehi/activities/EHI/edinburgh_handedness_inventory_short_multi_lang.jsonld create mode 100644 example_ehi/activities/EHI/leftRightValueConstraintsMultiLang.jsonld diff --git a/.remarkrc b/.remarkrc index b0a518d8c2..41ce9d2d65 100644 --- a/.remarkrc +++ b/.remarkrc @@ -3,16 +3,48 @@ "preset-lint-markdown-style-guide", "preset-lint-recommended", "remark-gfm", - ["lint-no-duplicate-headings", false], - ["lint-list-item-indent", "tab-size"], - ["lint-emphasis-marker", "consistent"], - ["lint-maximum-line-length", 500], - ["lint-maximum-heading-length", false], - ["lint-no-shortcut-reference-link", false], - ["remark-lint-unordered-list-marker-style", "-"], - ["lint-no-trailing-spaces"], - ["remark-lint-code-block-style", false], - ["lint-no-undefined-references", false], - ["remark-lint-heading-style", false] + [ + "lint-no-duplicate-headings", + false + ], + [ + "lint-list-item-indent", + "tab-size" + ], + [ + "lint-emphasis-marker", + "consistent" + ], + [ + "lint-maximum-line-length", + 500 + ], + [ + "lint-maximum-heading-length", + false + ], + [ + "lint-no-shortcut-reference-link", + false + ], + [ + "remark-lint-unordered-list-marker-style", + "-" + ], + [ + "lint-no-trailing-spaces" + ], + [ + "remark-lint-code-block-style", + false + ], + [ + "lint-no-undefined-references", + false + ], + [ + "remark-lint-heading-style", + false + ] ] } diff --git a/.zenodo.json b/.zenodo.json index ec33653b17..a495d3e367 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -4,13 +4,7 @@ "name": "Reproschema Contributors" } ], - "keywords": [ - "schema", - "assessment", - "jsonld", - "rdf", - "repronim" - ], + "keywords": ["schema", "assessment", "jsonld", "rdf", "repronim"], "license": "CC-BY-4.0", "upload_type": "software" } diff --git a/docs/tutorials/create-new-items.md b/docs/tutorials/create-new-items.md index e5ee267edf..0742a2faa2 100644 --- a/docs/tutorials/create-new-items.md +++ b/docs/tutorials/create-new-items.md @@ -36,53 +36,6 @@ We can now add: --8<-- "example_ehi/activities/EHI/items/writing.jsonld" ``` -### What did we add ? - -- the question for this item - -```json -"question": "Writing", -``` - -- the `inputType` for for the user interface that will decide how this item will displayed to the user. - -```json -"ui": {"inputType": "radio"}, -``` - -- the response options - -```json -"responseOptions": { - "valueType": "xsd:integer", - "minValue": -100, - "maxValue": 100, - "multipleChoice": false, - "choices": [ - { - "name": "Always right", - "value": 100 - }, - { - "name": "Usually right", - "value": 50 - }, - { - "name": "Both equally", - "value": 0 - }, - { - "name": "Usually left", - "value": -50 - }, - { - "name": "Always left", - "value": -100 - } - ] -} -``` - @@ -123,30 +76,6 @@ For next step you can create on your own the `throwing` item of the questionnair } ``` -### What did we add ? - -```json -"ui": { - "order": [ - "items/writing.jsonld", - "items/throwing.jsonld" - ], - "shuffle": false, - "addProperties": [ - { - "variableName": "writing", - "isAbout": "items/writing.jsonld", - "isVis": true - }, - { - "variableName": "throwing", - "isAbout": "items/throwing.jsonld", - "isVis": true - } - ] -} -``` - ## Viewing the results ### Creating an item for the results diff --git a/docs/tutorials/translating-an-activity.md b/docs/tutorials/translating-an-activity.md index 9a586f63ee..37676b692f 100644 --- a/docs/tutorials/translating-an-activity.md +++ b/docs/tutorials/translating-an-activity.md @@ -1,7 +1,8 @@ # Translating a questionnaire -Imagine that a colleague of yours has heard that you have created this online tool based on the Edinburgh handedness inventory -and she wants to use it for her own work. But she would need a French version of the questionnaire. +Imagine that a colleague of yours has heard that you have created this online tool +based on the Edinburgh handedness inventory and she wants to use it for her own work. +But she would need a French version of the questionnaire. Well there is an easy way to reuse the work we have already done to have the tool support several languages. @@ -29,145 +30,35 @@ ii) Quel oeil utiliser-vous pour viser? ```json linenums="1" hl_lines="5-8 12-15" { - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", - "@type": "reproschema:Field", - "@id": "writing", - "prefLabel": { - "en": "writing", - "fr": "écrire" - }, - "description": "writing item of the EHI", - "schemaVersion": "1.0.0-rc1", - "version": "0.0.1", - "question": { - "en": "Writing", - "fr": "Écrire", - }, - "ui": {"inputType": "radio"}, - "responseOptions": "../leftRightValueConstraints.jsonld" + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", + "@type": "reproschema:Field", + "@id": "writing", + "prefLabel": { + "en": "writing", + "fr": "écrire" + }, + "description": "writing item of the EHI", + "schemaVersion": "1.0.0-rc1", + "version": "0.0.1", + "question": { + "en": "Writing", + "fr": "Écrire" + }, + "ui": { "inputType": "radio" }, + "responseOptions": "../leftRightValueConstraintsMultiLang.jsonld" } ``` ## Updating the response options -```json linenums="1" hl_lines="5-8 12-15" -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", - "@id": "leftRightValueConstraints.jsonld", - "@type": "reproschema:ResponseOption", - "valueType": "xsd:integer", - "minValue": -100, - "maxValue": 100, - "multipleChoice": false, - "choices": [ - { - "name": { - "en": "Always right", - "fr": "Toujours la main droite" - }, - "value": 100 - }, - { - "name": { - "en": "Usually right", - "fr": "En général la main droite" - }, - "value": 50 - }, - { - "name": { - "en": "Both equally", - "fr": "Les deux" - }, - "value": 0 - }, - { - "name": { - "en": "Usually left", - "fr": "En général la main gauche" - }, - "value": -50 - }, - { - "name": { - "en": "Always left", - "fr": "Toujours la main gauche" - }, - "value": -100 - } - ] -} +```json linenums="1" hl_lines="10-14 17-21 24-28 31-35 38-42" +--8<-- "example_ehi/activities/EHI/leftRightValueConstraintsMultiLang.jsonld" ``` ## Updating the activity We need to update the `edinburgh_handedness_inventory_short.jsonld` so that the preamble question has both languages: -```json linenums="1" hl_lines="5-8 12-15" -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", - "@type": "reproschema:Activity", - "@id": "edinburgh_handedness_inventory_short.jsonld", - "prefLabel": { - "en": "Edinburgh handedness inventory - short form", - "fr": "Version abrégée du test Edinburgh", - }, - "description": "Short version of the Edinburgh handedness inventory", - "schemaVersion": "1.0.0-rc1", - "version": "0.0.1", - "citation": "10.1080/1357650X.2013.783045", - "preamble": { - "en": "Please indicate your preferences in the use of hands in the following activities or objects:", - "fr": "Quelle main utilisez-vous de préférence pour :" - }, - "ui": { - "order": [ - "items/writing.jsonld", - "items/throwing.jsonld", - "items/EHI_results.jsonld" - ], - "shuffle": false, - "addProperties": [ - { - "variableName": "writing", - "isAbout": "items/writing.jsonld", - "valueRequired": true, - "isVis": true - }, - { - "variableName": "throwing", - "isAbout": "items/throwing.jsonld", - "valueRequired": true, - "isVis": true - }, - { - "isAbout": "items/EHI_results.jsonld", - "variableName": "EHI_results", - "isVis": true - } - ] - }, - "compute": [ - { - "variableName": "EHI_results", - "jsExpression": "( writing + throwing ) / 2" - } - ] -} -``` - -### What did we change ? - -```json -"prefLabel": { - "en": "Edinburgh handedness inventory - short form", - "fr": "Version abrégée du test Edinburgh", -} -``` - -```json -"preamble": { - "en": "Please indicate your preferences in the use of hands in the following activities or objects:", - "fr": "Quelle main utilisez vous de préférence pour :" -} +```json linenums="1" hl_lines="5-8 13-16" +--8<-- "example_ehi/activities/EHI/edinburgh_handedness_inventory_short_multi_lang.jsonld" ``` diff --git a/example_ehi/activities/EHI/edinburgh_handedness_inventory_short.jsonld b/example_ehi/activities/EHI/edinburgh_handedness_inventory_short.jsonld index 73abba97fb..e05cf25d45 100644 --- a/example_ehi/activities/EHI/edinburgh_handedness_inventory_short.jsonld +++ b/example_ehi/activities/EHI/edinburgh_handedness_inventory_short.jsonld @@ -1,44 +1,44 @@ { - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", - "@type": "reproschema:Activity", - "@id": "edinburgh_handedness_inventory_short.jsonld", - "prefLabel": "Edinburgh handedness inventory - short form", - "description": "Short version of the Edinburgh handedness inventory", - "schemaVersion": "1.0.0-rc1", - "version": "0.0.1", - "citation": "10.1080/1357650X.2013.783045", - "preamble": "Please indicate your preferences in the use of hands in the following activities or objects:", - "ui": { - "order": [ - "items/writing.jsonld", - "items/throwing.jsonld", - "items/EHI_results.jsonld" - ], - "shuffle": false, - "addProperties": [ - { - "variableName": "writing", - "isAbout": "items/writing.jsonld", - "valueRequired": true, - "isVis": true - }, - { - "variableName": "throwing", - "isAbout": "items/throwing.jsonld", - "valueRequired": true, - "isVis": true - }, - { - "isAbout": "items/EHI_results.jsonld", - "variableName": "EHI_results", - "isVis": true - } - ] - }, - "compute": [ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", + "@type": "reproschema:Activity", + "@id": "edinburgh_handedness_inventory_short.jsonld", + "prefLabel": "Edinburgh handedness inventory - short form", + "description": "Short version of the Edinburgh handedness inventory", + "schemaVersion": "1.0.0-rc1", + "version": "0.0.1", + "citation": "10.1080/1357650X.2013.783045", + "preamble": "Please indicate your preferences in the use of hands in the following activities or objects:", + "ui": { + "order": [ + "items/writing.jsonld", + "items/throwing.jsonld", + "items/EHI_results.jsonld" + ], + "shuffle": false, + "addProperties": [ { + "variableName": "writing", + "isAbout": "items/writing.jsonld", + "valueRequired": true, + "isVis": true + }, + { + "variableName": "throwing", + "isAbout": "items/throwing.jsonld", + "valueRequired": true, + "isVis": true + }, + { + "isAbout": "items/EHI_results.jsonld", "variableName": "EHI_results", - "jsExpression": "( writing + throwing ) / 2" + "isVis": true } ] + }, + "compute": [ + { + "variableName": "EHI_results", + "jsExpression": "( writing + throwing ) / 2" + } + ] } diff --git a/example_ehi/activities/EHI/edinburgh_handedness_inventory_short_multi_lang.jsonld b/example_ehi/activities/EHI/edinburgh_handedness_inventory_short_multi_lang.jsonld new file mode 100644 index 0000000000..127c4c915d --- /dev/null +++ b/example_ehi/activities/EHI/edinburgh_handedness_inventory_short_multi_lang.jsonld @@ -0,0 +1,50 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", + "@type": "reproschema:Activity", + "@id": "edinburgh_handedness_inventory_short_multi_lang.jsonld", + "prefLabel": { + "en": "Edinburgh handedness inventory - short form", + "fr": "Version abrégée du test Edinburgh" + }, + "description": "Short version of the Edinburgh handedness inventory", + "schemaVersion": "1.0.0-rc1", + "version": "0.0.1", + "citation": "10.1080/1357650X.2013.783045", + "preamble": { + "en": "Please indicate your preferences in the use of hands in the following activities or objects:", + "fr": "Quelle main utilisez-vous de préférence pour :" + }, + "ui": { + "order": [ + "items/writing.jsonld", + "items/throwing.jsonld", + "items/EHI_results.jsonld" + ], + "shuffle": false, + "addProperties": [ + { + "variableName": "writing", + "isAbout": "items/writing.jsonld", + "valueRequired": true, + "isVis": true + }, + { + "variableName": "throwing", + "isAbout": "items/throwing.jsonld", + "valueRequired": true, + "isVis": true + }, + { + "isAbout": "items/EHI_results.jsonld", + "variableName": "EHI_results", + "isVis": true + } + ] + }, + "compute": [ + { + "variableName": "EHI_results", + "jsExpression": "( writing + throwing ) / 2" + } + ] +} diff --git a/example_ehi/activities/EHI/items/EHI_results.jsonld b/example_ehi/activities/EHI/items/EHI_results.jsonld index 584494c28a..11fe4ac0d8 100644 --- a/example_ehi/activities/EHI/items/EHI_results.jsonld +++ b/example_ehi/activities/EHI/items/EHI_results.jsonld @@ -1,18 +1,18 @@ { - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", - "@type": "reproschema:Field", - "@id": "EHI_results.jsonld", - "prefLabel": "EHI results", - "description": "Edinburgh handedness inventory", - "schemaVersion": "1.0.0-rc1", - "version": "0.0.1", - "ui": { - "inputType": "number", - "readonlyValue": true - }, - "responseOptions": { - "valueType": "xsd:integer", - "minValue": -100, - "maxValue": 100 - } + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", + "@type": "reproschema:Field", + "@id": "EHI_results.jsonld", + "prefLabel": "EHI results", + "description": "Edinburgh handedness inventory", + "schemaVersion": "1.0.0-rc1", + "version": "0.0.1", + "ui": { + "inputType": "number", + "readonlyValue": true + }, + "responseOptions": { + "valueType": "xsd:integer", + "minValue": -100, + "maxValue": 100 + } } diff --git a/example_ehi/activities/EHI/items/throwing.jsonld b/example_ehi/activities/EHI/items/throwing.jsonld index 228293709b..b9d8299b23 100644 --- a/example_ehi/activities/EHI/items/throwing.jsonld +++ b/example_ehi/activities/EHI/items/throwing.jsonld @@ -1,39 +1,41 @@ { - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", - "@type": "reproschema:Field", - "@id": "throwing", - "prefLabel": "throwing", - "description": "throwing item of the EHI", - "schemaVersion": "1.0.0-rc1", - "version": "0.0.1", - "question": "Throwing", - "ui": { "inputType": "radio" }, - "responseOptions": { - "valueType": "xsd:integer", - "minValue": -100, - "maxValue": 100, - "multipleChoice": false, - "choices": [ - { - "name": "Always right", - "value": 100 - }, - { - "name": "Usually right", - "value": 50 - }, - { - "name": "Both equally", - "value": 0 - }, - { - "name": "Usually left", - "value": -50 - }, - { - "name": "Always left", - "value": -100 - } - ] - } + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", + "@type": "reproschema:Field", + "@id": "throwing", + "prefLabel": "throwing", + "description": "throwing item of the EHI", + "schemaVersion": "1.0.0-rc1", + "version": "0.0.1", + "question": "Throwing", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "minValue": -100, + "maxValue": 100, + "multipleChoice": false, + "choices": [ + { + "name": "Always right", + "value": 100 + }, + { + "name": "Usually right", + "value": 50 + }, + { + "name": "Both equally", + "value": 0 + }, + { + "name": "Usually left", + "value": -50 + }, + { + "name": "Always left", + "value": -100 + } + ] + } } diff --git a/example_ehi/activities/EHI/items/writing.jsonld b/example_ehi/activities/EHI/items/writing.jsonld index 7bc24969e1..39cd920cdf 100644 --- a/example_ehi/activities/EHI/items/writing.jsonld +++ b/example_ehi/activities/EHI/items/writing.jsonld @@ -1,39 +1,41 @@ { - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", - "@type": "reproschema:Field", - "@id": "writing", - "prefLabel": "writing", - "description": "writing item of the EHI", - "schemaVersion": "1.0.0-rc1", - "version": "0.0.1", - "question": "Writing", - "ui": { "inputType": "radio" }, - "responseOptions": { - "valueType": "xsd:integer", - "minValue": -100, - "maxValue": 100, - "multipleChoice": false, - "choices": [ - { - "name": "Always right", - "value": 100 - }, - { - "name": "Usually right", - "value": 50 - }, - { - "name": "Both equally", - "value": 0 - }, - { - "name": "Usually left", - "value": -50 - }, - { - "name": "Always left", - "value": -100 - } - ] - } + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", + "@type": "reproschema:Field", + "@id": "writing", + "prefLabel": "writing", + "description": "writing item of the EHI", + "schemaVersion": "1.0.0-rc1", + "version": "0.0.1", + "question": "Writing", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "minValue": -100, + "maxValue": 100, + "multipleChoice": false, + "choices": [ + { + "name": "Always right", + "value": 100 + }, + { + "name": "Usually right", + "value": 50 + }, + { + "name": "Both equally", + "value": 0 + }, + { + "name": "Usually left", + "value": -50 + }, + { + "name": "Always left", + "value": -100 + } + ] + } } diff --git a/example_ehi/activities/EHI/leftRightValueConstraints.jsonld b/example_ehi/activities/EHI/leftRightValueConstraints.jsonld index 59afe82fb7..c889bb07de 100644 --- a/example_ehi/activities/EHI/leftRightValueConstraints.jsonld +++ b/example_ehi/activities/EHI/leftRightValueConstraints.jsonld @@ -7,25 +7,25 @@ "maxValue": 100, "multipleChoice": false, "choices": [ - { - "name": "Always right", - "value": 100 - }, - { - "name": "Usually right", - "value": 50 - }, - { - "name": "Both equally", - "value": 0 - }, - { - "name": "Usually left", - "value": -50 - }, - { - "name": "Always left", - "value": -100 - } + { + "name": "Always right", + "value": 100 + }, + { + "name": "Usually right", + "value": 50 + }, + { + "name": "Both equally", + "value": 0 + }, + { + "name": "Usually left", + "value": -50 + }, + { + "name": "Always left", + "value": -100 + } ] } diff --git a/example_ehi/activities/EHI/leftRightValueConstraintsMultiLang.jsonld b/example_ehi/activities/EHI/leftRightValueConstraintsMultiLang.jsonld new file mode 100644 index 0000000000..8f540cda6b --- /dev/null +++ b/example_ehi/activities/EHI/leftRightValueConstraintsMultiLang.jsonld @@ -0,0 +1,46 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", + "@id": "leftRightValueConstraintsMultiLang.jsonld", + "@type": "reproschema:ResponseOption", + "valueType": "xsd:integer", + "minValue": -100, + "maxValue": 100, + "multipleChoice": false, + "choices": [ + { + "name": { + "en": "Always right", + "fr": "Toujours la main droite" + }, + "value": 100 + }, + { + "name": { + "en": "Usually right", + "fr": "En général la main droite" + }, + "value": 50 + }, + { + "name": { + "en": "Both equally", + "fr": "Les deux" + }, + "value": 0 + }, + { + "name": { + "en": "Usually left", + "fr": "En général la main gauche" + }, + "value": -50 + }, + { + "name": { + "en": "Always left", + "fr": "Toujours la main gauche" + }, + "value": -100 + } + ] +} diff --git a/mkdocs.yml b/mkdocs.yml index a92b331d2f..214c8dff81 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -35,9 +35,9 @@ nav: - Create a new activity: "tutorials/create-new-activity.md" - Create new items: "tutorials/create-new-items.md" - Finalize the protocol: "tutorials/finalizing-the-protocol.md" - - Tips to make your life easier: "tutorials/tips-to-make-your-life-easier.md" - Translate a questionnaire: "tutorials/translating-an-activity.md" - Demographic information : "tutorials/collecting-demographics-information.md" + - Tips to make your life easier: "tutorials/tips-to-make-your-life-easier.md" - FAQ: "FAQ.md" - Glossary: "glossary.md" - Contributing: "CONTRIBUTING.md" diff --git a/mlc_config.json b/mlc_config.json index ebc6ca1adb..c3325eda53 100644 --- a/mlc_config.json +++ b/mlc_config.json @@ -1,9 +1,19 @@ { - "ignorePatterns": [ - {"pattern": "http://127.0.0.1:8000/"}, - {"pattern": "^https://jsonformatter.curiousconcept.com/"}, - {"pattern": "^http.*://schema.repronim.org/.*"}, - {"pattern": "^http://schema.org/version/2.0/"}, - {"pattern": "^https://doi.org/10.1080/1357650X.2013.783045"} - ] + "ignorePatterns": [ + { + "pattern": "http://127.0.0.1:8000/" + }, + { + "pattern": "^https://jsonformatter.curiousconcept.com/" + }, + { + "pattern": "^http.*://schema.repronim.org/.*" + }, + { + "pattern": "^http://schema.org/version/2.0/" + }, + { + "pattern": "^https://doi.org/10.1080/1357650X.2013.783045" + } + ] }