Skip to content

Commit

Permalink
preparing translations and simplified form example
Browse files Browse the repository at this point in the history
  • Loading branch information
bbaudry committed Mar 3, 2020
1 parent 02303e4 commit 2f5c522
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 39 deletions.
20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,23 +209,19 @@ filter:
### Forms
Just add in your form's process definition form processing result to match a [xapi extension](https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#miscext)
Just add in your form's process definition (frontmatter) the form's results to match a [xapi extension](https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#miscext)
```yaml
process:
xapi:
extensions:
_id: "{{ grav.user.username }}{{now|date('HisDdMy') }}"
sourceFiles: sourceFiles
totalWords: totalWords
targetLangs: targetLangs
http://id.tincanapi.com/extension/purpose: todo
targetDocType: targetDocType
http://id.tincanapi.com/extension/date: deadline
http://id.tincanapi.com/extension/severity: criticality
comments: comments
sourceLang: sourceLang
onbehalf: '{{ (form.value.onbehalf == "Myself" or form.value.onbehalf is null)? grav.user.email : form.value.onbehalf~"@salt.ch"|raw}}'
_id: "{{ grav.user.username }}{{now|date('HisDdMy') }}" #twig computed expl
http://id.tincanapi.com/extension/purpose: todo-form-field
targetDocType: targetDocType-form-field
http://id.tincanapi.com/extension/date: deadline-form-field
http://id.tincanapi.com/extension/severity: criticality-form-field
comments: comments-form-field
sourceLang: sourceLang-form-field
```
Expand Down
45 changes: 22 additions & 23 deletions blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Grav-Xapi
version: 0.3.0
description: Add to grav LRS connectivity and basic page activity statements tracking. Turns your favorite grav app into an Learning Management System.
description: Add to grav LRS connectivity and basic page activity statements tracking. Turns your favorite grav app into an simple Learning Management System.
icon: graduation-cap
author:
name: Gamahachaa
Expand Down Expand Up @@ -46,85 +46,84 @@ form:
lrs:
type: list
style: vertical
label: "list of LRSs"
label: PLUGIN_XAPI.LRS.LIST
fields:
.naming:
type: text
label: Name (to be mapped to user's group)
label: PLUGIN_XAPI.LRS.FIELDS.NAMING
.endpoint:
type: text
label: Endpoint (LRS's url)
label: PLUGIN_XAPI.LRS.FIELDS.ENDPOINT
.username:
type: text
label: Username (LRS's username)
label: PLUGIN_XAPI.LRS.FIELDS.USERNAME
.password:
type: text
label: Password (LRS's password)
label: PLUGIN_XAPI.LRS.FIELDS.PASSWORD
.version:
type: text
label: Version (LRS's version)
label: PLUGIN_XAPI.LRS.FIELDS.VERSION

template_activityType:
type: list
style: vertical
label: "Activity types vs template"
label: PLUGIN_XAPI.TEMPLATES.ACTIVITYTYPE.MAIN
fields:
.naming:
type: text
label: Template (to be mapped to an ActivityType)
label: PLUGIN_XAPI.TEMPLATES.ACTIVITYTYPE.NAMING
.activityIRI:
type: text
label: ActivityType IRI (custom or from the registry https://registry.tincanapi.com/)
label: PLUGIN_XAPI.TEMPLATES.ACTIVITYTYPE.IRI
template_verb:
type: list
style: vertical
label: "Verbs vs template"
label: PLUGIN_XAPI.TEMPLATES.VERB.MAIN
fields:
.naming:
type: text
label: Template (to be mapped to a Verb)
label: PLUGIN_XAPI.TEMPLATES.VERB.NAMING
.verbIRI:
type: text
label: Verb IRI (custom or from the registry https://registry.tincanapi.com/#home/verbs)
label: PLUGIN_XAPI.TEMPLATES.VERB.IRI
filter:
type: fieldset
title: Filters
help: "Add one item per line starting with an hyphen '-'"
info: "all items listed bellow will not trigger xapi statements"
title: PLUGIN_XAPI.FILTER.TITLE
info: PLUGIN_XAPI.FILTER.INFO
icon: filter
collapsed: true # Initial state of fieldset (see collapsible option)
collapsible: true # Whether one can expand the fieldset or not
fields:
filter.template:
type: array
label: "Do not track these templates"
label: PLUGIN_XAPI.FILTER.TEMPLATE
value_only: true
filter.taxonomies:
type: taxonomy
label: Taxonomy filter
label: PLUGIN_XAPI.FILTER.TAXO
multiple: true
validate:
type: array
filter.users:
type: array
label: "Do not track these users"
label: PLUGIN_XAPI.FILTER.USERS
title: TITLE
value_only: true
filter.groups:
type: array
label: "Do not track users if they belong to these groups"
label: PLUGIN_XAPI.FILTER.GROUPS
value_only: true
uri:
type: fieldset
title: URL Filters (routes and queries)
title: PLUGIN_XAPI.FILTER.URI.TITLE
fields:
filter.uri.routes:
type: array
label: Routes that would not trigger statements
label: PLUGIN_XAPI.FILTER.URI.ROUTES
value_only: true
filter.uri.query:
type: list
label: Url queries that would not trigger statements
label: PLUGIN_XAPI.FILTER.URI.QUERY
style: horizontal
fields:
.key:
Expand Down
34 changes: 30 additions & 4 deletions languages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,33 @@ en:
PLUGIN_XAPI:
ENABLE_PHP: Enable Tincan PHP
ENABLE_JS: Enable Tincan JS
TEXT_VARIABLE: Text Variable
TEXT_VARIABLE_HELP: Text to add to the top of a page
LRS_VAR: YAML Text Variable
LRS_HELP: Add your LRS
LRS:
LIST: "list of LRSs"
HELP: Add your LRS
FIELDS:
NAMING: Name (to be mapped to user's group)
ENDPOINT: Endpoint (LRS's url)
USERNAME: Username (LRS's username)
PASSWORD: Password (LRS's password)
VERSION: Version (LRS's version)
TEMPLATES:
ACTIVITYTYPE:
MAIN: "Activity types vs template"
NAMING: "Template (to be mapped to an ActivityType) "
IRI: "ActivityType IRI (custom or from the registry https://registry.tincanapi.com/)"
VERB:
MAIN: "Verbs vs template"
NAMING: "Template (to be mapped to a Verb) "
IRI: "Verb IRI (custom or from the registry https://registry.tincanapi.com/#home/verbs)"
FILTER:
TITLE: Filters
INFO: "all items listed bellow will not trigger xapi statements"
HELP: "Add one item per line starting with an hyphen"
TEMPLATE: "Do not track these templates"
TAXO: "Do not track pages with these taxonomies"
USERS: "Do no track these users' activities"
GROUPS: "Do not track users' activities if they belong to these groups"
URI:
TITLE: URL Filters (routes and queries)
ROUTES: "Routes that would not trigger statements"
QUERY: "Url queries' key/value pairs that would not trigger statements"

0 comments on commit 2f5c522

Please sign in to comment.