CONDITIONAL SCORE LOGIC (Basic Version)
The Score button in ToolBook will provide you with the ability to show the user their current score. For many of you this will be enough to meet your needs. Others will want to go a step further and perform different actions depending on the score.
To do this you will need to use the Actions Editor within ToolBook to analyze the score, and then set up some conditional behavior to occur based on that score.
You will need to be familiar with the Actions Editor in order to implement this type of solution.
There are two versions of this Mini Lesson
- Basic Version
You are reading the Basic Version now.
- Advanced Version
The Advanced Version is more complex to implement but provides you with more flexibility. To view the Advanced Version, click here.
In this demonstration the behavior will be as follows:
- When the user enters the summary page the score automatically appears in a Score field.
- When the user clicks on the Continue button, Actions Editor programming logic will take the user to one of two different pages, depending on the score that was achieved.
STEP 1 - ADDING A SCORE FIELD TO SHOW THE USER THEIR SCORE
On your summary page, add a Score field. You will find one of these in the Scoring and Tracking category of the catalog. Configure the field as needed. In my case I adjusted the field so that it would center the text and use Arial 18 point Bold.
The purpose of this field is simply to show the user their score. It serves no other purpose. You are free to delete this field and skip the rest of this step if you don't need the score shown to the user on the summary page.
In order to tell ToolBook to display the score to the user within the Score field, it is necessary to first tell ToolBook to Score the Quiz. Although there is a Score This Quiz button in the Scoring and Tracking category of the catalog, this demonstration will not be using that button. Instead the Score action within the Actions Editor will be used.
The goal is to have the score be shown to the user as soon as they enter the Summary page. As such we need to add logic to the On Load Page event for the Score field. Remember, the purpose of this field is simply to show the user their score. It serves no other purpose. If you do not want to show the user their score, skip this step.
- Open the Actions Editor for the Score field you previously added to the summary page.
- By default the On Click event will be showing. You'll need to click on the term On Click and choose On Load Page from the choices shown to you.
- From the Scoring and Tracking side panel in the Actions Editor add a Score Pages action.
- To adjust the Properties of your Score Pages action, double-click the lightening bolt at the front of that newly added line within your programming window. The Properties for Score Pages Action window will open.
- On the General tab ensure you configure this to score All Pages In The Book.
- On the Options tab, ensure that the Show Question Score checkbox is checked, and that the Percent Of Maximum Score is chosen. This will cause the score to be shown in this format: Score: 78%. You can choose to have the score shown in a different format if you wish.
- Click OK to close the Properties dialog and your Actions Editor window should show the following.
- Close the Actions Editor allowing it to save the changes.
STEP 2 - ADDING THE CONDITIONAL BRANCHING LOGIC
The Continue button is where conditional logic will be added. The Score field which was optionally added earlier has nothing to do with the Branching Logic.
Configuring the Branching logic is similar to STEP 1 but this time we're interested in the actual Score value.
- Add a Continue button to your page. For this demonstration I used a Rounded button and modified the caption to read "continue". You can use any object you like, a button, graphic, field, etc.
- Open the Actions Editor for the Continue button.
- Before we start adding code, we need to create a variable to store the score in. From the Action menu in the Actions Editor, choose Define Variables.
- Create a new Local variable with the name of myScore and set the initial value to 0.
- Note that you may want to define the variable as a Global Variable instead. You only need to do this if you plan on using the myScore variable in other places in your book.
- By default the On Click event will be showing.
- Use the Actions Editor to build up the following logic:
- For the Score Current Book action, make sure you specify the myScore variable will be used as the Variable To Store The Score.
- On the Options tab, ensure that the Show Question Score checkbox is unchecked. Remember, for this Step we are not interested in showing the user their score. Instead we just need to calculate it, and store it in a variable for analysis.
Please note that the myScore variable will contain the score achieved by the user, represented in total number of points (not percentage). As such, if a perfect score is 20 points and you wanted a passing score to be 90% of 20 points, that calculates out to 18 points for a passing score. With this in mind, the sample logic above used a hard-coded value of 18 to determine a passing score.
If you add or remove questions from your quiz, you'll need to remember to adjust this hard-coded value as needed.
Created with the Personal Edition of HelpNDoc: Write eBooks for the Kindle