Skip to main content

Reading a rule

This article will explain how to read a rule and edit it.

S
Written by Support Manager
Updated over 2 years ago

The scripting language that we use for rules is a custom language that only works with OpsAnalitica and is based on the .Net programming language.

Rules are run from top to bottom.

The language is such that you should be able to read this rule from left to right and understand it. With the more complex rules that gets a little harder.

The rule editor functions just like Microsoft's Visual Studio.

Above is the rule text for a True False - Give Full Score if True Rule.

Let's read it left to right:

Line

Explanation

1

If the response value, or the button pushed by the end user, is the True button. Then

2

The score for this question is the possible score as set by the checklist question. Full Points.

3

Return this Pass means you can stop running the rule.

5

Else if, if the response wasn't True, the button pushed was False, Then

6

The score for this question is 0.

7

Return this Pass means you can stop running the rule.

9

This Else would only be run if the person hadn't answered the question yet. A True-False question only has those two options or a N/A which means we aren't answering this question.

10

// means that row is commented out, it is just text for the rule builder and is not evaluated.

11

Return this Pass means you can stop running the rule.

To sum this rule up:

  • If the person pushed True - give them full points.

  • If the person pushed False - give them 0 points.

  • If the person pushed N/A or didn't push anything at all, do nothing.

As stated in the introduction. Copying rules and tweaking them is quicker and easier than writing them from scratch.

Also, we have hundreds of rules that we created and we are always happy to help a person build a rule to use. Just reach out to us through the chat.


Did this answer your question?