SurveyFactory Documentation Documentation Super Matrix template variables
Super Matrix template variables

Template variables > Super Matrix

Super Matrix template variables are defined for each question in your survey that is of type Super Matrix. If you are looking for template variables for another question type, please see template variables. This page details the structure of the question template variables so you can know what to expect when designing your templates.

question.
   # Variables in common with all question types
   id
   type = 'SuperMatrix'
   text
   instructions
   required
   number
   sortorder
   scored
   hidden
   valid
   answered
   inloop[]
   loops.
   template.
   errors[]

   # Additional variables for Super Matrix question type
   columnorder
   roworder

   columns[]
      # Variables shared by each column in question.columns[]
      id
      label
      type
      required
      fixedposition
      answerorder
      template.

      answers[]
         # Variables shared by each answer in column.answers[]
         id
         label
         value
         fixedposition

         # Only when column.type is checkbox, radio, select or selectmult
         selected

         # Only when column.type is select or selectmult
         selectable

         # Only when column.type is text
         type
         default
         required
         minlength
         maxlength
         validation
         validation_type
         validation_not
         validation_case

      # Only when column.type is checkbox, radio, select or selectmult
      unique_answers

   rows[]
      # Variables for each row in question.rows[]
      id
      label
      required
      noscore
      fixedposition
      template.

      columns[]
         data.
         answers[]
            data.
            f_value
            f_uniqueid

            # Only when column.type is text
            f_name

            # Only when column.type is checkbox, radio, select or selectmult
            f_selected

         # Only when column.type is checkbox, radio, select or selectmult
         f_name
         f_uniqueid


question.

This document assumes that you have the question object in a variable named question. This is most often achieved in a loop, such as:

[% FOREACH question IN survey.questions; %]

or using a custom template function such as getQuestion:

[% question = getQuestion(id); %]

question.id

Contains the ID # of the question as listed in the survey editor. This is unique across all of your surveys and is used in getQuestion and other custom template functions.

question.type

This variable will be set to 'SuperMatrix' for a Super Matrix question type.