clicker-answer.wf

Delivered as */*

[ hide source ] | [ make this the default ]

File Contents

# -*- Tcl -*-

# Simple clicker answer workflow template.
#
# Template variables:
#  @wfID@
#  @wfTitle@
#  @wfQuestion@

set :autoname 1
Property return_url -default "" -allow_query_parameter true
Action allocate -proc activate {obj} {
  :set_new_property name ___@wfID@.[::xo::cc set untrusted_user_id]
}
Action initialize -proc activate {obj} {
  :set_new_property _title "@wfTitle@"
}
Action submit -next_state done
State initial -actions {submit} -form ../@wfQuestion@ -view_method edit
State done -form ../de:question45 -eval_when_active {
  ${:object} proc view args {
    set return_url [:property return_url]
    if {$return_url ne ""} {
      ad_returnredirect $return_url
      ad_script_abort
    } else {
      next
    }
  }
}
if {[::xo::cc mobile]} {::xo::cc set_parameter template_file view-mobile}