Formula Playground
This section describes how to edit and test formulas in the Content Management System (CMS) Insight. Branching logic or Calculated Field formulas for any Question in an Assessment can be tested. Select the Edit Formula button to access the testing area for branching logic or Calculated Field questions. In setting up branching logic using non-calculated questions in an Assessment, the testing of formulas is accessed by selecting the “Edit Formula“ button, shown below.
Selecting “Edit Formula“ will present the new Formulas test area, shown below.
The areas of the Formulas test area are as shown:
The name of the Question for the formula being tested
The Formula Editor field, which displays the current Formula being tested
The field with variables listed. On first open, the variable is shown as the integer “a”
The result (empty on the first open)
Click here to extract questions from formula button replaces any existing test input fields with question values from the current formula.
Evaluate formula button runs the formula with the input values for the questions listed. It will show results “true/false“ or calculated data fields as decimal numbers.
Parse Questions / Answers button opens a section below the input fields which show the questions and answers as displayed to the participant, but also provides the additional information (values of different results)
Test Results button accepts input from the Parsed Questions / Answers and displays a dialog box with the result (true, false, or value)
As shown below, making a change to formula input field by itself does not make any changes to displayed calculations. Selecting click here to extract question formula updates the calculation entries for Assessment questions.
Once the the fields of questions for testing have been updated, data can be entered to test formula results. When evaluate formula is selected, the result will be updated to show the outcome of the formula. For example, “Test_Dropdown“ value = 0 and “Test_Radio“ value = 0 evaluate to a result “False.“
After changing values for testing, selecting evaluate formula again will update the result for the calculation. In the example below, the values were changed so the formula would evaluate to “True.“
Selecting Parse Questions / Answers opens a section which has entry fields similar to what the app user will experience during an Assessment. Additional information, the Value for each Text entry for each Response, is also shown to ease the verification of calculations. Inputting one or more values in the Validated Field Test then selecting Test Results will open a browser-based dialog box which shows the outcome of the parsed question and answers (“True”, “False“, or a calculated value).
Known issues:
Drop-down questions are shown as Radio questions in the “Validated Formula Test“ section.
Having multiple sequential Questions of the Radio type (Radio questions, Dropdown questions) listed adjacently in the formula will show all of the possible answers to all of questions as a single Radio field in the “Validated Formula Test“ section. The Questions can be tested using Quick Formula Test, but not using Validated Formula Test. Having a Question of a different value type (text input, checkbox, etc) between Radio questions will have the Radio responses be split into different Radio fields.