Creative with Quizzing System Variables
In my last post I mentioned that, based on the visits to my blog posts, Quizzes in Captivate seem to be one of the stumbling blocks for newbies. Most of the quizzing blog posts with focus on default quiz slides are already pretty old. More recently I have been talking about new features like Branch aware and Knowledge Check Slides. The most visited post on my blog will be updated in a near future, to accommodate recent changes in Captivate. The present article will offer you some ideas about using the Quizzing category of system variables. If you ever downloaded my full list of system variables, you know that these variables are read-only, at least if you are not a JS expert. As a bonus to reading this post, you’ll find a downloadable list with Quizzing System variables including some personal comments and links to blog posts where I have used those variables.
This article is meant as an introduction to the use of variables. For that reason the mentioned use cases are not complicated.
Using Read-only Variables
Quizzing System variables are read only. However you can use them in two ways, which will be illustrated by some use cases later on:
- To show information to the learner, by inserting them in a text container, which can be a shape or a text caption.
All variables are case sensitive, for that reason I recommend strongly only to insert variables using the X button in the Character part of the Properties panel for the text container. In the dialog box you choose System variables (default is User variables), eventually the category (Quizzing) and pick the correct variable from the dropdown list. It is also possible to limit the number of characters, Maximum length (set to 5 in this screenshot):
Since text containers including variables have to be generated on runtime, contrary to the static text containers, it is wise to use only websafe fonts which was not the case in the screenshot above.
- To use them in an advanced or shared action for multiple goals, like changing navigation, calculation, skipping slides etc.
You will see some use cases for both situations in this article.
Use case 1: extra Information on question slides
This use case has been explained more in detail in an older article (Buttons on question/score slide). In this example I ‘refurbished’ that older version using newer features multistate object, shared action, toggle command.
The idea is to insert system variables in a text container (shape or caption) that appears on the first question slide. Text container is timed for the rest of the project, always on top. Since all embedded quiz objects have priority in the stacking order (z-order, order of the layers in the timeline), you have to make sure that thise custom text container is not covered up by embedded objects. For that reason I edited the size of feedback messages on the quizzing master slide, to make room for the (green) text container. An alternative work flow is explained in the older article mentioned before:
This text container can be permanently on the question slides, always available, or you can use a Toggle shape button to trigger its appearance. That button is visible in the screenshot as a green button with the label ‘i’. Similar to the text container, it is also inserted on the first question slide, timed for the rest of the project. This shape button has an extra custom state ‘Close’, visible on the next screenshot, to turn it into a real toggle button. The action used for this shape button is the shared action described in ‘1 action = 5 toggle buttons‘, and a user variable v_visib is used in that action. When importing or dragging the shared action from the external Library with shared actions, that variable is created automatically (see Reuse Shared Actions in Other Projects).
Besides the system variables cpQuizInfoPointsscored, cpQuizInfoPointsPerQuestionSlide and cpQuizInfoNegativePointsOnCurrentQuestionSlide. The result on runtime, when the toggle button has opened the info text can be seen in this screenshot:
To be sure that the information is closed by default On Enter for each question slide, I use an On Enter action for each question slide (see use case 3).
Use case 2: Custom Score slide
You can turn on/off fields in the default Score slide, but you can also replace the inserted fields by your text and system/user variables. Look at this example in editing mode:
You see again several embedded quizzing system variables: cpQuizInfoPointsscored, cpInfoPercentage, cpQuizInfoTotalQuizPoints, cpQuizInfoTotalCorrectAnswers and cpQuizInfoTotalQuestionsPerProject. Moreover there is one user variable, v_penalty, which I’ll explain in use case 3.
On runtime it will look like this screenshot:
This score slide is taken from the same example file. Since both the text information container and its toggle button were timed for the rest of the project, you have to take care of hiding both On Enter for this score slide. I used this standard advanced action:
Use case 3: Calculation of the Total Penalty
Although there is a system variable (with a very long name) cpQuizInfoNegativePointsOnCurrentQuestionSlide, no exposed system variable is available containing the total penalty of the quiz, which is the opposite of the maximum number of points , cpQuizInfoTotalQuizPoints. If the user misses all answers, he’ll get a negative score equal to that Total penalty. I will have to calculate that total.
For that purpose I created a user variable v_penalty with a start value of 0. The On Enter event of each question slide was used to trigger this standard advanced action (a shared action had no sense, because the same action applies to each question slide):
The first 3 commands take care of resetting the toggle button (SB_Info with the variable v_visib ) and hiding the text information container (Tx_Info).
The Expression command is using cpQuizInfoNegativePointsOnCurrentQuestionSlide to calculate the present amount of v_penalty. It may seem confusing that I’m using ‘+’ as math operator: reason is that the system variable always shows a negative number. You don’t have to believe me: have a look at the second screenshot in use case 1.
More use cases – download
I wanted to keep it simple in the described use cases, introduction to the use of variables. Download the pdf with description of all quizzing system variables from this link.
The table has 6 columns:
- Variable name
- Variable type: a variable can be empty, a Boolean (only values are 0/1 or T/F), a number, text or undefined.
- Explanation which is sometimes bit different from the explanation found in the Variables dialog box
- Default value
- Comments: those are my personal comments
- Blog posts: here you’ll find quite a lot more use cases, I mention the blog posts where the referenced variable has been used
In this screenshot you see part of the first page:
I’m waiting for your comments. Do you see ways of using those system variables in your projects? Do you have questions, use cases that you cannot figure out if they are possible? Fire away.