The outcomes of computations can be handy to make your content more personal. Also, you can give back personal data, advice and information. You can read below how you can use a computation.
A ‘value of’
You can use your computation in a value of. A "value of" function remembers the user's response and can return it later in the module. For example, when you want to give back the exact score of a questionnaire. It can also be handy to make a 'value of' to test if your computation works.
How do you make a "value of"? Go to the option "value of" and fill in the option "field name you refer to" "computation: function name".
As conditional content
It can be nice to have conditional content that depends on a computation. For example, when you want to give back specific advice based on the score someone got on their questionnaire.
How do you create conditional content? If you want to use the computation in your conditional content or result section, go to the option "condition". Under the heading "value referenced" you write: "computation: function name". You can then enter the condition. For example, "is greater than" value "5".
In the result document
When you use a computation to give back specific results or advice in the result document, be sure to check the 'after submitting' box in the conditional content window in order for it to work.
As conditional content for the careprovider
If you want to give back results only for the careprovider, than first make a conditional content for the careprovider and then make conditional content based on the computation, which you copy-paste inside the careprovider conditional content.
How do you create conditional content for a counselor? Make the condition dependent on the value 'pragma: audience', 'equals', 'careprovider'. Also make sure you have checked 'after saving'.
In a diary
In a diary, you can also calculate a value from the answers of the client. Under the tab computation, build your computation, like in the example below.
When you have created the computation you want, you can choose from 'computed' when creating a new diary field. This question is read only. You will be able to choose from the computations that you have made. In the editor, it looks like this: