There are times when you will want to use more complicated scripted tests and simulations in training but still want to included them in the new Question and scoring system. The key actions are therefore provided in script format and can be used as follows.
Let’s assume a user must set a gauge to be between 550 and 650Hzand optimally should set it to 600Hz. The user’s current setting is found in a variable we created for the page called UserSetting.
Also on the page is a "hidden" question called evalQuestion which has three answers set as
1: Precisely correct (score of 5)
2: Within allowable tolerances (score of 1)
3: Incorrect (score of 0)
The user does not answer the question directly it is simply there to allow us to access the Question variables.
As the user completes the task we might use a piece of script to check the value and set the answer accordingly:
if (UserSetting < 550 && > 650) //is the within the correct range
{
if (UserSetting==600)
{
evalQuestion.SetUserAnswer(2)
}
else // the user is outside the correct range
{
evalQuestion.SetUserAnswer(3)
}
Remember that the question must be confirmed for the chosen action to be set so we should finish the script with the line:
evalQuestion.ConfirmQuestion()
If you then wish to allow the user to try the question again you can reset the question with
evalQuestion.ResetQuestion()