Form Elements as Variable to Calculate
December 23, 2014 12:00 AM
I am getting back into using Lectora and trying to calculate the number of checkboxes selected to determine if the user can proceed to the next page. Below is the scenario:
- I have four checkboxes (created using the Form Elements)
- If the user selects 2 out of the 4 checkboxes. I want the course to recognize that 2 or more items were selected and allow the user to proceed to the next page (basically showing the next button)
- If the user selected less than 2 checkboxes the system will show a message.
I have tried grouping the checkboxes then added a calculation button to determine how may selected, however every time I press the calculate button it keeps adding more values. For example, I selected 1 checkbox then clicked calculate and the response box shows "1". However when I select another checkbox and click calculate again, it shows "3".
i am sure this is simple but cannot find the right pattern. Can anybody help?
I am using Lectora Inspire 11.
Thanks
Discussion (2)
You will need 5 actions for 4 check boxes:
- Modify Variable; _Num_Checked; Set; 0
- Modify Variable; _Num_Checked; Add; 1; Condition: ChkBox1 =0 or Is Empty
- Modify Variable; _Num_Checked; Add; 1; Condition: ChkBox2 =0 or Is Empty
- Modify Variable; _Num_Checked; Add; 1; Condition: ChkBox3 =0 or Is Empty
- Modify Variable; _Num_Checked; Add; 1; Condition: ChkBox4 =0 or Is Empty
You might really like this tutorial then: http://lectora.com/blog/using-jquery-lectora-customize-e-learning-courses-part-1
Discussions have been disabled for this post