Copy link to clipboard
Copied
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?
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 8
...Copy link to clipboard
Copied
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...
Copy link to clipboard
Copied
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:
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Even within a course I will often prefer cpInfoEpochMS, especially if it is a non-linear course. For some reasons it is working more accurately.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Hi Lily
This is perfect, Thank you. I'd come to the conclusion that I'd need an additional variable to do just that. But didn't realise I could mimic a standard action in one of the conditional action tabs. So that's really helpful, thank you!!
Copy link to clipboard
Copied
Could have used Vdate as well (it will have to be reset after that anyway), but thought it would be easier to understand with a second variable. You should find my explanation of a mimicked standard action all over these forums (and in my blog).