Intro
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:
Conclusion
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.
I clearly stated that the category of Quizzing system variables are READ ONLY. If you use custom quiz slides, created with standard objects, actions and variables AND you use scored objects (interactive) there is no problem because they will be integrated in the quizzing system variables.
User variables is another problem. If you want those to stock scores of custom questions you’ll need to use JavaScript or buy the InfoSemantics widget (HTML compatible) called ‘CpExtra’ which allows to transfer values of user variables to quizzing system variables.
Hello,
scanning the information above suggests that system variables and custom variable can be combined to help record both scoring and attempts when custom quiz slides are involved. The nature of our trainings require several custom quizzes, multiple true / false on one slide, multiple fill in the blanks, etc. Generally speaking I am making a correct assumption? Apologies for any vagaries…..
I clearly stated that the category of Quizzing system variables are READ ONLY. If you use custom quiz slides, created with standard objects, actions and variables AND you use scored objects (interactive) there is no problem because they will be integrated in the quizzing system variables.
User variables is another problem. If you want those to stock scores of custom questions you’ll need to use JavaScript or buy the InfoSemantics widget (HTML compatible) called ‘CpExtra’ which allows to transfer values of user variables to quizzing system variables.
Thanks, Lieve, for the information. This will help me build quizzes in multiple languages.
You’re welcome. There are some posts which I wrote about localisation. I would recommend to use GIFT import for your quizzes, makes it a lot easier to translate in other languages. After having tried with CSV, which looks easier, but couldn’t import the translated CSV I went back to GIFT.
Thanks for providing the awesome spreadsheet re: Quiz system variables. It quickly answered a pressing question on my current project.
You’re welcome. The full explanatory table with all system variables can also be downloaded from one of my blog posts and much more tables like events, commands…. So much is lacking in the official Help documentation.