tellmimore / tellmi

A platform for surveys, including ecological momentary assesment and interventions.
https://tellmimore.github.io/tellmi/
MIT License
3 stars 0 forks source link

Flexible item templates #28

Open alpkaanaksu opened 2 months ago

alpkaanaksu commented 2 months ago

We had a fixed relationship duration item in the old app. We could create a way to specify items of any complexity, using basic input types.


<h3>Relationship duration</h3>
{years: inline number} years, {months: inline number} months.

The items at the end could look like:

Relationship duration

years, months.

('_____' is a text field)


Another use case could be asking for implementation intentions:

Wenn {trigger: inline text} , dann {action: dropdown}.

Wenn ____, dann [dropdown item].


Specifying fields

{: <inline/block> }

Resulting variable name for each field is:

_ So the value for years in the reldur template is saved as `reldur_years`. (assuming the item id is `reldur`)
alpkaanaksu commented 2 months ago

How to specify dropdown options?

Using item templates is probably a good idea.

"templates": {
    "action_dropdown": {
        "type": "dropdown",
        "options": [...]
    }
}

...

"Wenn {trigger: inline text} , dann {action: inline action_dropdown}."