In this part of the tutorial, we will learn about some of the basics about the auto-scoring Opus Pro does and how to display the score on screen.
Opus Pro now keeps track of a wide range of statistics about the Questions in a publication and automatically updates them each time a Question is confirmed. A glossary of all these variables is included in the Help file but some of the ones you will use regularly are:
- Q_SCORE_VALUE - the amount the user has scored so far.
- Q_SCORE_VALUE_PERCENT - the user's score as a percentage of the questions answered so far. Not to be confused with...
- Q_SCORE_TOTAL_PERCENT - the user's score as a percentage of all the questions in the publication.
- Q_SCORE_VALUE_POSSIBLE - the total scoring value of the questions the user has answered so far. Not to be confused with...
- Q_SCORE_TOTAL_POSSIBLE - the total scoring value of all questions in the publication.
- Q_SCORE_TOTAL_QUESTIONS - the number of questions in the publication.
To display any aspect of the score we simply need to create a text box and put the relevant variable in it.
- Click the Text tool on the Tools toolbar and draw a text object on your page.
- Click into the text box so the insertion caret appears.
- Type "Score: " into the text object.
- Next select Insert Variablefrom the Text menu (or the right-click menu if you prefer)
- Scroll through the list of the variables to find the Q_SCORE_VALUE variable.
- Click OK and the text object should now include Q_SCORE_VALUE surrounded by angled brackets to indicate that it is a variable (the content will vary during the progress of the publication. Your text box should now look something like this...
- Note If you are publishing to Flash we recommend that you use separate text objects for the "Score: " label and another for the variable alone.
This enables you to set the Text properties for the variable text to be Dynamic or Device.
This ensures that Flash will display it as text and not convert it to a vector object which cannot be updated. If you find your score does not change from the original state this may be the problem.
As there is only one question in the publication the other scoring variables are not very useful so let's add some more questions whilst learning to use the different question types.