Skip to main content
Known Participant
July 20, 2016
Answered

Days in a row streak counter

  • July 20, 2016
  • 1 reply
  • 726 views

Hi all

I'm trying to create a 'days in a row' streak counter.

Where the learner where if the learner accesses the module on consecutive days in a row it would increase. If they missed a day it would basically start from zero again.

I can have a variable load and save to the browsers memory and could create a variable  that every time they complete the module, increases by one.

However, I need something in addition which recognises whether some time has elapsed since the last time the module was used and resets that variable to 0.

I know that Captivate has system variables such as cpInfoCurrentDay would not sure how I can integrate it into an Advanced or Conditional Action to make it work.

What does cpInfoEpcohMS do and would be useful in this instance?

This topic has been closed for replies.
Correct answer Lilybiri

I've just realised I can't get my proposed logic to work as Captivate doesn't allow it..

I want the line as follows:

If Vdate is less than Vdate + 86000

Then...

But I can only add either a literal or a variable and can't have an expression under 'IF'.

Is there anyway around this?


I am confused now, Vdate will always be less than Vdate+86000? You will have to subtract Vdate from the present value of cpInfoEpochMS and see if the result is less than 86000. If you are using a conditional advanced action, you'll first need a decision that mimicks a standard action for the subtract Expression, then the conditional action. Something like this:

First decision 'Always'

   IF 1 is equal to 1

  Expression  v_subtract  = cpInfoEpochMS - Vdate

Second decision

  IF v_subract is less than 86000

      Increment v_counter by 1

ELSE

      Assign v_counter with 0

1 reply

arashmazAuthor
Known Participant
July 20, 2016

So I 'think' I may have found a rough solution...

After doing a bit of a search around the cpInfoEpochMS variable and finding an answer by RodWard

Create a counter (Vcounter) variable that displays the user's 'days in a row' score.

Create another variable (Vdate) that stores the cpInfoEPochMS/1000 (So it's in seconds) variable on completing the module.

Then on loading the module have a conditional action that goes as follows:

If Vdate is less than Vdate+86400 (total seconds in 24 hours)

Then Vcounter increment by 1

Else Assign Vcounter '0'.

In my head that sort of works...

Lilybiri
Legend
July 20, 2016

cpInfoEpochMS (category System information) keeps track of date/time in an absolute way, not referring to the start of a course like cpInfoElapsedTimeMS (category Movie Information). Maybe you could download the descriptive table with system variables  from this article:

System variables in Captivate 8/9 - Captivate blog

arashmazAuthor
Known Participant
July 20, 2016

Yeah I don't need to know how much time has elapsed from the start of the course. I need to know how much time has elapsed outside from finishing the course to loading it back up again. Which is why I cpInfoEpochMS would be preferred.