Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Days in a row streak counter

Participant ,
Jul 20, 2016 Jul 20, 2016

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?

TOPICS
Advanced
628
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 21, 2016 Jul 21, 2016

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

...
Translate
Participant ,
Jul 20, 2016 Jul 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...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 20, 2016 Jul 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 20, 2016 Jul 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 20, 2016 Jul 20, 2016

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 21, 2016 Jul 21, 2016

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 21, 2016 Jul 21, 2016

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 21, 2016 Jul 21, 2016

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!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 21, 2016 Jul 21, 2016
LATEST

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).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources