Assign point at certain point of timeline

Problem:

Hello folks, thanks for your time!
I’m struggling to make an hidden button or whatever to assign 1 point at certain time of timeline. Need that for a video presentation, when users watch 80% of the total video lenght will be assign to that user 1 point, without any action from user.

I’m tring to make an hidden button, that button trigger an action for modify a variable but can’t find total score on the variables list. Any suggestion?

Thanks.

ActivePresenter version:
Versione 8.3.2 - 64-bit build.

OS:
Win 10

Notes:

Solved reading other questions like mine. Thank you in any cases!
Basically, I created 2 hidden buttons that set prez.score variable.

80% timeline hidden button that trigger when his time ending:
var fScore = prez.score;
prez.score = function() {
return fScore.call(this) + 80;
}
prez.maxScore = function() {
return 100;
}

100% timeline hidden button that trigger when his time ending:
var fScore = prez.score;
prez.score = function() {
return fScore.call(this) + 20;
}
prez.maxScore = function() {
return 100;
}

I cannot uplod file cause I’m new user… anyways it works like a charm!

I upgraded code with some tricks, for example: if user views only 80% gets 80 points, if 100% gets 100 points.

I have another questions:

prez.maxScore can be setted only one time (project>propriety>event) or is better every time that its retrives?

Hi Jakkah,

You should define your custom prez.score and prez.maxScore only once (in Project > Properties > Event) as in my answer in this thread:

(You don’t need a custom result so please remove prez.result in the script from the thread above)

After that, you set the variable your_score_variable_name to 80, and 100 for each button, respectively.

Regards

Hello ToanLS,
your code works better and more clean then my solution.
Thank you!
Best regards.