Keeping track of scores
Forms can de used to ask users questions. Sometimes the question is a simple yes or no. Other times you may have questions with more than two choices or with complicated scoring requirements. This sample will show you two options for keeping scores.
The first sample considers a series of yes/no questions. Each question is bound to a radio group where yes scores 1 and no scores 0 (zero). This is relatively easy to keep track of, because a simple sum function or addition of the rawValues will keep the overall score.
On the other hand, once you introduce more than two options, with differing marking schemes things can become a little heated.
The main thing is to plan out the approach first, as this can affect how you are going to name objects. For example in the second sample we have used a loop to look at each of the questions in turn. Using loops help keep your script lean and maintainable. But to get the most out a loop, it is easier if the objects have the same name. The loop then just looks at each instance of the specified objects.
The sample for is available here: Assure Dynamics Scoring three options.
The main scripts are shown within the page layout. If you open the form in LC Designer you can dive right into the scripts. Please feel free to make changes and to adapt these examples to suit your requirements.