Scoring Engine Syntax Reference

Note: The Custom Logic/Scoring Engine is available as a REFERENCE and in most cases requires programming from our Professional Service Team. QuestionPro technical support cannot answer questions related to custom scripting.

Checking if an open-ended text is answered or not and then branching based on that:

Let us assume that there is an Open-Ended text question with QuestionCode : Q1.

#if (${Q1_1})
  $survey.branchTo("Q10")
#end
  • ${Q1_1} - Represents the First Open-Ended Text Box in the Question
  • $survey.branchTo("Q10") - Represents the branching directive

Custom1-5 and External Reference Data Population

$survey.updateCustom1("Value")
  • Updates the ${custom1} [Custom Variable 1] variable with the value
$survey.updateExternalReference("Value") 
  • Updates the ${ext_ref} [External Reference] variable with the value

Custom6 and above. Up to 255

$survey.updateHighCustomVariable(6, "Value")
  • Updates the ${custom6} variable with the value

Summing all the values for the Multiple Choice/Ratings Questions

#set ($score = $survey.sumValues())
  • The sumValues() method calculates the sum and assigns to the $score variable.

Chaining to multiple surveys

$survey.chainTo(3342)

In the example above, 3342 is the Survey ID you want to chain to.