Please take a look at this sample: https://drive.google.com/open?id=0B3hOg7Fkv-dvTnF1VWYteHVMV2c. You will need to store score manually in the On Correct event of each question by a small piece of javascript. Then in the last slide, you need to add script to display score in Properties > Event when selecting the slide.
This is a great example. Thank you for it. Could you tell me how to prevent the regular score screen from presenter to display at the end? Also how to not display the side bar?
To hide the regular score screen at the end, click Reporting tab in the Export to HTML5 Simulation dialog, clear Show report in Practice and Test mode check box.
To hide the side bar, please see the answer in this question: How to not display the sidebar with steps
I looked at this example but cannot apply it in another composition. To what I understand you add the javascript to each slide submit button on correct execute javascript and then on the score slide event. However my text remains empty.
What am I missing?
He adds JavaScript to On Correct event of each question (not submit button), and to Event section in the Properties pane of the score slide. If you already do that but no score displays, maybe there’s typos in your code. You can debug it yourself by using the browser developer tools > Console tab (click the address bar then press F12 to open developer tools). Or share your project so that we can help.
OK. I looked at the quiz. I think I have it all and understand it. I will try and get it to work and will let you know.
In correct there is:
execute javascript/ score_quiz_1 = 3;
in the quiz page event there is:
var displayScore = Prez.GetObject(‘DisplayScore’);
if (displayScore) {
var scoreText = ‘’;
scoreText += 'Question 1: ’ + (typeof score_quiz_1 == ‘undefined’? 0: score_quiz_1) + ‘ ’;
scoreText += 'Question 2: ’ + (typeof score_quiz_2 == ‘undefined’ ? 0: score_quiz_2) + ‘ ’;
scoreText += 'Question 3: ’ + (typeof score_quiz_3 == ‘undefined’ ? 0: score_quiz_3) + ‘ ’;
displayScore.SetText(scoreText);
} else {
alert(‘Object not found’);
}
OK. I got it to work. I think that I may have had a problem with the style of the score text which I copied from the quiz test. After I change its properties to inherit, it worked fine.
Thanks! This is really better for me at this point to show the score in this fashion rather than the report which does not look good enough to show.
I hope you will add an option to add a style sheet for it.
I added a total score line and the code is changed as follows:
var displayScore = Prez.GetObject(‘DisplayScore’);
var scoreTotal = (typeof score_quiz_1 == ‘undefined’? 0: score_quiz_1)
hey sorry for digging out this old thread again, but i’m currently trying to implement something like this. I downloaded the example project and I can’t get it to output the score. I know javascript and HTML but it seems like all my window.console.log calls etc. are ignored. Is there any docs that I’ve missed?
I added an alert call in the first line. That gets executed, however my console.log calls are ignored & getting the object via Prez.GetObject seems to fail.
This script is for ActivePresenter version 6, it’s not supported in version 7 anymore.
In version 7, you can use a report slide as described in this tutorial:
If it doesn’t suit your needs, please ask in a new thread.