Skip to main content
Nasser Hussien
Participant
April 4, 2016
Question

how to take cpInfoCurrentSlide system variable into user variable and subtract one to get the real number of the current slide.

  • April 4, 2016
  • 3 replies
  • 823 views

how to take cpInfoCurrentSlide system variable into user variable and subtract one to get the real number of the current slide.

This topic has been closed for replies.

3 replies

TLCMediaDesign
Inspiring
April 4, 2016

In HTML5 there is actually a variable already.

window.cpInfoCurrentSlideIndex

Lilybiri
Legend
April 4, 2016

Could you explain exactly why you want to do this? Because this variable is used often to insert the slide number on slides, it's index starts with 1 instead of the usual 0. Most other numbering system variables start with 0. That means if you want to replay a slide you also need an 'Expression' command like this:

Expression    cpCmndGotoSlide = cpInfoCurrentSlide - 1

Nasser Hussien
Participant
April 4, 2016

Thanks, I make a start slide then 10 random question slides, I need to

avoid counting the first slide to get the true number of the question

Lilybiri
Legend
April 4, 2016

If you use the Progress indicator in Quiz Preferences, it will give you the correct number of the question wherever it is in the file. You have choice between relative and absolute indicator. Why would you create a 'counter' when there is one available out of the box?

RodWard
Community Expert
Community Expert
April 4, 2016

Use either a Standard or Conditional Action and choose the Expression action. It will allow you to perform subtraction from a variable value.