🔥Smartwords

The full explanation and reference to Smartwords is linked below but here we'll provide some examples and "how to" of things you might want to try.

🔥Smartwords - Dynamic Content📐Functions

Smartwords - Quick Reference

{score} prints the player's score

{data.$$$} (where $$$ is the index) prints a Smartword from the Smartwords Library

|audience.response| is the player's last answer

|DATETIME(NOW())| is the time now (see DATETIME formatting to see how to format)

|audience.responses["exs.#####"]| is the player's response to the question ##### Note this is not the step number but a unique identifier. See example below.

🎓Examples

Arrange example

The Arrange question type will produce an audience.response in the format 1234 (for a four-option question) where the number represents the original option and sequence is the arrangement from the player. For example, if the player drags the bottom answer to the top to make it their highest priority then the audience.response will be 4123

In this example we have a Title and a Body dependent on the arrangement of the top TWO options. In order to index the smartword library we need to add (ie. concatenate) the text "Title_" with the first two numbers in the four-number sequence.

To accomplish this we need these smartwords/functions;

  • audience.response to get the option sequence from the player's arrangement

  • LEFT to take the first two digits

  • CONCAT to add

  • |partition.custom_data[]| is the array containing the exercise smartword library

{data.Title_43} is the same as |partition.custom_data["Title_43"]| but we can't mix {} with ||. And in this use case we need to use || in order to be able to use the functions

This is how the final smartword is contructed

1

Get the top two options

If the full arrangement is 4312 then to get "43" we use |LEFT(audience.response,2)|

2

Add Title or Body to form the Smartword Library index

|CONCAT("Title_"LEFT(audience.response,2))| will give us "Title_43"

3

Look up the result in the Smartword Library

|partition.custom_data[CONCAT("Title_"LEFT(audience.response,2))]|

Note the use of [ ] which denotes an array (ie the library) while ( ) denotes a function.

The final content in the Editor looks like this:

The result for the player looks like this:

MultiChoice example

You can see from the Smartword Library below that multichoice responses are represented by 1 when the option is selected and 0 when its not.

Because we have an entry for every combination of a 4-option multichoice question it's very easy to index the value - as shown below.

The result for the player looks like this

🎓Accessing question results

If you want to use the response immediately then you can use |audience.response| - it's much easier! However in my example I allow the player to return to this step from other rows and then the audience.response won't be the opentext question. Hence the need to code the exact question.

You'll also have to use this approach if you want to reference the answer much later, for example giving a summary perhaps.

Note the question index - "exs.#####" - must be in quotes.

How to find the unique question number

To find the question number requires some experimentation/prototyping.

1

Make sure the data point is empty

2

Run the exercise and then Export the Colibri Report

3

Open the Report and find the Answer

The column header will have the question index you need.

🎓DATETIME example

To make the above email look authentic it needed to be dated and timestamped with the time the player invoked the publication and for the warning to be abut an event three days from that time.

This is what the content looks like for the designer

The function NOW() give us the date & time right now.

The DATETIME function formats the NOW() result into a format suitable for our purposes.

Note that you can add and subtract time as is shown

  • |DATETIME(NOW()-"01:25:00","HH:mm")| is 1hr 25mins before now

  • |DATETIME(NOW()+"03:00:00:00","DD MMM YYYY")| is three days from now

Debugging Smartwords

If in doubt, add your smartword or function to the content body and see what result you get.

To see an example of smartwords in action, visit the page below:

🎓Mechanics Examples

Last updated

Was this helpful?