Conditional behavior to occur based on the score (Basic Version)

MINI LESSONS ›› Quiz Related Topics ››

MINI LESSON

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

  1. Basic Version
    You are reading the Basic Version now.
  2. Advanced Version
    The Advanced Version is more complex to implement but provides you with more flexibility. To view the Advanced Version, click here.


OVERVIEW

In this demonstration the behavior will be as follows:



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.

NOTE

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.


  1. Open the Actions Editor for the Score field you previously added to the summary page.
  2. 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.
  3. From the Scoring and Tracking side panel in the Actions Editor add a Score Pages action.
  4. 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.
  5. On the General tab ensure you configure this to score All Pages In The Book.

  6. 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.

  7. Click OK to close the Properties dialog and your Actions Editor window should show the following.

  8. 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.


  1. 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.
  2. Open the Actions Editor for the Continue button.  
  1. By default the On Click event will be showing.
  2. Use the Actions Editor to build up the following logic:

  3. For the Score Current Book action, make sure you specify the myScore variable will be used as the Variable To Store The Score.

  4. 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