The RESPONSUM assessment builder comes out of the box with a lot of field types that can be used. However, if you want to make your questions have weights and do calculations based on them, you can use the expressions below for:
- Filling the default value
- Conditionally determining if a field needs to be required
- Conditionally determining if a field is disabled
- Conditionally determining if a field is hidden
The expression can be formed when “Advanced Mode” is active and the “< >” button is pressed to build the expression:
Example:
add(if(equals(Q1;”yes”);10;0);if(equals(Q2;”yes”);10;0);if(equals(Q3;”yes”);10;0);if(equals(Q5;”high”);20;0);if(equals(Q5;”medium”);10;0))
Logic:
- if(param1; param2; param3)
- if boolean param1 is true, return param2, else return param3
- and(param1; param2[; paramN])type
- returns true if all boolean parameters are true
- or(param1; param2[; paramN])
- returns true if any boolean parameter is true
Operators:
- equals(param1; param2)
- checks if param1 is equal to param2 and returns a boolean value
- islarger(param1; param2)
- checks if numeric param1 is larger than numeric param2 and returns a boolean value
- issmaller(param1; param2)
- checks if numeric param1 is smaller than numeric param2 and returns a boolean value
- islargerorequal(param1; param2)
- checks if numeric param1 is larger or equal than numeric param2 and returns a boolean value
- issmallerorequal(param1; param2)
- checks if numeric param1 is smaller or equal than numeric param2 and returns a boolean value
Numeric:
- add(param1; param2[; paramN])
- adds two or more numeric parameters together.
- subtract(param1; param2[; paramN])
- substracts the second (and later) numeric parameter from the first numeric parameter
- multiply(param1; param2[; paramN])
- multiplies the first numeric parameter by the second and later numeric parameters
- divide(param1; param2[; paramN])
- divides the first numeric parameter by the second and later numeric parameters
Textual:
- concatenate(param1; param2[; paramN])
- returns the concatenated string of all parameters
- contains(param1;param2)
- param1 = string to check
- param2 = string to find
- returns true if param1 contains param2, else false
- not(param1)
- param1 = boolean
- returns !param1