Displaying a Certificate - based on the score achieved by the user

MINI LESSONS ›› Certificate ››

MINI LESSON

SHOWING A CERTIFICATE BASED ON THE USER'S SCORE

ToolBook ships with a Certificate feature. This will allow you to create a certificate page in your book to be shown to the user.


This lesson will demonstrate how to setup behavior to show the certificate only if the user received a passing score for the lesson.


OVERVIEW

In this demonstration the behavior will be as follows:



ADDING A CERTIFICATE PAGE

Using the Certificate catalog category, add a certificate page to your book and configure it as needed.


CONFIGURING THE SCORE PAGE TO DISPLAY THE CERTIFICATE

This lesson requires building the following page:



STEP 1 - ADDING A SCORE FIELD

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 you see fit. In my case I adjusted the field so that it would center the text and use Arial 18 point Bold text. I also made it transparent and used the Inset type of border.


STEP 2 - ADDING SCORE LOGIC TO THE SCORE FIELD

In order to get ToolBook to display the score in the Score field, it is necessary to 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.



STEP 3 - ADDING THE CONDITIONAL BRANCHING LOGIC

The Continue button is where conditional logic will be added.



      set myScore to characters 8 to (charcount(text of field "Score") - 1) of text of field "Score"


Although it is not necessary for you to understand how it works since it works without any modifications needed, if you are curious, here is what it is doing:


The Score field will be holding a value such as: Score: 78%


Although this looks great for display purposes it does us little good when what we need is just the number....the 78.


In order to extract just the number and leave the rest behind we need to pull-out characters (8) thru (one less than the number of characters in the string). This tosses out the % and also the "Score: ", leaving just the raw number which we can use for computational purposes.



KEYWORDS: 20479 P743




Created with the Personal Edition of HelpNDoc: Free CHM Help documentation generator