SurveyFactory Documentation Documentation Difference between revisions of "Publication template variables"
Difference between revisions of "Publication template variables"
m (1 revision)
(Add survey.publication.identifier)
Line 5: Line 5:
 
  survey.publication.
 
  survey.publication.
 
     [[#survey.publication.id|id]]
 
     [[#survey.publication.id|id]]
 +
    [[#survey.publication.identifier|identifier]]
 
     [[#survey.publication.moveback|moveback]]
 
     [[#survey.publication.moveback|moveback]]
 
     [[#survey.publication.jumpforward|jumpforward]]
 
     [[#survey.publication.jumpforward|jumpforward]]
Line 115: Line 116:
 
       [[#survey.publication.saveforlater.errors.5B.5D|errors]][]
 
       [[#survey.publication.saveforlater.errors.5B.5D|errors]][]
 
       [[#survey.publication.saveforlater.template.|template]].
 
       [[#survey.publication.saveforlater.template.|template]].
 +
 +
== survey.publication.id ==
 +
 +
An internal publication ID number generated by SurveyFactory to identify your publication.
 +
 +
== survey.publication.identifier ==
 +
 +
This will be set to the short text string you have used to identify this publication. It is required to be unique across all of your publications.
 +
 +
== survey.publication.moveback ==
  
 
== survey.publication.moveback ==
 
== survey.publication.moveback ==

Revision as of 08:12, 19 February 2014

Template variables > Publication

Publication template variables are passed through to your template when a respondent is taking your survey. They cover all items related to the publication such as Password Protection, Email Verification, CAPTCHA Image, Language Selection, Time limits and more. This page details the structure of those template variables so you can know what to expect when designing your templates.

survey.publication.
   id
   identifier
   moveback
   jumpforward
   submitany
   modifycomplete
   responsefrequency
   newresponseurl
   
   scoring.
       public

   timelimit.
      startedon
      total
      used
      remain

   language.
      prompt
      switch_allowed
      switch_restart
      f_name
      template.
      languages[]
         id
         name
         codes[]
         direction
         url
         f_value
         f_selected

   password.
      prompt
      formfields.
      username.
         f_name
         f_value
      password.
         f_name
         f_value
      numerrors
      errors[]
      template.

   captcha.
      prompt
      formfields.
      width
      height
      border
      imageurl
      reseturl
      code.
         f_name
         f_value
      numerrors
      errors[]
      template.

   email.
      prompt
      formfields.
      email.
         f_name
         f_value
      vcode.
         f_name
         f_value
      resentvcode
      numerrors
      errors[]
      template.

      addresses[]
         # Variables for each address in survey.publication.email.addresses[]
         email
         vcode
         verified
         current
         emailsent
         lastsenton
         canresend

   responses.
      prompt
      complete[]
      inprogress.
      template.

   errorevent.
      prompt
      ecode
      message
      template.

   completed.
      prompt
      template.

   saveforlater.
      prompt
      allowed
      email_allowed
      email_sent
      email.
          f_name
          f_value
      numerrors
      errors[]
      template.

survey.publication.id

An internal publication ID number generated by SurveyFactory to identify your publication.

survey.publication.identifier

This will be set to the short text string you have used to identify this publication. It is required to be unique across all of your publications.

survey.publication.moveback

survey.publication.moveback

survey.publication.jumpforward

survey.publication.submitany

survey.publication.modifycomplete

survey.publication.responsefrequency

This variable will be set to 'once' or 'multiple' depending on how you set the Response Frequency in the publication editor. For a normal link publication, this will be enforced through cookies. For a data set publication, this will be enforced via the invitation. You can also control the response frequency via other means if you change individual options for IP Address or Email Verification restrictions.

survey.publication.numerrors

survey.publication.newresponseurl

Contains a linking URL that can be used to to redirect the survey participant to a new response. Although this variable will be available under normal circumstance, it is best to check for its existence.

This variable may be undefined in rare cases, such as when a data set publication error is displayed due to lack of a valid invitation id. In cases such as this, it is impossible to know what the proper new response URL would be.

survey.publication.timelimit.

This variable is available whenever a time limit is set for the response. It contains three member variables named total, used and remain that describe the current time limit status.

survey.publication.timelimit.startedon

If the timer has been started, this variable will be available and contain the UTC timestamp of when the time limit was triggered. You can use this in your templates to determine whether to show the time limit, as you may not want to if it has yet to be triggered.

survey.publication.timelimit.total

This variable contains the total number of seconds that the time limit was set for.

survey.publication.timelimit.used

This variable contains the number of seconds that have elapsed since the time limit started.

survey.publication.timelimit.remain

This variable contains the number of seconds remaining until the time limit expires.

survey.publication.language.

survey.publication.language.prompt

survey.publication.language.switch_allowed

survey.publication.language.switch_restart

survey.publication.language.f_name

survey.publication.language.template.

survey.publication.language.languages[]

language.id

language.name

language.codes[]

language.direction

language.f_value

language.f_selected

survey.publication.password.

survey.publication.password.username.

survey.publication.password.username.f_name

survey.publication.password.username.f_value

survey.publication.password.password.

survey.publication.password.password.f_name

survey.publication.password.password.f_value

survey.publication.password.errors[]

survey.publication.password.template.

survey.publication.captcha.

survey.publication.captcha.width

survey.publication.captcha.height

survey.publication.captcha.border

survey.publication.captcha.imageurl

survey.publication.captcha.reseturl

survey.publication.captcha.code.

survey.publication.captcha.code.f_name

survey.publication.captcha.code.f_value

survey.publication.captcha.errors[]

survey.publication.captcha.template.

survey.publication.email.

survey.publication.email.email.

survey.publication.email.email.f_name

survey.publication.email.email.f_value

survey.publication.email.vcode.

survey.publication.email.vcode.f_name

survey.publication.email.vcode.f_value

survey.publication.email.errors[]

survey.publication.email.template.

survey.publication.responses.

survey.publication.responses.complete[]

When multiple responses are enabled, a single survey participant may have already completed several responses. In that case, when those prior responses can be identified (such as through cookies or invitations), this variable is an array of the previously completed responses, each one containing the response template variables for that response.

survey.publication.responses.inprogress.

When multiple responses are enabled and the survey participant is presented with the Select Response page, it may occur that they have an existing response in progress. In this case, this variable will be filled in with response template variables corresponding to the response that is currently in progress. In all other cases, this variable is not available.


survey.publication.errorevent.

survey.publication.errorevent.prompt

survey.publication.errorevent.ecode

survey.publication.errorevent.message

survey.publication.errorevent.template.

survey.publication.completed.

This hash is only available if the publish_completed.tpl template file is being shown and the respondent is being shown the default completion message. If any custom completion behavior exists for their response, this will never be defined.

survey.publication.completed.prompt

This variable is set to 1 when the default completion message should be shown. This variable keeps consistency between other publication display methods, so you can test for the prompt variable to see if the default completion notice is supposed to be displayed.

survey.publication.completed.template.

These are the template fields that have been defined for the default completion message for this publication. If any custom completion behavior exists, these will never be available. Otherwise, you can use these when the default completion message is used in the file publish_completed.tpl.