Skip to content

Commit

Permalink
more extracting of snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau committed May 10, 2024
1 parent ce7c4ed commit 72880e8
Show file tree
Hide file tree
Showing 13 changed files with 333 additions and 377 deletions.
54 changes: 43 additions & 11 deletions .remarkrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
]
}
8 changes: 1 addition & 7 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
71 changes: 0 additions & 71 deletions docs/tutorials/create-new-items.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
}
```

<!-- TODO
- describe the different input types or at least point the doc of the UI that describes them
-->
Expand Down Expand Up @@ -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
Expand Down
155 changes: 23 additions & 132 deletions docs/tutorials/translating-an-activity.md
Original file line number Diff line number Diff line change
@@ -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.

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

0 comments on commit 72880e8

Please sign in to comment.