Skip to content

Calculation (question trait)

mmaness edited this page Nov 14, 2011 · 5 revisions

A question trait which performs some calculations before or after a question is rendered.

Format

calculation before
  block
end
calculation after
  block
end
  • before - denotes that this calculation block should be executed before the question is rendered.
  • after - denotes that this calculation block should be executed after a response is validated.
  • block - the block contains expressions, assignments, and control flow statements.
  • end - you must terminate a block of calculations with the keyword end.

Detailed Description

Trait Options

None

Can Be Used With:

Example

YesNo DepartEarly
  text "Would you depart at #(depart_early)?"
  calculation before
    depart_early = DepartTime - 30
    depart_early = convert_mins_to_time(depart_early)
  end
TimeOfDay DepartTime
  text "What time did you depart for work today?"
  calculation after
    depart_early = DepartTime - 30
    depart_late = DepartTime + 30
  end

Related Pages


Go back to Question Trait

Home | JULIE Intro | Getting Started with JULIE | JULIE References | JULIE Development | Survenity Language